Preserve debug loc.
authorDevang Patel <dpatel@apple.com>
Tue, 5 Jul 2011 21:48:22 +0000 (21:48 +0000)
committerDevang Patel <dpatel@apple.com>
Tue, 5 Jul 2011 21:48:22 +0000 (21:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134441 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolutionExpander.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp

index 530a8bf52b1f4aec40c5e06607c05d0e41c78215..9f6063e56ac7f071962a5073e30e447ba2013688 100644 (file)
@@ -955,7 +955,7 @@ SCEVExpander::getAddRecExprPHILiterally(const SCEVAddRecExpr *Normalized,
     // at IVIncInsertPos.
     Instruction *InsertPos = L == IVIncInsertLoop ?
       IVIncInsertPos : Pred->getTerminator();
-    Builder.SetInsertPoint(InsertPos->getParent(), InsertPos);
+    Builder.SetInsertPoint(InsertPos);
     Value *IncV;
     // If the PHI is a pointer, use a GEP, otherwise use an add or sub.
     if (isPointer) {
index 477f87a536ff7b81aeedc9679efb7baab38f5bc4..2b0dfc6ae66b5072438371022fbc63203d62a2dc 100644 (file)
@@ -339,7 +339,7 @@ LinearFunctionTestReplace(Loop *L,
                << "      RHS:\t" << *RHS << "\n");
 
   ICmpInst *Cond = new ICmpInst(BI, Opcode, CmpIndVar, ExitCnt, "exitcond");
-
+  Cond->setDebugLoc(BI->getDebugLoc());
   Value *OrigCond = BI->getCondition();
   // It's tempting to use replaceAllUsesWith here to fully replace the old
   // comparison, but that's not immediately safe, since users of the old