[llvm-commits] [llvm] r167037 - /llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp

Hal Finkel hfinkel at anl.gov
Tue Oct 30 11:55:49 PDT 2012


Author: hfinkel
Date: Tue Oct 30 13:55:49 2012
New Revision: 167037

URL: http://llvm.org/viewvc/llvm-project?rev=167037&view=rev
Log:
BBVectorize: Don't make calls to SE when the result is unused.

SE was being called during the instruction-fusion process (when the result
is unreliable, and thus ignored). No functionality change is intended.

Modified:
    llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp

Modified: llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp?rev=167037&r1=167036&r2=167037&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/BBVectorize.cpp Tue Oct 30 13:55:49 2012
@@ -547,7 +547,7 @@
     bool getPairPtrInfo(Instruction *I, Instruction *J,
         Value *&IPtr, Value *&JPtr, unsigned &IAlignment, unsigned &JAlignment,
         unsigned &IAddressSpace, unsigned &JAddressSpace,
-        int64_t &OffsetInElmts) {
+        int64_t &OffsetInElmts, bool ComputeOffset = true) {
       OffsetInElmts = 0;
       if (LoadInst *LI = dyn_cast<LoadInst>(I)) {
         LoadInst *LJ = cast<LoadInst>(J);
@@ -567,6 +567,9 @@
         JAddressSpace = SJ->getPointerAddressSpace();
       }
 
+      if (!ComputeOffset)
+        return true;
+
       const SCEV *IPtrSCEV = SE->getSCEV(IPtr);
       const SCEV *JPtrSCEV = SE->getSCEV(JPtr);
 
@@ -1677,7 +1680,7 @@
     // been precomputed (OffsetInElmts must be unused here).
     (void) getPairPtrInfo(I, J, IPtr, JPtr, IAlignment, JAlignment,
                           IAddressSpace, JAddressSpace,
-                          OffsetInElmts);
+                          OffsetInElmts, false);
 
     // The pointer value is taken to be the one with the lowest offset.
     Value *VPtr;





More information about the llvm-commits mailing list