summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-30 18:19:08 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-30 18:19:08 +0000
commitc39d3497c84c2ad9d377eaa6ebeb4d2d0f7a16ab (patch)
treeeebaba55697f1f52c2ed998a48b5aca0f31c3e4d /llvm/lib/CodeGen
parentd92badfd9c99877fa487b2d72e5445973b8713c3 (diff)
downloadbcm5719-llvm-c39d3497c84c2ad9d377eaa6ebeb4d2d0f7a16ab.tar.gz
bcm5719-llvm-c39d3497c84c2ad9d377eaa6ebeb4d2d0f7a16ab.zip
Remember to track spill slot uses in VirtRegMap when inserting loads and stores.
LocalRewriter::runOnMachineFunction uses this information to mark dead spill slots. This means that InlineSpiller now also works for functions that spill. llvm-svn: 107302
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/InlineSpiller.cpp2
-rw-r--r--llvm/lib/CodeGen/Spiller.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/InlineSpiller.cpp b/llvm/lib/CodeGen/InlineSpiller.cpp
index a7a774d1ca5..2c9ea19d429 100644
--- a/llvm/lib/CodeGen/InlineSpiller.cpp
+++ b/llvm/lib/CodeGen/InlineSpiller.cpp
@@ -95,6 +95,7 @@ void InlineSpiller::spill(LiveInterval *li,
tii_.loadRegFromStackSlot(*MI->getParent(), MII, NewVReg, SS, RC, &tri_);
--MII; // Point to load instruction.
SlotIndex LoadIdx = lis_.InsertMachineInstrInMaps(MII).getDefIndex();
+ vrm_.addSpillSlotUse(SS, MII);
DEBUG(dbgs() << "\treload: " << LoadIdx << '\t' << *MII);
VNInfo *LoadVNI = NewLI.getNextValue(LoadIdx, 0, true,
lis_.getVNInfoAllocator());
@@ -124,6 +125,7 @@ void InlineSpiller::spill(LiveInterval *li,
&tri_);
--MII; // Point to store instruction.
SlotIndex StoreIdx = lis_.InsertMachineInstrInMaps(MII).getDefIndex();
+ vrm_.addSpillSlotUse(SS, MII);
DEBUG(dbgs() << "\tspilled: " << StoreIdx << '\t' << *MII);
VNInfo *StoreVNI = NewLI.getNextValue(Idx, 0, true,
lis_.getVNInfoAllocator());
diff --git a/llvm/lib/CodeGen/Spiller.cpp b/llvm/lib/CodeGen/Spiller.cpp
index ad65e9f4b25..19987afef1e 100644
--- a/llvm/lib/CodeGen/Spiller.cpp
+++ b/llvm/lib/CodeGen/Spiller.cpp
@@ -137,6 +137,7 @@ protected:
MachineInstr *loadInstr(prior(miItr));
SlotIndex loadIndex =
lis->InsertMachineInstrInMaps(loadInstr).getDefIndex();
+ vrm->addSpilSlotUse(ss, loadInstr);
SlotIndex endIndex = loadIndex.getNextIndex();
VNInfo *loadVNI =
newLI->getNextValue(loadIndex, 0, true, lis->getVNInfoAllocator());
@@ -150,6 +151,7 @@ protected:
MachineInstr *storeInstr(llvm::next(miItr));
SlotIndex storeIndex =
lis->InsertMachineInstrInMaps(storeInstr).getDefIndex();
+ vrm->addSpilSlotUse(ss, storeInstr);
SlotIndex beginIndex = storeIndex.getPrevIndex();
VNInfo *storeVNI =
newLI->getNextValue(beginIndex, 0, true, lis->getVNInfoAllocator());
OpenPOWER on IntegriCloud