summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-08-10 14:59:38 +0000
committerDan Gohman <gohman@apple.com>2007-08-10 14:59:38 +0000
commita17799a3bd2e61dec908c2042cb4e0f983935f65 (patch)
tree70004f40797cbeb2af9d4641412bc0d9fb0acd57 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parent66011c17d539d1ec93a145d7db6c0381494a826f (diff)
downloadbcm5719-llvm-a17799a3bd2e61dec908c2042cb4e0f983935f65.tar.gz
bcm5719-llvm-a17799a3bd2e61dec908c2042cb4e0f983935f65.zip
Fix EXTRACT_ELEMENT, EXTRACT_SUBVECTOR, and EXTRACT_VECTOR_ELT to
use an intptr ValueType instead of i32 for the index operand in getCopyToParts. llvm-svn: 40987
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index df40972196b..90ed4545bd0 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/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) {
OpenPOWER on IntegriCloud