mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01: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:
parent
222d1ed0c2
commit
34a4e7b161
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user