aboutsummaryrefslogtreecommitdiffstats
path: root/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
commit747675ca64694761cfeb43aa6c38c5202267a630 (patch)
tree1e9aa595d2afa2f4a51db9f52d5c8aa5af7a9607 /lib/CodeGen/SelectionDAG/FastISel.cpp
parente3a9f87e24208d94e806a1f5377c4088117a35a0 (diff)
downloadexternal_llvm-747675ca64694761cfeb43aa6c38c5202267a630.zip
external_llvm-747675ca64694761cfeb43aa6c38c5202267a630.tar.gz
external_llvm-747675ca64694761cfeb43aa6c38c5202267a630.tar.bz2
Have FastISel skip the multiply by 1 for getelementptr on i8*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55129 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 71042ff..450596e 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/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;