Update kill flags while rewriting instructions after splitting.

llvm-svn: 117959
This commit is contained in:
Jakob Stoklund Olesen 2010-11-01 21:51:29 +00:00
parent 69e7c09c32
commit 78ba455b51

View File

@ -822,6 +822,7 @@ void SplitEditor::rewrite(unsigned reg) {
for (MachineRegisterInfo::reg_iterator RI = mri_.reg_begin(reg),
RE = mri_.reg_end(); RI != RE;) {
MachineOperand &MO = RI.getOperand();
unsigned OpNum = RI.getOperandNo();
MachineInstr *MI = MO.getParent();
++RI;
if (MI->isDebugValue()) {
@ -844,6 +845,8 @@ void SplitEditor::rewrite(unsigned reg) {
DEBUG(dbgs() << " rewr BB#" << MI->getParent()->getNumber() << '\t'<< Idx);
assert(LI && "No register was live at use");
MO.setReg(LI->reg);
if (MO.isUse() && !MI->isRegTiedToDefOperand(OpNum))
MO.setIsKill(LI->killedAt(Idx.getDefIndex()));
DEBUG(dbgs() << '\t' << *MI);
}
}