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

Alkis Evlogimenos alkis at cs.uiuc.edu
Wed Jul 21 02:47:05 PDT 2004



Changes in directory llvm/lib/CodeGen:

RegAllocIterativeScan.cpp updated: 1.2 -> 1.3

---
Log message:

Change std::list into a std::vector for IntervalSets. This reduces
compile time for 176.gcc from 5.6 secs to 4.7 secs.


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

Index: llvm/lib/CodeGen/RegAllocIterativeScan.cpp
diff -u llvm/lib/CodeGen/RegAllocIterativeScan.cpp:1.2 llvm/lib/CodeGen/RegAllocIterativeScan.cpp:1.3
--- llvm/lib/CodeGen/RegAllocIterativeScan.cpp:1.2	Wed Jul 21 03:28:39 2004
+++ llvm/lib/CodeGen/RegAllocIterativeScan.cpp	Wed Jul 21 04:46:55 2004
@@ -53,7 +53,7 @@
         const TargetMachine* tm_;
         const MRegisterInfo* mri_;
         LiveIntervals* li_;
-        typedef std::list<LiveInterval*> IntervalPtrs;
+        typedef std::vector<LiveInterval*> IntervalPtrs;
         IntervalPtrs unhandled_, fixed_, active_, inactive_, handled_, spilled_;
 
         std::auto_ptr<PhysRegTracker> prt_;
@@ -196,7 +196,8 @@
           << mf_->getFunction()->getName() << '\n');
 
 
-    unhandled_.sort(less_ptr<LiveInterval>());
+    std::sort(unhandled_.begin(), unhandled_.end(),
+              greater_ptr<LiveInterval>());
     DEBUG(printIntervals("unhandled", unhandled_.begin(), unhandled_.end()));
     DEBUG(printIntervals("fixed", fixed_.begin(), fixed_.end()));
     DEBUG(printIntervals("active", active_.begin(), active_.end()));
@@ -204,8 +205,8 @@
 
     while (!unhandled_.empty()) {
         // pick the interval with the earliest start point
-        IntervalPtrs::value_type cur = unhandled_.front();
-        unhandled_.pop_front();
+        IntervalPtrs::value_type cur = unhandled_.back();
+        unhandled_.pop_back();
         ++numIterations;
         DEBUG(std::cerr << "\n*** CURRENT ***: " << *cur << '\n');
 





More information about the llvm-commits mailing list