From 4718dafb69abd0f3b281f827af974a6b88ecbb54 Mon Sep 17 00:00:00 2001 From: James Molloy Date: Wed, 2 Sep 2015 10:15:27 +0000 Subject: [PATCH] [LV] Cleanup: Sink an IRBuilder closer to its uses. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246635 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Vectorize/LoopVectorize.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp index de0f1f0179d..6d4a134aa67 100644 --- a/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -2881,12 +2881,6 @@ void InnerLoopVectorizer::createEmptyLoop() { 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::createEmptyLoop() { // 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"); } -- 2.11.0