18 #ifndef LLVM_CODEGEN_LIVERANGEEDIT_H
19 #define LLVM_CODEGEN_LIVERANGEEDIT_H
33 class MachineBlockFrequencyInfo;
34 class MachineLoopInfo;
41 virtual void anchor();
67 Delegate *
const TheDelegate;
70 const unsigned FirstNew;
73 bool ScannedRemattable;
103 void MRI_NoteNewVirtualRegister(
unsigned VReg)
override;
122 : Parent(parent), NewRegs(newRegs), MRI(MF.getRegInfo()), LIS(lis),
123 VRM(vrm), TII(*MF.getSubtarget().getInstrInfo()),
124 TheDelegate(delegate), FirstNew(newRegs.
size()),
125 ScannedRemattable(
false) {
132 assert(Parent &&
"No parent LiveInterval");
141 unsigned size()
const {
return NewRegs.
size()-FirstNew; }
143 unsigned get(
unsigned idx)
const {
return NewRegs[idx+FirstNew]; }
203 Rematted.insert(ParentVNI);
208 return Rematted.count(ParentVNI);
bool anyRematerializable(AliasAnalysis *)
anyRematerializable - Return true if any parent values may be rematerializable.
LiveInterval - This class represents the liveness of a register, or stack slot.
MachineBlockFrequencyInfo pass uses BlockFrequencyInfoImpl implementation to estimate machine basic b...
VNInfo - Value Number Information.
bool didRematerialize(const VNInfo *ParentVNI) const
didRematerialize - Return true if ParentVNI was rematerialized anywhere.
Callback methods for LiveRangeEdit owners.
bool checkRematerializable(VNInfo *VNI, const MachineInstr *DefMI, AliasAnalysis *)
checkRematerializable - Manually add VNI to the list of rematerializable values if DefMI may be remat...
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.
Reg
All possible values of the reg field in the ModR/M byte.
TargetInstrInfo - Interface to description of machine instruction set.
unsigned createFrom(unsigned OldReg)
createFrom - Create a new virtual register based on OldReg.
bundle_iterator - MachineBasicBlock iterator that automatically skips over MIs that are inside bundle...
virtual bool LRE_CanEraseVirtReg(unsigned)
Called when a virtual register is no longer used.
bool canRematerializeAt(Remat &RM, SlotIndex UseIdx, bool cheapAsAMove)
canRematerializeAt - Determine if ParentVNI can be rematerialized at UseIdx.
LiveInterval & getParent() const
~LiveRangeEdit() override
virtual void LRE_WillEraseInstruction(MachineInstr *MI)
Called immediately before erasing a dead machine instruction.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements...
MachineOperand class - Representation of each machine instruction operand.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
void resetDelegate(Delegate *delegate)
virtual void LRE_WillShrinkVirtReg(unsigned)
Called before shrinking the live range of a virtual register.
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
void markRematerialized(const VNInfo *ParentVNI)
markRematerialized - explicitly mark a value as rematerialized after doing it manually.
Representation of each machine instruction.
ArrayRef< unsigned > regs() const
SlotIndex rematerializeAt(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, unsigned DestReg, const Remat &RM, const TargetRegisterInfo &, bool Late=false)
rematerializeAt - Rematerialize RM.ParentVNI into DestReg by inserting an instruction into MBB before...
virtual void LRE_DidCloneVirtReg(unsigned New, unsigned Old)
Called after cloning a virtual register.
LiveRangeEdit(LiveInterval *parent, SmallVectorImpl< unsigned > &newRegs, MachineFunction &MF, LiveIntervals &lis, VirtRegMap *vrm, Delegate *delegate=nullptr)
Create a LiveRangeEdit for breaking down parent into smaller pieces.
Remat - Information needed to rematerialize at a specific location.
void eliminateDeadDefs(SmallVectorImpl< MachineInstr * > &Dead, ArrayRef< unsigned > RegsBeingSpilled=None)
eliminateDeadDefs - Try to delete machine instructions that are now dead (allDefsAreDead returns true...
LiveInterval & createEmptyIntervalFrom(unsigned OldReg)
createEmptyIntervalFrom - Create a new empty interval based on OldReg.
A vector that has set insertion semantics.
LiveInterval & createEmptyInterval()
create - Create a new register with the same class and original slot as parent.
void calculateRegClassAndHint(MachineFunction &, const MachineLoopInfo &, const MachineBlockFrequencyInfo &)
calculateRegClassAndHint - Recompute register class and hint for each new register.
void setDelegate(Delegate *delegate)
void eraseVirtReg(unsigned Reg)
eraseVirtReg - Notify the delegate that Reg is no longer in use, and try to erase it from LIS...
SlotIndex - An opaque wrapper around machine indexes.