LLVM 20.0.0git
Public Member Functions | List of all members
llvm::GCNDownwardRPTracker Class Reference

#include "Target/AMDGPU/GCNRegPressure.h"

Inheritance diagram for llvm::GCNDownwardRPTracker:
Inheritance graph
[legend]

Public Member Functions

 GCNDownwardRPTracker (const LiveIntervals &LIS_)
 
MachineBasicBlock::const_iterator getNext () const
 
GCNRegPressure moveMaxPressure ()
 return MaxPressure and clear it.
 
bool reset (const MachineInstr &MI, const LiveRegSet *LiveRegs=nullptr)
 Reset tracker to the point before the MI filling LiveRegs upon this point using LIS.
 
bool advanceBeforeNext (MachineInstr *MI=nullptr, bool UseInternalIterator=true)
 Move to the state right before the next MI or after the end of MBB.
 
void advanceToNext (MachineInstr *MI=nullptr, bool UseInternalIterator=true)
 Move to the state at the MI, advanceBeforeNext has to be called first.
 
bool advance (MachineInstr *MI=nullptr, bool UseInternalIterator=true)
 Move to the state at the next MI.
 
bool advance (MachineBasicBlock::const_iterator End)
 Advance instructions until before End.
 
bool advance (MachineBasicBlock::const_iterator Begin, MachineBasicBlock::const_iterator End, const LiveRegSet *LiveRegsCopy=nullptr)
 Reset to Begin and advance to End.
 
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.
 
void reset (const MachineInstr &MI, const LiveRegSet *LiveRegsCopy, bool After)
 
void reset (const MachineRegisterInfo &MRI_, const LiveRegSet &LiveRegs_)
 
- Public Member Functions inherited from llvm::GCNRPTracker
void reset (const MachineRegisterInfo &MRI_, const LiveRegSet &LiveRegs_)
 
const decltype(LiveRegs) & getLiveRegs () const
 
const MachineInstrgetLastTrackedMI () const
 
void clearMaxPressure ()
 
GCNRegPressure getPressure () const
 
