summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/RegAllocLinearScan.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-24 20:54:29 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-24 20:54:29 +0000
commit2b87d44c5de111da0389f832e7311101f61e6a55 (patch)
tree991b7477e3476d394ff490a3aa0f1f0dd69f563e /llvm/lib/CodeGen/RegAllocLinearScan.cpp
parent4398fd7b836561635662f23ed77ed5786aafc8f2 (diff)
downloadbcm5719-llvm-2b87d44c5de111da0389f832e7311101f61e6a55.tar.gz
bcm5719-llvm-2b87d44c5de111da0389f832e7311101f61e6a55.zip
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. llvm-svn: 106788
Diffstat (limited to 'llvm/lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r--llvm/lib/CodeGen/RegAllocLinearScan.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/RegAllocLinearScan.cpp b/llvm/lib/CodeGen/RegAllocLinearScan.cpp
index bc331f0ff81..25b63392bef 100644
--- a/llvm/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/llvm/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);
}
OpenPOWER on IntegriCloud