diff options
author | Devang Patel <dpatel@apple.com> | 2011-05-26 22:43:14 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2011-05-26 22:43:14 +0000 |
commit | 9dd19667fb441f715f920156905b5217382d250c (patch) | |
tree | 23e03b6f2dccde6f375bc70a5ecf1c3b08a73c85 | |
parent | 97de92c08d675e5ee5be2e1ebec64cbff86c17f4 (diff) | |
download | external_llvm-9dd19667fb441f715f920156905b5217382d250c.zip external_llvm-9dd19667fb441f715f920156905b5217382d250c.tar.gz external_llvm-9dd19667fb441f715f920156905b5217382d250c.tar.bz2 |
Do not move DBG_VALUE in middle of PHI nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132161 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/CodeGenPrepare.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index 7ba92ba..da6bf31 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -557,7 +557,10 @@ bool CodeGenPrepare::OptimizeCallInst(CallInst *CI) { 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; } |