summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-10-26 00:11:35 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-10-26 00:11:35 +0000
commite2c340c8d0b9cf7ea5fefc556171f82b1368b955 (patch)
tree20c1b14b1e5a2ea96fc1915c27fba09b77a2e5d4 /llvm/lib/CodeGen
parent7cdc1e5f16028e2937825202a2cf817865bf9659 (diff)
downloadbcm5719-llvm-e2c340c8d0b9cf7ea5fefc556171f82b1368b955.tar.gz
bcm5719-llvm-e2c340c8d0b9cf7ea5fefc556171f82b1368b955.zip
InlineSpiller can also update LiveStacks.
llvm-svn: 117338
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/InlineSpiller.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/InlineSpiller.cpp b/llvm/lib/CodeGen/InlineSpiller.cpp
index 81b30a48917..e938135a4ec 100644
--- a/llvm/lib/CodeGen/InlineSpiller.cpp
+++ b/llvm/lib/CodeGen/InlineSpiller.cpp
@@ -18,6 +18,7 @@
#include "SplitKit.h"
#include "VirtRegMap.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
+#include "llvm/CodeGen/LiveStackAnalysis.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
@@ -34,6 +35,7 @@ class InlineSpiller : public Spiller {
MachineFunctionPass &pass_;
MachineFunction &mf_;
LiveIntervals &lis_;
+ LiveStacks &lss_;
MachineLoopInfo &loops_;
VirtRegMap &vrm_;
MachineFrameInfo &mfi_;
@@ -61,6 +63,7 @@ public:
: pass_(pass),
mf_(mf),
lis_(pass.getAnalysis<LiveIntervals>()),
+ lss_(pass.getAnalysis<LiveStacks>()),
loops_(pass.getAnalysis<MachineLoopInfo>()),
vrm_(vrm),
mfi_(*mf.getFrameInfo()),
@@ -355,6 +358,12 @@ void InlineSpiller::spill(LiveRangeEdit &edit) {
rc_ = mri_.getRegClass(edit.getReg());
stackSlot_ = edit.assignStackSlot(vrm_);
+ // Update LiveStacks now that we are committed to spilling.
+ LiveInterval &stacklvr = lss_.getOrCreateInterval(stackSlot_, rc_);
+ if (!stacklvr.hasAtLeastOneValue())
+ stacklvr.getNextValue(SlotIndex(), 0, lss_.getVNInfoAllocator());
+ stacklvr.MergeRangesInAsValue(edit_->getParent(), stacklvr.getValNumInfo(0));
+
// Iterate over instructions using register.
for (MachineRegisterInfo::reg_iterator RI = mri_.reg_begin(edit.getReg());
MachineInstr *MI = RI.skipInstruction();) {
OpenPOWER on IntegriCloud