summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-21 17:37:05 +0000
committerDan Gohman <gohman@apple.com>2008-08-21 17:37:05 +0000
commit6a7461ad9b465e5d87a7cf0984624dfffb926ae1 (patch)
treee4ee0e053392c5d409a7a608f6bc5c57a3d1a1cb /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
parentf16134141de11d8512ad26a1bbff84625a52e3ab (diff)
downloadbcm5719-llvm-6a7461ad9b465e5d87a7cf0984624dfffb926ae1.tar.gz
bcm5719-llvm-6a7461ad9b465e5d87a7cf0984624dfffb926ae1.zip
Have FastISel skip the multiply by 1 for getelementptr on i8*.
llvm-svn: 55129
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 71042ff277a..450596e50d0 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -124,10 +124,8 @@ bool FastISel::SelectGetElementPtr(Instruction *I,
// 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, ISD::MUL, IdxN,
- ElementSize, VT);
+ if (ElementSize != 1)
+ IdxN = FastEmit_ri_(VT, ISD::MUL, IdxN, ElementSize, VT);
if (IdxN == 0)
// Unhandled operand. Halt "fast" selection and bail.
return false;
OpenPOWER on IntegriCloud