LLVM  14.0.0git
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::AMDGPUTargetStreamer Class Referenceabstract

#include "Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h"

Inheritance diagram for llvm::AMDGPUTargetStreamer:
Inheritance graph
[legend]
Collaboration diagram for llvm::AMDGPUTargetStreamer:
Collaboration graph
[legend]

Public Member Functions

 AMDGPUTargetStreamer (MCStreamer &S)
 
AMDGPUPALMetadatagetPALMetadata ()
 
virtual void EmitDirectiveAMDGCNTarget ()=0
 
virtual void EmitDirectiveHSACodeObjectVersion (uint32_t Major, uint32_t Minor)=0
 
virtual void EmitDirectiveHSACodeObjectISAV2 (uint32_t Major, uint32_t Minor, uint32_t Stepping, StringRef VendorName, StringRef ArchName)=0
 
virtual void EmitAMDKernelCodeT (const amd_kernel_code_t &Header)=0
 
virtual void EmitAMDGPUSymbolType (StringRef SymbolName, unsigned Type)=0
 
virtual void emitAMDGPULDS (MCSymbol *Symbol, unsigned Size, Align Alignment)=0
 
virtual bool EmitISAVersion ()=0
 
virtual bool EmitHSAMetadataV2 (StringRef HSAMetadataString)
 
virtual bool EmitHSAMetadataV3 (StringRef HSAMetadataString)
 
virtual bool EmitHSAMetadata (msgpack::Document &HSAMetadata, bool Strict)=0
 Emit HSA Metadata. More...
 
virtual bool EmitHSAMetadata (const AMDGPU::HSAMD::Metadata &HSAMetadata)=0
 
virtual bool EmitCodeEnd (const MCSubtargetInfo &STI)=0
 
virtual void EmitAmdhsaKernelDescriptor (const MCSubtargetInfo &STI, StringRef KernelName, const amdhsa::kernel_descriptor_t &KernelDescriptor, uint64_t NextVGPR, uint64_t NextSGPR, bool ReserveVCC, bool ReserveFlatScr)=0
 
const Optional< AMDGPU::IsaInfo::AMDGPUTargetID > & getTargetID () const
 
Optional< AMDGPU::IsaInfo::AMDGPUTargetID > & getTargetID ()
 
void initializeTargetID (const MCSubtargetInfo &STI)
 
void initializeTargetID (const MCSubtargetInfo &STI, StringRef FeatureString)
 
- Public Member Functions inherited from llvm::MCTargetStreamer
 MCTargetStreamer (MCStreamer &S)
 
virtual ~MCTargetStreamer ()
 
MCStreamergetStreamer ()
 
virtual void emitLabel (MCSymbol *Symbol)
 
virtual void emitAssignment (MCSymbol *Symbol, const MCExpr *Value)
 
virtual void prettyPrintAsm (MCInstPrinter &InstPrinter, uint64_t Address, const MCInst &Inst, const MCSubtargetInfo &STI, raw_ostream &OS)
 
virtual void emitDwarfFileDirective (StringRef Directive)
 
virtual void changeSection (const MCSection *CurSection, MCSection *Section, const MCExpr *SubSection, raw_ostream &OS)
 Update streamer for a new active section. More...
 
virtual void emitValue (const MCExpr *Value)
 
virtual void emitRawBytes (StringRef Data)
 Emit the bytes in Data into the output. More...
 
virtual void emitConstantPools ()
 
virtual void finish ()
 

Static Public Member Functions

static StringRef getArchNameFromElfMach (unsigned ElfMach)
 
static unsigned getElfMach (StringRef GPU)
 

Protected Member Functions

MCContextgetContext () const
 

Protected Attributes

Optional< AMDGPU::IsaInfo::AMDGPUTargetIDTargetID
 
- Protected Attributes inherited from llvm::MCTargetStreamer
MCStreamerStreamer
 

Detailed Description

Definition at line 34 of file AMDGPUTargetStreamer.h.

Constructor & Destructor Documentation

◆ AMDGPUTargetStreamer()

llvm::AMDGPUTargetStreamer::AMDGPUTargetStreamer ( MCStreamer S)
inline

Definition at line 44 of file AMDGPUTargetStreamer.h.

Member Function Documentation

◆ emitAMDGPULDS()

virtual void llvm::AMDGPUTargetStreamer::emitAMDGPULDS ( MCSymbol Symbol,
unsigned  Size,
Align  Alignment 
)
pure virtual

◆ EmitAMDGPUSymbolType()

virtual void llvm::AMDGPUTargetStreamer::EmitAMDGPUSymbolType ( StringRef  SymbolName,
unsigned  Type 
)
pure virtual

◆ EmitAmdhsaKernelDescriptor()

