diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-14 01:17:53 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-01-14 01:17:53 +0000 |
commit | c0767e029da2ed84c1f76d0be53e2c65695e20d5 (patch) | |
tree | d405389cf26ed46356daaf2bbb28c8a2b2b99c9f /llvm/lib/CodeGen/PHIElimination.cpp | |
parent | e3ed20ce9cf706eb1840c0ea79935d6652701535 (diff) | |
download | bcm5719-llvm-c0767e029da2ed84c1f76d0be53e2c65695e20d5.tar.gz bcm5719-llvm-c0767e029da2ed84c1f76d0be53e2c65695e20d5.zip |
Try again to teach getFirstTerminator() about debug values.
Fix some callers to better deal with debug values.
llvm-svn: 123419
Diffstat (limited to 'llvm/lib/CodeGen/PHIElimination.cpp')
-rw-r--r-- | llvm/lib/CodeGen/PHIElimination.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/PHIElimination.cpp b/llvm/lib/CodeGen/PHIElimination.cpp index 923fa213e7b..b940e269112 100644 --- a/llvm/lib/CodeGen/PHIElimination.cpp +++ b/llvm/lib/CodeGen/PHIElimination.cpp @@ -339,6 +339,8 @@ void PHIElimination::LowerAtomicPHINode( #ifndef NDEBUG for (MachineBasicBlock::iterator TI = llvm::next(Term); TI != opBlock.end(); ++TI) { + if (TI->isDebugValue()) + continue; assert(!TI->readsRegister(SrcReg) && "Terminator instructions cannot use virtual registers unless" "they are the first terminator in a block!"); @@ -347,9 +349,13 @@ void PHIElimination::LowerAtomicPHINode( } else if (reusedIncoming || !IncomingReg) { // We may have to rewind a bit if we didn't insert a copy this time. KillInst = Term; - while (KillInst != opBlock.begin()) - if ((--KillInst)->readsRegister(SrcReg)) + while (KillInst != opBlock.begin()) { + --KillInst; + if (KillInst->isDebugValue()) + continue; + if (KillInst->readsRegister(SrcReg)) break; + } } else { // We just inserted this copy. KillInst = prior(InsertPos); |