LLVM 24.0.0git
llvm::GCNDownwardRPTracker Class Reference

Downward RP tracker that relies on program order to advance down the instruction stream. More...

#include "Target/AMDGPU/GCNRegPressure.h"

Inheritance diagram for llvm::GCNDownwardRPTracker:
[legend]

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 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 retireDeadOperands (const MachineInstr &MI, SlotIndex SI)
 Retires all lanes of MI's register operands 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

Detailed Description

Downward RP tracker that relies on program order to advance down the instruction stream.

Definition at line 421 of file GCNRegPressure.h.

Constructor & Destructor Documentation

◆ GCNDownwardRPTracker()

llvm::GCNDownwardRPTracker::GCNDownwardRPTracker ( LiveIntervals & LIS)
inline

Member Function Documentation

◆ advance() [1/3]

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 758 of file GCNRegPressure.cpp.

References advanceBeforeNext(), and advanceToNext().

Referenced by advance(), and advance().

◆ advance() [2/3]

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 774 of file GCNRegPressure.cpp.

References advance(), llvm::End, and reset().

◆ advance() [3/3]

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 767 of file GCNRegPressure.cpp.

References advance(), and llvm::End.

◆ advanceBeforeNext()

bool GCNDownwardRPTracker::advanceBeforeNext ( )

Move to the state right before NextMI or the end of the MBB.

This retires defs/uses of LastTrackedMI that are dead after the instruction. returns false if it reached the end of the block.

Definition at line 738 of file GCNRegPressure.cpp.

References assert(), llvm::GCNRPTracker::LastTrackedMI, llvm::GCNRPTracker::LIS, and llvm::GCNDownwardRPTrackerBase::retireDeadOperands().

Referenced by advance(), and llvm::GCNRegPressurePrinter::runOnMachineFunction().

◆ advanceToNext()

void GCNDownwardRPTracker::advanceToNext ( )

Move to the state at NextMI.

This adds register lanes define by NextMI to CurPressure. Has to be called after advanceBeforeNext.

Definition at line 752 of file GCNRegPressure.cpp.

References llvm::GCNDownwardRPTrackerBase::addDefs(), llvm::GCNRPTracker::LastTrackedMI, and llvm::skipDebugInstructionsForward().

Referenced by advance(), and llvm::GCNRegPressurePrinter::runOnMachineFunction().

◆ getNext()

MachineBasicBlock::const_iterator llvm::GCNDownwardRPTracker::getNext ( ) const
inline

Returns the next MI that will be advanced over.

Definition at line 434 of file GCNRegPressure.h.

◆ moveMaxPressure()

GCNRegPressure llvm::GCNDownwardRPTracker::moveMaxPressure ( )
inline

return MaxPressure and clear it.

Definition at line 437 of file GCNRegPressure.h.

References llvm::GCNRPTracker::MaxPressure.

◆ reset() [1/5]

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.

◆ reset() [2/5]

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.

◆ reset() [3/5]

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().

◆ reset() [4/5]

void GCNRPTracker::reset ( const MachineRegisterInfo & MRI,
const LiveRegSet & LiveRegs )

Resets tracker with the provided LiveRegs.

Definition at line 335 of file GCNRegPressure.cpp.

◆ reset() [5/5]

void GCNRPTracker::reset ( const MachineRegisterInfo & MRI,
SlotIndex SI )

Resets tracker at the specified slot index SI.

Definition at line 329 of file GCNRegPressure.cpp.


The documentation for this class was generated from the following files: