19 "amdgpu-expert-scheduling-mode",
20 cl::desc(
"Enable expert scheduling mode 2 for all functions (GFX12+ only)"),
24 return ST.hasExpertSchedulingMode() &&
27 :
F.getFnAttribute(
"amdgpu-expert-scheduling-mode")
64 return "NUM_INST_CNTS";
70 bool HasExtendedWaitCounts =
IV.Major >= 12;
71 if (HasExtendedWaitCounts) {
117#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
161 case AMDGPU::S_WAIT_LOADCNT:
163 case AMDGPU::S_WAIT_EXPCNT:
165 case AMDGPU::S_WAIT_STORECNT:
167 case AMDGPU::S_WAIT_SAMPLECNT:
169 case AMDGPU::S_WAIT_BVHCNT:
171 case AMDGPU::S_WAIT_DSCNT:
173 case AMDGPU::S_WAIT_KMCNT:
175 case AMDGPU::S_WAIT_XCNT:
177 case AMDGPU::S_WAIT_ASYNCCNT:
179 case AMDGPU::S_WAIT_TENSORCNT:
Provides AMDGPU specific target descriptions.
AMD GCN specific subclass of TargetSubtarget.
static const uint32_t IV[8]
Represents the counter values to wait for in an s_waitcnt instruction.
LLVM_DUMP_METHOD void dump() const
unsigned get(InstCounterType T) const
void set(InstCounterType T, unsigned Val)
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned getVmVsrcBitMask()
unsigned getVaVdstBitMask()
iota_range< InstCounterType > inst_counter_types(InstCounterType MaxCounter)
unsigned encodeLoadcntDscnt(const IsaVersion &Version, const Waitcnt &Decoded)
unsigned getStorecntBitMask(const IsaVersion &Version)
unsigned getAsynccntBitMask(const IsaVersion &Version)
static cl::opt< bool > ExpertSchedulingModeFlag("amdgpu-expert-scheduling-mode", cl::desc("Enable expert scheduling mode 2 for all functions (GFX12+ only)"), cl::init(false), cl::Hidden)
Waitcnt decodeWaitcnt(const IsaVersion &Version, unsigned Encoded)
unsigned encodeWaitcnt(const IsaVersion &Version, const Waitcnt &Decoded)
unsigned decodeLgkmcnt(const IsaVersion &Version, unsigned Waitcnt)
unsigned getSamplecntBitMask(const IsaVersion &Version)
bool isExpertSchedulingMode(const GCNSubtarget &ST, const Function &F)
Return whether expert scheduling mode is available and enabled for F.
unsigned getKmcntBitMask(const IsaVersion &Version)
unsigned getVmcntBitMask(const IsaVersion &Version)
unsigned getXcntBitMask(const IsaVersion &Version)
Waitcnt decodeStorecntDscnt(const IsaVersion &Version, unsigned StorecntDscnt)
unsigned getLgkmcntBitMask(const IsaVersion &Version)
unsigned getBvhcntBitMask(const IsaVersion &Version)
unsigned decodeDscnt(const IsaVersion &Version, unsigned Waitcnt)
unsigned getExpcntBitMask(const IsaVersion &Version)
std::optional< AMDGPU::InstCounterType > counterTypeForInstr(unsigned Opcode)
Determine if MI is a gfx12+ single-counter S_WAIT_*CNT instruction, and if so, which counter it is wa...
StringLiteral getInstCounterName(InstCounterType T)
unsigned decodeExpcnt(const IsaVersion &Version, unsigned Waitcnt)
Waitcnt decodeLoadcntDscnt(const IsaVersion &Version, unsigned LoadcntDscnt)
unsigned encodeStorecntDscnt(const IsaVersion &Version, const Waitcnt &Decoded)
unsigned decodeStorecnt(const IsaVersion &Version, unsigned Waitcnt)
unsigned decodeVmcnt(const IsaVersion &Version, unsigned Waitcnt)
unsigned getLoadcntBitMask(const IsaVersion &Version)
unsigned decodeLoadcnt(const IsaVersion &Version, unsigned Waitcnt)
unsigned getDscntBitMask(const IsaVersion &Version)
initializer< Ty > init(const Ty &Val)
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
constexpr auto enum_seq(EnumT Begin, EnumT End)
Iterate over an enum type from Begin up to - but not including - End.
unsigned get(InstCounterType T) const
Instruction set architecture version.