Fix PR2568: Fix bug that cause redudant kill marker after its live interval has been extended due to coalescing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54346 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2008-08-05 07:10:38 +00:00
parent 59c0d4fcde
commit 068b4ff553
2 changed files with 47 additions and 1 deletions

View File

@@ -533,14 +533,16 @@ void SimpleRegisterCoalescing::RemoveUnnecessaryKills(unsigned Reg,
MachineOperand &UseMO = UI.getOperand();
if (UseMO.isKill()) {
MachineInstr *UseMI = UseMO.getParent();
#if 0
unsigned SReg, DReg;
if (!tii_->isMoveInstr(*UseMI, SReg, DReg))
continue;
#endif
unsigned UseIdx = li_->getUseIndex(li_->getInstructionIndex(UseMI));
if (JoinedCopies.count(UseMI))
continue;
const LiveRange *UI = LI.getLiveRangeContaining(UseIdx);
if (!LI.isKill(UI->valno, UseIdx+1))
if (!UI || !LI.isKill(UI->valno, UseIdx+1))
UseMO.setIsKill(false);
}
}