[llvm-commits] [llvm] r126002 - in /llvm/trunk/lib/CodeGen: LiveRangeEdit.cpp LiveRangeEdit.h VirtRegMap.h
Jakob Stoklund Olesen
stoklund at 2pi.dk
Fri Feb 18 16:38:43 PST 2011
Author: stoklund
Date: Fri Feb 18 18:38:43 2011
New Revision: 126002
URL: http://llvm.org/viewvc/llvm-project?rev=126002&view=rev
Log:
This method belonged in VirtRegMap.
Modified:
llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp
llvm/trunk/lib/CodeGen/LiveRangeEdit.h
llvm/trunk/lib/CodeGen/VirtRegMap.h
Modified: llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp?rev=126002&r1=126001&r2=126002&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp (original)
+++ llvm/trunk/lib/CodeGen/LiveRangeEdit.cpp Fri Feb 18 18:38:43 2011
@@ -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;
Modified: llvm/trunk/lib/CodeGen/LiveRangeEdit.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LiveRangeEdit.h?rev=126002&r1=126001&r2=126002&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LiveRangeEdit.h (original)
+++ llvm/trunk/lib/CodeGen/LiveRangeEdit.h Fri Feb 18 18:38:43 2011
@@ -73,10 +73,6 @@
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_; }
Modified: llvm/trunk/lib/CodeGen/VirtRegMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.h?rev=126002&r1=126001&r2=126002&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/VirtRegMap.h (original)
+++ llvm/trunk/lib/CodeGen/VirtRegMap.h Fri Feb 18 18:38:43 2011
@@ -218,6 +218,15 @@
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 {
More information about the llvm-commits
mailing list