LLVM 20.0.0git
|
Track the current register pressure at some position in the instruction stream, and remember the high water mark within the region traversed. More...
#include "llvm/CodeGen/RegisterPressure.h"
Public Member Functions | |
RegPressureTracker (IntervalPressure &rp) | |
RegPressureTracker (RegionPressure &rp) | |
void | reset () |
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 | addLiveRegs (ArrayRef< RegisterMaskPair > Regs) |
Force liveness of virtual registers or physical register units. | |
MachineBasicBlock::const_iterator | getPos () const |
Get the MI position corresponding to this register pressure. | |
void | setPos (MachineBasicBlock::const_iterator Pos) |
void | recede (SmallVectorImpl< RegisterMaskPair > *LiveUses=nullptr) |
Recede across the previous instruction. | |
void | recede (const RegisterOperands &RegOpers, SmallVectorImpl< RegisterMaskPair > *LiveUses=nullptr) |
Recede across the previous instruction. | |
void | recedeSkipDebugValues () |
Recede until we find an instruction which is not a DebugValue. | |
void | advance () |
Advance across the current instruction. | |
void | advance (const RegisterOperands &RegOpers) |
Advance across the current instruction. | |
void | closeRegion () |
Finalize the region boundaries and recored live ins and live outs. | |
void | initLiveThru (const RegPressureTracker &RPTracker) |
Initialize the LiveThru pressure set based on the untied defs found in RPTracker. | |
void | initLiveThru (ArrayRef< unsigned > PressureSet) |
Copy an existing live thru pressure result. | |
ArrayRef< unsigned > | getLiveThru () const |
RegisterPressure & | getPressure () |
Get the resulting register pressure over the traversed region. | |
const RegisterPressure & | getPressure () const |
const std::vector< unsigned > & | getRegSetPressureAtPos () const |
Get the register set pressure at the current position, which may be less than the pressure across the traversed region. | |
bool | isTopClosed () const |
Does this pressure result have a valid top position and live ins. | |
bool | isBottomClosed () const |
Does this pressure result have a valid bottom position and live outs. | |
void | closeTop () |
Set the boundary for the top of the region and summarize live ins. | |
void | closeBottom () |
Set the boundary for the bottom of the region and summarize live outs. | |
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 | 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 liveness. | |
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 | getMaxPressureDelta (const MachineInstr *MI, RegPressureDelta &Delta, ArrayRef< PressureChange > CriticalPSets, ArrayRef< unsigned > MaxPressureLimit) |
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. | |
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. | |
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. | |
void | getPressureAfterInst (const MachineInstr *MI, std::vector< unsigned > &PressureResult, std::vector< unsigned > &MaxPressureResult) |
bool | hasUntiedDef (Register VirtReg) const |
void | dump () const |
void | increaseRegPressure (Register RegUnit, LaneBitmask PreviousMask, LaneBitmask NewMask) |
void | decreaseRegPressure (Register RegUnit, LaneBitmask PreviousMask, LaneBitmask NewMask) |
Protected Member Functions | |
void | discoverLiveOut (RegisterMaskPair Pair) |
Add Reg to the live out set and increase max pressure. | |
void | discoverLiveIn (RegisterMaskPair Pair) |
Add Reg to the live in set and increase max pressure. | |
SlotIndex | getCurrSlot () const |
Get the SlotIndex for the first nondebug instruction including or after the current position. | |
void | bumpDeadDefs (ArrayRef< RegisterMaskPair > DeadDefs) |
void | bumpUpwardPressure (const MachineInstr *MI) |
Record the upward impact of a single instruction on current register pressure. | |
void | bumpDownwardPressure (const MachineInstr *MI) |
Record the downward impact of a single instruction on current register pressure. | |
void | discoverLiveInOrOut (RegisterMaskPair Pair, SmallVectorImpl< RegisterMaskPair > &LiveInOrOut) |
LaneBitmask | getLastUsedLanes (Register RegUnit, SlotIndex Pos) const |
LaneBitmask | getLiveLanesAt (Register RegUnit, SlotIndex Pos) const |
LaneBitmask | getLiveThroughAt (Register RegUnit, SlotIndex Pos) const |
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.
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.
Definition at line 359 of file RegisterPressure.h.
|
inline |
Definition at line 399 of file RegisterPressure.h.
References P.
|
inline |
Definition at line 400 of file RegisterPressure.h.
References P.
void RegPressureTracker::addLiveRegs | ( | ArrayRef< RegisterMaskPair > | Regs | ) |
Force liveness of virtual registers or physical register units.
Force liveness of registers.
Particularly useful to initialize the livein/out state of the tracker before the first call to advance/recede.
Definition at line 698 of file RegisterPressure.cpp.
References increaseRegPressure(), llvm::LiveRegSet::insert(), and P.
Referenced by computeLiveOuts(), and llvm::ScheduleDAGMILive::initRegPressure().
void RegPressureTracker::advance | ( | ) |
Advance across the current instruction.
Definition at line 939 of file RegisterPressure.cpp.
References llvm::RegisterOperands::adjustLaneLiveness(), advance(), llvm::RegisterOperands::collect(), getCurrSlot(), MI, MRI, and TRI.
Referenced by advance(), llvm::SIScheduleBlock::schedule(), and llvm::ScheduleDAGMILive::scheduleMI().
void RegPressureTracker::advance | ( | const RegisterOperands & | RegOpers | ) |
Advance across the current instruction.
This is a "low-level" variant of advance() which takes precomputed RegisterOperands of the instruction.
Definition at line 888 of file RegisterPressure.cpp.
References llvm::LaneBitmask::any(), assert(), bumpDeadDefs(), closeTop(), llvm::LiveRegSet::contains(), llvm::RegisterOperands::DeadDefs, decreaseRegPressure(), llvm::RegisterOperands::Defs, discoverLiveIn(), llvm::MachineBasicBlock::end(), llvm::LiveRegSet::erase(), getCurrSlot(), getLastUsedLanes(), increaseRegPressure(), llvm::LiveRegSet::insert(), isBottomClosed(), isTopClosed(), MBB, llvm::next_nodbg(), P, Reg, and llvm::RegisterOperands::Uses.
|
protected |
Definition at line 736 of file RegisterPressure.cpp.
References llvm::LiveRegSet::contains(), decreaseRegPressure(), increaseRegPressure(), P, and Reg.
Referenced by advance(), bumpDownwardPressure(), bumpUpwardPressure(), and recede().
|
protected |
Record the downward impact of a single instruction on current register pressure.
Unlike the advance/recede pressure tracking interface, this does not discover live in/outs.
This is intended for speculative queries. It leaves pressure inconsistent with the current position, so must be restored by the caller.
Definition at line 1284 of file RegisterPressure.cpp.
References llvm::RegisterOperands::adjustLaneLiveness(), assert(), bumpDeadDefs(), llvm::RegisterOperands::collect(), llvm::LiveRegSet::contains(), llvm::RegisterOperands::DeadDefs, decreaseRegPressure(), llvm::RegisterOperands::Defs, findUseBetween(), getCurrSlot(), llvm::LiveIntervals::getInstructionIndex(), getLastUsedLanes(), llvm::SlotIndex::getRegSlot(), increaseRegPressure(), MI, MRI, llvm::LaneBitmask::none(), Reg, TRI, and llvm::RegisterOperands::Uses.
Referenced by getDownwardPressure(), and getMaxDownwardPressureDelta().
|
protected |
Record the upward impact of a single instruction on current register pressure.
Unlike the advance/recede pressure tracking interface, this does not discover live in/outs.
This is intended for speculative queries. It leaves pressure inconsistent with the current position, so must be restored by the caller.
Definition at line 1034 of file RegisterPressure.cpp.
References llvm::RegisterOperands::adjustLaneLiveness(), llvm::LaneBitmask::any(), assert(), bumpDeadDefs(), llvm::RegisterOperands::collect(), llvm::LiveRegSet::contains(), llvm::RegisterOperands::DeadDefs, decreaseRegPressure(), llvm::RegisterOperands::Defs, llvm::RegisterOperands::detectDeadDefs(), llvm::LiveIntervals::getInstructionIndex(), getRegLanes(), llvm::SlotIndex::getRegSlot(), increaseRegPressure(), MI, MRI, P, Reg, TRI, and llvm::RegisterOperands::Uses.
Referenced by getMaxUpwardPressureDelta(), and getUpwardPressure().
void RegPressureTracker::closeBottom | ( | ) |
Set the boundary for the bottom of the region and summarize live outs.
Definition at line 331 of file RegisterPressure.cpp.
References llvm::LiveRegSet::appendTo(), assert(), getCurrSlot(), llvm::RegisterPressure::LiveOutRegs, and llvm::LiveRegSet::size().
Referenced by closeRegion(), llvm::ScheduleDAGMILive::initRegPressure(), and recedeSkipDebugValues().
void RegPressureTracker::closeRegion | ( | ) |
Finalize the region boundaries and recored live ins and live outs.
Finalize the region boundaries and record live ins and live outs.
Definition at line 343 of file RegisterPressure.cpp.
References assert(), closeBottom(), closeTop(), isBottomClosed(), isTopClosed(), and llvm::LiveRegSet::size().
Referenced by llvm::ScheduleDAGMILive::initRegPressure(), and llvm::PPCInstrInfo::shouldReduceRegisterPressure().
void RegPressureTracker::closeTop | ( | ) |
Set the boundary for the top of the region and summarize live ins.
Definition at line 319 of file RegisterPressure.cpp.
References llvm::LiveRegSet::appendTo(), assert(), getCurrSlot(), llvm::RegisterPressure::LiveInRegs, and llvm::LiveRegSet::size().
Referenced by advance(), closeRegion(), and llvm::ScheduleDAGMILive::initRegPressure().
void RegPressureTracker::decreaseRegPressure | ( | Register | RegUnit, |
LaneBitmask | PreviousMask, | ||
LaneBitmask | NewMask | ||
) |
Definition at line 170 of file RegisterPressure.cpp.
References decreaseSetPressure().
Referenced by advance(), bumpDeadDefs(), bumpDownwardPressure(), bumpUpwardPressure(), and recede().
|
protected |
Add Reg to the live in set and increase max pressure.
Definition at line 728 of file RegisterPressure.cpp.
References discoverLiveInOrOut(), and P.
Referenced by advance().
|
protected |
Definition at line 706 of file RegisterPressure.cpp.
References llvm::LaneBitmask::any(), assert(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::find_if(), llvm::LaneBitmask::getNone(), I, increaseSetPressure(), llvm::RegisterMaskPair::LaneMask, MRI, llvm::Other, P, llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::RegisterMaskPair::RegUnit.
Referenced by discoverLiveIn(), and discoverLiveOut().
|
protected |
Add Reg to the live out set and increase max pressure.
Definition at line 732 of file RegisterPressure.cpp.
References discoverLiveInOrOut(), and P.
Referenced by recede().
LLVM_DUMP_METHOD void RegPressureTracker::dump | ( | ) | const |
Definition at line 117 of file RegisterPressure.cpp.
References llvm::dbgs(), llvm::RegisterPressure::dump(), llvm::dumpRegSetPressure(), isBottomClosed(), and isTopClosed().
Referenced by llvm::ScheduleDAGMILive::initRegPressure().
|
protected |
Get the SlotIndex for the first nondebug instruction including or after the current position.
Definition at line 310 of file RegisterPressure.cpp.
References llvm::MachineBasicBlock::end(), llvm::LiveIntervals::getInstructionIndex(), llvm::LiveIntervals::getMBBEndIdx(), llvm::SlotIndex::getRegSlot(), and llvm::skipDebugInstructionsForward().
Referenced by advance(), bumpDownwardPressure(), closeBottom(), and closeTop().
void RegPressureTracker::getDownwardPressure | ( | const MachineInstr * | MI, |
std::vector< unsigned > & | PressureResult, | ||
std::vector< unsigned > & | MaxPressureResult | ||
) |
Get the pressure of each PSet after traversing this instruction top-down.
Definition at line 1382 of file RegisterPressure.cpp.
References bumpDownwardPressure(), MI, and P.
Referenced by getPressureAfterInst(), and getRegisterPressures().
|
protected |
Definition at line 1255 of file RegisterPressure.cpp.
References assert(), llvm::SlotIndex::getBaseIndex(), getLanesWithProperty(), llvm::LaneBitmask::getNone(), and MRI.
Referenced by advance(), and bumpDownwardPressure().
|
protected |
Definition at line 1245 of file RegisterPressure.cpp.
References assert(), llvm::LaneBitmask::getAll(), getLanesWithProperty(), llvm::LiveRange::liveAt(), and MRI.
|
protected |
Definition at line 1266 of file RegisterPressure.cpp.
References assert(), llvm::LiveRange::Segment::end, llvm::SlotIndex::getDeadSlot(), getLanesWithProperty(), llvm::LaneBitmask::getNone(), llvm::SlotIndex::getRegSlot(), llvm::LiveRange::getSegmentContaining(), MRI, and llvm::LiveRange::Segment::start.
Referenced by recede().
Definition at line 456 of file RegisterPressure.h.
Referenced by llvm::ScheduleDAGMILive::initRegPressure(), and llvm::ScheduleDAGMILive::updateScheduledPressure().
void RegPressureTracker::getMaxDownwardPressureDelta | ( | const MachineInstr * | MI, |
RegPressureDelta & | Delta, | ||
ArrayRef< PressureChange > | CriticalPSets, | ||
ArrayRef< unsigned > | MaxPressureLimit | ||
) |
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.
Find the register class with the most change in its pressure limit based on the tracker's current pressure, and return the number of excess register units of that pressure set introduced by this instruction.
This assumes that the current LiveIn set is sufficient.
This is expensive for an on-the-fly query because it calls bumpDownwardPressure to recompute the pressure sets based on current liveness. We don't yet have a fast version of downward pressure tracking analogous to getUpwardPressureDelta.
Definition at line 1343 of file RegisterPressure.cpp.
References assert(), bumpDownwardPressure(), computeExcessPressureDelta(), computeMaxPressureDelta(), llvm::RegPressureDelta::CriticalMax, llvm::RegPressureDelta::CurrentMax, llvm::PressureChange::getUnitInc(), MI, and P.
Referenced by getMaxPressureDelta(), and llvm::GenericScheduler::initCandidate().
|
inline |
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.
Definition at line 503 of file RegisterPressure.h.
References assert(), getMaxDownwardPressureDelta(), getMaxUpwardPressureDelta(), isBottomClosed(), isTopClosed(), and MI.
Referenced by llvm::ConvergingVLIWScheduler::readyQueueVerboseDump().
void RegPressureTracker::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.
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.
Find the pressure set with the most change beyond its pressure limit based on the tracker's current pressure, and return the change in number of register units of that pressure set introduced by this instruction.
This assumes that the current LiveOut set is sufficient.
This is expensive for an on-the-fly query because it calls bumpUpwardPressure to recompute the pressure sets based on current liveness. This mainly exists to verify correctness, e.g. with -verify-misched. getUpwardPressureDelta is the fast version of this query that uses the per-SUnit cache of the PressureDiff.
Definition at line 1094 of file RegisterPressure.cpp.
References assert(), bumpUpwardPressure(), computeExcessPressureDelta(), computeMaxPressureDelta(), llvm::RegPressureDelta::CriticalMax, llvm::RegPressureDelta::CurrentMax, llvm::dbgs(), llvm::PressureDiff::dump(), llvm::RegPressureDelta::Excess, llvm::PressureChange::getPSet(), llvm::PressureChange::getUnitInc(), getUpwardPressureDelta(), llvm::PressureChange::isValid(), llvm_unreachable, MI, P, and TRI.
Referenced by getMaxPressureDelta(), and llvm::GenericScheduler::initCandidate().
|
inline |
Get the MI position corresponding to this register pressure.
Definition at line 415 of file RegisterPressure.h.
Referenced by llvm::ScheduleDAGInstrs::buildSchedGraph(), llvm::ScheduleDAGMILive::initQueues(), llvm::ScheduleDAGMILive::initRegPressure(), llvm::SIScheduleDAGMI::schedule(), llvm::ScheduleDAGMILive::scheduleMI(), llvm::PPCInstrInfo::shouldReduceRegisterPressure(), and llvm::ScheduleDAGMILive::updatePressureDiffs().
|
inline |
Get the resulting register pressure over the traversed region.
This result is complete if closeRegion() was explicitly invoked.
Definition at line 460 of file RegisterPressure.h.
References P.
Referenced by llvm::ScheduleDAGMILive::computeCyclicCriticalPath(), llvm::SIScheduleDAGMI::getInRegs(), llvm::SIScheduleDAGMI::getOutRegs(), llvm::ScheduleDAGMILive::initRegPressure(), llvm::ScheduleDAGMILive::scheduleMI(), and llvm::PPCInstrInfo::shouldReduceRegisterPressure().
|
inline |
Definition at line 461 of file RegisterPressure.h.
References P.
|
inline |
Definition at line 526 of file RegisterPressure.h.
References assert(), getDownwardPressure(), getUpwardPressure(), isBottomClosed(), isTopClosed(), and MI.
Get the register set pressure at the current position, which may be less than the pressure across the traversed region.
Definition at line 465 of file RegisterPressure.h.
Referenced by llvm::ScheduleDAGMILive::initRegPressure(), llvm::GCNSchedStrategy::pickNodeFromQueue(), and llvm::ScheduleDAGMILive::scheduleMI().
void RegPressureTracker::getUpwardPressure | ( | const MachineInstr * | MI, |
std::vector< unsigned > & | PressureResult, | ||
std::vector< unsigned > & | MaxPressureResult | ||
) |
Get the pressure of each PSet after traversing this instruction bottom-up.
Definition at line 1366 of file RegisterPressure.cpp.
References bumpUpwardPressure(), MI, and P.
Referenced by getPressureAfterInst(), and getRegisterPressures().
void RegPressureTracker::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 liveness.
Delta | captures information needed for heuristics. |
CriticalPSets | Are the pressure sets that are known to exceed some limit within the region, not necessarily at the current position. |
MaxPressureLimit | Is the max pressure within the region, not necessarily at the current position. |
Definition at line 1162 of file RegisterPressure.cpp.
References assert(), llvm::PressureDiff::begin(), llvm::RegPressureDelta::CriticalMax, llvm::RegPressureDelta::CurrentMax, llvm::PressureDiff::end(), llvm::RegPressureDelta::Excess, llvm::RegisterClassInfo::getRegPressureSetLimit(), llvm::PressureChange::isValid(), P, llvm::PressureChange::setUnitInc(), and llvm::ArrayRef< T >::size().
Referenced by getMaxUpwardPressureDelta(), and llvm::GenericScheduler::initCandidate().
Definition at line 536 of file RegisterPressure.h.
References llvm::SparseSet< ValueT, KeyFunctorT, SparseT >::count().
Referenced by initLiveThru().
void RegPressureTracker::increaseRegPressure | ( | Register | RegUnit, |
LaneBitmask | PreviousMask, | ||
LaneBitmask | NewMask | ||
) |
Definition at line 155 of file RegisterPressure.cpp.
References llvm::LaneBitmask::any(), llvm::MachineRegisterInfo::getPressureSets(), llvm::PSetIterator::getWeight(), llvm::PSetIterator::isValid(), llvm::RegisterPressure::MaxSetPressure, and llvm::LaneBitmask::none().
Referenced by addLiveRegs(), advance(), bumpDeadDefs(), bumpDownwardPressure(), bumpUpwardPressure(), and recede().
void RegPressureTracker::init | ( | const MachineFunction * | mf, |
const RegisterClassInfo * | rci, | ||
const LiveIntervals * | lis, | ||
const MachineBasicBlock * | mbb, | ||
MachineBasicBlock::const_iterator | pos, | ||
bool | TrackLaneMasks, | ||
bool | TrackUntiedDefs | ||
) |
Setup the RegPressureTracker.
TODO: Add support for pressure without LiveIntervals.
Definition at line 263 of file RegisterPressure.cpp.
References assert(), llvm::TargetRegisterInfo::getNumRegPressureSets(), llvm::MachineRegisterInfo::getNumVirtRegs(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::LiveRegSet::init(), llvm::RegisterPressure::MaxSetPressure, and reset().
Referenced by llvm::ScheduleDAGMILive::buildDAGWithRegPressure(), llvm::ScheduleDAGMILive::initRegPressure(), llvm::SIScheduleDAGMI::initRPTracker(), and llvm::PPCInstrInfo::shouldReduceRegisterPressure().
Copy an existing live thru pressure result.
Definition at line 452 of file RegisterPressure.h.
References llvm::ArrayRef< T >::begin(), and llvm::ArrayRef< T >::end().
void RegPressureTracker::initLiveThru | ( | const RegPressureTracker & | RPTracker | ) |
Initialize the LiveThru pressure set based on the untied defs found in RPTracker.
The register tracker is unaware of global liveness so ignores normal live-thru ranges.
However, two-address or coalesced chains can also lead to live ranges with no holes. Count these to inform heuristics that we can never drop below this pressure.
Definition at line 359 of file RegisterPressure.cpp.
References assert(), llvm::LaneBitmask::getNone(), llvm::TargetRegisterInfo::getNumRegPressureSets(), hasUntiedDef(), increaseSetPressure(), isBottomClosed(), llvm::Register::isVirtual(), llvm::RegisterMaskPair::LaneMask, llvm::RegisterPressure::LiveOutRegs, and llvm::RegisterMaskPair::RegUnit.
Referenced by llvm::ScheduleDAGMILive::initRegPressure().
bool RegPressureTracker::isBottomClosed | ( | ) | const |
Does this pressure result have a valid bottom position and live outs.
Definition at line 303 of file RegisterPressure.cpp.
References llvm::RegionPressure::BottomPos.
Referenced by advance(), closeRegion(), dump(), getMaxPressureDelta(), getPressureAfterInst(), initLiveThru(), and recedeSkipDebugValues().
bool RegPressureTracker::isTopClosed | ( | ) | const |
Does this pressure result have a valid top position and live ins.
Definition at line 295 of file RegisterPressure.cpp.
References llvm::RegionPressure::TopPos.
Referenced by advance(), closeRegion(), dump(), getMaxPressureDelta(), getPressureAfterInst(), and recedeSkipDebugValues().
void RegPressureTracker::recede | ( | const RegisterOperands & | RegOpers, |
SmallVectorImpl< RegisterMaskPair > * | LiveUses = nullptr |
||
) |
Recede across the previous instruction.
This "low-level" variant assumes that recedeSkipDebugValues() was called previously and takes precomputed RegisterOperands for the instruction.
If LiveUses is provided, record any RegUnits that are made live by the current instruction's uses. This includes registers that are both defined and used by the instruction. If a pressure difference pointer is provided record the changes is pressure caused by this instruction independent of liveness.
Definition at line 756 of file RegisterPressure.cpp.
References addRegLanes(), llvm::LaneBitmask::any(), assert(), bumpDeadDefs(), llvm::LiveRegSet::contains(), llvm::RegisterOperands::DeadDefs, decreaseRegPressure(), llvm::RegisterOperands::Defs, discoverLiveOut(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::LiveRegSet::erase(), llvm::find_if(), llvm::LiveIntervals::getInstructionIndex(), getLiveThroughAt(), llvm::LaneBitmask::getNone(), llvm::SlotIndex::getRegSlot(), I, increaseRegPressure(), increaseSetPressure(), llvm::LiveRegSet::insert(), llvm::Register::isVirtual(), MRI, llvm::LaneBitmask::none(), llvm::Other, Reg, removeRegLanes(), setRegZero(), and llvm::RegisterOperands::Uses.
void RegPressureTracker::recede | ( | SmallVectorImpl< RegisterMaskPair > * | LiveUses = nullptr | ) |
Recede across the previous instruction.
Definition at line 865 of file RegisterPressure.cpp.
References llvm::RegisterOperands::adjustLaneLiveness(), assert(), llvm::MachineBasicBlock::begin(), llvm::RegisterOperands::collect(), llvm::RegisterOperands::detectDeadDefs(), llvm::LiveIntervals::getInstructionIndex(), llvm::SlotIndex::getRegSlot(), MBB, MI, MRI, recede(), recedeSkipDebugValues(), and TRI.
Referenced by llvm::ScheduleDAGMILive::buildDAGWithRegPressure(), llvm::ScheduleDAGInstrs::buildSchedGraph(), llvm::GCNIterativeScheduler::getSchedulePressure(), llvm::ScheduleDAGMILive::initRegPressure(), recede(), llvm::ScheduleDAGMILive::scheduleMI(), and llvm::PPCInstrInfo::shouldReduceRegisterPressure().
void RegPressureTracker::recedeSkipDebugValues | ( | ) |
Recede until we find an instruction which is not a DebugValue.
Definition at line 844 of file RegisterPressure.cpp.
References assert(), llvm::MachineBasicBlock::begin(), closeBottom(), llvm::LiveIntervals::getInstructionIndex(), llvm::SlotIndex::getRegSlot(), isBottomClosed(), isTopClosed(), MBB, P, and llvm::prev_nodbg().
Referenced by llvm::ScheduleDAGInstrs::buildSchedGraph(), recede(), llvm::ScheduleDAGMILive::scheduleMI(), and llvm::PPCInstrInfo::shouldReduceRegisterPressure().
void RegPressureTracker::reset | ( | ) |
Definition at line 243 of file RegisterPressure.cpp.
References llvm::LiveRegSet::clear(), llvm::RegisterPressure::MaxSetPressure, and reset().
Referenced by llvm::ScheduleDAGMILive::buildDAGWithRegPressure(), llvm::GCNIterativeScheduler::getSchedulePressure(), init(), and reset().
|
inline |
Definition at line 421 of file RegisterPressure.h.
Referenced by llvm::ScheduleDAGMILive::initQueues(), llvm::SIScheduleDAGMI::schedule(), llvm::SIScheduleBlock::schedule(), and llvm::ScheduleDAGMILive::scheduleMI().