[llvm-commits] CVS: llvm/lib/CodeGen/LiveIntervals.cpp

Alkis Evlogimenos alkis at niobe.cs.uiuc.edu
Sat Feb 21 22:09:37 PST 2004


Changes in directory llvm/lib/CodeGen:

LiveIntervals.cpp updated: 1.59 -> 1.60

---
Log message:

Abstract merging of ranges away from number of slots per instruction.

Also make it less aggressive as the current implementation breaks in
some cases.


---
Diffs of the changes:  (+7 -3)

Index: llvm/lib/CodeGen/LiveIntervals.cpp
diff -u llvm/lib/CodeGen/LiveIntervals.cpp:1.59 llvm/lib/CodeGen/LiveIntervals.cpp:1.60
--- llvm/lib/CodeGen/LiveIntervals.cpp:1.59	Sat Feb 21 12:07:33 2004
+++ llvm/lib/CodeGen/LiveIntervals.cpp	Sat Feb 21 22:05:12 2004
@@ -227,6 +227,7 @@
     // 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 @@
 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 @@
 {
     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);





More information about the llvm-commits mailing list