virtual void llvm::AMDGPUTargetStreamer::EmitAmdhsaKernelDescriptor ( const MCSubtargetInfo STI,
StringRef  KernelName,
const amdhsa::kernel_descriptor_t KernelDescriptor,
uint64_t  NextVGPR,
uint64_t  NextSGPR,
bool  ReserveVCC,
bool  ReserveFlatScr 
)
pure virtual

◆ EmitAMDKernelCodeT()

virtual void llvm::AMDGPUTargetStreamer::EmitAMDKernelCodeT ( const amd_kernel_code_t Header)
pure virtual

◆ EmitCodeEnd()

virtual bool llvm::AMDGPUTargetStreamer::EmitCodeEnd ( const MCSubtargetInfo STI)
pure virtual
Returns
True on success, false on failure.

Implemented in llvm::AMDGPUTargetELFStreamer, and llvm::AMDGPUTargetAsmStreamer.

Referenced by llvm::AMDGPUAsmPrinter::doFinalization().

◆ EmitDirectiveAMDGCNTarget()

virtual void llvm::AMDGPUTargetStreamer::EmitDirectiveAMDGCNTarget ( )
pure virtual

◆ EmitDirectiveHSACodeObjectISAV2()

virtual void llvm::AMDGPUTargetStreamer::EmitDirectiveHSACodeObjectISAV2 ( uint32_t  Major,
uint32_t  Minor,
uint32_t  Stepping,
StringRef  VendorName,
StringRef  ArchName 
)
pure virtual

◆ EmitDirectiveHSACodeObjectVersion()

virtual void llvm::AMDGPUTargetStreamer::EmitDirectiveHSACodeObjectVersion ( uint32_t  Major,
uint32_t  Minor 
)
pure virtual

◆ EmitHSAMetadata() [1/2]

virtual bool llvm::AMDGPUTargetStreamer::EmitHSAMetadata ( const AMDGPU::HSAMD::Metadata HSAMetadata)
pure virtual
Returns
True on success, false on failure.

Implemented in llvm::AMDGPUTargetELFStreamer, and llvm::AMDGPUTargetAsmStreamer.

◆ EmitHSAMetadata() [2/2]

virtual bool llvm::AMDGPUTargetStreamer::EmitHSAMetadata ( msgpack::Document HSAMetadata,
bool  Strict 
)
pure virtual

Emit HSA Metadata.

When Strict is true, known metadata elements must already be well-typed. When Strict is false, known types are inferred and the HSAMetadata structure is updated with the correct types.

Returns
True on success, false on failure.

Implemented in llvm::AMDGPUTargetELFStreamer, and llvm::AMDGPUTargetAsmStreamer.

Referenced by llvm::AMDGPU::HSAMD::MetadataStreamerV3::emitTo(), and llvm::AMDGPU::HSAMD::MetadataStreamerV2::emitTo().

◆ EmitHSAMetadataV2()

bool AMDGPUTargetStreamer::EmitHSAMetadataV2 ( StringRef  HSAMetadataString)
virtual
Returns
True on success, false on failure.

Definition at line 48 of file AMDGPUTargetStreamer.cpp.

References llvm::AMDGPU::HSAMD::fromString().

◆ EmitHSAMetadataV3()

bool AMDGPUTargetStreamer::EmitHSAMetadataV3 ( StringRef  HSAMetadataString)
virtual
Returns
True on success, false on failure.

Definition at line 55 of file AMDGPUTargetStreamer.cpp.

References llvm::msgpack::Document::fromYAML().

◆ EmitISAVersion()

virtual bool llvm::AMDGPUTargetStreamer::EmitISAVersion ( )
pure virtual
Returns
True on success, false on failure.

Implemented in llvm::AMDGPUTargetELFStreamer, and llvm::AMDGPUTargetAsmStreamer.

Referenced by llvm::AMDGPUAsmPrinter::emitEndOfAsmFile().

◆ getArchNameFromElfMach()

StringRef AMDGPUTargetStreamer::getArchNameFromElfMach ( unsigned  ElfMach)
static

Definition at line 62 of file AMDGPUTargetStreamer.cpp.

References llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1010, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1011, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1012, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1013, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1030, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1031, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1032, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1033, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1034, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1035, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX600, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX601, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX602, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX700, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX701, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX702, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX703, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX704, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX705, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX801, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX802, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX803, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX805, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX810, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX900, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX902, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX904, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX906, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX908, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX909, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX90A, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX90C, llvm::ELF::EF_AMDGPU_MACH_NONE, llvm::ELF::EF_AMDGPU_MACH_R600_BARTS, llvm::ELF::EF_AMDGPU_MACH_R600_CAICOS, llvm::ELF::EF_AMDGPU_MACH_R600_CAYMAN, llvm::ELF::EF_AMDGPU_MACH_R600_CEDAR, llvm::ELF::EF_AMDGPU_MACH_R600_CYPRESS, llvm::ELF::EF_AMDGPU_MACH_R600_JUNIPER, llvm::ELF::EF_AMDGPU_MACH_R600_R600, llvm::ELF::EF_AMDGPU_MACH_R600_R630, llvm::ELF::EF_AMDGPU_MACH_R600_REDWOOD, llvm::ELF::EF_AMDGPU_MACH_R600_RS880, llvm::ELF::EF_AMDGPU_MACH_R600_RV670, llvm::ELF::EF_AMDGPU_MACH_R600_RV710, llvm::ELF::EF_AMDGPU_MACH_R600_RV730, llvm::ELF::EF_AMDGPU_MACH_R600_RV770, llvm::ELF::EF_AMDGPU_MACH_R600_SUMO, llvm::ELF::EF_AMDGPU_MACH_R600_TURKS, llvm::AMDGPU::getArchNameAMDGCN(), llvm::AMDGPU::getArchNameR600(), llvm::AMDGPU::GK_BARTS, llvm::AMDGPU::GK_CAICOS, llvm::AMDGPU::GK_CAYMAN, llvm::AMDGPU::GK_CEDAR, llvm::AMDGPU::GK_CYPRESS, llvm::AMDGPU::GK_GFX1010, llvm::AMDGPU::GK_GFX1011, llvm::AMDGPU::GK_GFX1012, llvm::AMDGPU::GK_GFX1013, llvm::AMDGPU::GK_GFX1030, llvm::AMDGPU::GK_GFX1031, llvm::AMDGPU::GK_GFX1032, llvm::AMDGPU::GK_GFX1033, llvm::AMDGPU::GK_GFX1034, llvm::AMDGPU::GK_GFX1035, llvm::AMDGPU::GK_GFX600, llvm::AMDGPU::GK_GFX601, llvm::AMDGPU::GK_GFX602, llvm::AMDGPU::GK_GFX700, llvm::AMDGPU::GK_GFX701, llvm::AMDGPU::GK_GFX702, llvm::AMDGPU::GK_GFX703, llvm::AMDGPU::GK_GFX704, llvm::AMDGPU::GK_GFX705, llvm::AMDGPU::GK_GFX801, llvm::AMDGPU::GK_GFX802, llvm::AMDGPU::GK_GFX803, llvm::AMDGPU::GK_GFX805, llvm::AMDGPU::GK_GFX810, llvm::AMDGPU::GK_GFX900, llvm::AMDGPU::GK_GFX902, llvm::AMDGPU::GK_GFX904, llvm::AMDGPU::GK_GFX906, llvm::AMDGPU::GK_GFX908, llvm::AMDGPU::GK_GFX909, llvm::AMDGPU::GK_GFX90A, llvm::AMDGPU::GK_GFX90C, llvm::AMDGPU::GK_JUNIPER, llvm::AMDGPU::GK_NONE, llvm::AMDGPU::GK_R600, llvm::AMDGPU::GK_R630, llvm::AMDGPU::GK_REDWOOD, llvm::AMDGPU::GK_RS880, llvm::AMDGPU::GK_RV670, llvm::AMDGPU::GK_RV710, llvm::AMDGPU::GK_RV730, llvm::AMDGPU::GK_RV770, llvm::AMDGPU::GK_SUMO, llvm::AMDGPU::GK_TURKS, and llvm_unreachable.

◆ getContext()

MCContext& llvm::AMDGPUTargetStreamer::getContext ( ) const
inlineprotected

◆ getElfMach()

unsigned AMDGPUTargetStreamer::getElfMach ( StringRef  GPU)
static

Definition at line 124 of file AMDGPUTargetStreamer.cpp.

References llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1010, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1011, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1012, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1013, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1030, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1031, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1032, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1033, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1034, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX1035, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX600, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX601, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX602, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX700, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX701, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX702, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX703, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX704, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX705, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX801, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX802, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX803, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX805, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX810, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX900, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX902, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX904, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX906, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX908, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX909, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX90A, llvm::ELF::EF_AMDGPU_MACH_AMDGCN_GFX90C, llvm::ELF::EF_AMDGPU_MACH_NONE, llvm::ELF::EF_AMDGPU_MACH_R600_BARTS, llvm::ELF::EF_AMDGPU_MACH_R600_CAICOS, llvm::ELF::EF_AMDGPU_MACH_R600_CAYMAN, llvm::ELF::EF_AMDGPU_MACH_R600_CEDAR, llvm::ELF::EF_AMDGPU_MACH_R600_CYPRESS, llvm::ELF::EF_AMDGPU_MACH_R600_JUNIPER, llvm::ELF::EF_AMDGPU_MACH_R600_R600, llvm::ELF::EF_AMDGPU_MACH_R600_R630, llvm::ELF::EF_AMDGPU_MACH_R600_REDWOOD, llvm::ELF::EF_AMDGPU_MACH_R600_RS880, llvm::ELF::EF_AMDGPU_MACH_R600_RV670, llvm::ELF::EF_AMDGPU_MACH_R600_RV710, llvm::ELF::EF_AMDGPU_MACH_R600_RV730, llvm::ELF::EF_AMDGPU_MACH_R600_RV770, llvm::ELF::EF_AMDGPU_MACH_R600_SUMO, llvm::ELF::EF_AMDGPU_MACH_R600_TURKS, llvm::AMDGPU::GK_BARTS, llvm::AMDGPU::GK_CAICOS, llvm::AMDGPU::GK_CAYMAN, llvm::AMDGPU::GK_CEDAR, llvm::AMDGPU::GK_CYPRESS, llvm::AMDGPU::GK_GFX1010, llvm::AMDGPU::GK_GFX1011, llvm::AMDGPU::GK_GFX1012, llvm::AMDGPU::GK_GFX1013, llvm::AMDGPU::GK_GFX1030, llvm::AMDGPU::GK_GFX1031, llvm::AMDGPU::GK_GFX1032, llvm::AMDGPU::GK_GFX1033, llvm::AMDGPU::GK_GFX1034, llvm::AMDGPU::GK_GFX1035, llvm::AMDGPU::GK_GFX600, llvm::AMDGPU::GK_GFX601, llvm::AMDGPU::GK_GFX602, llvm::AMDGPU::GK_GFX700, llvm::AMDGPU::GK_GFX701, llvm::AMDGPU::GK_GFX702, llvm::AMDGPU::GK_GFX703, llvm::AMDGPU::GK_GFX704, llvm::AMDGPU::GK_GFX705, llvm::AMDGPU::GK_GFX801, llvm::AMDGPU::GK_GFX802, llvm::AMDGPU::GK_GFX803, llvm::AMDGPU::GK_GFX805, llvm::AMDGPU::GK_GFX810, llvm::AMDGPU::GK_GFX900, llvm::AMDGPU::GK_GFX902, llvm::AMDGPU::GK_GFX904, llvm::AMDGPU::GK_GFX906, llvm::AMDGPU::GK_GFX908, llvm::AMDGPU::GK_GFX909, llvm::AMDGPU::GK_GFX90A, llvm::AMDGPU::GK_GFX90C, llvm::AMDGPU::GK_JUNIPER, llvm::AMDGPU::GK_NONE, llvm::AMDGPU::GK_R600, llvm::AMDGPU::GK_R630, llvm::AMDGPU::GK_REDWOOD, llvm::AMDGPU::GK_RS880, llvm::AMDGPU::GK_RV670, llvm::AMDGPU::GK_RV710, llvm::AMDGPU::GK_RV730, llvm::AMDGPU::GK_RV770, llvm::AMDGPU::GK_SUMO, llvm::AMDGPU::GK_TURKS, llvm_unreachable, llvm::AMDGPU::parseArchAMDGCN(), and llvm::AMDGPU::parseArchR600().

◆ getPALMetadata()

AMDGPUPALMetadata* llvm::AMDGPUTargetStreamer::getPALMetadata ( )
inline

◆ getTargetID() [1/2]

Optional<AMDGPU::IsaInfo::AMDGPUTargetID>& llvm::AMDGPUTargetStreamer::getTargetID ( )
inline

Definition at line 100 of file AMDGPUTargetStreamer.h.

References TargetID.

◆ getTargetID() [2/2]

const Optional<AMDGPU::IsaInfo::AMDGPUTargetID>& llvm::AMDGPUTargetStreamer::getTargetID ( ) const
inline

◆ initializeTargetID() [1/2]

void llvm::AMDGPUTargetStreamer::initializeTargetID ( const MCSubtargetInfo STI)
inline

Definition at line 103 of file AMDGPUTargetStreamer.h.

References assert(), llvm::None, and TargetID.

Referenced by initializeTargetID().

◆ initializeTargetID() [2/2]

void llvm::AMDGPUTargetStreamer::initializeTargetID ( const MCSubtargetInfo STI,
StringRef  FeatureString 
)
inline

Definition at line 107 of file AMDGPUTargetStreamer.h.

References assert(), getTargetID(), initializeTargetID(), and llvm::None.

Member Data Documentation

◆ TargetID

Optional<AMDGPU::IsaInfo::AMDGPUTargetID> llvm::AMDGPUTargetStreamer::TargetID
protected

The documentation for this class was generated from the following files: