9#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUWAITCNTUTILS_H
10#define LLVM_LIB_TARGET_AMDGPU_AMDGPUWAITCNTUTILS_H
84 std::array<unsigned, NUM_INST_CNTS> Cnt;
92 Waitcnt(
unsigned VmCnt,
unsigned ExpCnt,
unsigned LgkmCnt,
unsigned VsCnt)
101 Waitcnt(
unsigned LoadCnt,
unsigned ExpCnt,
unsigned DsCnt,
unsigned StoreCnt,
102 unsigned SampleCnt,
unsigned BvhCnt,
unsigned KmCnt,
unsigned XCnt,
103 unsigned AsyncCnt,
unsigned TensorCnt,
unsigned VaVdst,
121 return any_of(Cnt, [](
unsigned Val) {
return Val != ~0u; });
164#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Provides some synthesis utilities to produce sequences of values.
static const uint32_t IV[8]
Represents the counter values to wait for in an s_waitcnt instruction.
void print(raw_ostream &OS) const
void add(AMDGPU::InstCounterType T, unsigned Count)
bool hasWaitDepctr() const
Waitcnt(unsigned LoadCnt, unsigned ExpCnt, unsigned DsCnt, unsigned StoreCnt, unsigned SampleCnt, unsigned BvhCnt, unsigned KmCnt, unsigned XCnt, unsigned AsyncCnt, unsigned TensorCnt, unsigned VaVdst, unsigned VmVsrc)
LLVM_DUMP_METHOD void dump() const
bool hasWaitExceptStoreCnt() const
bool hasWaitStoreCnt() const
Waitcnt(unsigned VmCnt, unsigned ExpCnt, unsigned LgkmCnt, unsigned VsCnt)
Waitcnt combined(const Waitcnt &Other) const
unsigned get(InstCounterType T) const
friend raw_ostream & operator<<(raw_ostream &OS, const AMDGPU::Waitcnt &Wait)
void clear(AMDGPU::InstCounterType T)
void set(InstCounterType T, unsigned Val)
A helper class to return the specified delimiter string after the first invocation of operator String...
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
This class implements an extremely fast bulk output stream that can only output to a stream.
iota_range< InstCounterType > inst_counter_types(InstCounterType MaxCounter)
unsigned encodeLoadcntDscnt(const IsaVersion &Version, const Waitcnt &Decoded)
Waitcnt decodeWaitcnt(const IsaVersion &Version, unsigned Encoded)
unsigned encodeWaitcnt(const IsaVersion &Version, const Waitcnt &Decoded)
Waitcnt decodeStorecntDscnt(const IsaVersion &Version, unsigned StorecntDscnt)
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)
Waitcnt decodeLoadcntDscnt(const IsaVersion &Version, unsigned LoadcntDscnt)
unsigned encodeStorecntDscnt(const IsaVersion &Version, const Waitcnt &Decoded)
This is an optimization pass for GlobalISel generic memory operations.
void fill(R &&Range, T &&Value)
Provide wrappers to std::fill which take ranges instead of having to pass begin/end explicitly.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
FunctionAddr VTableAddr uintptr_t uintptr_t Version
FunctionAddr VTableAddr Count
unsigned get(InstCounterType T) const
Instruction set architecture version.
static constexpr bool is_iterable