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;
108 void MRI_NoteNewVirtualRegister(
unsigned VReg)
override;
130 : Parent(parent), NewRegs(newRegs), MRI(MF.getRegInfo()), LIS(lis),
131 VRM(vrm), TII(*MF.getSubtarget().getInstrInfo()), TheDelegate(delegate),
132 FirstNew(newRegs.
size()), ScannedRemattable(
false),
133 DeadRemats(deadRemats) {
140 assert(Parent &&
"No parent LiveInterval");
149 unsigned size()
const {
return NewRegs.
size()-FirstNew; }
151 unsigned get(
unsigned idx)
const {
return NewRegs[idx+FirstNew]; }
221 Rematted.insert(ParentVNI);
226 return Rematted.count(ParentVNI);
232 DeadRemats->insert(inst);
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.
LiveRangeEdit(LiveInterval *parent, SmallVectorImpl< unsigned > &newRegs, MachineFunction &MF, LiveIntervals &lis, VirtRegMap *vrm, Delegate *delegate=nullptr, SmallPtrSet< MachineInstr *, 32 > *deadRemats=nullptr)
Create a LiveRangeEdit for breaking down parent into smaller pieces.
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.
void markDeadRemat(MachineInstr *inst)
bool canRematerializeAt(Remat &RM, VNInfo *OrigVNI, SlotIndex UseIdx, bool cheapAsAMove)
canRematerializeAt - Determine if ParentVNI can be rematerialized at UseIdx.
Function Alias Analysis false
void pop_back()
pop_back - It allows LiveRangeEdit users to drop new registers.
TargetInstrInfo - Interface to description of machine instruction set.
unsigned createFrom(unsigned OldReg)
createFrom - Create a new virtual register based on OldReg.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
void eliminateDeadDefs(SmallVectorImpl< MachineInstr * > &Dead, ArrayRef< unsigned > RegsBeingSpilled=None, AliasAnalysis *AA=nullptr)
eliminateDeadDefs - Try to delete machine instructions that are now dead (allDefsAreDead returns true...
virtual bool LRE_CanEraseVirtReg(unsigned)
Called when a virtual register is no longer used.
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
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
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...
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
virtual void LRE_DidCloneVirtReg(unsigned New, unsigned Old)
Called after cloning a virtual register.
Remat - Information needed to rematerialize at a specific location.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
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.