LLVM API Documentation
#include <AMDGPUAsmPrinter.h>
Public Member Functions | |
AMDGPUAsmPrinter (TargetMachine &TM, MCStreamer &Streamer) | |
virtual bool | runOnMachineFunction (MachineFunction &MF) |
virtual const char * | getPassName () const |
void | EmitProgramInfoR600 (MachineFunction &MF) |
Emit register usage information so that the GPU driver can correctly setup the GPU state. More... | |
void | EmitProgramInfoSI (MachineFunction &MF) |
virtual void | EmitInstruction (const MachineInstr *MI) |
Implemented in AMDGPUMCInstLower.cpp. More... | |
![]() | |
virtual | ~AsmPrinter () |
const DwarfDebug * | getDwarfDebug () const |
bool | isVerbose () const |
unsigned | getFunctionNumber () const |
const TargetLoweringObjectFile & | getObjFileLowering () const |
getObjFileLowering - Return information about object file lowering. More... | |
const DataLayout & | getDataLayout () const |
getDataLayout - Return information about data layout. More... | |
StringRef | getTargetTriple () const |
getTargetTriple - Return the target triple string. More... | |
const MCSection * | getCurrentSection () const |
getCurrentSection() - Return the current section we are emitting to. More... | |
MCSymbol * | getSymbol (const GlobalValue *GV) const |
void | getAnalysisUsage (AnalysisUsage &AU) const |
bool | doInitialization (Module &M) |
bool | doFinalization (Module &M) |
void | SetupMachineFunction (MachineFunction &MF) |
void | EmitFunctionHeader () |
void | EmitFunctionBody () |
void | emitPrologLabel (const MachineInstr &MI) |
CFIMoveType | needsCFIMoves () |
bool | needsSEHMoves () |
bool | needsRelocationsForDwarfStringPool () const |
virtual void | EmitConstantPool () |
void | EmitJumpTableInfo () |
virtual void | EmitGlobalVariable (const GlobalVariable *GV) |
EmitGlobalVariable - Emit the specified global variable to the .s file. More... | |
bool | EmitSpecialLLVMGlobal (const GlobalVariable *GV) |
void | EmitAlignment (unsigned NumBits, const GlobalValue *GV=0) const |
void | EmitBasicBlockStart (const MachineBasicBlock *MBB) const |
void | EmitGlobalConstant (const Constant *CV) |
Print a general LLVM constant to the .s file. More... | |
virtual void | EmitStartOfAsmFile (Module &) |
virtual void | EmitEndOfAsmFile (Module &) |
virtual void | EmitFunctionBodyStart () |
virtual void | EmitFunctionBodyEnd () |
virtual void | EmitFunctionEntryLabel () |
virtual void | EmitMachineConstantPoolValue (MachineConstantPoolValue *MCPV) |
virtual void | EmitXXStructor (const Constant *CV) |
virtual bool | isBlockOnlyReachableByFallthrough (const MachineBasicBlock *MBB) const |
virtual void | emitImplicitDef (const MachineInstr *MI) const |
MCSymbol * | GetTempSymbol (StringRef Name, unsigned ID) const |
MCSymbol * | GetTempSymbol (StringRef Name) const |
MCSymbol * | GetSymbolWithGlobalValueBase (const GlobalValue *GV, StringRef Suffix, bool ForcePrivate=true) const |
MCSymbol * | GetExternalSymbolSymbol (StringRef Sym) const |
MCSymbol * | GetCPISymbol (unsigned CPID) const |
GetCPISymbol - Return the symbol for the specified constant pool entry. More... | |
MCSymbol * | GetJTISymbol (unsigned JTID, bool isLinkerPrivate=false) const |
GetJTISymbol - Return the symbol for the specified jump table entry. More... | |
MCSymbol * | GetJTSetSymbol (unsigned UID, unsigned MBBID) const |
MCSymbol * | GetBlockAddressSymbol (const BlockAddress *BA) const |
MCSymbol * | GetBlockAddressSymbol (const BasicBlock *BB) const |
void | printOffset (int64_t Offset, raw_ostream &OS) const |
printOffset - This is just convenient handler for printing offsets. More... | |
void | EmitInt8 (int Value) const |
void | EmitInt16 (int Value) const |
void | EmitInt32 (int Value) const |
void | EmitLabelDifference (const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size) const |
void | EmitLabelOffsetDifference (const MCSymbol *Hi, uint64_t Offset, const MCSymbol *Lo, unsigned Size) const |
void | EmitLabelPlusOffset (const MCSymbol *Label, uint64_t Offset, unsigned Size, bool IsSectionRelative=false) const |
void | EmitLabelReference (const MCSymbol *Label, unsigned Size, bool IsSectionRelative=false) const |
void | EmitSLEB128 (int64_t Value, const char *Desc=0) const |
EmitSLEB128 - emit the specified signed leb128 value. More... | |
void | EmitULEB128 (uint64_t Value, const char *Desc=0, unsigned PadTo=0) const |
EmitULEB128 - emit the specified unsigned leb128 value. More... | |
void | EmitCFAByte (unsigned Val) const |
EmitCFAByte - Emit a .byte 42 directive for a DW_CFA_xxx value. More... | |
void | EmitEncodingByte (unsigned Val, const char *Desc=0) const |
unsigned | GetSizeOfEncodedValue (unsigned Encoding) const |
GetSizeOfEncodedValue - Return the size of the encoding in bytes. More... | |
void | EmitTTypeReference (const GlobalValue *GV, unsigned Encoding) const |
EmitReference - Emit reference to a ttype global with a specified encoding. More... | |
void | EmitSectionOffset (const MCSymbol *Label, const MCSymbol *SectionLabel) const |
virtual unsigned | getISAEncoding () |
virtual void | EmitDwarfRegOp (const MachineLocation &MLoc, bool Indirect) const |
EmitDwarfRegOp - Emit dwarf register operation. More... | |
void | emitCFIInstruction (const MCCFIInstruction &Inst) const |
Emit frame instruction to describe the layout of the frame. More... | |
virtual void | PrintSpecial (const MachineInstr *MI, raw_ostream &OS, const char *Code) const |
virtual bool | PrintAsmOperand (const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS) |
virtual bool | PrintAsmMemoryOperand (const MachineInstr *MI, unsigned OpNo, unsigned AsmVariant, const char *ExtraCode, raw_ostream &OS) |
![]() | |
FunctionPass (char &pid) | |
Pass * | createPrinterPass (raw_ostream &O, const std::string &Banner) const |
createPrinterPass - Get a function printer pass. More... | |
virtual void | assignPassManager (PMStack &PMS, PassManagerType T) |
virtual PassManagerType | getPotentialPassManagerType () const |
Return what kind of Pass Manager can manage this pass. More... | |
![]() | |
Pass (PassKind K, char &pid) | |
virtual | ~Pass () |
PassKind | getPassKind () const |
AnalysisID | getPassID () const |
getPassID - Return the PassID number that corresponds to this pass. More... | |
virtual void | print (raw_ostream &O, const Module *M) const |
void | dump () const |
virtual void | preparePassManager (PMStack &) |
Check if available pass managers are suitable for this pass or not. More... | |
void | setResolver (AnalysisResolver *AR) |
AnalysisResolver * | getResolver () const |
virtual void | releaseMemory () |
virtual void * | getAdjustedAnalysisPointer (AnalysisID ID) |
virtual ImmutablePass * | getAsImmutablePass () |
virtual PMDataManager * | getAsPMDataManager () |
virtual void | verifyAnalysis () const |
virtual void | dumpPassStructure (unsigned Offset=0) |
template<typename AnalysisType > | |
AnalysisType * | getAnalysisIfAvailable () const |
bool | mustPreserveAnalysisID (char &AID) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis () const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis (Function &F) |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI, Function &F) |
Protected Attributes | |
bool | DisasmEnabled |
std::vector< std::string > | DisasmLines |
std::vector< std::string > | HexLines |
size_t | DisasmLineMaxLen |
Additional Inherited Members | |
![]() | |
enum | CFIMoveType { CFI_M_None, CFI_M_EH, CFI_M_Debug } |
![]() | |
static const PassInfo * | lookupPassInfo (const void *TI) |
static const PassInfo * | lookupPassInfo (StringRef Arg) |
static Pass * | createPass (AnalysisID ID) |
![]() | |
TargetMachine & | TM |
const MCAsmInfo * | MAI |
const MCInstrInfo * | MII |
MCContext & | OutContext |
MCStreamer & | OutStreamer |
const MachineFunction * | MF |
The current machine function. More... | |
MachineModuleInfo * | MMI |
MMI - This is a pointer to the current MachineModuleInfo. More... | |
Mangler * | Mang |
MCSymbol * | CurrentFnSym |
MCSymbol * | CurrentFnSymForSize |
![]() | |
AsmPrinter (TargetMachine &TM, MCStreamer &Streamer) | |
![]() | |
MachineFunctionPass (char &ID) | |
Definition at line 24 of file AMDGPUAsmPrinter.h.
|
explicit |
Definition at line 48 of file AMDGPUAsmPrinter.cpp.
References DisasmEnabled, llvm::TargetMachine::getSubtarget(), and llvm::MCStreamer::hasRawTextSupport().
|
virtual |
Implemented in AMDGPUMCInstLower.cpp.
Reimplemented from llvm::AsmPrinter.
Definition at line 69 of file AMDGPUMCInstLower.cpp.
References DisasmEnabled, DisasmLineMaxLen, DisasmLines, llvm::MCStreamer::EmitInstruction(), llvm::MCCodeEmitter::EncodeInstruction(), llvm::MachineBasicBlock::end(), llvm::raw_ostream::flush(), llvm::format(), llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getEmitter(), llvm::TargetMachine::getInstrInfo(), llvm::TargetMachine::getMCAsmInfo(), llvm::MachineInstr::getParent(), llvm::TargetMachine::getRegisterInfo(), HexLines, I, llvm::MachineInstr::isBundle(), llvm::AMDGPUMCInstLower::lower(), llvm::A64CC::MI, llvm::AsmPrinter::OutContext, llvm::AsmPrinter::OutStreamer, llvm::AMDGPUInstPrinter::printInst(), llvm::SmallVectorTemplateCommon< T >::size(), and llvm::AsmPrinter::TM.
void AMDGPUAsmPrinter::EmitProgramInfoR600 | ( | MachineFunction & | MF | ) |
Emit register usage information so that the GPU driver can correctly setup the GPU state.
Definition at line 105 of file AMDGPUAsmPrinter.cpp.
References llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), ShaderType::COMPUTE, llvm::MCStreamer::EmitIntValue(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::end(), llvm::AMDGPUSubtarget::EVERGREEN, ShaderType::GEOMETRY, llvm::MachineFunction::getInfo(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::TargetMachine::getRegisterInfo(), llvm::TargetMachine::getSubtarget(), I, llvm::MachineOperand::isReg(), llvm::AMDGPUMachineFunction::LDSSize, llvm::A64CC::MI, llvm::AsmPrinter::OutStreamer, ShaderType::PIXEL, R_02880C_DB_SHADER_CONTROL, R_028844_SQ_PGM_RESOURCES_PS, R_028850_SQ_PGM_RESOURCES_PS, R_028860_SQ_PGM_RESOURCES_VS, R_028868_SQ_PGM_RESOURCES_VS, R_028878_SQ_PGM_RESOURCES_GS, R_0288D4_SQ_PGM_RESOURCES_LS, R_0288E8_SQ_LDS_ALLOC, llvm::RoundUpToAlignment(), S_02880C_KILL_ENABLE, S_NUM_GPRS, S_STACK_SIZE, llvm::AMDGPUMachineFunction::ShaderType, llvm::R600MachineFunctionInfo::StackSize, llvm::AsmPrinter::TM, and ShaderType::VERTEX.
Referenced by runOnMachineFunction().
void AMDGPUAsmPrinter::EmitProgramInfoSI | ( | MachineFunction & | MF | ) |
Definition at line 169 of file AMDGPUAsmPrinter.cpp.
References llvm::MachineBasicBlock::begin(), llvm::MachineFunction::begin(), ShaderType::COMPUTE, llvm::MCStreamer::EmitIntValue(), llvm::MachineBasicBlock::end(), llvm::MachineFunction::end(), ShaderType::GEOMETRY, llvm::AMDGPUSubtarget::getGeneration(), llvm::MachineFunction::getInfo(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::TargetMachine::getRegisterInfo(), llvm::TargetMachine::getSubtarget(), I, llvm::MachineOperand::isReg(), llvm::AMDGPUMachineFunction::LDSSize, llvm::A64CC::MI, llvm::AsmPrinter::OutStreamer, ShaderType::PIXEL, llvm::SIMachineFunctionInfo::PSInputAddr, R_00B028_SPI_SHADER_PGM_RSRC1_PS, R_00B02C_SPI_SHADER_PGM_RSRC2_PS, R_00B128_SPI_SHADER_PGM_RSRC1_VS, R_00B228_SPI_SHADER_PGM_RSRC1_GS, R_00B848_COMPUTE_PGM_RSRC1, R_00B84C_COMPUTE_PGM_RSRC2, R_0286CC_SPI_PS_INPUT_ENA, llvm::RoundUpToAlignment(), S_00B028_SGPRS, S_00B028_VGPRS, S_00B02C_EXTRA_LDS_SIZE, S_00B84C_LDS_SIZE, llvm::AMDGPUSubtarget::SEA_ISLANDS, llvm::AMDGPUMachineFunction::ShaderType, llvm::AsmPrinter::TM, and ShaderType::VERTEX.
Referenced by runOnMachineFunction().
|
inlinevirtual |
getPassName - Return a nice clean name for a pass. This usually implemented in terms of the name that is registered by one of the Registration templates, but can be overloaded directly.
Reimplemented from llvm::Pass.
Definition at line 31 of file AMDGPUAsmPrinter.h.
|
virtual |
We need to override this function so we can avoid the call to EmitFunctionHeader(), which the MCPureStreamer can't handle.
Reimplemented from llvm::AsmPrinter.
Definition at line 57 of file AMDGPUAsmPrinter.cpp.
References DisasmEnabled, DisasmLineMaxLen, DisasmLines, llvm::MachineFunction::dump(), llvm::AMDGPUSubtarget::dumpCode(), llvm::MCStreamer::EmitBytes(), llvm::AsmPrinter::EmitFunctionBody(), EmitProgramInfoR600(), EmitProgramInfoSI(), llvm::MCStreamer::EmitRawText(), llvm::TargetLoweringObjectFile::getContext(), llvm::MCContext::getELFSection(), llvm::AMDGPUSubtarget::getGeneration(), llvm::MachineFunction::getName(), llvm::AsmPrinter::getObjFileLowering(), llvm::SectionKind::getReadOnly(), llvm::TargetMachine::getSubtarget(), llvm::MCStreamer::hasRawTextSupport(), HexLines, llvm::AMDGPUSubtarget::NORTHERN_ISLANDS, llvm::AsmPrinter::OutStreamer, llvm::AsmPrinter::SetupMachineFunction(), llvm::MCStreamer::SwitchSection(), and llvm::AsmPrinter::TM.
|
protected |
Definition at line 44 of file AMDGPUAsmPrinter.h.
Referenced by AMDGPUAsmPrinter(), EmitInstruction(), and runOnMachineFunction().
|
protected |
Definition at line 46 of file AMDGPUAsmPrinter.h.
Referenced by EmitInstruction(), and runOnMachineFunction().
|
protected |
Definition at line 45 of file AMDGPUAsmPrinter.h.
Referenced by EmitInstruction(), and runOnMachineFunction().
|
protected |
Definition at line 45 of file AMDGPUAsmPrinter.h.
Referenced by EmitInstruction(), and runOnMachineFunction().