[llvm] r246635 - [LV] Cleanup: Sink an IRBuilder closer to its uses.

James Molloy via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 03:15:28 PDT 2015


Author: jamesm
Date: Wed Sep  2 05:15:27 2015
New Revision: 246635

URL: http://llvm.org/viewvc/llvm-project?rev=246635&view=rev
Log:
[LV] Cleanup: Sink an IRBuilder closer to its uses.

NFC.

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

Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=246635&r1=246634&r2=246635&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Wed Sep  2 05:15:27 2015
@@ -2881,12 +2881,6 @@ void InnerLoopVectorizer::createEmptyLoo
     createInductionVariable(Lp, StartIdx, CountRoundDown, Step,
                             getDebugLocFromInstOrOperands(OldInduction));
 
-  // This is the IR builder that we use to add all of the logic for bypassing
-  // the new vector loop.
-  IRBuilder<> BypassBuilder(LoopBypassBlocks.back()->getTerminator());
-  setDebugLocFromInst(BypassBuilder,
-                      getDebugLocFromInstOrOperands(OldInduction));
-
   // We are going to resume the execution of the scalar loop.
   // Go over all of the induction variables that we found and fix the
   // PHIs that are left in the scalar version of the loop.
@@ -2920,10 +2914,11 @@ void InnerLoopVectorizer::createEmptyLoo
       // We also know which PHI node holds it.
       ResumeIndex = ResumeVal;
     } else {
-      Value *CRD = BypassBuilder.CreateSExtOrTrunc(CountRoundDown,
-                                                   II.getStepValue()->getType(),
-                                                   "cast.crd");
-      EndValue = II.transform(BypassBuilder, CRD);
+      IRBuilder<> B(LoopBypassBlocks.back()->getTerminator());
+      Value *CRD = B.CreateSExtOrTrunc(CountRoundDown,
+                                       II.getStepValue()->getType(),
+                                       "cast.crd");
+      EndValue = II.transform(B, CRD);
       EndValue->setName("ind.end");
     }
 




More information about the llvm-commits mailing list