LLVM  6.0.0svn
Functions
AMDGPUAsmPrinter.cpp File Reference

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

#include "AMDGPUAsmPrinter.h"
#include "AMDGPU.h"
#include "AMDGPUSubtarget.h"
#include "AMDGPUTargetMachine.h"
#include "InstPrinter/AMDGPUInstPrinter.h"
#include "MCTargetDesc/AMDGPUTargetStreamer.h"
#include "R600Defines.h"
#include "R600MachineFunctionInfo.h"
#include "R600RegisterInfo.h"
#include "SIDefines.h"
#include "SIInstrInfo.h"
#include "SIMachineFunctionInfo.h"
#include "SIRegisterInfo.h"
#include "Utils/AMDGPUBaseInfo.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/IR/DiagnosticInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCSectionELF.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/Support/AMDGPUMetadata.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
Include dependency graph for AMDGPUAsmPrinter.cpp:

Go to the source code of this file.

Functions

static uint32_t getFPMode (const MachineFunction &F)
 
static AsmPrintercreateAMDGPUAsmPrinterPass (TargetMachine &tm, std::unique_ptr< MCStreamer > &&Streamer)
 
void LLVMInitializeAMDGPUAsmPrinter ()
 
static bool hasAnyNonFlatUseOfReg (const MachineRegisterInfo &MRI, const SIInstrInfo &TII, unsigned Reg)
 
static unsigned getNumExtraSGPRs (const SISubtarget &ST, bool VCCUsed, bool FlatScrUsed)
 
static unsigned getRsrcReg (CallingConv::ID CallConv)
 
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

◆ createAMDGPUAsmPrinterPass()

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

Definition at line 84 of file AMDGPUAsmPrinter.cpp.

Referenced by LLVMInitializeAMDGPUAsmPrinter().

◆ getElementByteSizeValue()

static amd_element_byte_size_t getElementByteSizeValue ( unsigned  Size)
static

Definition at line 1066 of file AMDGPUAsmPrinter.cpp.

References AMD_CODE_PROPERTY_ENABLE_SGPR_DISPATCH_ID, AMD_CODE_PROPERTY_ENABLE_SGPR_DISPATCH_PTR, AMD_CODE_PROPERTY_ENABLE_SGPR_FLAT_SCRATCH_INIT, AMD_CODE_PROPERTY_ENABLE_SGPR_GRID_WORKGROUP_COUNT_X, AMD_CODE_PROPERTY_ENABLE_SGPR_GRID_WORKGROUP_COUNT_Y, AMD_CODE_PROPERTY_ENABLE_SGPR_GRID_WORKGROUP_COUNT_Z, AMD_CODE_PROPERTY_ENABLE_SGPR_KERNARG_SEGMENT_PTR, AMD_CODE_PROPERTY_ENABLE_SGPR_PRIVATE_SEGMENT_BUFFER, AMD_CODE_PROPERTY_ENABLE_SGPR_QUEUE_PTR, AMD_CODE_PROPERTY_IS_DEBUG_SUPPORTED, AMD_CODE_PROPERTY_IS_DYNAMIC_CALLSTACK, AMD_CODE_PROPERTY_IS_PTR64, AMD_CODE_PROPERTY_IS_XNACK_SUPPORTED, AMD_CODE_PROPERTY_PRIVATE_ELEMENT_SIZE, AMD_ELEMENT_16_BYTES, AMD_ELEMENT_4_BYTES, AMD_ELEMENT_8_BYTES, AMD_HSA_BITS_SET, amd_kernel_code_s::code_properties, amd_kernel_code_s::compute_pgm_resource_registers, llvm::countTrailingZeros(), amd_kernel_code_s::debug_private_segment_buffer_sgpr, amd_kernel_code_s::debug_wavefront_private_segment_offset_sgpr, llvm::SISubtarget::debuggerEmitPrologue(), llvm::SISubtarget::debuggerSupported(), llvm::AMDGPUMachineFunction::getABIArgOffset(), llvm::MachineFunction::getInfo(), llvm::SISubtarget::getKernArgSegmentSize(), llvm::AMDGPUMachineFunction::getMaxKernArgAlign(), llvm::MachineFunction::getSubtarget(), llvm::AMDGPUSubtarget::getWavefrontSize(), llvm::SIMachineFunctionInfo::hasDispatchID(), llvm::SIMachineFunctionInfo::hasDispatchPtr(), llvm::SIMachineFunctionInfo::hasFlatScratchInit(), llvm::SIMachineFunctionInfo::hasGridWorkgroupCountX(), llvm::SIMachineFunctionInfo::hasGridWorkgroupCountY(), llvm::SIMachineFunctionInfo::hasGridWorkgroupCountZ(), llvm::SIMachineFunctionInfo::hasKernargSegmentPtr(), llvm::SIMachineFunctionInfo::hasPrivateSegmentBuffer(), llvm::SIMachineFunctionInfo::hasQueuePtr(), if(), llvm::AMDGPU::initDefaultAMDKernelCodeT(), llvm::AMDGPUSubtarget::isXNACKEnabled(), amd_kernel_code_s::kernarg_segment_alignment, amd_kernel_code_s::kernarg_segment_byte_size, llvm_unreachable, llvm::max(), llvm::AMDGPU::HSAMD::Kernel::DebugProps::Metadata::mDebuggerABIVersion, llvm::AMDGPU::HSAMD::Kernel::CodeProps::Metadata::mKernargSegmentSize, amd_kernel_code_s::reserved_vgpr_count, amd_kernel_code_s::reserved_vgpr_first, amd_kernel_code_s::wavefront_sgpr_count, amd_kernel_code_s::workgroup_group_segment_byte_size, amd_kernel_code_s::workitem_private_segment_byte_size, and amd_kernel_code_s::workitem_vgpr_count.

