aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/LiveRangeEdit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/LiveRangeEdit.cpp')
-rw-r--r--lib/CodeGen/LiveRangeEdit.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/LiveRangeEdit.cpp b/lib/CodeGen/LiveRangeEdit.cpp
index 8a123fb..463ebcb 100644
--- a/lib/CodeGen/LiveRangeEdit.cpp
+++ b/lib/CodeGen/LiveRangeEdit.cpp
@@ -18,12 +18,21 @@
using namespace llvm;
+int LiveRangeEdit::assignStackSlot(VirtRegMap &vrm) {
+ int ss = vrm.getStackSlot(getReg());
+ if (ss != VirtRegMap::NO_STACK_SLOT)
+ return ss;
+ return vrm.assignVirt2StackSlot(getReg());
+}
+
LiveInterval &LiveRangeEdit::create(MachineRegisterInfo &mri,
LiveIntervals &lis,
VirtRegMap &vrm) {
const TargetRegisterClass *RC = mri.getRegClass(parent_.reg);
unsigned VReg = mri.createVirtualRegister(RC);
vrm.grow();
+ // Immediately assign to the same stack slot as parent.
+ vrm.assignVirt2StackSlot(VReg, assignStackSlot(vrm));
LiveInterval &li = lis.getOrCreateInterval(VReg);
newRegs_.push_back(&li);
return li;