LLVM 24.0.0git
llvm::AMDGPU::CoExecInfo Struct Reference

Co-execution characteristics for a multi-cycle instruction. More...

#include "Target/AMDGPU/AMDGPUCoExecInfo.h"

Public Member Functions

 CoExecInfo ()
 Default constructor - initialize to safe defaults.
CoExecMaskT getMask (unsigned Stage) const
 Get capability mask for a stage.
bool canCoExec (CoExecMaskT InstMask, unsigned Stage) const
 Check if an instruction class mask can co-execute at a given stage.
std::optional< unsignedfindNextAllowedStage (CoExecMaskT InstMask, unsigned FromStage) const
 Find next stage where the instruction class is allowed.
unsigned getStallCycles (CoExecMaskT InstMask, unsigned Stage) const
 Return the number of cycles an instruction matching InstMask must wait at Stage.
CoExecStageType getType (unsigned Stage) const
 Get stage type for a specific stage.

Static Public Member Functions

static CoExecStageType getStageType (CoExecMaskT Mask)
 Get stage type from mask for display.
static CoExecInfo build (unsigned UnitOccupancy, unsigned TotalWindow, const char *Pattern)
 Build a CoExecInfo from an occupancy and stage pattern.

Public Attributes

unsigned UnitOccupancy = 0
 Number of cycles for which the producing instruction occupies its execution unit.
unsigned TotalWindow = 0
 Number of cycles in the co-execution window, counting any trailing vacant stages.
CoExecSlotInfo Slots [MaxCoExecStages]
 Per-stage slot info (capability mask).
StringRef Pattern
 Pattern string for display (e.g., "0EIIEEIIV").

Detailed Description

Co-execution characteristics for a multi-cycle instruction.

Definition at line 237 of file AMDGPUCoExecInfo.h.

Constructor & Destructor Documentation

◆ CoExecInfo()

llvm::AMDGPU::CoExecInfo::CoExecInfo ( )
inline

Default constructor - initialize to safe defaults.

Definition at line 250 of file AMDGPUCoExecInfo.h.

References llvm::AMDGPU::All, llvm::AMDGPU::I, llvm::AMDGPU::MaxCoExecStages, and Slots.

Referenced by build().

Member Function Documentation

◆ build()

CoExecInfo llvm::AMDGPU::CoExecInfo::build ( unsigned UnitOccupancy,
unsigned TotalWindow,
const char * Pattern )
inlinestatic

Build a CoExecInfo from an occupancy and stage pattern.

Build CoExecInfo from a pattern string.

Pattern chars: '0'=E0, 'E'=External, 'I'=Internal, 'V'=Vacant, 'S'=Internal+ScaleWMMAAbsorb (I plus next scaled WMMA), 'T'=TRANS co-exec (all except TRANS), 'A'=Any

Definition at line 332 of file AMDGPUCoExecInfo.h.

References llvm::AMDGPU::All, assert(), CoExecInfo(), llvm::AMDGPU::I, llvm::AMDGPU::MaxCoExecStages, Pattern, llvm::AMDGPU::StageE, llvm::AMDGPU::StageE0, llvm::AMDGPU::StageI, llvm::AMDGPU::StageIS, llvm::AMDGPU::StageTR, llvm::AMDGPU::StageV, TotalWindow, and UnitOccupancy.

Referenced by llvm::AMDGPU::getCoExecInfo(), and llvm::AMDGPU::getMFMACoExecInfo().

◆ canCoExec()

bool llvm::AMDGPU::CoExecInfo::canCoExec ( CoExecMaskT InstMask,
unsigned Stage ) const
inline

Check if an instruction class mask can co-execute at a given stage.

Definition at line 261 of file AMDGPUCoExecInfo.h.

References Slots, and TotalWindow.

Referenced by getStallCycles().

◆ findNextAllowedStage()

std::optional< unsigned > llvm::AMDGPU::CoExecInfo::findNextAllowedStage ( CoExecMaskT InstMask,
unsigned FromStage ) const
inline

Find next stage where the instruction class is allowed.

Definition at line 268 of file AMDGPUCoExecInfo.h.

References llvm::AMDGPU::I, Slots, and TotalWindow.

Referenced by getStallCycles().

◆ getMask()

CoExecMaskT llvm::AMDGPU::CoExecInfo::getMask ( unsigned Stage) const
inline

Get capability mask for a stage.

Definition at line 256 of file AMDGPUCoExecInfo.h.

References llvm::AMDGPU::All, Slots, and TotalWindow.

Referenced by getType().

◆ getStageType()

◆ getStallCycles()

unsigned llvm::AMDGPU::CoExecInfo::getStallCycles ( CoExecMaskT InstMask,
unsigned Stage ) const
inline

Return the number of cycles an instruction matching InstMask must wait at Stage.

Returns zero when no stall is required.

Definition at line 279 of file AMDGPUCoExecInfo.h.

References canCoExec(), findNextAllowedStage(), llvm::Next, and TotalWindow.

◆ getType()

CoExecStageType llvm::AMDGPU::CoExecInfo::getType ( unsigned Stage) const
inline

Get stage type for a specific stage.

Definition at line 315 of file AMDGPUCoExecInfo.h.

References getMask(), and getStageType().

Member Data Documentation

◆ Pattern

StringRef llvm::AMDGPU::CoExecInfo::Pattern

Pattern string for display (e.g., "0EIIEEIIV").

Definition at line 247 of file AMDGPUCoExecInfo.h.

Referenced by build(), and llvm::AMDGPU::getMFMACoExecInfo().

◆ Slots

CoExecSlotInfo llvm::AMDGPU::CoExecInfo::Slots[MaxCoExecStages]

Per-stage slot info (capability mask).

Definition at line 245 of file AMDGPUCoExecInfo.h.

Referenced by canCoExec(), CoExecInfo(), findNextAllowedStage(), getMask(), and llvm::AMDGPU::getMFMACoExecInfo().

◆ TotalWindow

unsigned llvm::AMDGPU::CoExecInfo::TotalWindow = 0

Number of cycles in the co-execution window, counting any trailing vacant stages.

Definition at line 243 of file AMDGPUCoExecInfo.h.

Referenced by build(), canCoExec(), findNextAllowedStage(), getMask(), llvm::AMDGPU::getMFMACoExecInfo(), and getStallCycles().

◆ UnitOccupancy

unsigned llvm::AMDGPU::CoExecInfo::UnitOccupancy = 0

Number of cycles for which the producing instruction occupies its execution unit.

Definition at line 240 of file AMDGPUCoExecInfo.h.

Referenced by build().


The documentation for this struct was generated from the following file: