summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveRangeEdit.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-10-15 00:16:55 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-10-15 00:16:55 +0000
commit0f3e98ce2ed0daf9e003931dc7f4c053b307c3df (patch)
tree99e6d3bf5d3f41ec5debb6e2aff58a3484116cb6 /llvm/lib/CodeGen/LiveRangeEdit.cpp
parentb3ce035c7155644d5bced46c45ae5ac865b7aedc (diff)
downloadbcm5719-llvm-0f3e98ce2ed0daf9e003931dc7f4c053b307c3df.tar.gz
bcm5719-llvm-0f3e98ce2ed0daf9e003931dc7f4c053b307c3df.zip
Move stack slot assignments into LiveRangeEdit.
All registers created during splitting or spilling are assigned to the same stack slot as the parent register. When splitting or rematting, we may not spill at all. In that case the stack slot is still assigned, but it will be dead. llvm-svn: 116546
Diffstat (limited to 'llvm/lib/CodeGen/LiveRangeEdit.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveRangeEdit.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeEdit.cpp b/llvm/lib/CodeGen/LiveRangeEdit.cpp
index 8a123fbe701..463ebcb4ae5 100644
--- a/llvm/lib/CodeGen/LiveRangeEdit.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud