17#ifndef LLVM_CODEGEN_LIVERANGEEDIT_H
18#define LLVM_CODEGEN_LIVERANGEEDIT_H
46 virtual void anchor();
73 Delegate *
const TheDelegate;
76 const unsigned FirstNew;
97 void MRI_NoteNewVirtualRegister(
Register VReg)
override;
122 : Parent(parent), NewRegs(newRegs), MRI(MF.getRegInfo()), LIS(lis),
123 VRM(vrm), TII(*MF.getSubtarget().getInstrInfo()), TheDelegate(delegate),
124 FirstNew(newRegs.
size()), DeadRemats(deadRemats) {
125 MRI.addDelegate(
this);
131 assert(Parent &&
"No parent LiveInterval");
141 unsigned size()
const {
return NewRegs.size() - FirstNew; }
143 Register get(
unsigned idx)
const {
return NewRegs[idx + FirstNew]; }
163 return createEmptyIntervalFrom(
getReg(),
true);
179 bool canRematerializeAt(Remat &RM,
SlotIndex UseIdx);
191 bool Late =
false,
unsigned SubIdx = 0,
198 Rematted.insert(ParentVNI);
203 return Rematted.count(ParentVNI);
221 void calculateRegClassAndHint(MachineFunction &, VirtRegAuxInfo &);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static const Function * getParent(const Value *V)
const HexagonInstrInfo * TII
static MCRegister getReg(const MCDisassembler *D, unsigned RC, unsigned RegNo)
This file implements a set that has insertion order iteration characteristics.
This file defines the SmallPtrSet class.
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
ArrayRef< T > slice(size_t N, size_t M) const
slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.
LiveInterval - This class represents the liveness of a register, or stack slot.
Callback methods for LiveRangeEdit owners.
virtual ~Delegate()=default
virtual bool LRE_CanEraseVirtReg(Register)
Called when a virtual register is no longer used.
virtual void LRE_WillEraseInstruction(MachineInstr *MI)
Called immediately before erasing a dead machine instruction.
virtual void LRE_WillShrinkVirtReg(Register)
Called before shrinking the live range of a virtual register.
virtual void LRE_DidCloneVirtReg(Register New, Register Old)
Called after cloning a virtual register.
~LiveRangeEdit() override
Register get(unsigned idx) const
Register createFrom(Register OldReg)
createFrom - Create a new virtual register based on OldReg.
LiveInterval & createEmptyInterval()
create - Create a new register with the same class and original slot as parent.
LiveRangeEdit(const LiveInterval *parent, SmallVectorImpl< Register > &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.
SmallVectorImpl< Register >::const_iterator iterator
Iterator for accessing the new registers added by this edit.
const LiveInterval & getParent() const
ArrayRef< Register > regs() const
void pop_back()
pop_back - It allows LiveRangeEdit users to drop new registers.
void markRematerialized(const VNInfo *ParentVNI)
markRematerialized - explicitly mark a value as rematerialized after doing it manually.
bool didRematerialize(const VNInfo *ParentVNI) const
didRematerialize - Return true if ParentVNI was rematerialized anywhere.
MachineInstrBundleIterator< MachineInstr > iterator
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
Wrapper class representing virtual and physical registers.
SlotIndex - An opaque wrapper around machine indexes.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
A SetVector that performs no allocations if smaller than a certain size.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
typename SuperClass::const_iterator const_iterator
TargetInstrInfo - Interface to description of machine instruction set.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
VNInfo - Value Number Information.
Calculate auxiliary information for a virtual register such as its spill weight and allocation hint.
This is an optimization pass for GlobalISel generic memory operations.
static constexpr LaneBitmask getAll()
const VNInfo *const ParentVNI
Remat(const VNInfo *ParentVNI)