summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocGreedy.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-03 20:29:43 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-03 20:29:43 +0000
commit4a6518e6a83fe65b1cc02c421331bd7c4bdc638a (patch)
treea56443caea177db4f3b662058043dac9a920961b /llvm/lib/CodeGen/RegAllocGreedy.cpp
parentdb4cf7e4a41c176d98bcbe3b271f81f45748a802 (diff)
downloadbcm5719-llvm-4a6518e6a83fe65b1cc02c421331bd7c4bdc638a.tar.gz
bcm5719-llvm-4a6518e6a83fe65b1cc02c421331bd7c4bdc638a.zip
Ensure that the computed interference intervals actually overlap their basic blocks.
llvm-svn: 124815
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocGreedy.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocGreedy.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp
index 730bddb8b00..92f97d046f5 100644
--- a/llvm/lib/CodeGen/RegAllocGreedy.cpp
+++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp
@@ -626,6 +626,8 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg,
IntI.advanceTo(Start);
if (!IntI.valid())
break;
+ if (IntI.start() >= Stop)
+ continue;
if (!IP.first.isValid() || IntI.start() < IP.first)
IP.first = IntI.start();
}
@@ -635,6 +637,8 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg,
IntI.advanceTo(Stop);
if (!IntI.valid() || IntI.start() >= Stop)
--IntI;
+ if (IntI.stop() <= Start)
+ continue;
if (!IP.second.isValid() || IntI.stop() > IP.second)
IP.second = IntI.stop();
}
@@ -663,10 +667,15 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg,
tie(Start, Stop) = Indexes->getMBBRange(BI.MBB);
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.
- if (!IP.second.isValid() || IP.second < Start) {
+ if (!IP.second.isValid()) {
// Block is interference-free.
DEBUG(dbgs() << ", no interference");
if (!BI.Uses) {
@@ -739,7 +748,7 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg,
<< " -> BB#" << BI.MBB->getNumber());
// Check interference entering the block.
- if (!IP.first.isValid() || IP.first > Stop) {
+ if (!IP.first.isValid()) {
// Block is interference-free.
DEBUG(dbgs() << ", no interference");
if (!BI.Uses) {
OpenPOWER on IntegriCloud