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

Alkis Evlogimenos alkis at cs.uiuc.edu
Fri Jan 16 14:18:20 PST 2004


Changes in directory llvm/lib/CodeGen:

RegAllocLinearScan.cpp updated: 1.28 -> 1.29

---
Log message:

Fold open interval ends handling into
LiveIntervals::Interval::expiredAt() and simplify regalloc code.


---
Diffs of the changes:  (+4 -10)

Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp
diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.28 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.29
--- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.28	Tue Jan 13 18:09:36 2004
+++ llvm/lib/CodeGen/RegAllocLinearScan.cpp	Fri Jan 16 14:17:05 2004
@@ -428,11 +428,8 @@
     DEBUG(std::cerr << "\tprocessing active intervals:\n");
     for (IntervalPtrs::iterator i = active_.begin(); i != active_.end();) {
         unsigned reg = (*i)->reg;
-        // remove expired intervals. we expire earlier because this if
-        // an interval expires this is going to be the last use. in
-        // this case we can reuse the register for a def in the same
-        // instruction
-        if ((*i)->expiredAt(cur->start() + 1)) {
+        // remove expired intervals
+        if ((*i)->expiredAt(cur->start())) {
             DEBUG(std::cerr << "\t\tinterval " << **i << " expired\n");
             if (reg >= MRegisterInfo::FirstVirtualRegister) {
                 reg = v2pMap_[reg];
@@ -465,11 +462,8 @@
     for (IntervalPtrs::iterator i = inactive_.begin(); i != inactive_.end();) {
         unsigned reg = (*i)->reg;
 
-        // remove expired intervals. we expire earlier because this if
-        // an interval expires this is going to be the last use. in
-        // this case we can reuse the register for a def in the same
-        // instruction
-        if ((*i)->expiredAt(cur->start() + 1)) {
+        // remove expired intervals
+        if ((*i)->expiredAt(cur->start())) {
             DEBUG(std::cerr << "\t\t\tinterval " << **i << " expired\n");
             // remove from inactive
             i = inactive_.erase(i);





More information about the llvm-commits mailing list