From 6a7461ad9b465e5d87a7cf0984624dfffb926ae1 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 21 Aug 2008 17:37:05 +0000 Subject: Have FastISel skip the multiply by 1 for getelementptr on i8*. llvm-svn: 55129 --- llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp') 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; -- cgit v1.2.3