Do not move DBG_VALUE in middle of PHI nodes.

llvm-svn: 132161
This commit is contained in:
Devang Patel 2011-05-26 22:43:14 +00:00
parent f5801f8d11
commit 252f0079a9
1 changed files with 4 additions and 1 deletions

View File

@ -557,6 +557,9 @@ 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();
if (isa<PHINode>(VI))
DVI->insertBefore(VI->getParent()->getFirstNonPHI());
else
DVI->insertAfter(VI);
return true;
}