Change the Spiller interface to take a LiveRangeEdit reference.

This makes it possible to register delegates and get callbacks when the spiller
edits live ranges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127389 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jakob Stoklund Olesen
2011-03-10 01:51:42 +00:00
parent 38f6bd0fc8
commit 47dbf6cef7
7 changed files with 34 additions and 50 deletions

View File

@ -13,6 +13,7 @@
#define DEBUG_TYPE "regalloc"
#include "LiveDebugVariables.h"
#include "LiveRangeEdit.h"
#include "VirtRegMap.h"
#include "VirtRegRewriter.h"
#include "Spiller.h"
@ -1230,7 +1231,8 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur) {
if (cur->weight != HUGE_VALF && cur->weight <= minWeight) {
DEBUG(dbgs() << "\t\t\tspilling(c): " << *cur << '\n');
SmallVector<LiveInterval*, 8> added;
spiller_->spill(cur, added, 0);
LiveRangeEdit LRE(*cur, added);
spiller_->spill(LRE);
std::sort(added.begin(), added.end(), LISorter());
if (added.empty())
@ -1306,7 +1308,8 @@ void RALinScan::assignRegOrStackSlotAtInterval(LiveInterval* cur) {
DEBUG(dbgs() << "\t\t\tspilling(a): " << *sli << '\n');
if (sli->beginIndex() < earliestStart)
earliestStart = sli->beginIndex();
spiller_->spill(sli, added, &spillIs);
LiveRangeEdit LRE(*sli, added, 0, &spillIs);
spiller_->spill(LRE);
spilled.insert(sli->reg);
}