diff options
| author | Dan Gohman <gohman@apple.com> | 2007-09-28 23:53:40 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2007-09-28 23:53:40 +0000 |
| commit | a90183e7d1315b210f158a652d36a61990d3f4c5 (patch) | |
| tree | d3fe9f64b50a4e36fadb70335934b22ab7830bae /llvm/lib/CodeGen | |
| parent | 92866f4fbb3ba5ea8365069e62fe2b6aa76bb082 (diff) | |
| download | bcm5719-llvm-a90183e7d1315b210f158a652d36a61990d3f4c5.tar.gz bcm5719-llvm-a90183e7d1315b210f158a652d36a61990d3f4c5.zip | |
Teach SplitVectorOp how to split INSERT_VECTOR_ELT.
llvm-svn: 42457
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index ffb2a66527b..2fc8b0a7b9d 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -5837,6 +5837,18 @@ void SelectionDAGLegalize::SplitVectorOp(SDOperand Op, SDOperand &Lo, Lo = Node->getOperand(0); Hi = Node->getOperand(1); break; + case ISD::INSERT_VECTOR_ELT: { + SplitVectorOp(Node->getOperand(0), Lo, Hi); + unsigned Index = cast<ConstantSDNode>(Node->getOperand(2))->getValue(); + SDOperand ScalarOp = Node->getOperand(1); + if (Index < NewNumElts) + Lo = DAG.getNode(ISD::INSERT_VECTOR_ELT, NewVT, Lo, ScalarOp, + DAG.getConstant(Index, TLI.getPointerTy())); + else + Hi = DAG.getNode(ISD::INSERT_VECTOR_ELT, NewVT, Hi, ScalarOp, + DAG.getConstant(Index - NewNumElts, TLI.getPointerTy())); + break; + } case ISD::BUILD_VECTOR: { SmallVector<SDOperand, 8> LoOps(Node->op_begin(), Node->op_begin()+NewNumElts); |

