diff options
| author | Justin Bogner <mail@justinbogner.com> | 2016-05-11 17:46:03 +0000 |
|---|---|---|
| committer | Justin Bogner <mail@justinbogner.com> | 2016-05-11 17:46:03 +0000 |
| commit | c200ad7e3b809d55254a1c2ed4ab833d59a562ef (patch) | |
| tree | 98babe19c502db722474b0d94e540427535ac55c /llvm | |
| parent | 43be52a59f5333e31cadcdff8a6f1a77f5ba3cd3 (diff) | |
| download | bcm5719-llvm-c200ad7e3b809d55254a1c2ed4ab833d59a562ef.tar.gz bcm5719-llvm-c200ad7e3b809d55254a1c2ed4ab833d59a562ef.zip | |
SDAG: Minor cleanup in X86
Don't bother returning a result we don't use here. I've also renamed
this from selectGather to tryGather to better indicate that it may not
do anything.
llvm-svn: 269215
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp index 9f590ffa44d..db7e5fe5756 100644 --- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -197,7 +197,7 @@ namespace { private: void Select(SDNode *N) override; - SDNode *selectGather(SDNode *N, unsigned Opc); + bool tryGather(SDNode *N, unsigned Opc); bool foldOffsetIntoAddress(uint64_t Offset, X86ISelAddressMode &AM); bool matchLoadInAddress(LoadSDNode *N, X86ISelAddressMode &AM); @@ -1895,7 +1895,7 @@ static unsigned getFusedLdStOpcode(EVT &LdVT, unsigned Opc) { } /// Customized ISel for GATHER operations. -SDNode *X86DAGToDAGISel::selectGather(SDNode *Node, unsigned Opc) { +bool X86DAGToDAGISel::tryGather(SDNode *Node, unsigned Opc) { // Operands of Gather: VSrc, Base, VIdx, VMask, Scale SDValue Chain = Node->getOperand(0); SDValue VSrc = Node->getOperand(2); @@ -1904,7 +1904,7 @@ SDNode *X86DAGToDAGISel::selectGather(SDNode *Node, unsigned Opc) { SDValue VMask = Node->getOperand(5); ConstantSDNode *Scale = dyn_cast<ConstantSDNode>(Node->getOperand(6)); if (!Scale) - return nullptr; + return false; SDVTList VTs = CurDAG->getVTList(VSrc.getValueType(), VSrc.getValueType(), MVT::Other); @@ -1923,7 +1923,8 @@ SDNode *X86DAGToDAGISel::selectGather(SDNode *Node, unsigned Opc) { // of ResNode. ReplaceUses(SDValue(Node, 0), SDValue(ResNode, 0)); ReplaceUses(SDValue(Node, 1), SDValue(ResNode, 2)); - return ResNode; + CurDAG->RemoveDeadNode(Node); + return true; } void X86DAGToDAGISel::Select(SDNode *Node) { @@ -2005,9 +2006,7 @@ void X86DAGToDAGISel::Select(SDNode *Node) { case Intrinsic::x86_avx2_gather_q_d: Opc = X86::VPGATHERQDrm; break; case Intrinsic::x86_avx2_gather_q_d_256: Opc = X86::VPGATHERQDYrm; break; } - SDNode *RetVal = selectGather(Node, Opc); - if (RetVal) - // We already called ReplaceUses inside SelectGather. + if (tryGather(Node, Opc)) return; break; } |

