LLVM 24.0.0git
llvm::GCNRPTracker Class Reference

#include "Target/AMDGPU/GCNRegPressure.h"

Inheritance diagram for llvm::GCNRPTracker:
[legend]

Public Types

using LiveRegSet = DenseMap<unsigned, LaneBitmask>

Public Member Functions

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 ()
void setPressureCallback (std::function< void(const GCNRegPressure &)> CB)
 Sets a function that the tracker calls with the pressure of every program point that it folds into the maximum pressure.
GCNRegPressure getPressure () const
decltype(LiveRegs) moveLiveRegs ()

Protected Member Functions

 GCNRPTracker (LiveIntervals &LIS_)
void updateMaxPressure (const GCNRegPressure &RP)
 Folds the pressure RP of one program point into MaxPressure and passes it to the pressure callback.
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

LiveIntervals & LIS
LiveRegSet LiveRegs
GCNRegPressure CurPressure
GCNRegPressure MaxPressure
MachineBasicBlock::const_iterator LastTrackedMI
const MachineRegisterInfo * MRI = nullptr
std::function< void(const GCNRegPressure &)> PressureCallback

Detailed Description

Definition at line 332 of file GCNRegPressure.h.

Member Typedef Documentation

◆ LiveRegSet

Constructor & Destructor Documentation

◆ GCNRPTracker()

llvm::GCNRPTracker::GCNRPTracker ( LiveIntervals & LIS_)
inlineprotected

Member Function Documentation

◆ clearMaxPressure()

void llvm::GCNRPTracker::clearMaxPressure ( )
inline

Definition at line 376 of file GCNRegPressure.h.

References MaxPressure.

◆ getLastTrackedMI()

const MachineInstr * llvm::GCNRPTracker::getLastTrackedMI ( ) const
inline

Definition at line 372 of file GCNRegPressure.h.

References LastTrackedMI.

◆ getLastUsedLanes()

LaneBitmask GCNRPTracker::getLastUsedLanes ( Register Reg,
SlotIndex Pos ) const
protected

◆ getLiveRegs()

const decltype(LiveRegs) & llvm::GCNRPTracker::getLiveRegs ( ) const
inline

Definition at line 371 of file GCNRegPressure.h.

References LiveRegs.

Referenced by llvm::GCNRegPressurePrinter::runOnMachineFunction().

◆ getMaxPressure()

const GCNRegPressure & llvm::GCNRPTracker::getMaxPressure ( ) const
inline

Definition at line 378 of file GCNRegPressure.h.

References MaxPressure.

Referenced by llvm::GCNRegPressurePrinter::runOnMachineFunction().

◆ getPressure()

GCNRegPressure llvm::GCNRPTracker::getPressure ( ) const
inline

◆ moveLiveRegs()

decltype(LiveRegs) llvm::GCNRPTracker::moveLiveRegs ( )
inline

Definition at line 391 of file GCNRegPressure.h.

References LiveRegs.

◆ reset() [1/4]

void GCNRPTracker::reset ( const MachineBasicBlock & MBB,
bool End )
protected

Resets tracker at the start or End of the MBB.

Definition at line 554 of file GCNRegPressure.cpp.

References llvm::End, LIS, MBB, and reset().

◆ reset() [2/4]

void GCNRPTracker::reset ( const MachineInstr & MI,
bool After )
protected

Resets tracker before or After the provided MI, which can be a debug instruction.

Definition at line 526 of file GCNRegPressure.cpp.

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

Referenced by llvm::GCNDownwardRPTracker::reset(), reset(), and reset().

◆ reset() [3/4]

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

Resets tracker with the provided LiveRegs.

Definition at line 567 of file GCNRegPressure.cpp.

References CurPressure, llvm::getRegPressure(), LastTrackedMI, LiveRegs, MaxPressure, and MRI.

◆ reset() [4/4]

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

Resets tracker at the specified slot index SI.

Definition at line 560 of file GCNRegPressure.cpp.

References CurPressure, llvm::getLiveRegs(), llvm::getRegPressure(), LastTrackedMI, LIS, LiveRegs, MaxPressure, and MRI.

◆ resetMaxPressure()

void llvm::GCNRPTracker::resetMaxPressure ( )
inline

◆ setPressureCallback()

void llvm::GCNRPTracker::setPressureCallback ( std::function< void(const GCNRegPressure &)> CB)
inline

Sets a function that the tracker calls with the pressure of every program point that it folds into the maximum pressure.

A user can compute there a maximum that maxPerRegFile() does not keep, e.g. of one register kind.

Definition at line 385 of file GCNRegPressure.h.

References PressureCallback.

Referenced by llvm::dumpMaxRegPressure().

◆ updateMaxPressure()

void llvm::GCNRPTracker::updateMaxPressure ( const GCNRegPressure & RP)
inlineprotected

Folds the pressure RP of one program point into MaxPressure and passes it to the pressure callback.

Definition at line 348 of file GCNRegPressure.h.

References llvm::maxPerRegFile(), MaxPressure, and PressureCallback.

Referenced by llvm::GCNDownwardRPTrackerBase::addDefs(), llvm::GCNUpwardRPTracker::recede(), llvm::GCNDownwardRPTrackerBase::retireDeadDefs(), and llvm::GCNDownwardRPTrackerBase::retireDeadUses().

Member Data Documentation

◆ CurPressure

◆ LastTrackedMI

◆ LIS

◆ LiveRegs

◆ MaxPressure

◆ MRI

◆ PressureCallback

std::function<void(const GCNRegPressure &)> llvm::GCNRPTracker::PressureCallback
protected

Definition at line 342 of file GCNRegPressure.h.

Referenced by setPressureCallback(), and updateMaxPressure().


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