forked from OSchip/llvm-project
parent
609bc44c2e
commit
13eb3650b0
|
@ -19,18 +19,13 @@
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
unsigned LiveRangeEdit::getOriginal(const VirtRegMap &vrm) const {
|
|
||||||
unsigned Orig = vrm.getPreSplitReg(getReg());
|
|
||||||
return Orig ? Orig : getReg();
|
|
||||||
}
|
|
||||||
|
|
||||||
LiveInterval &LiveRangeEdit::create(MachineRegisterInfo &mri,
|
LiveInterval &LiveRangeEdit::create(MachineRegisterInfo &mri,
|
||||||
LiveIntervals &lis,
|
LiveIntervals &lis,
|
||||||
VirtRegMap &vrm) {
|
VirtRegMap &vrm) {
|
||||||
const TargetRegisterClass *RC = mri.getRegClass(getReg());
|
const TargetRegisterClass *RC = mri.getRegClass(getReg());
|
||||||
unsigned VReg = mri.createVirtualRegister(RC);
|
unsigned VReg = mri.createVirtualRegister(RC);
|
||||||
vrm.grow();
|
vrm.grow();
|
||||||
vrm.setIsSplitFromReg(VReg, getOriginal(vrm));
|
vrm.setIsSplitFromReg(VReg, vrm.getOriginal(getReg()));
|
||||||
LiveInterval &li = lis.getOrCreateInterval(VReg);
|
LiveInterval &li = lis.getOrCreateInterval(VReg);
|
||||||
newRegs_.push_back(&li);
|
newRegs_.push_back(&li);
|
||||||
return li;
|
return li;
|
||||||
|
|
|
@ -73,10 +73,6 @@ public:
|
||||||
LiveInterval &getParent() const { return parent_; }
|
LiveInterval &getParent() const { return parent_; }
|
||||||
unsigned getReg() const { return parent_.reg; }
|
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.
|
/// Iterator for accessing the new registers added by this edit.
|
||||||
typedef SmallVectorImpl<LiveInterval*>::const_iterator iterator;
|
typedef SmallVectorImpl<LiveInterval*>::const_iterator iterator;
|
||||||
iterator begin() const { return newRegs_.begin()+firstNew_; }
|
iterator begin() const { return newRegs_.begin()+firstNew_; }
|
||||||
|
|
|
@ -218,6 +218,15 @@ namespace llvm {
|
||||||
return Virt2SplitMap[virtReg];
|
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
|
/// @brief returns true if the specified virtual register is not
|
||||||
/// mapped to a stack slot or rematerialized.
|
/// mapped to a stack slot or rematerialized.
|
||||||
bool isAssignedReg(unsigned virtReg) const {
|
bool isAssignedReg(unsigned virtReg) const {
|
||||||
|
|
Loading…
Reference in New Issue