[llvm-commits] [llvm] r132161 - /llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
Devang Patel
dpatel at apple.com
Thu May 26 15:43:15 PDT 2011
Author: dpatel
Date: Thu May 26 17:43:14 2011
New Revision: 132161
URL: http://llvm.org/viewvc/llvm-project?rev=132161&view=rev
Log:
Do not move DBG_VALUE in middle of PHI nodes.
Modified:
llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp?rev=132161&r1=132160&r2=132161&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/CodeGenPrepare.cpp Thu May 26 17:43:14 2011
@@ -557,7 +557,10 @@
if (DVI->getParent() != VI->getParent() || DT->dominates(DVI, VI)) {
DEBUG(dbgs() << "Moving Debug Value before :\n" << *DVI << ' ' << *VI);
DVI->removeFromParent();
- DVI->insertAfter(VI);
+ if (isa<PHINode>(VI))
+ DVI->insertBefore(VI->getParent()->getFirstNonPHI());
+ else
+ DVI->insertAfter(VI);
return true;
}
More information about the llvm-commits
mailing list