LLVM: lib/Target/AMDGPU/MCTargetDesc/AMDGPUTargetStreamer.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUTARGETSTREAMER_H
10#define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUTARGETSTREAMER_H
11
15
16namespace llvm {
17
21
23
28}
29}
30
33
34protected:
35
36 std::optionalAMDGPU::IsaInfo::AMDGPUTargetID TargetID;
38
40
41public:
47
49
51
55
57
59
62
69
74
75
77
78
80
81
82
83
84
85
86
87
91
92
96
97
99
100 virtual void
106
109
110 const std::optionalAMDGPU::IsaInfo::AMDGPUTargetID &getTargetID() const {
112 }
113 std::optionalAMDGPU::IsaInfo::AMDGPUTargetID &getTargetID() {
115 }
117 assert(TargetID == std::nullopt && "TargetID can only be initialized once");
119 }
122
124 getTargetID()->setTargetIDFromFeaturesString(FeatureString);
125 }
126};
127
130public:
132
133 void finish() override;
134
136
138
140
142
144
147 const MCSymbol *NumExplicitSGPR, const MCSymbol *NumNamedBarrier,
149 const MCSymbol *UsesFlatScratch, const MCSymbol *HasDynamicallySizedStack,
150 const MCSymbol *HasRecursion, const MCSymbol *HasIndirectCall) override;
151
154 const MCSymbol *MaxNamedBarrier) override;
155
156
158
159
161
162
164
165 void
168 const MCExpr *NextVGPR, const MCExpr *NextSGPR,
169 const MCExpr *ReserveVCC,
170 const MCExpr *ReserveFlatScr) override;
171};
172
176
177 void EmitNote(StringRef Name, const MCExpr *DescSize, unsigned NoteType,
179
180 unsigned getEFlags();
181
182 unsigned getEFlagsR600();
183 unsigned getEFlagsAMDGCN();
184
185 unsigned getEFlagsUnknownOS();
186 unsigned getEFlagsAMDHSA();
187 unsigned getEFlagsAMDPAL();
188 unsigned getEFlagsMesa3D();
189
190 unsigned getEFlagsV3();
191 unsigned getEFlagsV4();
192 unsigned getEFlagsV6();
193
194public:
196
198
199 void finish() override;
200
202
204
206
208
209
211
212
214
215
217
218 void
221 const MCExpr *NextVGPR, const MCExpr *NextSGPR,
222 const MCExpr *ReserveVCC,
223 const MCExpr *ReserveFlatScr) override;
224};
225}
226#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
AMDGPUTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
bool EmitHSAMetadata(msgpack::Document &HSAMetadata, bool Strict) override
void EmitAMDGPUSymbolType(StringRef SymbolName, unsigned Type) override
bool EmitISAVersion() override
void EmitDirectiveAMDHSACodeObjectVersion(unsigned COV) override
void EmitDirectiveAMDGCNTarget() override
void EmitMCResourceMaximums(const MCSymbol *MaxVGPR, const MCSymbol *MaxAGPR, const MCSymbol *MaxSGPR, const MCSymbol *MaxNamedBarrier) override
void EmitAMDKernelCodeT(AMDGPU::AMDGPUMCKernelCodeT &Header) override
void EmitAmdhsaKernelDescriptor(const MCSubtargetInfo &STI, StringRef KernelName, const AMDGPU::MCKernelDescriptor &KernelDescriptor, const MCExpr *NextVGPR, const MCExpr *NextSGPR, const MCExpr *ReserveVCC, const MCExpr *ReserveFlatScr) override
void EmitMCResourceInfo(const MCSymbol *NumVGPR, const MCSymbol *NumAGPR, const MCSymbol *NumExplicitSGPR, const MCSymbol *NumNamedBarrier, const MCSymbol *PrivateSegmentSize, const MCSymbol *UsesVCC, const MCSymbol *UsesFlatScratch, const MCSymbol *HasDynamicallySizedStack, const MCSymbol *HasRecursion, const MCSymbol *HasIndirectCall) override
bool EmitCodeEnd(const MCSubtargetInfo &STI) override
void emitAMDGPULDS(MCSymbol *Sym, unsigned Size, Align Alignment) override
void EmitDirectiveAMDGCNTarget() override
bool EmitCodeEnd(const MCSubtargetInfo &STI) override
void EmitAMDKernelCodeT(AMDGPU::AMDGPUMCKernelCodeT &Header) override
bool EmitHSAMetadata(msgpack::Document &HSAMetadata, bool Strict) override
AMDGPUTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
void emitAMDGPULDS(MCSymbol *Sym, unsigned Size, Align Alignment) override
void EmitAmdhsaKernelDescriptor(const MCSubtargetInfo &STI, StringRef KernelName, const AMDGPU::MCKernelDescriptor &KernelDescriptor, const MCExpr *NextVGPR, const MCExpr *NextSGPR, const MCExpr *ReserveVCC, const MCExpr *ReserveFlatScr) override
MCELFStreamer & getStreamer()
void EmitAMDGPUSymbolType(StringRef SymbolName, unsigned Type) override
bool EmitISAVersion() override
virtual void EmitAmdhsaKernelDescriptor(const MCSubtargetInfo &STI, StringRef KernelName, const AMDGPU::MCKernelDescriptor &KernelDescriptor, const MCExpr *NextVGPR, const MCExpr *NextSGPR, const MCExpr *ReserveVCC, const MCExpr *ReserveFlatScr)
Definition AMDGPUTargetStreamer.h:101
virtual bool EmitHSAMetadata(msgpack::Document &HSAMetadata, bool Strict)
Emit HSA Metadata.
Definition AMDGPUTargetStreamer.h:88
AMDGPUPALMetadata * getPALMetadata()
Definition AMDGPUTargetStreamer.h:48
AMDGPUTargetStreamer(MCStreamer &S)
Definition AMDGPUTargetStreamer.h:42
virtual void EmitDirectiveAMDHSACodeObjectVersion(unsigned COV)
Definition AMDGPUTargetStreamer.h:52
virtual bool EmitISAVersion()
Definition AMDGPUTargetStreamer.h:76
void initializeTargetID(const MCSubtargetInfo &STI)
Definition AMDGPUTargetStreamer.h:116
virtual void emitAMDGPULDS(MCSymbol *Symbol, unsigned Size, Align Alignment)
Definition AMDGPUTargetStreamer.h:60
virtual bool EmitHSAMetadataV3(StringRef HSAMetadataString)
virtual void EmitMCResourceInfo(const MCSymbol *NumVGPR, const MCSymbol *NumAGPR, const MCSymbol *NumExplicitSGPR, const MCSymbol *NumNamedBarrier, const MCSymbol *PrivateSegmentSize, const MCSymbol *UsesVCC, const MCSymbol *UsesFlatScratch, const MCSymbol *HasDynamicallySizedStack, const MCSymbol *HasRecursion, const MCSymbol *HasIndirectCall)
Definition AMDGPUTargetStreamer.h:63
std::optional< AMDGPU::IsaInfo::AMDGPUTargetID > & getTargetID()
Definition AMDGPUTargetStreamer.h:113
virtual bool EmitCodeEnd(const MCSubtargetInfo &STI)
Definition AMDGPUTargetStreamer.h:98
static unsigned getElfMach(StringRef GPU)
virtual void EmitAMDGPUSymbolType(StringRef SymbolName, unsigned Type)
Definition AMDGPUTargetStreamer.h:58
void initializeTargetID(const MCSubtargetInfo &STI, StringRef FeatureString)
Definition AMDGPUTargetStreamer.h:120
virtual void EmitDirectiveAMDGCNTarget()
Definition AMDGPUTargetStreamer.h:50
virtual void EmitAMDKernelCodeT(AMDGPU::AMDGPUMCKernelCodeT &Header)
Definition AMDGPUTargetStreamer.h:56
virtual bool EmitHSAMetadata(const AMDGPU::HSAMD::Metadata &HSAMetadata)
Definition AMDGPUTargetStreamer.h:93
MCContext & getContext() const
Definition AMDGPUTargetStreamer.h:39
static StringRef getArchNameFromElfMach(unsigned ElfMach)
const std::optional< AMDGPU::IsaInfo::AMDGPUTargetID > & getTargetID() const
Definition AMDGPUTargetStreamer.h:110
virtual void EmitMCResourceMaximums(const MCSymbol *MaxVGPR, const MCSymbol *MaxAGPR, const MCSymbol *MaxSGPR, const MCSymbol *MaxNamedBarrier)
Definition AMDGPUTargetStreamer.h:70
std::optional< AMDGPU::IsaInfo::AMDGPUTargetID > TargetID
Definition AMDGPUTargetStreamer.h:36
unsigned CodeObjectVersion
Definition AMDGPUTargetStreamer.h:37
Context object for machine code objects.
Base class for the full range of assembler expressions which are needed for parsing.
Streaming machine code generation interface.
Generic base class for all target subtargets.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
MCTargetStreamer(MCStreamer &S)
StringRef - Represent a constant reference to a string, i.e.
The instances of the Type class are immutable: once they are created, they are never changed.
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
An efficient, type-erasing, non-owning reference to a callable.
Simple in-memory representation of a document of msgpack objects with ability to find and create arra...
This is an optimization pass for GlobalISel generic memory operations.
This struct is a compact representation of a valid (non-zero power of two) alignment.