15#ifndef LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H
16#define LLVM_LIB_TARGET_AMDGPU_AMDGPUINSTRINFO_H
43#define GET_BufferIntrinsicKind_DECL
44#include "AMDGPUGenSearchableTables.inc"
72 static std::optional<unsigned> getArg(
uint8_t Arg) {
92 if (
Kind != BufferKindAtomicCmpSwap)
98 if (
Kind != BufferKindLoadToLDS)
112 "buffer intrinsic without an offset");
134 return Arg + (HasChain ? 2 : 1);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Representation of each machine instruction.
A description of a memory reference used in the backend.
const ImageDimIntrinsicInfo * getImageDimIntrinsicByBaseOpcode(unsigned BaseOpcode, unsigned Dim)
const BufferIntrinsicInfo * lookupBufferIntrinsic(unsigned Intr)
unsigned getMIROperandIdx(const MachineInstr &MI, unsigned Arg)
Convert IR argument index Arg of the intrinsic called by MI, a G_INTRINSIC* instruction,...
bool isUniformMMO(const MachineMemOperand *MMO)
Intrinsic::ID getIntrinsicID(const MachineInstr &I)
Return the intrinsic ID for opcodes with the G_AMDGPU_INTRIN_ prefix.
constexpr unsigned getSDOperandIdx(unsigned Arg, bool HasChain=true)
Convert IR argument index Arg of an intrinsic into an operand index of the INTRINSIC_* SelectionDAG n...
const ImageDimIntrinsicInfo * getImageDimIntrinsicInfo(unsigned Intr)
const RsrcIntrinsic * lookupRsrcIntrinsic(unsigned Intr)
This is an optimization pass for GlobalISel generic memory operations.
The argument layout of a buffer intrinsic.
bool IsAsync
Loads to LDS that are asynchronous.
bool isFormatFromRsrc() const
Whether the data is converted according to the format in the resource.
std::optional< unsigned > getSizeArg() const
The access size of loads to LDS and prefetches.
std::optional< unsigned > getImmOffsetArg() const
The immediate offset of loads to LDS.
bool isFormat() const
Whether the data is converted according to a format, drawn either from the resource descriptor (untyp...
std::optional< unsigned > getAuxArg() const
The auxiliary (cache policy) argument.
std::optional< unsigned > getCmpArg() const
The comparison value for compare-and-swap atomics.
std::optional< unsigned > getVDataArg() const
The stored value for stores and atomics.
bool IsFormatFromRsrc
The data is converted according to the format in the resource (the *_format intrinsics).
unsigned getOffsetArg() const
The main offset: the voffset if there is one, and the soffset otherwise.
std::optional< unsigned > getVOffsetArg() const
The voffset, which scalar loads and prefetches don't have.
std::optional< unsigned > getSOffsetArg() const
The soffset, which is the only offset of scalar loads and prefetches.
std::optional< unsigned > getLDSPtrArg() const
The LDS destination of loads to LDS.
std::optional< unsigned > getVIndexArg() const
std::optional< unsigned > getFormatArg() const
static constexpr uint8_t NoArg
The position of absent arguments, (uint8_t)-1.
unsigned AtomicNoRetBaseOpcode