aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/LiveRangeEdit.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-18 22:35:20 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-18 22:35:20 +0000
commite324f6e05ff7a157347edb48203db0250805f748 (patch)
treec8bd989c58f7753f1969bfcbd95b9c32113b1e5d /lib/CodeGen/LiveRangeEdit.cpp
parent188a7e00e784f78d6b5b250a64ac5c374f0fd3f0 (diff)
Use VirtRegMap's Virt2SplitMap to keep track of the original live range before splitting.
All new virtual registers created for spilling or splitting point back to their original. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125980 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/LiveRangeEdit.cpp')
-rw-r--r--lib/CodeGen/LiveRangeEdit.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveRangeEdit.cpp b/lib/CodeGen/LiveRangeEdit.cpp
index 3c7d9f66e7..e23f382834 100644
--- a/lib/CodeGen/LiveRangeEdit.cpp
+++ b/lib/CodeGen/LiveRangeEdit.cpp
@@ -19,12 +19,18 @@
using namespace llvm;
+unsigned LiveRangeEdit::getOriginal(const VirtRegMap &vrm) const {
+ unsigned Orig = vrm.getPreSplitReg(getReg());
+ return Orig ? Orig : getReg();
+}
+
LiveInterval &LiveRangeEdit::create(MachineRegisterInfo &mri,
LiveIntervals &lis,
VirtRegMap &vrm) {
- const TargetRegisterClass *RC = mri.getRegClass(parent_.reg);
+ const TargetRegisterClass *RC = mri.getRegClass(getReg());
unsigned VReg = mri.createVirtualRegister(RC);
vrm.grow();
+ vrm.setIsSplitFromReg(VReg, getOriginal(vrm));
LiveInterval &li = lis.getOrCreateInterval(VReg);
newRegs_.push_back(&li);
return li;