From: Alkis Evlogimenos Date: Wed, 21 Jul 2004 12:00:10 +0000 (+0000) Subject: Clear spilled list at once. Remove unused vector. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=fc29e63afec1e8f4636c13bd9723b27efc2d4c73;p=oota-llvm.git Clear spilled list at once. Remove unused vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15073 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/RegAllocIterativeScan.cpp b/lib/CodeGen/RegAllocIterativeScan.cpp index 63fd358451f..3f380aaf9de 100644 --- a/lib/CodeGen/RegAllocIterativeScan.cpp +++ b/lib/CodeGen/RegAllocIterativeScan.cpp @@ -161,14 +161,14 @@ bool RA::runOnMachineFunction(MachineFunction &fn) { // the spill code and restart the algorithm std::set spilledRegs; for (IntervalPtrs::iterator - i = spilled_.begin(); i != spilled_.end(); ) { + i = spilled_.begin(); i != spilled_.end(); ++i) { int slot = vrm_->assignVirt2StackSlot((*i)->reg); std::vector added = li_->addIntervalsForSpills(**i, *vrm_, slot); std::copy(added.begin(), added.end(), std::back_inserter(handled_)); spilledRegs.insert((*i)->reg); - i = spilled_.erase(i); } + spilled_.clear(); for (IntervalPtrs::iterator i = handled_.begin(); i != handled_.end(); ) if (spilledRegs.count((*i)->reg)) @@ -415,7 +415,6 @@ void RA::assignRegOrSpillAtInterval(IntervalPtrs::value_type cur) // otherwise we spill all intervals aliasing the register with // minimum weight, assigned the newly cleared register to the // current interval and continue - std::vector added; assert(MRegisterInfo::isPhysicalRegister(minReg) && "did not choose a register to spill?"); std::vector toSpill(mri_->getNumRegs(), false);