decltype(LiveRegsmoveLiveRegs ()
 

Additional Inherited Members

- Public Types inherited from llvm::GCNRPTracker
using LiveRegSet = DenseMap< unsigned, LaneBitmask >
 
- Protected Member Functions inherited from llvm::GCNRPTracker
 GCNRPTracker (const LiveIntervals &LIS_)
 
void reset (const MachineInstr &MI, const LiveRegSet *LiveRegsCopy, bool After)
 
void bumpDeadDefs (ArrayRef< RegisterMaskPair > DeadDefs)
 Mostly copy/paste from CodeGen/RegisterPressure.cpp.
 
LaneBitmask getLastUsedLanes (Register RegUnit, SlotIndex Pos) const
 Mostly copy/paste from CodeGen/RegisterPressure.cpp.
 
- Protected Attributes inherited from llvm::GCNRPTracker
const LiveIntervalsLIS
 
LiveRegSet LiveRegs
 
GCNRegPressure CurPressure
 
GCNRegPressure MaxPressure
 
const MachineInstrLastTrackedMI = nullptr
 
const MachineRegisterInfoMRI = nullptr
 

Detailed Description

Definition at line 244 of file GCNRegPressure.h.

Constructor & Destructor Documentation

◆ GCNDownwardRPTracker()

llvm::GCNDownwardRPTracker::GCNDownwardRPTracker ( const LiveIntervals LIS_)
inline

Definition at line 251 of file GCNRegPressure.h.

Member Function Documentation

◆ advance() [1/3]

bool GCNDownwardRPTracker::advance ( MachineBasicBlock::const_iterator  Begin,
MachineBasicBlock::const_iterator  End,
const LiveRegSet LiveRegsCopy = nullptr 
)

Reset to Begin and advance to End.

Definition at line 622 of file GCNRegPressure.cpp.

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

◆ advance() [2/3]

bool GCNDownwardRPTracker::advance ( MachineBasicBlock::const_iterator  End)

Advance instructions until before End.

Definition at line 616 of file GCNRegPressure.cpp.

References advance(), and End.

◆ advance() [3/3]

bool GCNDownwardRPTracker::advance ( MachineInstr MI = nullptr,
bool  UseInternalIterator = true 
)

Move to the state at the next MI.

returns false if reached end of block. If UseInternalIterator is true, then internal iterators are used and set to process in program order. If UseInternalIterator is false, then it is assumed that the tracker is using an externally managed iterator, and advance* calls will not update the state of the iterator. In such cases, the tracker will move to the state right before the provided MI and use LIS for RP calculations.

Definition at line 603 of file GCNRegPressure.cpp.

References advanceBeforeNext(), advanceToNext(), and MI.

Referenced by advance(), and llvm::GCNSchedStrategy::schedNode().

◆ advanceBeforeNext()

bool GCNDownwardRPTracker::advanceBeforeNext ( MachineInstr MI = nullptr,
bool  UseInternalIterator = true 
)

Move to the state right before the next MI or after the end of MBB.

returns false if reached end of the block. If UseInternalIterator is true, then internal iterators are used and set to process in program order. If UseInternalIterator is false, then it is assumed that the tracker is using an externally managed iterator, and advance* calls will not update the state of the iterator. In such cases, the tracker will move to the state right before the provided MI and use LIS for RP calculations.

UseInternalIterator

Definition at line 512 of file GCNRegPressure.cpp.

References assert(), llvm::GCNRPTracker::CurPressure, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::erase(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::SlotIndex::getBaseIndex(), llvm::SlotIndex::getDeadSlot(), llvm::LiveIntervals::getInstructionIndex(), llvm::LiveIntervals::getInterval(), llvm::LaneBitmask::getNone(), llvm::LiveInterval::hasSubRanges(), llvm::GCNRegPressure::inc(), llvm::SmallSet< T, N, C >::insert(), llvm::GCNRPTracker::LastTrackedMI, llvm::GCNRPTracker::LIS, llvm::LiveRange::liveAt(), llvm::GCNRPTracker::LiveRegs, llvm_unreachable, llvm::max(), llvm::GCNRPTracker::MaxPressure, MI, llvm::GCNRPTracker::MRI, llvm::MachineInstr::operands(), and llvm::LiveInterval::subranges().

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

◆ advanceToNext()

void GCNDownwardRPTracker::advanceToNext ( MachineInstr MI = nullptr,
bool  UseInternalIterator = true 
)

Move to the state at the MI, advanceBeforeNext has to be called first.

If UseInternalIterator is true, then internal iterators are used and set to process in program order. If UseInternalIterator is false, then it is assumed that the tracker is using an externally managed iterator, and advance* calls will not update the state of the iterator. In such cases, the tracker will move to the state at the provided MI .

Definition at line 578 of file GCNRegPressure.cpp.

References llvm::MachineInstr::all_defs(), llvm::GCNRPTracker::CurPressure, getDefRegMask(), llvm::GCNRegPressure::inc(), llvm::GCNRPTracker::LastTrackedMI, llvm::GCNRPTracker::LiveRegs, llvm::max(), llvm::GCNRPTracker::MaxPressure, MI, llvm::GCNRPTracker::MRI, and llvm::skipDebugInstructionsForward().

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

◆ bumpDownwardPressure()

GCNRegPressure GCNDownwardRPTracker::bumpDownwardPressure ( const MachineInstr MI,
const SIRegisterInfo TRI 
) const

◆ getNext()

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

Definition at line 255 of file GCNRegPressure.h.

◆ moveMaxPressure()

GCNRegPressure llvm::GCNDownwardRPTracker::moveMaxPressure ( )
inline

return MaxPressure and clear it.

Definition at line 258 of file GCNRegPressure.h.

References llvm::GCNRegPressure::clear(), and llvm::GCNRPTracker::MaxPressure.

◆ reset() [1/3]

bool GCNDownwardRPTracker::reset ( const MachineInstr MI,
const LiveRegSet LiveRegs = nullptr 
)

Reset tracker to the point before the MI filling LiveRegs upon this point using LIS.

returns false if block is empty except debug values.

Definition at line 499 of file GCNRegPressure.cpp.

References llvm::GCNRPTracker::LastTrackedMI, MI, llvm::GCNRPTracker::MRI, llvm::GCNRPTracker::reset(), and llvm::skipDebugInstructionsForward().

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

◆ reset() [2/3]

void GCNRPTracker::reset ( const MachineInstr MI,
const LiveRegSet LiveRegsCopy,
bool  After 
)

Definition at line 169 of file GCNRegPressure.cpp.

◆ reset() [3/3]

void GCNRPTracker::reset ( const MachineRegisterInfo MRI_,
const LiveRegSet LiveRegs_ 
)

Definition at line 179 of file GCNRegPressure.cpp.


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