[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervals.cpp
Alkis Evlogimenos
alkis at niobe.cs.uiuc.edu
Tue Feb 17 22:39:01 PST 2004
Changes in directory llvm/lib/CodeGen:
LiveIntervals.cpp updated: 1.53 -> 1.54
---
Log message:
Be more agressive when joining ranges.
---
Diffs of the changes: (+9 -9)
Index: llvm/lib/CodeGen/LiveIntervals.cpp
diff -u llvm/lib/CodeGen/LiveIntervals.cpp:1.53 llvm/lib/CodeGen/LiveIntervals.cpp:1.54
--- llvm/lib/CodeGen/LiveIntervals.cpp:1.53 Tue Feb 17 21:35:38 2004
+++ llvm/lib/CodeGen/LiveIntervals.cpp Tue Feb 17 22:38:37 2004
@@ -625,10 +625,10 @@
LiveIntervals::Interval::Ranges::iterator
LiveIntervals::Interval::mergeRangesForward(Ranges::iterator it)
{
- for (Ranges::iterator next = it + 1;
- next != ranges.end() && it->second >= next->first; ) {
- it->second = std::max(it->second, next->second);
- next = ranges.erase(next);
+ for (Ranges::iterator n = next(it);
+ n != ranges.end() && ((it->second & 1) + it->second) >= n->first; ) {
+ it->second = std::max(it->second, n->second);
+ n = ranges.erase(n);
}
return it;
}
@@ -637,12 +637,12 @@
LiveIntervals::Interval::mergeRangesBackward(Ranges::iterator it)
{
while (it != ranges.begin()) {
- Ranges::iterator prev = it - 1;
- if (it->first > prev->second) break;
+ Ranges::iterator p = prior(it);
+ if (it->first > ((p->second & 1) + p->second)) break;
- it->first = std::min(it->first, prev->first);
- it->second = std::max(it->second, prev->second);
- it = ranges.erase(prev);
+ it->first = std::min(it->first, p->first);
+ it->second = std::max(it->second, p->second);
+ it = ranges.erase(p);
}
return it;
More information about the llvm-commits
mailing list