[llvm] r286159 - Reset debug loc to OldInduction in InnerLoopVectorizer::createInductionVariable. (NFC)

Dehao Chen via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 13:59:40 PST 2016


Author: dehao
Date: Mon Nov  7 15:59:40 2016
New Revision: 286159

URL: http://llvm.org/viewvc/llvm-project?rev=286159&view=rev
Log:
Reset debug loc to OldInduction in InnerLoopVectorizer::createInductionVariable. (NFC)

This is to prevent SetInsertionPoint from setting debug loc to Latch->getTerminator().

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=286159&r1=286158&r2=286159&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Mon Nov  7 15:59:40 2016
@@ -3040,10 +3040,12 @@ PHINode *InnerLoopVectorizer::createIndu
     Latch = Header;
 
   IRBuilder<> Builder(&*Header->getFirstInsertionPt());
-  setDebugLocFromInst(Builder, getDebugLocFromInstOrOperands(OldInduction));
+  Instruction *OldInst = getDebugLocFromInstOrOperands(OldInduction);
+  setDebugLocFromInst(Builder, OldInst);
   auto *Induction = Builder.CreatePHI(Start->getType(), 2, "index");
 
   Builder.SetInsertPoint(Latch->getTerminator());
+  setDebugLocFromInst(Builder, OldInst);
 
   // Create i+1 and fill the PHINode.
   Value *Next = Builder.CreateAdd(Induction, Step, "index.next");




More information about the llvm-commits mailing list