◆ getFPMode()

static uint32_t getFPMode ( const MachineFunction F)
static

◆ getNumExtraSGPRs()

static unsigned getNumExtraSGPRs ( const SISubtarget ST,
bool  VCCUsed,
bool  FlatScrUsed 
)
static

Definition at line 511 of file AMDGPUAsmPrinter.cpp.

References llvm::alignTo(), assert(), Callee, contains(), llvm::SISubtarget::debuggerEmitPrologue(), llvm::SISubtarget::debuggerReserveRegs(), llvm::LLVMContext::diagnose(), llvm::DK_ResourceLimit, llvm::Function::doesNotRecurse(), llvm::DS_Error, llvm::AMDGPUSubtarget::enableDX10Clamp(), llvm::AMDGPUSubtarget::enableIEEEBit(), llvm::AMDGPU::IsaInfo::FIXED_NUM_SGPRS_FOR_INIT_BUG, llvm::SISubtarget::getAddressableNumSGPRs(), llvm::Function::getContext(), getFPMode(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::AMDGPUSubtarget::getGeneration(), llvm::MachineOperand::getGlobal(), llvm::SIRegisterInfo::getHWRegIndex(), llvm::MachineFunction::getInfo(), llvm::SISubtarget::getInstrInfo(), llvm::AMDGPUSubtarget::getLocalMemorySize(), llvm::SISubtarget::getMaxNumUserSGPRs(), llvm::SISubtarget::getMinNumSGPRs(), llvm::SISubtarget::getMinNumVGPRs(), llvm::SIInstrInfo::getNamedOperand(), llvm::MachineFunction::getRegInfo(), llvm::SIInstrInfo::getRegisterInfo(), llvm::SISubtarget::getReservedNumVGPRs(), llvm::SISubtarget::getSGPREncodingGranule(), llvm::MachineFunction::getSubtarget(), llvm::AMDGPU::IsaInfo::getTotalNumSGPRs(), llvm::SISubtarget::getVGPREncodingGranule(), llvm::AMDGPUSubtarget::getWavefrontSize(), hasAnyNonFlatUseOfReg(), llvm::SIMachineFunctionInfo::hasFlatScratchInit(), llvm::SISubtarget::hasSGPRInitBug(), I, llvm::AMDGPUSubtarget::isAmdHsaOS(), llvm::GlobalValue::isDeclaration(), llvm::MachineRegisterInfo::isPhysRegUsed(), llvm::AMDGPUSubtarget::isTrapHandlerEnabled(), llvm::AMDGPUSubtarget::isXNACKEnabled(), llvm_unreachable, llvm::max(), MI, MRI, llvm::reverse(), S_00B848_DEBUG_MODE, S_00B848_DX10_CLAMP, S_00B848_FLOAT_MODE, S_00B848_IEEE_MODE, S_00B848_PRIORITY, S_00B848_PRIV, S_00B848_SGPRS, S_00B848_VGPRS, S_00B84C_EXCP_EN, S_00B84C_EXCP_EN_MSB, S_00B84C_LDS_SIZE, S_00B84C_SCRATCH_EN, S_00B84C_TG_SIZE_EN, S_00B84C_TGID_X_EN, S_00B84C_TGID_Y_EN, S_00B84C_TGID_Z_EN, S_00B84C_TIDIG_COMP_CNT, S_00B84C_TRAP_HANDLER, S_00B84C_USER_SGPR, llvm::AMDGPUSubtarget::SEA_ISLANDS, llvm::ARM_MB::ST, TII, and llvm::AMDGPUSubtarget::VOLCANIC_ISLANDS.

◆ getRsrcReg()

static unsigned getRsrcReg ( CallingConv::ID  CallConv)
static

Definition at line 934 of file AMDGPUAsmPrinter.cpp.

References llvm::alignTo(), llvm::CallingConv::AMDGPU_CS, llvm::CallingConv::AMDGPU_ES, llvm::CallingConv::AMDGPU_GS, llvm::CallingConv::AMDGPU_HS, llvm::CallingConv::AMDGPU_LS, llvm::CallingConv::AMDGPU_PS, llvm::CallingConv::AMDGPU_VS, llvm::Triple::AMDPAL, llvm::AMDGPU::PALMD::CS_SCRATCH_SIZE, llvm::AMDGPU::PALMD::ES_SCRATCH_SIZE, llvm::Function::getCallingConv(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getInfo(), llvm::Triple::getOS(), llvm::SIMachineFunctionInfo::getPSInputAddr(), llvm::SIMachineFunctionInfo::getPSInputEnable(), llvm::MachineFunction::getSubtarget(), llvm::TargetMachine::getTargetTriple(), llvm::AMDGPU::PALMD::GS_SCRATCH_SIZE, llvm::AMDGPU::PALMD::HS_SCRATCH_SIZE, llvm::AMDGPU::isCompute(), llvm::SISubtarget::isVGPRSpillingEnabled(), LLVM_FALLTHROUGH, llvm::AMDGPU::PALMD::LS_SCRATCH_SIZE, llvm::AsmPrinter::OutStreamer, llvm::AMDGPU::PALMD::PS_SCRATCH_SIZE, R_00B028_SPI_SHADER_PGM_RSRC1_PS, R_00B128_SPI_SHADER_PGM_RSRC1_VS, R_00B228_SPI_SHADER_PGM_RSRC1_GS, R_00B328_SPI_SHADER_PGM_RSRC1_ES, R_00B428_SPI_SHADER_PGM_RSRC1_HS, R_00B528_SPI_SHADER_PGM_RSRC1_LS, R_00B848_COMPUTE_PGM_RSRC1, R_00B84C_COMPUTE_PGM_RSRC2, R_00B860_COMPUTE_TMPRING_SIZE, R_0286CC_SPI_PS_INPUT_ENA, R_0286D0_SPI_PS_INPUT_ADDR, R_0286E8_SPI_TMPRING_SIZE, R_SPILLED_SGPRS, R_SPILLED_VGPRS, S_00B028_SGPRS, S_00B028_VGPRS, S_00B02C_EXTRA_LDS_SIZE, S_00B84C_SCRATCH_EN, S_00B860_WAVESIZE, S_0286E8_WAVESIZE, llvm::AsmPrinter::TM, llvm::AMDGPU::PALMD::VS_NUM_USED_SGPRS, llvm::AMDGPU::PALMD::VS_NUM_USED_VGPRS, and llvm::AMDGPU::PALMD::VS_SCRATCH_SIZE.

◆ hasAnyNonFlatUseOfReg()

static bool hasAnyNonFlatUseOfReg ( const MachineRegisterInfo MRI,
const SIInstrInfo TII,
unsigned  Reg 
)
static

◆ LLVMInitializeAMDGPUAsmPrinter()

void LLVMInitializeAMDGPUAsmPrinter ( )