30#include "llvm/Config/llvm-config.h"
52 assert((PrevMask & ~NewMask).
none() &&
"Must not remove bits");
53 if (PrevMask.
any() || NewMask.
none())
58 for (; PSetI.
isValid(); ++PSetI)
59 CurrSetPressure[*PSetI] += Weight;
66 assert((NewMask & ~PrevMask).
none() &&
"Must not add bits");
67 if (NewMask.
any() || PrevMask.
none())
72 for (; PSetI.
isValid(); ++PSetI) {
73 assert(CurrSetPressure[*PSetI] >= Weight &&
"register pressure underflow");
74 CurrSetPressure[*PSetI] -= Weight;
78#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
83 for (
unsigned i = 0, e = SetPressure.
size(); i < e; ++i) {
84 if (SetPressure[i] != 0) {
85 dbgs() <<
TRI->getRegPressureSetName(i) <<
"=" << SetPressure[i] <<
'\n';
95 dbgs() <<
"Max Pressure: ";
97 dbgs() <<
"Live In: ";
100 if (!
P.LaneMask.all())
105 dbgs() <<
"Live Out: ";
108 if (!
P.LaneMask.all())
118 dbgs() <<
"Curr Pressure: ";
126 const char *sep =
"";
143 dbgs() <<
"[Excess=";
145 dbgs() <<
", CriticalMax=";
147 dbgs() <<
", CurrentMax=";
157 if (PreviousMask.
any() || NewMask.
none())
162 for (; PSetI.
isValid(); ++PSetI) {
163 CurrSetPressure[*PSetI] += Weight;
226 unsigned NumRegUnits =
TRI.getNumRegs();
227 unsigned NumVirtRegs =
MRI.getNumVirtRegs();
229 this->NumRegUnits = NumRegUnits;
246 CurrSetPressure.clear();
247 LiveThruPressure.clear();
250 if (RequireIntervals)
267 bool TrackLaneMasks,
bool TrackUntiedDefs) {
275 this->TrackUntiedDefs = TrackUntiedDefs;
276 this->TrackLaneMasks = TrackLaneMasks;
278 if (RequireIntervals) {
279 assert(lis &&
"IntervalPressure requires LiveIntervals");
295 if (RequireIntervals)
303 if (RequireIntervals)
312 if (IdxPos == MBB->
end())
319 if (RequireIntervals)
331 if (RequireIntervals)
344 assert(LiveRegs.
size() == 0 &&
"no region boundary");
372 return Other.RegUnit == RegUnit;
374 if (
I == RegUnits.
end())
384 return Other.RegUnit == RegUnit;
386 if (
I == RegUnits.
end()) {
396 return Other.RegUnit == RegUnit;
398 if (
I == RegUnits.
end()) {
410 return Other.RegUnit == RegUnit;
412 if (
I != RegUnits.
end()) {
413 I->LaneMask &= ~Pair.LaneMask;
414 if (
I->LaneMask.none())
429 if (Property(SR, Pos))
430 Result |= SR.LaneMask;
432 }
else if (Property(LI, Pos)) {
433 Result = TrackLaneMasks ?
MRI.getMaxLaneMaskForVReg(RegUnit)
450 bool TrackLaneMasks,
Register RegUnit,
465class RegisterOperandsCollector {
476 : RegOpers(RegOpers),
TRI(
TRI),
MRI(
MRI), IgnoreDead(IgnoreDead) {}
480 collectOperand(*OperI);
489 collectOperandLanes(*OperI);
519 if (
Reg.isVirtual()) {
521 }
else if (
MRI.isAllocatable(
Reg)) {
534 pushRegLanes(
Reg, SubRegIdx, RegOpers.
Uses);
545 pushRegLanes(
Reg, SubRegIdx, RegOpers.
Defs);
549 void pushRegLanes(
Register Reg,
unsigned SubRegIdx,
551 if (
Reg.isVirtual()) {
553 ?
TRI.getSubRegIndexLaneMask(SubRegIdx)
554 :
MRI.getMaxLaneMaskForVReg(
Reg);
556 }
else if (
MRI.isAllocatable(
Reg)) {
568 bool TrackLaneMasks,
bool IgnoreDead) {
579 for (
auto *RI =
Defs.begin(); RI !=
Defs.end(); ) {
600 for (
auto *
I =
Defs.begin();
I !=
Defs.end();) {
606 if (RegUnit.
isVirtual() && AddFlagsMI !=
nullptr &&
607 (LiveAfter & ~
I->LaneMask).none())
611 if (ActualDef.
none()) {
614 I->LaneMask = ActualDef;
620 for (
auto &[RegUnit, LaneMask] :
Uses)
623 if (AddFlagsMI !=
nullptr) {
630 if (LiveAfter.
none())
665 for (; PSetI.
isValid(); ++PSetI) {
668 for (;
I !=
E &&
I->isValid(); ++
I) {
669 if (
I->getPSet() >= *PSetI)
676 if (!
I->isValid() ||
I->getPSet() != *PSetI) {
682 unsigned NewUnitInc =
I->getUnitInc() + Weight;
683 if (NewUnitInc != 0) {
684 I->setUnitInc(NewUnitInc);
688 for (J = std::next(
I); J !=
E && J->
isValid(); ++J, ++
I)
710 return Other.RegUnit == RegUnit;
714 if (
I == LiveInOrOut.
end()) {
719 PrevMask =
I->LaneMask;
721 I->LaneMask = NewMask;
756 assert(!CurrPos->isDebugOrPseudoInstr());
767 LaneBitmask NewMask = PreviousMask & ~Def.LaneMask;
769 LaneBitmask LiveOut = Def.LaneMask & ~PreviousMask;
775 PreviousMask = LiveOut;
778 if (NewMask.
none()) {
781 if (TrackLaneMasks && LiveUses !=
nullptr)
789 if (RequireIntervals)
798 if (NewMask == PreviousMask)
802 if (PreviousMask.
none()) {
803 if (LiveUses !=
nullptr) {
804 if (!TrackLaneMasks) {
810 bool IsRedef =
I != LiveUses->
end();
822 if (RequireIntervals) {
831 if (TrackUntiedDefs) {
835 (LiveRegs.
contains(RegUnit) & Def.LaneMask).none())
836 UntiedDefs.insert(RegUnit);
854 if (RequireIntervals && !CurrPos->isDebugOrPseudoInstr())
864 if (CurrPos->isDebugInstr() || CurrPos->isPseudoProbe()) {
874 if (TrackLaneMasks) {
877 }
else if (RequireIntervals) {
881 recede(RegOpers, LiveUses);
886 assert(!TrackUntiedDefs &&
"unsupported mode");
892 if (RequireIntervals)
897 if (RequireIntervals)
913 if (RequireIntervals) {
915 if (LastUseMask.
any()) {
940 if (TrackLaneMasks) {
954 for (
unsigned i = 0, e = OldPressureVec.
size(); i < e; ++i) {
955 unsigned POld = OldPressureVec[i];
956 unsigned PNew = NewPressureVec[i];
957 int PDiff = (int)PNew - (
int)POld;
962 if (!LiveThruPressureVec.
empty())
963 Limit += LiveThruPressureVec[i];
969 PDiff = PNew - Limit;
970 }
else if (Limit > PNew)
971 PDiff = Limit - POld;
995 unsigned CritIdx = 0, CritEnd = CriticalPSets.
size();
996 for (
unsigned i = 0, e = OldMaxPressureVec.
size(); i < e; ++i) {
997 unsigned POld = OldMaxPressureVec[i];
998 unsigned PNew = NewMaxPressureVec[i];
1003 while (CritIdx != CritEnd && CriticalPSets[CritIdx].getPSet() < i)
1006 if (CritIdx != CritEnd && CriticalPSets[CritIdx].getPSet() == i) {
1007 int PDiff = (int)PNew - (
int)CriticalPSets[CritIdx].getUnitInc();
1032 assert(!
MI->isDebugOrPseudoInstr() &&
"Expect a nondebug instruction.");
1035 if (RequireIntervals)
1044 else if (RequireIntervals)
1057 LaneBitmask LiveBefore = (LiveAfter & ~DefLanes) | UseLanes;
1093 std::vector<unsigned> SavedPressure = CurrSetPressure;
1094 std::vector<unsigned> SavedMaxPressure =
P.MaxSetPressure;
1101 MaxPressureLimit, Delta);
1106 P.MaxSetPressure.swap(SavedMaxPressure);
1107 CurrSetPressure.swap(SavedPressure);
1116 if (Delta != Delta2) {
1117 dbgs() <<
"PDiff: ";
1119 dbgs() <<
"DELTA: " << *
MI;
1158 unsigned CritIdx = 0, CritEnd = CriticalPSets.
size();
1160 PDiffI = PDiff.
begin(), PDiffE = PDiff.
end();
1161 PDiffI != PDiffE && PDiffI->
isValid(); ++PDiffI) {
1163 unsigned PSetID = PDiffI->getPSet();
1165 if (!LiveThruPressure.empty())
1166 Limit += LiveThruPressure[PSetID];
1168 unsigned POld = CurrSetPressure[PSetID];
1169 unsigned MOld =
P.MaxSetPressure[PSetID];
1170 unsigned MNew = MOld;
1172 unsigned PNew = POld + PDiffI->getUnitInc();
1173 assert((PDiffI->getUnitInc() >= 0) == (PNew >= POld)
1174 &&
"PSet overflow/underflow");
1179 unsigned ExcessInc = 0;
1181 ExcessInc = POld > Limit ? PNew - POld : PNew - Limit;
1182 else if (POld > Limit)
1183 ExcessInc = Limit - POld;
1193 while (CritIdx != CritEnd && CriticalPSets[CritIdx].getPSet() < PSetID)
1196 if (CritIdx != CritEnd && CriticalPSets[CritIdx].getPSet() == PSetID) {
1197 int CritInc = (int)MNew - (
int)CriticalPSets[CritIdx].getUnitInc();
1198 if (CritInc > 0 && CritInc <= std::numeric_limits<int16_t>::max()) {
1225 if (InstSlot >= PriorUseIdx && InstSlot < NextUseIdx) {
1228 LastUseMask &= ~UseMask;
1229 if (LastUseMask.
none())
1238 assert(RequireIntervals);
1248 assert(RequireIntervals);
1252 const LiveRange::Segment *S = LR.getSegmentContaining(Pos);
1253 return S != nullptr && S->end == Pos.getRegSlot();
1259 assert(RequireIntervals);
1276 assert(!
MI->isDebugOrPseudoInstr() &&
"Expect a nondebug instruction.");
1279 if (RequireIntervals)
1288 if (RequireIntervals) {
1292 if (LastUseMask.
none())
1302 if (LastUseMask.
none())
1339 std::vector<unsigned> SavedPressure = CurrSetPressure;
1340 std::vector<unsigned> SavedMaxPressure =
P.MaxSetPressure;
1347 MaxPressureLimit, Delta);
1352 P.MaxSetPressure.swap(SavedMaxPressure);
1353 CurrSetPressure.swap(SavedPressure);
1359 std::vector<unsigned> &PressureResult,
1360 std::vector<unsigned> &MaxPressureResult) {
1362 PressureResult = CurrSetPressure;
1363 MaxPressureResult =
P.MaxSetPressure;
1368 P.MaxSetPressure.swap(MaxPressureResult);
1369 CurrSetPressure.swap(PressureResult);
1375 std::vector<unsigned> &PressureResult,
1376 std::vector<unsigned> &MaxPressureResult) {
1378 PressureResult = CurrSetPressure;
1379 MaxPressureResult =
P.MaxSetPressure;
1384 P.MaxSetPressure.swap(MaxPressureResult);
1385 CurrSetPressure.swap(PressureResult);
unsigned const MachineRegisterInfo * MRI
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Returns the sub type a function will return at a given Idx Should correspond to the result type of an ExtractValue instruction executed with just that one unsigned Idx
A common definition of LaneBitmask for use in TableGen and CodeGen.
unsigned const TargetRegisterInfo * TRI
Register Usage Information Collector
static void computeExcessPressureDelta(ArrayRef< unsigned > OldPressureVec, ArrayRef< unsigned > NewPressureVec, RegPressureDelta &Delta, const RegisterClassInfo *RCI, ArrayRef< unsigned > LiveThruPressureVec)
Find the max change in excess pressure across all sets.
static void increaseSetPressure(std::vector< unsigned > &CurrSetPressure, const MachineRegisterInfo &MRI, unsigned Reg, LaneBitmask PrevMask, LaneBitmask NewMask)
Increase pressure for each pressure set provided by TargetRegisterInfo.
static void decreaseSetPressure(std::vector< unsigned > &CurrSetPressure, const MachineRegisterInfo &MRI, Register Reg, LaneBitmask PrevMask, LaneBitmask NewMask)
Decrease pressure for each pressure set provided by TargetRegisterInfo.
static void removeRegLanes(SmallVectorImpl< VRegMaskOrUnit > &RegUnits, VRegMaskOrUnit Pair)
static void computeMaxPressureDelta(ArrayRef< unsigned > OldMaxPressureVec, ArrayRef< unsigned > NewMaxPressureVec, ArrayRef< PressureChange > CriticalPSets, ArrayRef< unsigned > MaxPressureLimit, RegPressureDelta &Delta)
Find the max change in max pressure that either surpasses a critical PSet limit or exceeds the curren...
static const LiveRange * getLiveRange(const LiveIntervals &LIS, unsigned Reg)
static LaneBitmask getRegLanes(ArrayRef< VRegMaskOrUnit > RegUnits, Register RegUnit)
static LaneBitmask getLiveLanesAt(const LiveIntervals &LIS, const MachineRegisterInfo &MRI, bool TrackLaneMasks, Register RegUnit, SlotIndex Pos)
static void setRegZero(SmallVectorImpl< VRegMaskOrUnit > &RegUnits, Register RegUnit)
static LaneBitmask findUseBetween(unsigned Reg, LaneBitmask LastUseMask, SlotIndex PriorUseIdx, SlotIndex NextUseIdx, const MachineRegisterInfo &MRI, const LiveIntervals *LIS)
Helper to find a vreg use between two indices [PriorUseIdx, NextUseIdx).
static void addRegLanes(SmallVectorImpl< VRegMaskOrUnit > &RegUnits, VRegMaskOrUnit Pair)
static LaneBitmask getLanesWithProperty(const LiveIntervals &LIS, const MachineRegisterInfo &MRI, bool TrackLaneMasks, Register RegUnit, SlotIndex Pos, LaneBitmask SafeDefault, bool(*Property)(const LiveRange &LR, SlotIndex Pos))
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
size_t size() const
size - Get the array size.
bool empty() const
empty - Check if the array is empty.
ConstMIBundleOperands - Iterate over all operands in a const bundle of machine instructions.
A live range for subregisters.
LiveInterval - This class represents the liveness of a register, or stack slot.
bool hasSubRanges() const
Returns true if subregister liveness information is available.
iterator_range< subrange_iterator > subranges()
SlotIndex getInstructionIndex(const MachineInstr &Instr) const
Returns the base index of the given instruction.
SlotIndex getMBBEndIdx(const MachineBasicBlock *mbb) const
Return the last index in the given basic block.
LiveRange * getCachedRegUnit(unsigned Unit)
Return the live range for register unit Unit if it has already been computed, or nullptr if it hasn't...
LiveInterval & getInterval(Register Reg)
Result of a LiveRange query.
bool isDeadDef() const
Return true if this instruction has a dead def.
This class represents the liveness of a register, stack slot, etc.
const Segment * getSegmentContaining(SlotIndex Idx) const
Return the segment that contains the specified index, or null if there is none.
bool liveAt(SlotIndex index) const
LiveQueryResult Query(SlotIndex Idx) const
Query Liveness at Idx.
LaneBitmask erase(VRegMaskOrUnit Pair)
Clears the Pair.LaneMask lanes of Pair.Reg (mark them as dead).
LaneBitmask contains(Register Reg) const
void init(const MachineRegisterInfo &MRI)
LaneBitmask insert(VRegMaskOrUnit Pair)
Mark the Pair.LaneMask lanes of Pair.Reg as live.
void appendTo(SmallVectorImpl< VRegMaskOrUnit > &To) const
bool isValid() const
isValid - Returns true until all the operands have been visited.
MachineInstrBundleIterator< const MachineInstr > const_iterator
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Representation of each machine instruction.
void setRegisterDefReadUndef(Register Reg, bool IsUndef=true)
Mark all subregister defs of register Reg with the undef flag.
MachineOperand class - Representation of each machine instruction operand.
unsigned getSubReg() const
bool readsReg() const
readsReg - Returns true if this operand reads the previous value of its register.
bool isReg() const
isReg - Tests if this is a MO_Register operand.
MachineInstr * getParent()
getParent - Return the instruction that this operand belongs to.
Register getReg() const
getReg - Returns the register number.
bool isInternalRead() const
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
PSetIterator getPressureSets(Register RegUnit) const
Get an iterator over the pressure sets affected by the given physical or virtual register.
unsigned getNumVirtRegs() const
getNumVirtRegs - Return the number of virtual registers created.
Iterate over the pressure sets affected by the given physical or virtual register.
unsigned getWeight() const
Capture a change in pressure for a single pressure set.
unsigned getPSetOrMax() const
List of PressureChanges in order of increasing, unique PSetID.
void dump(const TargetRegisterInfo &TRI) const
void addPressureChange(Register RegUnit, bool IsDec, const MachineRegisterInfo *MRI)
Add a change in pressure to the pressure diff of a given instruction.
const_iterator end() const
const_iterator begin() const
void addInstruction(unsigned Idx, const RegisterOperands &RegOpers, const MachineRegisterInfo &MRI)
Record pressure difference induced by the given operand list to node with index Idx.
void init(unsigned N)
Initialize an array of N PressureDiffs.
Track the current register pressure at some position in the instruction stream, and remember the high...
void closeRegion()
Finalize the region boundaries and recored live ins and live outs.
void discoverLiveIn(VRegMaskOrUnit Pair)
Add Reg to the live in set and increase max pressure.
void closeBottom()
Set the boundary for the bottom of the region and summarize live outs.
void recede(SmallVectorImpl< VRegMaskOrUnit > *LiveUses=nullptr)
Recede across the previous instruction.
void bumpDownwardPressure(const MachineInstr *MI)
Record the downward impact of a single instruction on current register pressure.
void addLiveRegs(ArrayRef< VRegMaskOrUnit > Regs)
Force liveness of virtual registers or physical register units.
void recedeSkipDebugValues()
Recede until we find an instruction which is not a DebugValue.
void getMaxUpwardPressureDelta(const MachineInstr *MI, PressureDiff *PDiff, RegPressureDelta &Delta, ArrayRef< PressureChange > CriticalPSets, ArrayRef< unsigned > MaxPressureLimit)
Consider the pressure increase caused by traversing this instruction bottom-up.
void initLiveThru(const RegPressureTracker &RPTracker)
Initialize the LiveThru pressure set based on the untied defs found in RPTracker.
void bumpDeadDefs(ArrayRef< VRegMaskOrUnit > DeadDefs)
void init(const MachineFunction *mf, const RegisterClassInfo *rci, const LiveIntervals *lis, const MachineBasicBlock *mbb, MachineBasicBlock::const_iterator pos, bool TrackLaneMasks, bool TrackUntiedDefs)
Setup the RegPressureTracker.
void discoverLiveInOrOut(VRegMaskOrUnit Pair, SmallVectorImpl< VRegMaskOrUnit > &LiveInOrOut)
bool isBottomClosed() const
Does this pressure result have a valid bottom position and live outs.
bool hasUntiedDef(Register VirtReg) const
void closeTop()
Set the boundary for the top of the region and summarize live ins.
LaneBitmask getLiveLanesAt(Register RegUnit, SlotIndex Pos) const
void getMaxDownwardPressureDelta(const MachineInstr *MI, RegPressureDelta &Delta, ArrayRef< PressureChange > CriticalPSets, ArrayRef< unsigned > MaxPressureLimit)
Consider the pressure increase caused by traversing this instruction top-down.
void advance()
Advance across the current instruction.
bool isTopClosed() const
Does this pressure result have a valid top position and live ins.
void bumpUpwardPressure(const MachineInstr *MI)
Record the upward impact of a single instruction on current register pressure.
void getDownwardPressure(const MachineInstr *MI, std::vector< unsigned > &PressureResult, std::vector< unsigned > &MaxPressureResult)
Get the pressure of each PSet after traversing this instruction top-down.
SlotIndex getCurrSlot() const
Get the SlotIndex for the first nondebug instruction including or after the current position.
LaneBitmask getLastUsedLanes(Register RegUnit, SlotIndex Pos) const
void getUpwardPressure(const MachineInstr *MI, std::vector< unsigned > &PressureResult, std::vector< unsigned > &MaxPressureResult)
Get the pressure of each PSet after traversing this instruction bottom-up.
LaneBitmask getLiveThroughAt(Register RegUnit, SlotIndex Pos) const
void increaseRegPressure(Register RegUnit, LaneBitmask PreviousMask, LaneBitmask NewMask)
void discoverLiveOut(VRegMaskOrUnit Pair)
Add Reg to the live out set and increase max pressure.
void decreaseRegPressure(Register RegUnit, LaneBitmask PreviousMask, LaneBitmask NewMask)
void getUpwardPressureDelta(const MachineInstr *MI, PressureDiff &PDiff, RegPressureDelta &Delta, ArrayRef< PressureChange > CriticalPSets, ArrayRef< unsigned > MaxPressureLimit) const
This is the fast version of querying register pressure that does not directly depend on current liven...
unsigned getRegPressureSetLimit(unsigned Idx) const
Get the register unit limit for the given pressure set index.
List of registers defined and used by a machine instruction.
SmallVector< VRegMaskOrUnit, 8 > Defs
List of virtual registers and register units defined by the instruction which are not dead.
void collect(const MachineInstr &MI, const TargetRegisterInfo &TRI, const MachineRegisterInfo &MRI, bool TrackLaneMasks, bool IgnoreDead)
Analyze the given instruction MI and fill in the Uses, Defs and DeadDefs list based on the MachineOpe...
SmallVector< VRegMaskOrUnit, 8 > DeadDefs
List of virtual registers and register units defined by the instruction but dead.
void adjustLaneLiveness(const LiveIntervals &LIS, const MachineRegisterInfo &MRI, SlotIndex Pos, MachineInstr *AddFlagsMI=nullptr)
Use liveness information to find out which uses/defs are partially undefined/dead and adjust the VReg...
void detectDeadDefs(const MachineInstr &MI, const LiveIntervals &LIS)
Use liveness information to find dead defs not marked with a dead flag and move them to the DeadDefs ...
SmallVector< VRegMaskOrUnit, 8 > Uses
List of virtual registers and register units read by the instruction.
Wrapper class representing virtual and physical registers.
constexpr bool isVirtual() const
Return true if the specified register number is in the virtual register namespace.
static constexpr bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
SlotIndex - An opaque wrapper around machine indexes.
SlotIndex getDeadSlot() const
Returns the dead def kill slot for the current instruction.
SlotIndex getBaseIndex() const
Returns the base index for associated with this index.
SlotIndex getRegSlot(bool EC=false) const
Returns the register use/def slot in the current instruction for a normal or early-clobber def.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
reference emplace_back(ArgTypes &&... Args)
iterator erase(const_iterator CI)
void push_back(const T &Elt)
void clear()
clear - Clears the set.
void setUniverse(unsigned U)
setUniverse - Set the universe size which determines the largest key the set can hold.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
virtual unsigned getNumRegPressureSets() const =0
Get the number of dimensions of register pressure.
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
A Use represents the edge between a Value definition and its users.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
IterT next_nodbg(IterT It, IterT End, bool SkipPseudoOp=true)
Increment It, then continue incrementing it while it points to a debug instruction.
Printable PrintLaneMask(LaneBitmask LaneMask)
Create Printable object to print LaneBitmasks on a raw_ostream.
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_calloc(size_t Count, size_t Sz)
IterT skipDebugInstructionsForward(IterT It, IterT End, bool SkipPseudoOp=true)
Increment It until it points to a non-debug instruction or to End and return the resulting iterator.
Printable printVRegOrUnit(unsigned VRegOrUnit, const TargetRegisterInfo *TRI)
Create Printable object to print virtual registers and physical registers on a raw_ostream.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
void dumpRegSetPressure(ArrayRef< unsigned > SetPressure, const TargetRegisterInfo *TRI)
IterT prev_nodbg(IterT It, IterT Begin, bool SkipPseudoOp=true)
Decrement It, then continue decrementing it while it points to a debug instruction.
void swap(llvm::BitVector &LHS, llvm::BitVector &RHS)
Implement std::swap in terms of BitVector swap.
RegisterPressure computed within a region of instructions delimited by TopIdx and BottomIdx.
void reset()
Clear the result so it can be used for another round of pressure tracking.
void openBottom(SlotIndex PrevBottom)
If the current bottom is not greater than the previous index, open it.
SlotIndex TopIdx
Record the boundary of the region being tracked.
void openTop(SlotIndex NextTop)
If the current top is not less than or equal to the next index, open it.
static constexpr LaneBitmask getAll()
constexpr bool none() const
constexpr bool any() const
static constexpr LaneBitmask getNone()
This represents a simple continuous liveness interval for a value.
Store the effects of a change in pressure on things that MI scheduler cares about.
PressureChange CriticalMax
PressureChange CurrentMax
RegisterPressure computed within a region of instructions delimited by TopPos and BottomPos.
MachineBasicBlock::const_iterator TopPos
Record the boundary of the region being tracked.
MachineBasicBlock::const_iterator BottomPos
void openTop(MachineBasicBlock::const_iterator PrevTop)
If the current top is the previous instruction (before receding), open it.
void reset()
Clear the result so it can be used for another round of pressure tracking.
void openBottom(MachineBasicBlock::const_iterator PrevBottom)
If the current bottom is the previous instr (before advancing), open it.
SmallVector< VRegMaskOrUnit, 8 > LiveOutRegs
SmallVector< VRegMaskOrUnit, 8 > LiveInRegs
List of live in virtual registers or physical register units.
void dump(const TargetRegisterInfo *TRI) const
std::vector< unsigned > MaxSetPressure
Map of max reg pressure indexed by pressure set ID, not class ID.
Register RegUnit
Virtual register or register unit.