diff options
author | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-07-21 09:46:55 +0000 |
---|---|---|
committer | Alkis Evlogimenos <alkis@evlogimenos.com> | 2004-07-21 09:46:55 +0000 |
commit | a3efc0373134eef33138bf13a7cc144af8bc17ca (patch) | |
tree | 9a7ed207bb8ba8ce17f5d8852c41a47420429ab2 /llvm/lib/CodeGen/RegAllocIterativeScan.cpp | |
parent | 29d020ab606cebb7ea17678e6a4a8b8d82d00c60 (diff) | |
download | bcm5719-llvm-a3efc0373134eef33138bf13a7cc144af8bc17ca.tar.gz bcm5719-llvm-a3efc0373134eef33138bf13a7cc144af8bc17ca.zip |
Change std::list into a std::vector for IntervalSets. This reduces
compile time for 176.gcc from 5.6 secs to 4.7 secs.
llvm-svn: 15072
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocIterativeScan.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocIterativeScan.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/RegAllocIterativeScan.cpp b/llvm/lib/CodeGen/RegAllocIterativeScan.cpp index b92fc747457..63fd358451f 100644 --- a/llvm/lib/CodeGen/RegAllocIterativeScan.cpp +++ b/llvm/lib/CodeGen/RegAllocIterativeScan.cpp @@ -53,7 +53,7 @@ namespace { 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 @@ bool RA::linearScan() << 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 @@ bool RA::linearScan() 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'); |