diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-19 00:38:43 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-02-19 00:38:43 +0000 |
commit | fd38917d4d040759d75e9d1f4e2c885fb40ba2d7 (patch) | |
tree | dafdd21967740a0c8627d474cb59fb330536e027 | |
parent | a2ebf60ef2c434428af7f810b13327ab50245a67 (diff) | |
download | llvm-fd38917d4d040759d75e9d1f4e2c885fb40ba2d7.tar.gz llvm-fd38917d4d040759d75e9d1f4e2c885fb40ba2d7.tar.bz2 llvm-fd38917d4d040759d75e9d1f4e2c885fb40ba2d7.tar.xz |
This method belonged in VirtRegMap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126002 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/LiveRangeEdit.cpp | 7 | ||||
-rw-r--r-- | lib/CodeGen/LiveRangeEdit.h | 4 | ||||
-rw-r--r-- | lib/CodeGen/VirtRegMap.h | 9 |
3 files changed, 10 insertions, 10 deletions
diff --git a/lib/CodeGen/LiveRangeEdit.cpp b/lib/CodeGen/LiveRangeEdit.cpp index e23f382834..3bbda1c2e6 100644 --- a/lib/CodeGen/LiveRangeEdit.cpp +++ b/lib/CodeGen/LiveRangeEdit.cpp @@ -19,18 +19,13 @@ 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(getReg()); unsigned VReg = mri.createVirtualRegister(RC); vrm.grow(); - vrm.setIsSplitFromReg(VReg, getOriginal(vrm)); + vrm.setIsSplitFromReg(VReg, vrm.getOriginal(getReg())); LiveInterval &li = lis.getOrCreateInterval(VReg); newRegs_.push_back(&li); return li; diff --git a/lib/CodeGen/LiveRangeEdit.h b/lib/CodeGen/LiveRangeEdit.h index 832a12db4f..73f69ed639 100644 --- a/lib/CodeGen/LiveRangeEdit.h +++ b/lib/CodeGen/LiveRangeEdit.h @@ -73,10 +73,6 @@ public: LiveInterval &getParent() const { return parent_; } unsigned getReg() const { return parent_.reg; } - /// getOriginal - Return the original virtual register that parent descends - /// from through splitting. The original was not created by splitting. - unsigned getOriginal(const VirtRegMap&) const; - /// Iterator for accessing the new registers added by this edit. typedef SmallVectorImpl<LiveInterval*>::const_iterator iterator; iterator begin() const { return newRegs_.begin()+firstNew_; } diff --git a/lib/CodeGen/VirtRegMap.h b/lib/CodeGen/VirtRegMap.h index 23101ce74f..ba50f4e423 100644 --- a/lib/CodeGen/VirtRegMap.h +++ b/lib/CodeGen/VirtRegMap.h @@ -218,6 +218,15 @@ namespace llvm { return Virt2SplitMap[virtReg]; } + /// getOriginal - Return the original virtual register that VirtReg descends + /// from through splitting. + /// A register that was not created by splitting is its own original. + /// This operation is idempotent. + unsigned getOriginal(unsigned VirtReg) const { + unsigned Orig = getPreSplitReg(VirtReg); + return Orig ? Orig : VirtReg; + } + /// @brief returns true if the specified virtual register is not /// mapped to a stack slot or rematerialized. bool isAssignedReg(unsigned virtReg) const { |