1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

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.

llvm-svn: 10833
This commit is contained in:
Alkis Evlogimenos 2004-01-13 22:26:14 +00:00
parent 222d1ed0c2
commit 34a4e7b161

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