|
LLVM 24.0.0git
|
Downward RP tracker that relies on program order to advance down the instruction stream. More...
#include "Target/AMDGPU/GCNRegPressure.h"
Public Member Functions | |
| GCNDownwardRPTracker (LiveIntervals &LIS) | |
| MachineBasicBlock::const_iterator | getNext () const |
| Returns the next MI that will be advanced over. | |
| GCNRegPressure | moveMaxPressure () |
return MaxPressure and clear it. | |
| bool | reset (const MachineInstr &MI, MachineBasicBlock::const_iterator End, const LiveRegSet *LiveRegsCopy=nullptr) |
Reset tracker to the point before the MI (filling LiveRegs upon this point using LiveRegsCopy if provided or LIS otherwise) point using LIS. | |
| bool | advanceBeforeNext () |
| Move to the state right before NextMI or the end of the MBB. | |
| void | advanceToNext () |
| Move to the state at NextMI. | |
| bool | advance () |
| Advance to the state at the next MI in program order. | |
| bool | advance (MachineBasicBlock::const_iterator End) |
Advance in program order until before End. | |
| bool | advance (MachineBasicBlock::const_iterator Begin, MachineBasicBlock::const_iterator End, const LiveRegSet *LiveRegsCopy=nullptr) |
Reset tracker to Begin (filling LiveRegs upon this point using LiveRegsCopy if provided or LIS otherwise) and advance to End, which must be between Begin and the end of its parent block (inclusive). | |
| void | addDefs (const MachineInstr &MI) |
Adds all lanes (dead or not) defined by MI's register operands to CurPressure. | |
| void | reset (const MachineInstr &MI, bool After) |
Resets tracker before or After the provided MI, which can be a debug instruction. | |
| void | reset (const MachineBasicBlock &MBB, bool End) |
Resets tracker at the start or End of the MBB. | |
| void | reset (const MachineRegisterInfo &MRI, SlotIndex SI) |
Resets tracker at the specified slot index SI. | |
| void | reset (const MachineRegisterInfo &MRI, const LiveRegSet &LiveRegs) |
Resets tracker with the provided LiveRegs. | |
| Public Member Functions inherited from llvm::GCNDownwardRPTrackerBase | |
| GCNRegPressure | bumpDownwardPressure (const MachineInstr *MI, const SIRegisterInfo *TRI) const |
Mostly copy/paste from CodeGen/RegisterPressure.cpp Calculate the impact MI will have on CurPressure and. | |
| Public Member Functions inherited from llvm::GCNRPTracker | |
| void | reset (const MachineRegisterInfo &MRI, const LiveRegSet &LiveRegs) |
Resets tracker with the provided LiveRegs. | |
| const decltype(LiveRegs) & | getLiveRegs () const |
| const MachineInstr * | getLastTrackedMI () const |
| void | clearMaxPressure () |
| const GCNRegPressure & | getMaxPressure () const |
| void | resetMaxPressure () |
| GCNRegPressure | getPressure () const |
| decltype(LiveRegs) | moveLiveRegs () |
Additional Inherited Members | |
| Public Types inherited from llvm::GCNRPTracker | |
| using | LiveRegSet = DenseMap<unsigned, LaneBitmask> |
| Protected Member Functions inherited from llvm::GCNDownwardRPTrackerBase | |
| GCNDownwardRPTrackerBase (LiveIntervals &LIS) | |
| void | retireDeadUses (const MachineInstr &MI) |
Retires the lanes of MI's used registers that die at MI, mirroring RegPressureTracker::advance(). | |
| void | retireDeadDefs (const MachineInstr &MI, SlotIndex SI) |
Retires the lanes defined by MI that are dead at SI, according to LIS. | |
| void | addDefs (const MachineInstr &MI) |
Adds all lanes (dead or not) defined by MI's register operands to CurPressure. | |
| Protected Member Functions inherited from llvm::GCNRPTracker | |
| GCNRPTracker (LiveIntervals &LIS_) | |
| void | reset (const MachineInstr &MI, bool After) |
Resets tracker before or After the provided MI, which can be a debug instruction. | |
| void | reset (const MachineBasicBlock &MBB, bool End) |
Resets tracker at the start or End of the MBB. | |
| void | reset (const MachineRegisterInfo &MRI, SlotIndex SI) |
Resets tracker at the specified slot index SI. | |
| LaneBitmask | getLastUsedLanes (Register Reg, SlotIndex Pos) const |
| Mostly copy/paste from CodeGen/RegisterPressure.cpp. | |
| Protected Attributes inherited from llvm::GCNRPTracker | |
| LiveIntervals & | LIS |
| LiveRegSet | LiveRegs |
| GCNRegPressure | CurPressure |
| GCNRegPressure | MaxPressure |
| MachineBasicBlock::const_iterator | LastTrackedMI |
| const MachineRegisterInfo * | MRI = nullptr |
Downward RP tracker that relies on program order to advance down the instruction stream.
Definition at line 427 of file GCNRegPressure.h.
|
inline |
Definition at line 435 of file GCNRegPressure.h.
References llvm::GCNDownwardRPTrackerBase::GCNDownwardRPTrackerBase(), and llvm::GCNRPTracker::LIS.
| void GCNDownwardRPTrackerBase::addDefs | ( | const MachineInstr & | MI | ) |
Adds all lanes (dead or not) defined by MI's register operands to CurPressure.
Definition at line 416 of file GCNRegPressure.cpp.
References llvm::GCNRPTracker::MRI, and TRI.
| bool GCNDownwardRPTracker::advance | ( | ) |
Advance to the state at the next MI in program order.
returns false if it reached end of block.
Definition at line 779 of file GCNRegPressure.cpp.
References advanceBeforeNext(), and advanceToNext().
| bool GCNDownwardRPTracker::advance | ( | MachineBasicBlock::const_iterator | Begin, |
| MachineBasicBlock::const_iterator | End, | ||
| const LiveRegSet * | LiveRegsCopy = nullptr ) |
Reset tracker to Begin (filling LiveRegs upon this point using LiveRegsCopy if provided or LIS otherwise) and advance to End, which must be between Begin and the end of its parent block (inclusive).
returns false if the range [Begin, End) is empty except debug values.
Definition at line 795 of file GCNRegPressure.cpp.
| bool GCNDownwardRPTracker::advance | ( | MachineBasicBlock::const_iterator | End | ) |
Advance in program order until before End.
Returns whether it actually had to advance to reach End.
Definition at line 788 of file GCNRegPressure.cpp.
| bool GCNDownwardRPTracker::advanceBeforeNext | ( | ) |
Move to the state right before NextMI or the end of the MBB.
This retires defs of LastTrackedMI that are dead after the instruction. Its dead uses were already retired by advanceToNext. returns false if it reached the end of the block.
Definition at line 758 of file GCNRegPressure.cpp.
References assert(), llvm::GCNRPTracker::LastTrackedMI, llvm::GCNRPTracker::LIS, and llvm::GCNDownwardRPTrackerBase::retireDeadDefs().
Referenced by advance(), and llvm::GCNRegPressurePrinter::runOnMachineFunction().
| void GCNDownwardRPTracker::advanceToNext | ( | ) |
Move to the state at NextMI.
This retires the uses that die at NextMI, then adds the register lanes it defines to CurPressure. Has to be called after advanceBeforeNext.
Definition at line 772 of file GCNRegPressure.cpp.
References llvm::GCNDownwardRPTrackerBase::addDefs(), llvm::GCNRPTracker::LastTrackedMI, llvm::GCNDownwardRPTrackerBase::retireDeadUses(), and llvm::skipDebugInstructionsForward().
Referenced by advance(), and llvm::GCNRegPressurePrinter::runOnMachineFunction().
|
inline |
Returns the next MI that will be advanced over.
Definition at line 441 of file GCNRegPressure.h.
|
inline |
return MaxPressure and clear it.
Definition at line 444 of file GCNRegPressure.h.
References llvm::GCNRPTracker::MaxPressure.
| void GCNRPTracker::reset | ( | const MachineBasicBlock & | MBB, |
| bool | End ) |
Resets tracker at the start or End of the MBB.
Definition at line 326 of file GCNRegPressure.cpp.
| void GCNRPTracker::reset | ( | const MachineInstr & | MI, |
| bool | After ) |
Resets tracker before or After the provided MI, which can be a debug instruction.
Definition at line 323 of file GCNRegPressure.cpp.
| bool GCNDownwardRPTracker::reset | ( | const MachineInstr & | MI, |
| MachineBasicBlock::const_iterator | End, | ||
| const LiveRegSet * | LiveRegsCopy = nullptr ) |
Reset tracker to the point before the MI (filling LiveRegs upon this point using LiveRegsCopy if provided or LIS otherwise) point using LIS.
End must be between the MI and the end of its parent block (inclusive). returns false if the range [MI, End) is empty except debug values.
Definition at line 652 of file GCNRegPressure.cpp.
References assert(), llvm::End, MI, llvm::GCNRPTracker::reset(), and llvm::skipDebugInstructionsForward().
Referenced by advance(), and llvm::GCNRegPressurePrinter::runOnMachineFunction().
| void GCNRPTracker::reset | ( | const MachineRegisterInfo & | MRI, |
| const LiveRegSet & | LiveRegs ) |
Resets tracker with the provided LiveRegs.
Definition at line 335 of file GCNRegPressure.cpp.
| void GCNRPTracker::reset | ( | const MachineRegisterInfo & | MRI, |
| SlotIndex | SI ) |
Resets tracker at the specified slot index SI.
Definition at line 329 of file GCNRegPressure.cpp.