Fix a crash when debugging the coalescer. DebugValue instructions are not

in the coalescer's instruction map.

llvm-svn: 104086
This commit is contained in:
Bob Wilson 2010-05-18 23:19:42 +00:00
parent bd130a2962
commit 055c01d9dc
1 changed files with 13 additions and 4 deletions

View File

@ -837,8 +837,13 @@ SimpleRegisterCoalescing::UpdateRegDefsUses(unsigned SrcReg, unsigned DstReg,
UseMI->isRegTiedToDefOperand(&O-&UseMI->getOperand(0))))
UseMI->addRegisterKilled(DstReg, tri_, true);
}
DEBUG(dbgs() << "\t\tupdated: " << li_->getInstructionIndex(UseMI)
<< "\t" << *UseMI);
DEBUG({
dbgs() << "\t\tupdated: ";
if (!UseMI->isDebugValue())
dbgs() << li_->getInstructionIndex(UseMI) << "\t";
dbgs() << *UseMI;
});
continue;
}
@ -853,8 +858,12 @@ SimpleRegisterCoalescing::UpdateRegDefsUses(unsigned SrcReg, unsigned DstReg,
O.setSubReg(SubIdx);
O.setReg(DstReg);
DEBUG(dbgs() << "\t\tupdated: " << li_->getInstructionIndex(UseMI)
<< "\t" << *UseMI);
DEBUG({
dbgs() << "\t\tupdated: ";
if (!UseMI->isDebugValue())
dbgs() << li_->getInstructionIndex(UseMI) << "\t";
dbgs() << *UseMI;
});
// After updating the operand, check if the machine instruction has
// become a copy. If so, update its val# information.