summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2008-06-02 17:36:36 +0000
committerOwen Anderson <resistor@mac.com>2008-06-02 17:36:36 +0000
commit0908deccc21b61381cffc58ca146662e788e2d43 (patch)
tree89dad15665edaf865fc5fe13012bbd1b18570eb2 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parent416867a81b07816f151ff1cdbf5570db1add3513 (diff)
downloadbcm5719-llvm-0908deccc21b61381cffc58ca146662e788e2d43.tar.gz
bcm5719-llvm-0908deccc21b61381cffc58ca146662e788e2d43.zip
Correctly handle removed instructions at the beginning of MBBs when renumbering.
llvm-svn: 51876
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index f711c0ccaa5..54738539fa9 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -128,13 +128,11 @@ void LiveIntervals::computeNumbering() {
i++;
} while (!newInstr);
- MachineInstr* preceding = i2miMap_[(mi2iMap_[newInstr] -
- InstrSlots::NUM) / InstrSlots::NUM];
- if (preceding->getParent() == newInstr->getParent() &&
- preceding->modifiesRegister(I->second.reg))
- LI->start = mi2iMap_[newInstr] - InstrSlots::NUM + offset;
- else
+ if (mi2iMap_[newInstr] ==
+ MBB2IdxMap[newInstr->getParent()->getNumber()].first)
LI->start = mi2iMap_[newInstr];
+ else
+ LI->start = mi2iMap_[newInstr] - InstrSlots::NUM + offset;
}
// Remap the ending index in the same way that we remapped the start,
@@ -172,13 +170,11 @@ void LiveIntervals::computeNumbering() {
i++;
} while (!newInstr);
- MachineInstr* preceding = i2miMap_[(mi2iMap_[newInstr] -
- InstrSlots::NUM) / InstrSlots::NUM];
- if (preceding->getParent() == newInstr->getParent() &&
- preceding->modifiesRegister(I->second.reg))
- vni->def = mi2iMap_[newInstr] - InstrSlots::NUM + offset;
- else
+ if (mi2iMap_[newInstr] ==
+ MBB2IdxMap[newInstr->getParent()->getNumber()].first)
vni->def = mi2iMap_[newInstr];
+ else
+ vni->def = mi2iMap_[newInstr] - InstrSlots::NUM + offset;
}
// Remap the VNInfo kill indices, which works the same as
OpenPOWER on IntegriCloud