diff options
author | Dan Gohman <gohman@apple.com> | 2008-08-26 20:57:08 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-08-26 20:57:08 +0000 |
commit | b5e04bfb189304d7ad63faa8fb596e1d9c8c9f6a (patch) | |
tree | 079a81c0c0b43a5cfc38de3a7d93935850b34cba /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | 3bcbbece1998c52b78ff07eb9796c21d3eda7b3e (diff) | |
download | bcm5719-llvm-b5e04bfb189304d7ad63faa8fb596e1d9c8c9f6a.tar.gz bcm5719-llvm-b5e04bfb189304d7ad63faa8fb596e1d9c8c9f6a.zip |
Make FastISel use the correct argument type when casting GEP indices.
llvm-svn: 55384
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 965fc022868..4d4e1b8c217 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/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. |