From: Dan Gohman Date: Tue, 26 Aug 2008 20:57:08 +0000 (+0000) Subject: Make FastISel use the correct argument type when casting GEP indices. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=80bc6e2243b7ae99da42bf2e61df4ebccf8d8821;p=oota-llvm.git 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 --- diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 965fc022868..4d4e1b8c217 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.