diff options
author | Owen Anderson <resistor@mac.com> | 2008-08-15 18:49:41 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-08-15 18:49:41 +0000 |
commit | d669b9b6715f983d8c54bc34a01b5569ab262557 (patch) | |
tree | aa968ea55b0090a059cf5635d8546c1b46cc15ff /llvm/lib/CodeGen/RegAllocLinearScan.cpp | |
parent | abd2615ecb7daf119596d157a5cc1b510ed306d7 (diff) | |
download | bcm5719-llvm-d669b9b6715f983d8c54bc34a01b5569ab262557.tar.gz bcm5719-llvm-d669b9b6715f983d8c54bc34a01b5569ab262557.zip |
Convert several std::vectors over to SmallVector, and use reserve() as appropriate for cases where std::vector is still used.
llvm-svn: 54820
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r-- | llvm/lib/CodeGen/RegAllocLinearScan.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp index 3ab4b026689..c6f714a9cb7 100644 --- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp +++ b/llvm/lib/CodeGen/RegAllocLinearScan.cpp @@ -58,7 +58,7 @@ namespace { RALinScan() : MachineFunctionPass((intptr_t)&ID) {} typedef std::pair<LiveInterval*, LiveInterval::iterator> IntervalPtr; - typedef std::vector<IntervalPtr> IntervalPtrs; + typedef SmallVector<IntervalPtr, 32> IntervalPtrs; private: /// RelatedRegClasses - This structure is built the first time a function is /// compiled, and keeps track of which register classes have registers that @@ -94,7 +94,7 @@ namespace { IntervalPtrs inactive_; typedef std::priority_queue<LiveInterval*, - std::vector<LiveInterval*>, + SmallVector<LiveInterval*, 64>, greater_ptr<LiveInterval> > IntervalHeap; IntervalHeap unhandled_; std::auto_ptr<PhysRegTracker> prt_; @@ -322,6 +322,8 @@ void RALinScan::initIntervalSets() active_.empty() && inactive_.empty() && "interval sets should be empty on initialization"); + handled_.reserve(li_->getNumIntervals()); + for (LiveIntervals::iterator i = li_->begin(), e = li_->end(); i != e; ++i) { if (TargetRegisterInfo::isPhysicalRegister(i->second->reg)) { reginfo_->setPhysRegUsed(i->second->reg); |