diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-06-24 20:54:29 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-06-24 20:54:29 +0000 |
commit | 67674e2685af8ab16292550becac15f7b17ea831 (patch) | |
tree | a565994132e2ad60a8612349e7b26c807c89e054 /lib/CodeGen/RegAllocLinearScan.cpp | |
parent | 788184365a4a949eb83b0036045e6793bc6c20f0 (diff) | |
download | external_llvm-67674e2685af8ab16292550becac15f7b17ea831.zip external_llvm-67674e2685af8ab16292550becac15f7b17ea831.tar.gz external_llvm-67674e2685af8ab16292550becac15f7b17ea831.tar.bz2 |
Don't return a std::vector in the Spiller interface, but take a reference to a
vector instead. This avoids needless copying and allocation.
Add documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106788 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r-- | lib/CodeGen/RegAllocLinearScan.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index bc331f0..25b6339 100644 --- a/lib/CodeGen/RegAllocLinearScan.cpp +++ b/lib/CodeGen/RegAllocLinearScan.cpp @@ -1206,8 +1206,7 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur) { DEBUG(dbgs() << "\t\t\tspilling(c): " << *cur << '\n'); SmallVector<LiveInterval*, 8> spillIs; std::vector<LiveInterval*> added; - - added = spiller_->spill(cur, spillIs); + spiller_->spill(cur, added, spillIs); std::sort(added.begin(), added.end(), LISorter()); addStackInterval(cur, ls_, li_, mri_, *vrm_); @@ -1285,10 +1284,8 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur) { if (sli->beginIndex() < earliestStart) earliestStart = sli->beginIndex(); - std::vector<LiveInterval*> newIs; - newIs = spiller_->spill(sli, spillIs, &earliestStart); + spiller_->spill(sli, added, spillIs, &earliestStart); addStackInterval(sli, ls_, li_, mri_, *vrm_); - std::copy(newIs.begin(), newIs.end(), std::back_inserter(added)); spilled.insert(sli->reg); } |