LLVM  8.0.1
Classes | Namespaces | Macros | Functions
AMDGPUBaseInfo.cpp File Reference
#include "AMDGPUBaseInfo.h"
#include "AMDGPUTargetTransformInfo.h"
#include "AMDGPU.h"
#include "SIDefines.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/SubtargetFeature.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstring>
#include <utility>
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "AMDGPUGenInstrInfo.inc"
#include "AMDGPUGenSearchableTables.inc"
Include dependency graph for AMDGPUBaseInfo.cpp:

Go to the source code of this file.

Classes

struct  llvm::AMDGPU::MIMGInfo
 
struct  llvm::AMDGPU::MUBUFInfo
 

Namespaces

 llvm
 This class represents lattice values for constants.
 
 llvm::AMDGPU
 
 llvm::AMDGPU::IsaInfo
 

Macros

#define GET_INSTRINFO_NAMED_OPS
 
#define GET_INSTRMAP_INFO
 
#define GET_MIMGBaseOpcodesTable_IMPL
 
#define GET_MIMGDimInfoTable_IMPL
 
#define GET_MIMGInfoTable_IMPL
 
#define GET_MIMGLZMappingTable_IMPL
 
#define GET_MUBUFInfoTable_DECL
 
#define GET_MUBUFInfoTable_IMPL
 
#define MAP_REG2REG
 
#define CASE_CI_VI(node)
 
#define CASE_VI_GFX9(node)   case node: return isGFX9(STI) ? node##_gfx9 : node##_vi;
 
#define CASE_CI_VI(node)   case node##_ci: case node##_vi: return node;
 
#define CASE_VI_GFX9(node)   case node##_vi: case node##_gfx9: return node;
 
#define GET_SourcesOfDivergence_IMPL
 

Functions

int llvm::AMDGPU::getMIMGOpcode (unsigned BaseOpcode, unsigned MIMGEncoding, unsigned VDataDwords, unsigned VAddrDwords)
 
int llvm::AMDGPU::getMaskedMIMGOp (unsigned Opc, unsigned NewChannels)
 
int llvm::AMDGPU::getMUBUFBaseOpcode (unsigned Opc)
 
int llvm::AMDGPU::getMUBUFOpcode (unsigned BaseOpc, unsigned Dwords)
 
int llvm::AMDGPU::getMUBUFDwords (unsigned Opc)
 
bool llvm::AMDGPU::getMUBUFHasVAddr (unsigned Opc)
 
bool llvm::AMDGPU::getMUBUFHasSrsrc (unsigned Opc)
 
bool llvm::AMDGPU::getMUBUFHasSoffset (unsigned Opc)
 
int llvm::AMDGPU::getMCOpcode (uint16_t Opcode, unsigned Gen)
 
void llvm::AMDGPU::IsaInfo::streamIsaVersion (const MCSubtargetInfo *STI, raw_ostream &Stream)
 Streams isa version string for given subtarget STI into Stream. More...
 
