llvm::RegPressureTracker

Track the current register pressure at some position in the instruction stream, and remember the high water mark within the region traversed. This does not automatically consider live-through ranges. The client may independently adjust for global liveness.

Synopsis

Declared in <llvm/CodeGen/RegisterPressure.h>

class RegPressureTracker;

Description

Each RegPressureTracker only works within a MachineBasicBlock. Pressure can be tracked across a larger region by storing a RegisterPressure result at each block boundary and explicitly adjusting pressure to account for block live-in and live-out register sets.

RegPressureTracker holds a reference to a RegisterPressure result that it computes incrementally. During downward tracking, P.BottomIdx or P.BottomPos is invalid until it reaches the end of the block or closeRegion() is explicitly called. Similarly, P.TopIdx is invalid during upward tracking. Changing direction has the side effect of closing region, and traversing past TopIdx or BottomIdx reopens it.

Member Functions

NameDescription
RegPressureTracker [constructor]Constructors
addLiveRegs Force liveness of virtual registers or physical register units. Particularly useful to initialize the livein/out state of the tracker before the first call to advance/recede.
advance advance overloads
closeBottom
closeRegion Finalize the region boundaries and recored live ins and live outs.
closeTop
decreaseRegPressure
dump
getDownwardPressure Get the pressure of each PSet after traversing this instruction top-down.
getLiveThru
getMaxDownwardPressureDelta Consider the pressure increase caused by traversing this instruction top-down. Find the pressure set with the most change beyond its pressure limit based on the tracker's current pressure, and record the number of excess register units of that pressure set introduced by this instruction.
getMaxPressureDelta Find the pressure set with the most change beyond its pressure limit after traversing this instruction either upward or downward depending on the closed end of the current region.
getMaxUpwardPressureDelta Consider the pressure increase caused by traversing this instruction bottom-up. Find the pressure set with the most change beyond its pressure limit based on the tracker's current pressure, and record the number of excess register units of that pressure set introduced by this instruction.
getPos Get the MI position corresponding to this register pressure.
getPressure Get the resulting register pressure over the traversed region. This result is complete if closeRegion() was explicitly invoked.
getPressureAfterInst
getRegSetPressureAtPos Get the register set pressure at the current position, which may be less than the pressure across the traversed region.
getUpwardPressure Get the pressure of each PSet after traversing this instruction bottom-up.
getUpwardPressureDelta
hasUntiedDef
increaseRegPressure
init
initLiveThru initLiveThru overloads
isBottomClosed
isTopClosed
recede recede overloads
recedeSkipDebugValues Recede until we find an instruction which is not a DebugValue.
reset
setPos

Protected Member Functions

NameDescription
bumpDeadDefs
bumpDownwardPressure
bumpUpwardPressure
discoverLiveIn Add Reg to the live in set and increase max pressure.
discoverLiveInOrOut
discoverLiveOut Add Reg to the live out set and increase max pressure.
getCurrSlot Get the SlotIndex for the first nondebug instruction including or after the current position.
getLastUsedLanes
getLiveLanesAt
getLiveThroughAt