aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-26 20:57:08 +0000
committerDan Gohman <gohman@apple.com>2008-08-26 20:57:08 +0000
commit8d6f1b29ffbe6d270707ea528e26cc4769b7d17e (patch)
tree1c44e402fc9bfd835d58e53e7dd933fc7fb3dd1a /lib/CodeGen/SelectionDAG/FastISel.cpp
parent0254ba1639d3ab02a8c5be6466f4eed9efe94cf6 (diff)
downloadexternal_llvm-8d6f1b29ffbe6d270707ea528e26cc4769b7d17e.zip
external_llvm-8d6f1b29ffbe6d270707ea528e26cc4769b7d17e.tar.gz
external_llvm-8d6f1b29ffbe6d270707ea528e26cc4769b7d17e.tar.bz2
Make FastISel use the correct argument type when casting GEP indices.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55384 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 965fc02..4d4e1b8 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -124,18 +124,19 @@ bool FastISel::SelectGetElementPtr(Instruction *I,
// it.
MVT IdxVT = MVT::getMVT(Idx->getType(), /*HandleUnknown=*/false);
if (IdxVT.bitsLT(VT))
- IdxN = FastEmit_r(VT, VT, ISD::SIGN_EXTEND, IdxN);
+ IdxN = FastEmit_r(IdxVT.getSimpleVT(), VT, ISD::SIGN_EXTEND, IdxN);
else if (IdxVT.bitsGT(VT))
- IdxN = FastEmit_r(VT, VT, ISD::TRUNCATE, IdxN);
+ IdxN = FastEmit_r(IdxVT.getSimpleVT(), VT, ISD::TRUNCATE, IdxN);
if (IdxN == 0)
// Unhandled operand. Halt "fast" selection and bail.
return false;
- if (ElementSize != 1)
+ if (ElementSize != 1) {
IdxN = FastEmit_ri_(VT, ISD::MUL, IdxN, ElementSize, VT);
- if (IdxN == 0)
- // Unhandled operand. Halt "fast" selection and bail.
- return false;
+ if (IdxN == 0)
+ // Unhandled operand. Halt "fast" selection and bail.
+ return false;
+ }
N = FastEmit_rr(VT, VT, ISD::ADD, N, IdxN);
if (N == 0)
// Unhandled operand. Halt "fast" selection and bail.