diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-06-30 02:43:01 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-06-30 02:43:01 +0000 |
| commit | c74714523d746f78b2b2c519cea065060aa6f886 (patch) | |
| tree | 52956d3f0d818913c234040b1ea339713684cf70 /lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
| parent | 50326cac32c2f740c1680a182f5671fd3292113d (diff) | |
| download | external_llvm-c74714523d746f78b2b2c519cea065060aa6f886.zip external_llvm-c74714523d746f78b2b2c519cea065060aa6f886.tar.gz external_llvm-c74714523d746f78b2b2c519cea065060aa6f886.tar.bz2 | |
Implement split and scalarize for SELECT_CC, fixing PR2504
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52887 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index f087496..c40a783 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -6895,6 +6895,22 @@ void SelectionDAGLegalize::SplitVectorOp(SDOperand Op, SDOperand &Lo, } break; } + case ISD::SELECT_CC: { + SDOperand CondLHS = Node->getOperand(0); + SDOperand CondRHS = Node->getOperand(1); + SDOperand CondCode = Node->getOperand(4); + + SDOperand LL, LH, RL, RH; + SplitVectorOp(Node->getOperand(2), LL, LH); + SplitVectorOp(Node->getOperand(3), RL, RH); + + // Handle a simple select with vector operands. + Lo = DAG.getNode(ISD::SELECT_CC, NewVT_Lo, CondLHS, CondRHS, + LL, RL, CondCode); + Hi = DAG.getNode(ISD::SELECT_CC, NewVT_Hi, CondLHS, CondRHS, + LH, RH, CondCode); + break; + } case ISD::VSETCC: { SDOperand LL, LH, RL, RH; SplitVectorOp(Node->getOperand(0), LL, LH); @@ -7122,6 +7138,13 @@ SDOperand SelectionDAGLegalize::ScalarizeVectorOp(SDOperand Op) { ScalarizeVectorOp(Op.getOperand(1)), ScalarizeVectorOp(Op.getOperand(2))); break; + case ISD::SELECT_CC: + Result = DAG.getNode(ISD::SELECT_CC, NewVT, Node->getOperand(0), + Node->getOperand(1), + ScalarizeVectorOp(Op.getOperand(2)), + ScalarizeVectorOp(Op.getOperand(3)), + Node->getOperand(4)); + break; case ISD::VSETCC: { SDOperand Op0 = ScalarizeVectorOp(Op.getOperand(0)); SDOperand Op1 = ScalarizeVectorOp(Op.getOperand(1)); |
