From 0a12b801b546269b87c3806c6d4606cf2b287daa Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Tue, 26 Oct 2010 00:11:35 +0000 Subject: [PATCH] InlineSpiller can also update LiveStacks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117338 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/InlineSpiller.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/CodeGen/InlineSpiller.cpp b/lib/CodeGen/InlineSpiller.cpp index 81b30a48917..e938135a4ec 100644 --- a/lib/CodeGen/InlineSpiller.cpp +++ b/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()), + lss_(pass.getAnalysis()), loops_(pass.getAnalysis()), 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();) { -- 2.34.1