diff options
author | Dan Gohman <gohman@apple.com> | 2007-08-10 14:59:38 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2007-08-10 14:59:38 +0000 |
commit | 25ac7e8364f475597e2a6f3628fce839583e1f45 (patch) | |
tree | af1cbb5bfafcbdd280c610b53dd1e41ab856dd5f /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 594d37e21aea4ef841d9ee5d9c328c4bf1c6bed7 (diff) |
Fix EXTRACT_ELEMENT, EXTRACT_SUBVECTOR, and EXTRACT_VECTOR_ELT to
use an intptr ValueType instead of i32 for the index operand in
getCopyToParts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40987 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index df40972196..90ed4545bd 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -718,6 +718,8 @@ static void getCopyToParts(SelectionDAG &DAG, SDOperand *Parts, unsigned NumParts, MVT::ValueType PartVT) { + TargetLowering &TLI = DAG.getTargetLoweringInfo(); + MVT::ValueType PtrVT = TLI.getPointerTy(); MVT::ValueType ValueVT = Val.getValueType(); if (!MVT::isVector(ValueVT) || NumParts == 1) { @@ -725,7 +727,7 @@ static void getCopyToParts(SelectionDAG &DAG, if (NumParts > 1) { for (unsigned i = 0; i != NumParts; ++i) Parts[i] = DAG.getNode(ISD::EXTRACT_ELEMENT, PartVT, Val, - DAG.getConstant(i, MVT::i32)); + DAG.getConstant(i, PtrVT)); if (!DAG.getTargetLoweringInfo().isLittleEndian()) std::reverse(Parts, Parts + NumParts); return; @@ -776,11 +778,11 @@ static void getCopyToParts(SelectionDAG &DAG, Ops[i] = DAG.getNode(ISD::EXTRACT_SUBVECTOR, IntermediateVT, Val, DAG.getConstant(i * (NumElements / NumIntermediates), - MVT::i32)); + PtrVT)); else Ops[i] = DAG.getNode(ISD::EXTRACT_VECTOR_ELT, IntermediateVT, Val, - DAG.getConstant(i, MVT::i32)); + DAG.getConstant(i, PtrVT)); // Split the intermediate operands into legal parts. if (NumParts == NumIntermediates) { |