[llvm-commits] [llvm] r55129 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp

Dan Gohman gohman at apple.com
Thu Aug 21 10:37:07 PDT 2008


Author: djg
Date: Thu Aug 21 12:37:05 2008
New Revision: 55129

URL: http://llvm.org/viewvc/llvm-project?rev=55129&view=rev
Log:
Have FastISel skip the multiply by 1 for getelementptr on i8*.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=55129&r1=55128&r2=55129&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Thu Aug 21 12:37:05 2008
@@ -124,10 +124,8 @@
         // 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;





More information about the llvm-commits mailing list