10 #ifndef LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUBASEINFO_H
11 #define LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUBASEINFO_H
29 class MachineMemOperand;
31 class MCRegisterClass;
34 class MCSubtargetInfo;
69 unsigned FlatWorkGroupSize);
78 unsigned FlatWorkGroupSize);
91 unsigned FlatWorkGroupSize);
102 unsigned FlatWorkGroupSize);
180 std::pair<int, int> Default,
181 bool OnlyFirstRequired =
false);
214 unsigned &Vmcnt,
unsigned &Expcnt,
unsigned &Lgkmcnt);
241 unsigned Vmcnt,
unsigned Expcnt,
unsigned Lgkmcnt);
364 #endif // LLVM_LIB_TARGET_AMDGPU_UTILS_AMDGPUBASEINFO_H
unsigned getMinNumVGPRs(const FeatureBitset &Features, unsigned WavesPerEU)
unsigned mc2PseudoReg(unsigned Reg)
Convert hardware register Reg to a pseudo register.
unsigned getAddressableNumVGPRs(const FeatureBitset &Features)
bool isGroupSegment(const GlobalValue *GV, AMDGPUAS AS)
Describe properties that are true of each instruction in the target description file.
MachineInstrBuilder MachineInstrBuilder &DefMI const MCInstrDesc & Desc
unsigned getMaxWorkGroupsPerCU(const FeatureBitset &Features, unsigned FlatWorkGroupSize)
unsigned getRegBitWidth(unsigned RCID)
Get the size in bits of a register from the register class RC.
unsigned getTotalNumVGPRs(const FeatureBitset &Features)
unsigned getMinWavesPerEU(const FeatureBitset &Features)
bool isInlinableLiteralV216(int32_t Literal, bool HasInv2Pi)
unsigned getWavesPerWorkGroup(const FeatureBitset &Features, unsigned FlatWorkGroupSize)
std::pair< int, int > getIntegerPairAttribute(const Function &F, StringRef Name, std::pair< int, int > Default, bool OnlyFirstRequired)
unsigned getVGPREncodingGranule(const FeatureBitset &Features)
bool isInlinableLiteral16(int16_t Literal, bool HasInv2Pi)
LLVM_READONLY int16_t getNamedOperandIdx(uint16_t Opcode, uint16_t NamedIdx)
unsigned getEUsPerCU(const FeatureBitset &Features)
A description of a memory reference used in the backend.
unsigned getWavefrontSize(const FeatureBitset &Features)
bool isGlobalSegment(const GlobalValue *GV, AMDGPUAS AS)
unsigned getVGPRAllocGranule(const FeatureBitset &Features)
bool isRegIntersect(unsigned Reg0, unsigned Reg1, const MCRegisterInfo *TRI)
Is there any intersection between registers.
OpenCL uses address spaces to differentiate between various memory regions on the hardware...
AMD Kernel Code Object (amd_kernel_code_t).
unsigned getRegOperandSize(const MCRegisterInfo *MRI, const MCInstrDesc &Desc, unsigned OpNo)
Get size of register operand.
Reg
All possible values of the reg field in the ModR/M byte.
unsigned getMinFlatWorkGroupSize(const FeatureBitset &Features)
unsigned encodeLgkmcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt, unsigned Lgkmcnt)
unsigned decodeLgkmcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt)
unsigned encodeExpcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt, unsigned Expcnt)
unsigned getMaxWavesPerCU(const FeatureBitset &Features)
unsigned getMaxNumSGPRs(const FeatureBitset &Features, unsigned WavesPerEU, bool Addressable)
unsigned getWaitcntBitMask(const IsaInfo::IsaVersion &Version)
uint8_t OperandType
Information about the type of the operand.
unsigned getMaxWavesPerEU(const FeatureBitset &Features)
unsigned getMaxFlatWorkGroupSize(const FeatureBitset &Features)
MCRegisterClass - Base class of TargetRegisterClass.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
bool isSISrcFPOperand(const MCInstrDesc &Desc, unsigned OpNo)
Is this floating-point operand?
SPIR_KERNEL - Calling convention for SPIR kernel functions.
int64_t getSMRDEncodedOffset(const MCSubtargetInfo &ST, int64_t ByteOffset)
bool isCompute(CallingConv::ID cc)
bool isInlinableLiteral64(int64_t Literal, bool HasInv2Pi)
Is this literal inlinable.
bool isSI(const MCSubtargetInfo &STI)
unsigned const MachineRegisterInfo * MRI
Container class for subtarget features.
void decodeWaitcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt, unsigned &Vmcnt, unsigned &Expcnt, unsigned &Lgkmcnt)
Decodes Vmcnt, Expcnt and Lgkmcnt from given Waitcnt for given isa Version, and writes decoded values...
unsigned getTotalNumSGPRs(const FeatureBitset &Features)
bool isEntryFunctionCC(CallingConv::ID CC)
unsigned getMinNumSGPRs(const FeatureBitset &Features, unsigned WavesPerEU)
Instruction set architecture version.
bool isLegalSMRDImmOffset(const MCSubtargetInfo &ST, int64_t ByteOffset)
bool isSISrcInlinableOperand(const MCInstrDesc &Desc, unsigned OpNo)
Does this opearnd support only inlinable literals?
void initDefaultAMDKernelCodeT(amd_kernel_code_t &Header, const FeatureBitset &Features)
Operands with register or inline constant.
Triple - Helper class for working with autoconf configuration names.
unsigned decodeVmcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt)
unsigned getLgkmcntBitMask(const IsaInfo::IsaVersion &Version)
LLVM_READNONE bool isKernel(CallingConv::ID CC)
unsigned getExpcntBitMask(const IsaInfo::IsaVersion &Version)
unsigned encodeVmcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt, unsigned Vmcnt)
bool isShader(CallingConv::ID cc)
bool isCI(const MCSubtargetInfo &STI)
llvm_unreachable("Unknown RegBank!")
unsigned getInitialPSInputAddr(const Function &F)
bool isGFX9(const MCSubtargetInfo &STI)
bool isVI(const MCSubtargetInfo &STI)
unsigned decodeExpcnt(const IsaInfo::IsaVersion &Version, unsigned Waitcnt)
unsigned encodeWaitcnt(const IsaInfo::IsaVersion &Version, unsigned Vmcnt, unsigned Expcnt, unsigned Lgkmcnt)
Encodes Vmcnt, Expcnt and Lgkmcnt into Waitcnt for given isa Version.
int getIntegerAttribute(const Function &F, StringRef Name, int Default)
MCSubtargetInfo - Generic base class for all target subtargets.
bool shouldEmitConstantsToTextSection(const Triple &TT)
unsigned getVmcntBitMask(const IsaInfo::IsaVersion &Version)
bool isUniformMMO(const MachineMemOperand *MMO)
unsigned getAddressableNumSGPRs(const FeatureBitset &Features)
Operands with register or 32-bit immediate.
unsigned getSGPREncodingGranule(const FeatureBitset &Features)
bool isSISrcOperand(const MCInstrDesc &Desc, unsigned OpNo)
Can this operand also contain immediate values?
bool isInlinableLiteral32(int32_t Literal, bool HasInv2Pi)
bool isReadOnlySegment(const GlobalValue *GV, AMDGPUAS AS)
const FeatureBitset Features
const MCOperandInfo * OpInfo
LLVM_READNONE unsigned getOperandSize(const MCOperandInfo &OpInfo)
unsigned getMCReg(unsigned Reg, const MCSubtargetInfo &STI)
If Reg is a pseudo reg, return the correct hardware register given STI otherwise return Reg...
unsigned getSGPRAllocGranule(const FeatureBitset &Features)
unsigned getLocalMemorySize(const FeatureBitset &Features)
StringRef - Represent a constant reference to a string, i.e.
bool isSGPR(unsigned Reg, const MCRegisterInfo *TRI)
Is Reg - scalar register.
unsigned getMaxNumVGPRs(const FeatureBitset &Features, unsigned WavesPerEU)
This holds information about one operand of a machine instruction, indicating the register class for ...
Calling convention for AMDGPU code object kernels.
IsaVersion getIsaVersion(const FeatureBitset &Features)