Updated ModuloScheduling. It makes it all the wya through register allocation on...
[oota-llvm.git] / lib / CodeGen / RegAllocIterativeScan.cpp
index 9f0c5e8af490462658b6dae1e64b3760184e8cb5..e9e9fd8e13603b4a5c08b4c6761172ec3b7fd23a 100644 (file)
@@ -29,7 +29,7 @@
 #include "Support/Debug.h"
 #include "Support/Statistic.h"
 #include "Support/STLExtras.h"
-#include "LiveIntervals.h"
+#include "LiveIntervalAnalysis.h"
 #include "PhysRegTracker.h"
 #include "VirtRegMap.h"
 #include <algorithm>
@@ -85,7 +85,7 @@ namespace {
 
         /// initIntervalSets - initializes the four interval sets:
         /// unhandled, fixed, active and inactive
-        void initIntervalSets(LiveIntervals::Intervals& li);
+        void initIntervalSets();
 
         /// processActiveIntervals - expire old intervals and move
         /// non-overlapping ones to the incative list
@@ -151,9 +151,9 @@ bool RA::runOnMachineFunction(MachineFunction &fn) {
     vrm_.reset(new VirtRegMap(*mf_));
     if (!spiller_.get()) spiller_.reset(createSpiller());
 
-    initIntervalSets(li_->getIntervals());
+    initIntervalSets();
 
-    numIntervals += li_->getIntervals().size();
+    numIntervals += li_->getNumIntervals();
 
     while (linearScan()) {
         // we spilled some registers, so we need to add intervals for
@@ -251,17 +251,15 @@ bool RA::linearScan()
     return !spilled_.empty();
 }
 
-void RA::initIntervalSets(LiveIntervals::Intervals& li)
-{
+void RA::initIntervalSets() {
     assert(unhandled_.empty() && fixed_.empty() &&
            active_.empty() && inactive_.empty() &&
            "interval sets should be empty on initialization");
 
-    for (LiveIntervals::Intervals::iterator i = li.begin(), e = li.end();
-         i != e; ++i) {
-        unhandled_.push_back(&*i);
-        if (MRegisterInfo::isPhysicalRegister(i->reg))
-            fixed_.push_back(&*i);
+    for (LiveIntervals::iterator i = li_->begin(), e = li_->end(); i != e; ++i){
+      unhandled_.push_back(&i->second);
+      if (MRegisterInfo::isPhysicalRegister(i->second.reg))
+        fixed_.push_back(&i->second);
     }
 }