mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-06 04:31:08 +00:00
Ensure that the computed interference intervals actually overlap their basic blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124815 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
97af98678c
commit
2dfbb3e912
@ -626,6 +626,8 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg,
|
|||||||
IntI.advanceTo(Start);
|
IntI.advanceTo(Start);
|
||||||
if (!IntI.valid())
|
if (!IntI.valid())
|
||||||
break;
|
break;
|
||||||
|
if (IntI.start() >= Stop)
|
||||||
|
continue;
|
||||||
if (!IP.first.isValid() || IntI.start() < IP.first)
|
if (!IP.first.isValid() || IntI.start() < IP.first)
|
||||||
IP.first = IntI.start();
|
IP.first = IntI.start();
|
||||||
}
|
}
|
||||||
@ -635,6 +637,8 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg,
|
|||||||
IntI.advanceTo(Stop);
|
IntI.advanceTo(Stop);
|
||||||
if (!IntI.valid() || IntI.start() >= Stop)
|
if (!IntI.valid() || IntI.start() >= Stop)
|
||||||
--IntI;
|
--IntI;
|
||||||
|
if (IntI.stop() <= Start)
|
||||||
|
continue;
|
||||||
if (!IP.second.isValid() || IntI.stop() > IP.second)
|
if (!IP.second.isValid() || IntI.stop() > IP.second)
|
||||||
IP.second = IntI.stop();
|
IP.second = IntI.stop();
|
||||||
}
|
}
|
||||||
@ -663,10 +667,15 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg,
|
|||||||
tie(Start, Stop) = Indexes->getMBBRange(BI.MBB);
|
tie(Start, Stop) = Indexes->getMBBRange(BI.MBB);
|
||||||
|
|
||||||
DEBUG(dbgs() << "BB#" << BI.MBB->getNumber() << " -> EB#"
|
DEBUG(dbgs() << "BB#" << BI.MBB->getNumber() << " -> EB#"
|
||||||
<< Bundles->getBundle(BI.MBB->getNumber(), 1));
|
<< Bundles->getBundle(BI.MBB->getNumber(), 1)
|
||||||
|
<< " intf [" << IP.first << ';' << IP.second << ')');
|
||||||
|
|
||||||
|
// The interference interval should either be invalid or overlap MBB.
|
||||||
|
assert((!IP.first.isValid() || IP.first < Stop) && "Bad interference");
|
||||||
|
assert((!IP.second.isValid() || IP.second > Start) && "Bad interference");
|
||||||
|
|
||||||
// Check interference leaving the block.
|
// Check interference leaving the block.
|
||||||
if (!IP.second.isValid() || IP.second < Start) {
|
if (!IP.second.isValid()) {
|
||||||
// Block is interference-free.
|
// Block is interference-free.
|
||||||
DEBUG(dbgs() << ", no interference");
|
DEBUG(dbgs() << ", no interference");
|
||||||
if (!BI.Uses) {
|
if (!BI.Uses) {
|
||||||
@ -739,7 +748,7 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg,
|
|||||||
<< " -> BB#" << BI.MBB->getNumber());
|
<< " -> BB#" << BI.MBB->getNumber());
|
||||||
|
|
||||||
// Check interference entering the block.
|
// Check interference entering the block.
|
||||||
if (!IP.first.isValid() || IP.first > Stop) {
|
if (!IP.first.isValid()) {
|
||||||
// Block is interference-free.
|
// Block is interference-free.
|
||||||
DEBUG(dbgs() << ", no interference");
|
DEBUG(dbgs() << ", no interference");
|
||||||
if (!BI.Uses) {
|
if (!BI.Uses) {
|
||||||
|
Loading…
Reference in New Issue
Block a user