LLVM 23.0.0git
AMDGPUAsmPrinter.cpp File Reference

The AMDGPUAsmPrinter is used to print both assembly string and also binary code. More...

Go to the source code of this file.

Functions

static uint32_t getFPMode (SIModeRegisterDefaults Mode)
static AsmPrintercreateAMDGPUAsmPrinterPass (TargetMachine &tm, std::unique_ptr< MCStreamer > &&Streamer)
LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeAMDGPUAsmPrinter ()
const AMDGPUMCExprcreateOccupancy (unsigned InitOcc, const MCExpr *NumSGPRs, const MCExpr *NumVGPRs, unsigned DynamicVGPRBlockSize, const GCNSubtarget &STM, MCContext &Ctx)
 Mimics GCNSubtarget::computeOccupancy for MCExpr.
static void appendTypeEncoding (std::string &Enc, Type *Ty, const DataLayout &DL, bool IsReturnType)
static std::string computeTypeId (const FunctionType *FTy, const DataLayout &DL)
static const MCExprcomputeAccumOffset (const MCExpr *NumVGPR, MCContext &Ctx)
static unsigned getRsrcReg (CallingConv::ID CallConv)
static void EmitPALMetadataCommon (AMDGPUPALMetadata *MD, const SIProgramInfo &CurrentProgramInfo, CallingConv::ID CC, const GCNSubtarget &ST, unsigned DynamicVGPRBlockSize)
static amd_element_byte_size_t getElementByteSizeValue (unsigned Size)

Detailed Description

The AMDGPUAsmPrinter is used to print both assembly string and also binary code.

When passed an MCAsmStreamer it prints assembly and when passed an MCObjectStreamer it outputs binary code.

Definition in file AMDGPUAsmPrinter.cpp.

Function Documentation

◆ appendTypeEncoding()

void appendTypeEncoding ( std::string & Enc,
Type * Ty,
const DataLayout & DL,
bool IsReturnType )
static

Definition at line 541 of file AMDGPUAsmPrinter.cpp.

References llvm::divideCeil(), and DL.

Referenced by computeTypeId().

◆ computeAccumOffset()

◆ computeTypeId()

std::string computeTypeId ( const FunctionType * FTy,
const DataLayout & DL )
static

Definition at line 564 of file AMDGPUAsmPrinter.cpp.

References appendTypeEncoding(), and DL.

◆ createAMDGPUAsmPrinterPass()

AsmPrinter * createAMDGPUAsmPrinterPass ( TargetMachine & tm,
std::unique_ptr< MCStreamer > && Streamer )
static

Definition at line 86 of file AMDGPUAsmPrinter.cpp.

Referenced by LLVMInitializeAMDGPUAsmPrinter().

◆ createOccupancy()

const AMDGPUMCExpr * createOccupancy ( unsigned InitOcc,
const MCExpr * NumSGPRs,
const MCExpr * NumVGPRs,
unsigned DynamicVGPRBlockSize,
const GCNSubtarget & STM,
MCContext & Ctx )

Mimics GCNSubtarget::computeOccupancy for MCExpr.

Remove dependency on GCNSubtarget and depend only only the necessary values for said occupancy computation. Should match computeOccupancy implementation without passing STM on.

Definition at line 398 of file AMDGPUAsmPrinter.cpp.

References llvm::AMDGPUMCExpr::AGVK_Occupancy, llvm::AMDGPUMCExpr::create(), llvm::MCConstantExpr::create(), llvm::GCNSubtarget::getGeneration(), llvm::AMDGPU::IsaInfo::getMaxWavesPerEU(), llvm::AMDGPU::IsaInfo::getTotalNumVGPRs(), and llvm::AMDGPU::IsaInfo::getVGPRAllocGranule().

◆ EmitPALMetadataCommon()

◆ getElementByteSizeValue()

amd_element_byte_size_t getElementByteSizeValue ( unsigned Size)
static

◆ getFPMode()

◆ getRsrcReg()

◆ LLVMInitializeAMDGPUAsmPrinter()