Fix miscomputation of live intervals. The catch is that registers can

be dead at the defining instruction but can only be killed in
subsequent ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10833 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alkis Evlogimenos 2004-01-13 22:26:14 +00:00
parent 048a1d8db7
commit af25473d5e

View File

@ -196,6 +196,21 @@ void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock* mbb,
unsigned start = getInstructionIndex(*mi);
unsigned end = start;
// register can be dead by the instruction defining it but it can
// only be killed by subsequent instructions
for (LiveVariables::killed_iterator
ki = lv_->dead_begin(*mi),
ke = lv_->dead_end(*mi);
ki != ke; ++ki) {
if (reg == ki->second) {
end = getInstructionIndex(ki->first) + 1;
DEBUG(std::cerr << " dead\n");
goto exit;
}
}
++mi;
for (MachineBasicBlock::iterator e = mbb->end(); mi != e; ++mi) {
for (LiveVariables::killed_iterator
ki = lv_->dead_begin(*mi),
@ -203,6 +218,7 @@ void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock* mbb,
ki != ke; ++ki) {
if (reg == ki->second) {
end = getInstructionIndex(ki->first) + 1;
DEBUG(std::cerr << " dead\n");
goto exit;
}
}
@ -213,6 +229,7 @@ void LiveIntervals::handlePhysicalRegisterDef(MachineBasicBlock* mbb,
ki != ke; ++ki) {
if (reg == ki->second) {
end = getInstructionIndex(ki->first) + 1;
DEBUG(std::cerr << " killed\n");
goto exit;
}
}