summaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocLinearScan.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-07-24 03:32:06 +0000
committerChris Lattner <sabre@nondot.org>2004-07-24 03:32:06 +0000
commit4df98e546dd0cca214df661ae1072e1a3f6eff98 (patch)
treeef32b39ff289f9e01385619fdd4ae9dee97cee78 /lib/CodeGen/RegAllocLinearScan.cpp
parent7ac2d3146a196fa0120c579ecd2ddd69652ad230 (diff)
downloadllvm-4df98e546dd0cca214df661ae1072e1a3f6eff98.tar.gz
llvm-4df98e546dd0cca214df661ae1072e1a3f6eff98.tar.bz2
llvm-4df98e546dd0cca214df661ae1072e1a3f6eff98.tar.xz
Completely eliminate the intervals_ list. instead, the r2iMap_ maintains
ownership of the intervals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r--lib/CodeGen/RegAllocLinearScan.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp
index 51b73c690e..382cff4ad7 100644
--- a/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/lib/CodeGen/RegAllocLinearScan.cpp
@@ -82,7 +82,7 @@ namespace {
/// initIntervalSets - initializa 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
@@ -146,7 +146,7 @@ bool RA::runOnMachineFunction(MachineFunction &fn) {
vrm_.reset(new VirtRegMap(*mf_));
if (!spiller_.get()) spiller_.reset(createSpiller());
- initIntervalSets(li_->getIntervals());
+ initIntervalSets();
linearScan();
@@ -193,7 +193,7 @@ void RA::linearScan()
DEBUG(printIntervals("active", active_.begin(), active_.end()));
DEBUG(printIntervals("inactive", inactive_.begin(), inactive_.end()));
}
- numIntervals += li_->getIntervals().size();
+ numIntervals += li_->getNumIntervals();
efficiency = double(numIterations) / double(numIntervals);
// expire any remaining active intervals
@@ -217,17 +217,16 @@ void RA::linearScan()
DEBUG(std::cerr << *vrm_);
}
-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(&*i);
- if (MRegisterInfo::isPhysicalRegister(i->reg))
- fixed_.push_back(&*i);
+ for (LiveIntervals::iterator i = li_->begin(), e = li_->end(); i != e; ++i){
+ unhandled_.push(i->second);
+ if (MRegisterInfo::isPhysicalRegister(i->second->reg))
+ fixed_.push_back(i->second);
}
}