LLVM 23.0.0git
llvm::HardwareUnitInfo Class Reference

HardwareUnitInfo is a wrapper class which maps to some real hardware resource. More...

#include "Target/AMDGPU/AMDGPUCoExecSchedStrategy.h"

Public Member Functions

 HardwareUnitInfo ()
unsigned size ()
unsigned getTotalCycles ()
void setType (unsigned TheType)
AMDGPU::InstructionFlavor getType () const
bool producesCoexecWindow () const
void setProducesCoexecWindow (bool Val)
bool contains (SUnit *SU) const
SUnitgetHigherPriority (SUnit *SU, SUnit *Other) const
void reset ()
SUnitgetNextTargetSU (bool LookDeep=false) const
void insert (SUnit *SU, unsigned BlockingCycles)
 Insert the SU into the AllSUs and account its BlockingCycles into the TotalCycles.
void markScheduled (SUnit *SU, unsigned BlockingCycles)
 Update the state for SU being scheduled by removing it from the AllSus and reducing its BlockingCycles from the TotalCycles.

Detailed Description

HardwareUnitInfo is a wrapper class which maps to some real hardware resource.

This is used to model hardware resource pressure per region, and guide scheduling heuristics.

Definition at line 154 of file AMDGPUCoExecSchedStrategy.h.

Constructor & Destructor Documentation

◆ HardwareUnitInfo()

llvm::HardwareUnitInfo::HardwareUnitInfo ( )
inline

Definition at line 177 of file AMDGPUCoExecSchedStrategy.h.

Member Function Documentation

◆ contains()

bool llvm::HardwareUnitInfo::contains ( SUnit * SU) const
inline

◆ getHigherPriority()

SUnit * llvm::HardwareUnitInfo::getHigherPriority ( SUnit * SU,
SUnit * Other ) const
inline
Returns
true if there is a difference in priority between SU and Other. If so,
the SUnit with higher priority. This method looks through the PrioritySUs to determine if one SU is more prioritized than the other. If neither are in the PrioritySUs list, then neither have priority over each other.

Definition at line 201 of file AMDGPUCoExecSchedStrategy.h.

References llvm::Other.

Referenced by llvm::CandidateHeuristics::tryCriticalResource().

◆ getNextTargetSU()

SUnit * HardwareUnitInfo::getNextTargetSU ( bool LookDeep = false) const
Returns
the next SU in PrioritySUs that is not ready. If LookDeep is set, we will look beyond the PrioritySUs (if all the PrioritySUs are ready) to AllSUs to attempt to find a target SU. When looking through AllSUs we sort pick the target SU by minimal depth for top-down scheduling. getNextTargetSU is useful for determining which SU on this HardwareUnit we are trying to schedule - this info helps us determine which dependencies to schedule. LookDeep is useful if the dependencies are long latency (e.g. memory instructions). If we have many long latency dependencies, it is beneficial to enable SUs multiple levels ahead.

Definition at line 82 of file AMDGPUCoExecSchedStrategy.cpp.

Referenced by llvm::CandidateHeuristics::tryCriticalResourceDependency().

◆ getTotalCycles()

unsigned llvm::HardwareUnitInfo::getTotalCycles ( )
inline

Definition at line 181 of file AMDGPUCoExecSchedStrategy.h.

◆ getType()

◆ insert()

void HardwareUnitInfo::insert ( SUnit * SU,
unsigned BlockingCycles )

Insert the SU into the AllSUs and account its BlockingCycles into the TotalCycles.

This maintains the list of PrioritySUs.

Definition at line 108 of file AMDGPUCoExecSchedStrategy.cpp.

References assert(), and llvm::SUnit::getDepth().

◆ markScheduled()

void HardwareUnitInfo::markScheduled ( SUnit * SU,
unsigned BlockingCycles )

Update the state for SU being scheduled by removing it from the AllSus and reducing its BlockingCycles from the TotalCycles.

This maintains the list of PrioritySUS.

Definition at line 137 of file AMDGPUCoExecSchedStrategy.cpp.

References llvm::SUnit::getDepth().

Referenced by llvm::CandidateHeuristics::updateForScheduling().

◆ producesCoexecWindow()

bool llvm::HardwareUnitInfo::producesCoexecWindow ( ) const
inline

Definition at line 190 of file AMDGPUCoExecSchedStrategy.h.

◆ reset()

void llvm::HardwareUnitInfo::reset ( )
inline

Definition at line 212 of file AMDGPUCoExecSchedStrategy.h.

References llvm::AMDGPU::Other.

◆ setProducesCoexecWindow()

void llvm::HardwareUnitInfo::setProducesCoexecWindow ( bool Val)
inline

Definition at line 192 of file AMDGPUCoExecSchedStrategy.h.

◆ setType()

void llvm::HardwareUnitInfo::setType ( unsigned TheType)
inline

Definition at line 183 of file AMDGPUCoExecSchedStrategy.h.

References assert(), and llvm::AMDGPU::NUM_FLAVORS.

◆ size()

unsigned llvm::HardwareUnitInfo::size ( )
inline

Definition at line 179 of file AMDGPUCoExecSchedStrategy.h.


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