18 #ifndef LLVM_CODEGEN_LIVERANGEEDIT_H
19 #define LLVM_CODEGEN_LIVERANGEEDIT_H
32 class MachineBlockFrequencyInfo;
33 class MachineLoopInfo;
40 virtual void anchor();
66 Delegate *
const TheDelegate;
69 const unsigned FirstNew;
72 bool ScannedRemattable;
102 void MRI_NoteNewVirtualRegister(
unsigned VReg);
120 : Parent(parent), NewRegs(newRegs),
121 MRI(MF.getRegInfo()), LIS(lis), VRM(vrm),
122 TII(*MF.getTarget().getInstrInfo()),
123 TheDelegate(delegate),
124 FirstNew(newRegs.
size()),
130 assert(Parent &&
"No parent LiveInterval");
139 unsigned size()
const {
return NewRegs.
size()-FirstNew; }
141 unsigned get(
unsigned idx)
const {
return NewRegs[idx+FirstNew]; }
201 Rematted.insert(ParentVNI);
206 return Rematted.count(ParentVNI);
bool anyRematerializable(AliasAnalysis *)
bool didRematerialize(const VNInfo *ParentVNI) const
didRematerialize - Return true if ParentVNI was rematerialized anywhere.
Callback methods for LiveRangeEdit owners.
LoopInfoBase< BlockT, LoopT > * LI
bool checkRematerializable(VNInfo *VNI, const MachineInstr *DefMI, AliasAnalysis *)
ArrayRef< T > makeArrayRef(const T &OneElt)
Construct an ArrayRef from a single element.
SmallVectorImpl< unsigned >::const_iterator iterator
Iterator for accessing the new registers added by this edit.
unsigned createFrom(unsigned OldReg)
createFrom - Create a new virtual register based on OldReg.
virtual bool LRE_CanEraseVirtReg(unsigned)
bool canRematerializeAt(Remat &RM, SlotIndex UseIdx, bool cheapAsAMove)
LiveInterval & getParent() const
virtual void LRE_WillEraseInstruction(MachineInstr *MI)
Called immediately before erasing a dead machine instruction.
LiveRangeEdit(LiveInterval *parent, SmallVectorImpl< unsigned > &newRegs, MachineFunction &MF, LiveIntervals &lis, VirtRegMap *vrm, Delegate *delegate=0)
void resetDelegate(Delegate *delegate)
virtual void LRE_WillShrinkVirtReg(unsigned)
Called before shrinking the live range of a virtual register.
void markRematerialized(const VNInfo *ParentVNI)
ArrayRef< unsigned > regs() const
SlotIndex rematerializeAt(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, const Remat &RM, const TargetRegisterInfo &, bool Late=false)
virtual void LRE_DidCloneVirtReg(unsigned New, unsigned Old)
Remat - Information needed to rematerialize at a specific location.
void eliminateDeadDefs(SmallVectorImpl< MachineInstr * > &Dead, ArrayRef< unsigned > RegsBeingSpilled=None)
LiveInterval & createEmptyIntervalFrom(unsigned OldReg)
createEmptyIntervalFrom - Create a new empty interval based on OldReg.
A vector that has set insertion semantics.
LiveInterval & createEmptyInterval()
void calculateRegClassAndHint(MachineFunction &, const MachineLoopInfo &, const MachineBlockFrequencyInfo &)
void setDelegate(Delegate *delegate)
void eraseVirtReg(unsigned Reg)
SlotIndex - An opaque wrapper around machine indexes.