Update kill flags while rewriting instructions after splitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117959 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen 2010-11-01 21:51:29 +00:00
parent c2bf50245f
commit 79cb53ce95

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);
}
}