Set debug loc.
authorDevang Patel <dpatel@apple.com>
Wed, 22 Jun 2011 19:52:36 +0000 (19:52 +0000)
committerDevang Patel <dpatel@apple.com>
Wed, 22 Jun 2011 19:52:36 +0000 (19:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133636 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/IndVarSimplify.cpp

index d71c6ff0afb00cf2ed8e4a218278775c5f6d2ed0..1d793394728d7f9800d1de1f297027d56a939940 100644 (file)
@@ -1400,6 +1400,8 @@ void IndVarSimplify::RewriteIVExpressions(Loop *L, SCEVExpander &Rewriter) {
     // Patch the new value into place.
     if (Op->hasName())
       NewVal->takeName(Op);
+    if (Instruction *NewValI = dyn_cast<Instruction>(NewVal))
+      NewValI->setDebugLoc(User->getDebugLoc());
     User->replaceUsesOfWith(Op, NewVal);
     UI->setOperandValToReplace(NewVal);