aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-21 17:25:26 +0000
committerDan Gohman <gohman@apple.com>2008-08-21 17:25:26 +0000
commit7a0e6593d03bd2dd21c3ac7dcf189f1da86b16da (patch)
treeccf7606e9167f7ba4979a36ebfea4904ad6c53cd /lib/CodeGen/SelectionDAG/FastISel.cpp
parentad3460c3c968e33c5b9a07104b9fe5a5c27ff55b (diff)
MVT::getMVT uses iPTR for pointer types, while we need the actual
intptr_t type in this case. FastISel can now select simple getelementptr instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55125 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index b4271fe6d2..71042ff277 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -74,7 +74,7 @@ bool FastISel::SelectGetElementPtr(Instruction *I,
return false;
const Type *Ty = I->getOperand(0)->getType();
- MVT VT = MVT::getMVT(Ty, /*HandleUnknown=*/false);
+ MVT::SimpleValueType VT = TLI.getPointerTy().getSimpleVT();
for (GetElementPtrInst::op_iterator OI = I->op_begin()+1, E = I->op_end();
OI != E; ++OI) {
Value *Idx = *OI;
@@ -85,7 +85,7 @@ bool FastISel::SelectGetElementPtr(Instruction *I,
uint64_t Offs = TD.getStructLayout(StTy)->getElementOffset(Field);
// FIXME: This can be optimized by combining the add with a
// subsequent one.
- N = FastEmit_ri_(VT.getSimpleVT(), ISD::ADD, N, Offs, VT.getSimpleVT());
+ N = FastEmit_ri_(VT, ISD::ADD, N, Offs, VT);
if (N == 0)
// Unhandled operand. Halt "fast" selection and bail.
return false;
@@ -99,7 +99,7 @@ bool FastISel::SelectGetElementPtr(Instruction *I,
if (CI->getZExtValue() == 0) continue;
uint64_t Offs =
TD.getABITypeSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
- N = FastEmit_ri_(VT.getSimpleVT(), ISD::ADD, N, Offs, VT.getSimpleVT());
+ N = FastEmit_ri_(VT, ISD::ADD, N, Offs, VT);
if (N == 0)
// Unhandled operand. Halt "fast" selection and bail.
return false;
@@ -117,21 +117,21 @@ bool FastISel::SelectGetElementPtr(Instruction *I,
// it.
MVT IdxVT = MVT::getMVT(Idx->getType(), /*HandleUnknown=*/false);
if (IdxVT.bitsLT(VT))
- IdxN = FastEmit_r(VT.getSimpleVT(), ISD::SIGN_EXTEND, IdxN);
+ IdxN = FastEmit_r(VT, ISD::SIGN_EXTEND, IdxN);
else if (IdxVT.bitsGT(VT))
- IdxN = FastEmit_r(VT.getSimpleVT(), ISD::TRUNCATE, IdxN);
+ IdxN = FastEmit_r(VT, ISD::TRUNCATE, IdxN);
if (IdxN == 0)
// Unhandled operand. Halt "fast" selection and bail.
return false;
// FIXME: If multiple is power of two, turn it into a shift. The
// optimization should be in FastEmit_ri?
- IdxN = FastEmit_ri_(VT.getSimpleVT(), ISD::MUL, IdxN,
- ElementSize, VT.getSimpleVT());
+ IdxN = FastEmit_ri_(VT, ISD::MUL, IdxN,
+ ElementSize, VT);
if (IdxN == 0)
// Unhandled operand. Halt "fast" selection and bail.
return false;
- N = FastEmit_rr(VT.getSimpleVT(), ISD::ADD, N, IdxN);
+ N = FastEmit_rr(VT, ISD::ADD, N, IdxN);
if (N == 0)
// Unhandled operand. Halt "fast" selection and bail.
return false;