summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervals.cpp
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-22 04:05:13 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-02-22 04:05:13 +0000
commitd890f59f19d0830cb49f3021d4a5cf6ccd848c3d (patch)
tree7860270f6d2650189e861c37906f3da6f72e477c /llvm/lib/CodeGen/LiveIntervals.cpp
parenta376aae246cf527b381d1eb70c5e64df1e47644b (diff)
downloadbcm5719-llvm-d890f59f19d0830cb49f3021d4a5cf6ccd848c3d.tar.gz
bcm5719-llvm-d890f59f19d0830cb49f3021d4a5cf6ccd848c3d.zip
Abstract merging of ranges away from number of slots per instruction.
Also make it less aggressive as the current implementation breaks in some cases. llvm-svn: 11696
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervals.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervals.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervals.cpp b/llvm/lib/CodeGen/LiveIntervals.cpp
index 00e366fbb30..f15d6cd1b35 100644
--- a/llvm/lib/CodeGen/LiveIntervals.cpp
+++ b/llvm/lib/CodeGen/LiveIntervals.cpp
@@ -227,6 +227,7 @@ void LiveIntervals::updateSpilledInterval(Interval& li, int slot)
// the new spill weight is now infinity as it cannot be spilled again
li.weight = std::numeric_limits<float>::infinity();
DEBUG(std::cerr << '\n');
+ DEBUG(std::cerr << "\t\t\t\tupdated interval: " << li << '\n');
}
void LiveIntervals::printRegName(unsigned reg) const
@@ -652,8 +653,10 @@ void LiveIntervals::Interval::join(const LiveIntervals::Interval& other)
LiveIntervals::Interval::Ranges::iterator
LiveIntervals::Interval::mergeRangesForward(Ranges::iterator it)
{
- for (Ranges::iterator n = next(it);
- n != ranges.end() && ((it->second & 1) + it->second) >= n->first; ) {
+ Ranges::iterator n;
+ while ((n = next(it)) != ranges.end()) {
+ if (n->first > it->second)
+ break;
it->second = std::max(it->second, n->second);
n = ranges.erase(n);
}
@@ -665,7 +668,8 @@ LiveIntervals::Interval::mergeRangesBackward(Ranges::iterator it)
{
while (it != ranges.begin()) {
Ranges::iterator p = prior(it);
- if (it->first > ((p->second & 1) + p->second)) break;
+ if (it->first > p->second)
+ break;
it->first = std::min(it->first, p->first);
it->second = std::max(it->second, p->second);
OpenPOWER on IntegriCloud