bool llvm::AMDGPU::IsaInfo::hasCodeObjectV3 (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getWavefrontSize (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getLocalMemorySize (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getEUsPerCU (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getMaxWorkGroupsPerCU (const MCSubtargetInfo *STI, unsigned FlatWorkGroupSize)
 
unsigned llvm::AMDGPU::IsaInfo::getMaxWavesPerCU (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getMaxWavesPerCU (const MCSubtargetInfo *STI, unsigned FlatWorkGroupSize)
 
unsigned llvm::AMDGPU::IsaInfo::getMinWavesPerEU (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getMaxWavesPerEU ()
 
unsigned llvm::AMDGPU::IsaInfo::getMaxWavesPerEU (const MCSubtargetInfo *STI, unsigned FlatWorkGroupSize)
 
unsigned llvm::AMDGPU::IsaInfo::getMinFlatWorkGroupSize (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getMaxFlatWorkGroupSize (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getWavesPerWorkGroup (const MCSubtargetInfo *STI, unsigned FlatWorkGroupSize)
 
unsigned llvm::AMDGPU::IsaInfo::getSGPRAllocGranule (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getSGPREncodingGranule (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getTotalNumSGPRs (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getAddressableNumSGPRs (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getMinNumSGPRs (const MCSubtargetInfo *STI, unsigned WavesPerEU)
 
unsigned llvm::AMDGPU::IsaInfo::getMaxNumSGPRs (const MCSubtargetInfo *STI, unsigned WavesPerEU, bool Addressable)
 
unsigned llvm::AMDGPU::IsaInfo::getNumExtraSGPRs (const MCSubtargetInfo *STI, bool VCCUsed, bool FlatScrUsed, bool XNACKUsed)
 
unsigned llvm::AMDGPU::IsaInfo::getNumExtraSGPRs (const MCSubtargetInfo *STI, bool VCCUsed, bool FlatScrUsed)
 
unsigned llvm::AMDGPU::IsaInfo::getNumSGPRBlocks (const MCSubtargetInfo *STI, unsigned NumSGPRs)
 
unsigned llvm::AMDGPU::IsaInfo::getVGPRAllocGranule (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getVGPREncodingGranule (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getTotalNumVGPRs (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getAddressableNumVGPRs (const MCSubtargetInfo *STI)
 
unsigned llvm::AMDGPU::IsaInfo::getMinNumVGPRs (const MCSubtargetInfo *STI, unsigned WavesPerEU)
 
unsigned llvm::AMDGPU::IsaInfo::getMaxNumVGPRs (const MCSubtargetInfo *STI, unsigned WavesPerEU)
 
unsigned llvm::AMDGPU::IsaInfo::getNumVGPRBlocks (const MCSubtargetInfo *STI, unsigned NumVGPRs)
 
void llvm::AMDGPU::initDefaultAMDKernelCodeT (amd_kernel_code_t &Header, const MCSubtargetInfo *STI)
 
amdhsa::kernel_descriptor_t llvm::AMDGPU::getDefaultAmdhsaKernelDescriptor ()
 
bool llvm::AMDGPU::isGroupSegment (const GlobalValue *GV)
 
bool llvm::AMDGPU::isGlobalSegment (const GlobalValue *GV)
 
bool llvm::AMDGPU::isReadOnlySegment (const GlobalValue *GV)
 
bool llvm::AMDGPU::shouldEmitConstantsToTextSection (const Triple &TT)
 
int llvm::AMDGPU::getIntegerAttribute (const Function &F, StringRef Name, int Default)
 
std::pair< int, int > llvm::AMDGPU::getIntegerPairAttribute (const Function &F, StringRef Name, std::pair< int, int > Default, bool OnlyFirstRequired)
 
unsigned llvm::AMDGPU::getVmcntBitMask (const IsaVersion &Version)
 
unsigned llvm::AMDGPU::getExpcntBitMask (const IsaVersion &Version)
 
unsigned llvm::AMDGPU::getLgkmcntBitMask (const IsaVersion &Version)
 
unsigned llvm::AMDGPU::getWaitcntBitMask (const IsaVersion &Version)
 
unsigned llvm::AMDGPU::decodeVmcnt (const IsaVersion &Version, unsigned Waitcnt)
 
unsigned llvm::AMDGPU::decodeExpcnt (const IsaVersion &Version, unsigned Waitcnt)
 
unsigned llvm::AMDGPU::decodeLgkmcnt (const IsaVersion &Version, unsigned Waitcnt)
 
void llvm::AMDGPU::decodeWaitcnt (const 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 into Vmcnt, Expcnt and Lgkmcnt respectively. More...
 
Waitcnt llvm::AMDGPU::decodeWaitcnt (const IsaVersion &Version, unsigned Encoded)
 
unsigned llvm::AMDGPU::encodeVmcnt (const IsaVersion &Version, unsigned Waitcnt, unsigned Vmcnt)
 
unsigned llvm::AMDGPU::encodeExpcnt (const IsaVersion &Version, unsigned Waitcnt, unsigned Expcnt)
 
unsigned llvm::AMDGPU::encodeLgkmcnt (const IsaVersion &Version, unsigned Waitcnt, unsigned Lgkmcnt)
 
unsigned llvm::AMDGPU::encodeWaitcnt (const IsaVersion &Version, unsigned Vmcnt, unsigned Expcnt, unsigned Lgkmcnt)
 Encodes Vmcnt, Expcnt and Lgkmcnt into Waitcnt for given isa Version. More...
 
unsigned llvm::AMDGPU::encodeWaitcnt (const IsaVersion &Version, const Waitcnt &Decoded)
 
unsigned llvm::AMDGPU::getInitialPSInputAddr (const Function &F)
 
bool llvm::AMDGPU::isShader (CallingConv::ID cc)
 
bool llvm::AMDGPU::isCompute (CallingConv::ID cc)
 
bool llvm::AMDGPU::isEntryFunctionCC (CallingConv::ID CC)
 
bool llvm::AMDGPU::hasXNACK (const MCSubtargetInfo &STI)
 
bool llvm::AMDGPU::hasSRAMECC (const MCSubtargetInfo &STI)
 
bool llvm::AMDGPU::hasMIMG_R128 (const MCSubtargetInfo &STI)
 
bool llvm::AMDGPU::hasPackedD16 (const MCSubtargetInfo &STI)
 
bool llvm::AMDGPU::isSI (const MCSubtargetInfo &STI)
 
bool llvm::AMDGPU::isCI (const MCSubtargetInfo &STI)
 
bool llvm::AMDGPU::isVI (const MCSubtargetInfo &STI)
 
bool llvm::AMDGPU::isGFX9 (const MCSubtargetInfo &STI)
 
bool llvm::AMDGPU::isGCN3Encoding (const MCSubtargetInfo &STI)
 
bool llvm::AMDGPU::isSGPR (unsigned Reg, const MCRegisterInfo *TRI)
 Is Reg - scalar register. More...
 
bool llvm::AMDGPU::isRegIntersect (unsigned Reg0, unsigned Reg1, const MCRegisterInfo *TRI)
 Is there any intersection between registers. More...
 
unsigned llvm::AMDGPU::getMCReg (unsigned Reg, const MCSubtargetInfo &STI)
 If Reg is a pseudo reg, return the correct hardware register given STI otherwise return Reg. More...
 
unsigned llvm::AMDGPU::mc2PseudoReg (unsigned Reg)
 Convert hardware register Reg to a pseudo register. More...
 
bool llvm::AMDGPU::isSISrcOperand (const MCInstrDesc &Desc, unsigned OpNo)
 Can this operand also contain immediate values? More...
 
bool llvm::AMDGPU::isSISrcFPOperand (const MCInstrDesc &Desc, unsigned OpNo)
 Is this floating-point operand? More...
 
bool llvm::AMDGPU::isSISrcInlinableOperand (const MCInstrDesc &Desc, unsigned OpNo)
 Does this opearnd support only inlinable literals? More...
 
unsigned llvm::AMDGPU::getRegBitWidth (unsigned RCID)
 Get the size in bits of a register from the register class RC. More...
 
unsigned llvm::AMDGPU::getRegBitWidth (const MCRegisterClass &RC)
 Get the size in bits of a register from the register class RC. More...
 
unsigned llvm::AMDGPU::getRegOperandSize (const MCRegisterInfo *MRI, const MCInstrDesc &Desc, unsigned OpNo)
 Get size of register operand. More...
 
bool llvm::AMDGPU::isInlinableLiteral64 (int64_t Literal, bool HasInv2Pi)
 Is this literal inlinable. More...
 
bool llvm::AMDGPU::isInlinableLiteral32 (int32_t Literal, bool HasInv2Pi)
 
bool llvm::AMDGPU::isInlinableLiteral16 (int16_t Literal, bool HasInv2Pi)
 
bool llvm::AMDGPU::isInlinableLiteralV216 (int32_t Literal, bool HasInv2Pi)
 
bool llvm::AMDGPU::isArgPassedInSGPR (const Argument *A)
 
int64_t llvm::AMDGPU::getSMRDEncodedOffset (const MCSubtargetInfo &ST, int64_t ByteOffset)
 
bool llvm::AMDGPU::isLegalSMRDImmOffset (const MCSubtargetInfo &ST, int64_t ByteOffset)
 
bool llvm::AMDGPU::splitMUBUFOffset (uint32_t Imm, uint32_t &SOffset, uint32_t &ImmOffset, const GCNSubtarget *Subtarget, uint32_t Align)
 
bool llvm::AMDGPU::isIntrinsicSourceOfDivergence (unsigned IntrID)
 

Macro Definition Documentation

◆ CASE_CI_VI [1/2]

#define CASE_CI_VI (   node)
Value:
assert(!isSI(STI)); \
case node: return isCI(STI) ? node##_ci : node##_vi;
bool isSI(const MCSubtargetInfo &STI)
bool isCI(const MCSubtargetInfo &STI)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())

Definition at line 757 of file AMDGPUBaseInfo.cpp.

◆ CASE_CI_VI [2/2]

#define CASE_CI_VI (   node)    case node##_ci: case node##_vi: return node;

Definition at line 757 of file AMDGPUBaseInfo.cpp.

◆ CASE_VI_GFX9 [1/2]

#define CASE_VI_GFX9 (   node)    case node: return isGFX9(STI) ? node##_gfx9 : node##_vi;

Definition at line 758 of file AMDGPUBaseInfo.cpp.

◆ CASE_VI_GFX9 [2/2]

#define CASE_VI_GFX9 (   node)    case node##_vi: case node##_gfx9: return node;

Definition at line 758 of file AMDGPUBaseInfo.cpp.

◆ GET_INSTRINFO_NAMED_OPS

#define GET_INSTRINFO_NAMED_OPS

Definition at line 43 of file AMDGPUBaseInfo.cpp.

◆ GET_INSTRMAP_INFO

#define GET_INSTRMAP_INFO

Definition at line 44 of file AMDGPUBaseInfo.cpp.

◆ GET_MIMGBaseOpcodesTable_IMPL

#define GET_MIMGBaseOpcodesTable_IMPL

Definition at line 110 of file AMDGPUBaseInfo.cpp.

◆ GET_MIMGDimInfoTable_IMPL

#define GET_MIMGDimInfoTable_IMPL

Definition at line 111 of file AMDGPUBaseInfo.cpp.

◆ GET_MIMGInfoTable_IMPL

#define GET_MIMGInfoTable_IMPL

Definition at line 112 of file AMDGPUBaseInfo.cpp.

◆ GET_MIMGLZMappingTable_IMPL

#define GET_MIMGLZMappingTable_IMPL

Definition at line 113 of file AMDGPUBaseInfo.cpp.

◆ GET_MUBUFInfoTable_DECL

#define GET_MUBUFInfoTable_DECL

Definition at line 140 of file AMDGPUBaseInfo.cpp.

◆ GET_MUBUFInfoTable_IMPL

#define GET_MUBUFInfoTable_IMPL

Definition at line 141 of file AMDGPUBaseInfo.cpp.

◆ GET_SourcesOfDivergence_IMPL

#define GET_SourcesOfDivergence_IMPL

Definition at line 1004 of file AMDGPUBaseInfo.cpp.

◆ MAP_REG2REG

#define MAP_REG2REG

Definition at line 700 of file AMDGPUBaseInfo.cpp.

Referenced by llvm::AMDGPU::getMCReg(), and llvm::AMDGPU::mc2PseudoReg().

Variable Documentation

◆ Intr

unsigned Intr