24#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUCOEXECINFO_H
25#define LLVM_LIB_TARGET_AMDGPU_AMDGPUCOEXECINFO_H
264 return any(
Slots[Stage].Mask & InstMask);
269 unsigned FromStage)
const {
271 if (any(
Slots[
I].Mask & InstMask))
284 if (std::optional<unsigned>
Next =
286 return *
Next - Stage;
339 "Pattern must describe every cycle of the co-execution window");
342 for (
unsigned I = 0;
I < Info.TotalWindow; ++
I) {
378 unsigned Opc =
MI.getOpcode();
387 bool HasScaling = InstInfo && InstInfo->HasMatrixScale;
393 TII.getNamedOperand(
MI, AMDGPU::OpName::matrix_a_fmt)) {
395 TII.getNamedOperand(
MI, AMDGPU::OpName::matrix_b_fmt);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
const HexagonInstrInfo * TII
Interface definition for SIInstrInfo.
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
CoExecMask
Bitmask for instruction types allowed to co-execute at a stage.
const char * getCoExecMaskName(CoExecMaskT Mask)
Return a human-readable name for a mask holding a single instruction class, as produced by getCoExecM...
InstructionFlavor
Classification of instructions by execution characteristics.
@ LLVM_MARK_AS_BITMASK_ENUM
constexpr unsigned MaxCoExecStages
Max stages: INT8 16x16x64 = 17 cycles, round up for safety.
const char * getStageTypeName(CoExecStageType T)
CoExecInfo getMFMACoExecInfo(unsigned Opcode)
Get co-execution info for a gfx950 MFMA instruction.
constexpr StringRef getFlavorName(InstructionFlavor F)
CoExecStageType
Stage type for co-execution (for annotation/display).
CoExecInfo getCoExecInfo(const MachineInstr &MI, const SIInstrInfo &TII)
Get co-execution info for a WMMA instruction, selecting the per-cycle slot pattern from the opcode (a...
InstructionFlavor classifyFlavor(const MachineInstr &MI, const SIInstrInfo &SII)
Classify MI into the execution flavor that drives both the scheduler's slot preferences and the hazar...
constexpr CoExecMaskT getCoExecMask(InstructionFlavor F)
Map a flavor to the co-execution class it occupies in a window slot.
WMMAVariant
Normalized WMMA or SWMMAC family used to select co-execution rules.
@ F8F6F4_16x16x128_BothF4
This is an optimization pass for GlobalISel generic memory operations.
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Next
Co-execution characteristics for a multi-cycle instruction.
CoExecStageType getType(unsigned Stage) const
Get stage type for a specific stage.
CoExecMaskT getMask(unsigned Stage) const
Get capability mask for a stage.
unsigned UnitOccupancy
Number of cycles for which the producing instruction occupies its execution unit.
unsigned TotalWindow
Number of cycles in the co-execution window, counting any trailing vacant stages.
unsigned getStallCycles(CoExecMaskT InstMask, unsigned Stage) const
Return the number of cycles an instruction matching InstMask must wait at Stage.
bool canCoExec(CoExecMaskT InstMask, unsigned Stage) const
Check if an instruction class mask can co-execute at a given stage.
StringRef Pattern
Pattern string for display (e.g., "0EIIEEIIV").
static CoExecInfo build(unsigned UnitOccupancy, unsigned TotalWindow, const char *Pattern)
Build a CoExecInfo from an occupancy and stage pattern.
CoExecInfo()
Default constructor - initialize to safe defaults.
std::optional< unsigned > findNextAllowedStage(CoExecMaskT InstMask, unsigned FromStage) const
Find next stage where the instruction class is allowed.
static CoExecStageType getStageType(CoExecMaskT Mask)
Get stage type from mask for display.
CoExecSlotInfo Slots[MaxCoExecStages]
Per-stage slot info (capability mask).
Per-slot info: which instruction classes may co-execute here.