LLVM 24.0.0git
SPIRVNonSemanticDebugHandler.h
Go to the documentation of this file.
1//===-- SPIRVNonSemanticDebugHandler.h - NSDI AsmPrinter handler -*- C++
2//-*-===//
3//
4// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7//
8//===----------------------------------------------------------------------===//
9//
10// This file declares SPIRVNonSemanticDebugHandler, a DebugHandlerBase subclass
11// that emits NonSemantic.Shader.DebugInfo.100 instructions in the SPIR-V
12// AsmPrinter. It replaces SPIRVEmitNonSemanticDI, which was a
13// MachineFunctionPass, with a handler that controls instruction placement
14// directly instead of routing through SPIRVModuleAnalysis.
15//
16//===----------------------------------------------------------------------===//
17
18#ifndef LLVM_LIB_TARGET_SPIRV_SPIRVNONSEMANTICDEBUGHANDLER_H
19#define LLVM_LIB_TARGET_SPIRV_SPIRVNONSEMANTICDEBUGHANDLER_H
20
22#include "SPIRVModuleAnalysis.h"
23#include "llvm/ADT/DenseMap.h"
24#include "llvm/ADT/SetVector.h"
27#include "llvm/ADT/StringMap.h"
30#include "llvm/MC/MCInst.h"
31#include "llvm/MC/MCRegister.h"
32#include <optional>
33
34namespace llvm {
35
36class GlobalVariable;
37class SPIRVSubtarget;
38
39/// AsmPrinter handler that emits NonSemantic.Shader.DebugInfo.100 (NSDI)
40/// instructions for the SPIR-V backend. Registered with SPIRVAsmPrinter when
41/// the module contains debug info (llvm.dbg.cu).
42///
43/// Call sequence:
44/// - beginModule() collects compile-unit metadata.
45/// - prepareModuleOutput() adds the extension and ext-inst set to MAI.
46/// - emitNonSemanticDebugStrings() emits NSDI OpStrings in section 7.
47/// - emitNonSemanticGlobalDebugInfo() emits module-scope NSDI and sets
48/// GlobalNSDIEnabled.
49/// - beginFunctionImpl() prepares per-function DebugFunctionDefinition state.
50/// - endInstruction() emits DebugFunctionDefinition after the last function-
51/// level OpVariable; SPIRVAsmPrinter calls notifyEntryLabelEmitted() after
52/// the synthesized entry OpLabel when there are no OpVariables.
53/// - endFunctionImpl() resets per-function state.
55 static constexpr unsigned NSSet = static_cast<unsigned>(
56 SPIRV::InstructionSet::NonSemantic_Shader_DebugInfo_100);
57
58 struct CompileUnitInfo {
59 const DICompileUnit *TheCU = nullptr;
60 SmallString<128> FilePath;
61 unsigned SpirvSourceLanguage = 0; // NonSemantic.Shader.DebugInfo.100 source
62 // language code (section 4.3)
63 };
65 int64_t DwarfVersion = 0;
66
67 // DI types partitioned from DebugInfoFinder.types() in beginModule()
68 // (basics, pointers, vectors, subroutine types NSDI v1 may emit).
72 // DICompositeType nodes with DW_TAG_array_type and DINode::FlagVector,
73 // partitioned from DebugInfoFinder.types() in beginModule().
75 // DICompositeType nodes with DW_TAG_array_type that are not vectors,
76 // partitioned in beginModule().
78 // DICompositeType nodes with DW_TAG_structure_type, DW_TAG_class_type, or
79 // DW_TAG_union_type, partitioned in beginModule() for DebugTypeComposite.
81 // DIDerivedType nodes with DW_TAG_typedef, partitioned in beginModule() for
82 // DebugTypedef emission.
84
85 // NonSemantic debug instruction result id per emitted scope.
87
88 // DISubprogram nodes that are declarations only (!isDefinition()), collected
89 // in beginModule() for DebugFunctionDeclaration emission.
90 SmallVector<const DISubprogram *> SubprogramDeclarations;
91
92 // DISubprogram nodes that are definitions, collected in beginModule() for
93 // DebugFunction emission.
94 SmallVector<const DISubprogram *> SubprogramDefinitions;
95
96 // Distinct DILocations from instruction !dbg attachments and debug program
97 // records (#dbg_declare, #dbg_value, #dbg_assign, #dbg_label).
98 SetVector<const DILocation *> UniqueDebugLocations;
99
100 struct GlobalVariableDebugInfo {
101 const DIExpression *Expr = nullptr;
102 const GlobalVariable *LLVMGV = nullptr;
103 };
105 GlobalVariableDebugInfoMap;
106
107 // Distinct DILexicalBlock and DINamespace scopes, parent-before-child
108 // order, collected in beginModule() for DebugLexicalBlock emission.
109 SetVector<const DIScope *> LexicalBlocks;
110
111 // Path \c OpString result id per \c DIScope (CU, \c DIFile, declaration
112 // \c DISubprogram, …). Filled during \c emitNonSemanticDebugStrings() using
113 // \c getDebugFullPath + \c emitOpStringIfNew; section 10 uses it for
114 // \c DebugSource without recomputing path text.
115 DenseMap<const DIScope *, MCRegister> ScopeToPathOpStringReg;
116
117 // DebugSource result id keyed by path \c OpString id (\c MCRegister::id()),
118 // deduplicating when the same file string is reused.
119 DenseMap<unsigned, MCRegister> DebugSourceRegByFileStr;
120
121 // Maps OpString contents to result id. Populated only by emitOpStringIfNew()
122 // during section 7; section 10 uses getCachedOpStringReg() (lookup only).
123 StringMap<MCRegister> OpStringContentCache;
124
125#ifndef NDEBUG // Only declare the variable for debugging purposes.
126 // True after emitNonSemanticDebugStrings() emitted the NSDI OpStrings for
127 // this module. SPIRVAsmPrinter calls that before
128 // emitNonSemanticGlobalDebugInfo().
129 bool NonSemanticOpStringsSectionEmitted = false;
130#endif
131
132 MCRegister CachedEmptyStringReg;
133
134 MCRegister CachedDebugInfoNoneReg;
135
136 MCRegister CachedOpTypeVoidReg;
137
138 MCRegister CachedOpTypeInt32Reg;
139
140 // Cache of already-emitted i32 constants, keyed by value. Prevents
141 // duplicate OpConstant instructions for the same integer value.
142 DenseMap<uint32_t, MCRegister> I32ConstantCache;
143
144 // Cache of already-emitted DebugTypeFunction instructions, keyed by operand
145 // ids (flags, return type, parameters).
146 DenseMap<SmallVector<MCRegister, 8>, MCRegister> DebugTypeFunctionCache;
147
148 // True once emitNonSemanticGlobalDebugInfo() has run. Both
149 // SPIRVAsmPrinter::emitFunctionHeader() and emitEndOfAsmFile() may call
150 // outputModuleSections(), each guarded by ModuleSectionsEmitted, so only
151 // one fires. This flag provides a secondary guard in case the call sites
152 // change.
153 bool GlobalDIEmitted = false;
154
155 // True when emitNonSemanticGlobalDebugInfo() completed module-scope NSDI
156 // emission for this module.
157 bool GlobalNSDIEnabled = false;
158
159 SPIRV::ModuleAnalysisInfo *CurrentMAI = nullptr;
160
161 const MachineFunction *CurrentMF = nullptr;
162
163 const MachineInstr *LastFunctionOpVariable = nullptr;
164
165 bool DebugFunctionDefinitionEmitted = false;
166
167 const MachineInstr *LastLineMI = nullptr;
168
169public:
171
172 /// Collect compile-unit metadata from the module. Called by
173 /// AsmPrinter::doInitialization() via the handler list. No emission.
174 void beginModule(Module *M) override;
175
176 /// Emit OpString instructions for all NSDI file paths and basic type names
177 /// into the debug section (section 7 of the SPIR-V module layout). Must be
178 /// called from SPIRVAsmPrinter::outputDebugSourceAndStrings(), after
179 /// prepareModuleOutput() has registered the ext inst set. Registers are
180 /// stored in \c OpStringContentCache and \c ScopeToPathOpStringReg;
181 /// \c emitNonSemanticGlobalDebugInfo() resolves them via
182 /// \c getCachedOpStringReg() and path maps.
184
185 /// Add SPV_KHR_non_semantic_info extension and
186 /// NonSemantic.Shader.DebugInfo.100 ext inst set entry to MAI. Must be called
187 /// before outputGlobalRequirements() and outputOpExtInstImports() in
188 /// SPIRVAsmPrinter::outputModuleSections().
189 void prepareModuleOutput(const SPIRVSubtarget &ST,
191
192 /// Emit module-scope NSDI instructions (DebugSource, DebugCompilationUnit,
193 /// DebugTypeBasic, DebugTypePointer, DebugTypeFunction,
194 /// DebugFunctionDeclaration, DebugFunction). Called by
195 /// SPIRVAsmPrinter::outputModuleSections() at section 10 in place of
196 /// outputModuleSection(MB_NonSemanticGlobalDI). Requires
197 /// emitNonSemanticDebugStrings() to have run first when NSDI strings apply.
198 /// Sets \c GlobalNSDIEnabled when module-scope NSDI emission completes.
200
201 /// Called after the synthesized entry \c OpLabel has been emitted.
203
204protected:
205 // All module-level output is driven by emitNonSemanticGlobalDebugInfo(),
206 // called explicitly from SPIRVAsmPrinter::outputModuleSections(). Nothing
207 // needs to happen in the AsmPrinterHandler::endModule() callback.
208 void endModule() override {}
209
210 // DebugHandlerBase stores MMI as a pointer copy from Asm->MMI at construction
211 // time (DebugHandlerBase.cpp: `MMI(Asm->MMI)`). The handler is constructed
212 // before AsmPrinter::doInitialization() runs, so Asm->MMI is null at that
213 // point and MMI remains null for this handler's entire lifetime. Do not call
214 // the base-class beginInstruction/endInstruction — they dereference MMI to
215 // create temp symbols for label tracking and would crash.
216 // Future local NSDI that needs MCContext must use
217 // Asm->OutStreamer->getContext() rather than MMI->getContext().
218 void beginInstruction(const MachineInstr *MI) override;
219 void endInstruction() override;
220
221 // Override beginFunctionImpl(), not beginFunction():
222 // DebugHandlerBase::beginFunction() populates LScopes and DbgValues needed
223 // for future DebugLine emission.
224 void beginFunctionImpl(const MachineFunction *MF) override;
225 void endFunctionImpl(const MachineFunction *MF) override;
226
227private:
228 void emitDebugFunctionDefinition(MCRegister DebugFunctionReg,
229 MCRegister OpFunctionReg,
231
232 void resetPerFunctionDebugState();
233
234 void emitDebugLineForInstruction(const MachineInstr *MI);
235 void preparePerFunctionDebug(const MachineFunction *MF);
236 void tryEmitDebugFunctionDefinition(SPIRV::ModuleAnalysisInfo &MAI);
237
238 void emitMCInst(MCInst &Inst);
239 MCRegister emitOpString(StringRef S, SPIRV::ModuleAnalysisInfo &MAI);
240
241 /// Section 7 only: emit OpString and cache it if not already present. Must
242 /// not be called after NonSemanticOpStringsSectionEmitted is set. Returns
243 /// the path (or string) \c OpString result id.
244 MCRegister emitOpStringIfNew(StringRef S, SPIRV::ModuleAnalysisInfo &MAI);
245
246 /// Section 10 only: lookup OpString id from cache; asserts if missing or if
247 /// section 7 did not complete.
248 MCRegister getCachedOpStringReg(StringRef S);
249
250 /// Section 7 only: emit the path \c OpString for \p Scope and cache it under
251 /// \p Scope. Returns the \c OpString result id. A \p Scope already seen
252 /// returns the cached id without rebuilding the path. A null \p Scope maps to
253 /// the empty path and is cached like any other, though section 10 reads it
254 /// through \c getCachedScopePathOpStringReg, which handles null separately.
255 MCRegister emitAndCacheScopePathOpStringReg(const DIScope *Scope,
257
258 /// Section 10 only: lookup path \c OpString id for \p Scope from
259 /// \c ScopeToPathOpStringReg; asserts if missing or invalid. When
260 /// \p UseEmptyPathIfNullScope is true and \p Scope is null, returns
261 /// \c CachedEmptyStringReg instead.
263 getCachedScopePathOpStringReg(const DIScope *Scope,
264 bool UseEmptyPathIfNullScope = false);
265 MCRegister emitOpConstantI32(uint32_t Value, MCRegister I32TypeReg,
267 MCRegister emitExtInst(SPIRV::NonSemanticExtInst::NonSemanticExtInst Opcode,
268 MCRegister VoidTypeReg, MCRegister ExtInstSetReg,
271
272 /// Return a cached DebugTypeFunction id when \p Ops matches a prior emission,
273 /// otherwise emit and cache a new instruction.
274 MCRegister getOrEmitDebugTypeFunction(ArrayRef<MCRegister> Ops,
275 MCRegister VoidTypeReg,
276 MCRegister ExtInstSetReg,
278
279 /// Return OpTypeVoid id for this module (lazy lookup / emit, then cache).
280 MCRegister getOrEmitOpTypeVoidReg(SPIRV::ModuleAnalysisInfo &MAI);
281
282 /// Return OpTypeInt 32 0 id for this module (lazy lookup / emit, then cache).
283 MCRegister getOrEmitOpTypeInt32Reg(SPIRV::ModuleAnalysisInfo &MAI);
284
285 /// Find OpTypeVoid in the already-emitted TypeConstVars section, or emit one
286 /// if the module does not contain it (e.g. no void-returning functions).
287 MCRegister findOrEmitOpTypeVoid(SPIRV::ModuleAnalysisInfo &MAI);
288
289 /// Find OpTypeInt 32 0 in the already-emitted TypeConstVars section, or emit
290 /// one if the module does not contain it.
291 MCRegister findOrEmitOpTypeInt32(SPIRV::ModuleAnalysisInfo &MAI);
292
293 /// Emit \c DebugTypePointer for pointer metadata \p PT.
294 ///
295 /// \returns The result id register on success. Returns \c std::nullopt and
296 /// emits nothing if \p PT has no DWARF address space (needed to pick the
297 /// SPIR-V storage class), or if \p PT has a non-null base DI type that is not
298 /// yet in \c DebugScopeRegs (the pointee was not emitted as a debug type).
299 ///
300 /// Base Type operand: the register from \c DebugScopeRegs for \p PT's base
301 /// type when it is set and mapped; \c DebugInfoNone when there is no base
302 /// type (e.g. \c void * in IR), consistent with SPIRV-LLVM-Translator.
303 std::optional<MCRegister>
304 emitDebugTypePointer(const DIDerivedType *PT, MCRegister ExtInstSetReg,
306
307 /// Emit one DebugTypeFunction for ST when every DI operand maps to a debug
308 /// type id; otherwise emit nothing and return std::nullopt.
309 std::optional<MCRegister>
310 emitDebugTypeFunctionForSubroutineType(const DISubroutineType *ST,
311 MCRegister ExtInstSetReg,
313
314 /// Emit \c DebugFunctionDeclaration for a \c DISubprogram that is not a
315 /// definition (\p SP must satisfy \c !isDefinition()).
316 ///
317 /// \returns The result id register on success. Returns \c std::nullopt and
318 /// emits nothing if \p SP is null, is a definition, has no \c
319 /// DISubroutineType type, the signature type was not emitted in \c
320 /// DebugScopeRegs, no path
321 /// \c OpString was recorded for \p SP in section 7, or
322 /// \c resolveScope returns no id for the \c Parent operand.
323 std::optional<MCRegister>
324 emitDebugFunctionDeclaration(const DISubprogram *SP, MCRegister VoidTypeReg,
325 MCRegister I32TypeReg, MCRegister ExtInstSetReg,
327
328 /// Emit \c DebugFunction for a defining \c DISubprogram (\p SP must satisfy
329 /// \c isDefinition()).
330 std::optional<MCRegister> emitDebugFunction(const DISubprogram *SP,
331 MCRegister VoidTypeReg,
332 MCRegister I32TypeReg,
333 MCRegister ExtInstSetReg,
335
336 /// Emit \c DebugGlobalVariable for the source global variable \p GV.
337 ///
338 /// (\c SPIRVDebug::Operand::GlobalVariable): Name, Type, Source, Line,
339 /// Column, Parent, Linkage Name, Variable, Flags, and an optional Static
340 /// Member Declaration. Line, Column, and Flags are emitted as \c OpConstant
341 /// ids as required for non-semantic debug info.
342 ///
343 /// \c DebugInfoNone is used for two operands when LLVM has no value to
344 /// supply:
345 /// \c Type when \p GV is a declaration with no DI type (e.g. \c extern void;
346 /// valid IR, \c isDefinition: false); \c Variable when no \c
347 /// llvm::GlobalVariable in this module carries \p GV in its \c !dbg metadata.
348 ///
349 /// \returns The result id register on success. Returns \c std::nullopt and
350 /// emits nothing if a non-null \p GV type was not emitted in \c
351 /// DebugScopeRegs, or \p GV has a static data member declaration that was not
352 /// emitted in \c DebugScopeRegs.
353 std::optional<MCRegister> emitDebugGlobalVariable(
354 const DIGlobalVariable *GV, const GlobalVariableDebugInfo &Info,
355 MCRegister VoidTypeReg, MCRegister I32TypeReg, MCRegister ExtInstSetReg,
357
358 /// Emit \c DebugExpression for \p Expr. Unimplemented: defined as a no-op
359 /// (\returns \c std::nullopt, emits nothing) so \c emitDebugGlobalVariable
360 /// can complete Variable-operand resolution for the opcodes we support today.
361 std::optional<MCRegister> emitDebugExpression(const DIExpression *Expr,
362 MCRegister VoidTypeReg,
363 MCRegister ExtInstSetReg,
365
366 /// Emit \c DebugTypeVector for the vector composite type \p VT.
367 ///
368 /// \returns The result id register on success. Returns \c std::nullopt and
369 /// emits nothing if \p VT has no \c DIBasicType base type, if the base type
370 /// has not been emitted yet, if \p VT has more than one \c DISubrange
371 /// element, or if the component count is not a compile-time constant.
372 std::optional<MCRegister> emitDebugTypeVector(const DICompositeType *VT,
373 MCRegister ExtInstSetReg,
375
376 /// Emit \c DebugTypeArray for the array composite type \p AT.
377 ///
378 /// Emits the element (base) type id followed by one Component Count per
379 /// \c DISubrange, in DWARF subrange order. A count that is not a
380 /// compile-time constant is emitted as 0, matching \c OpTypeRuntimeArray. A
381 /// matrix arrives here as a multi-subrange array and is emitted with one
382 /// count per dimension.
383 ///
384 /// \returns The result id register on success. Returns \c std::nullopt and
385 /// emits nothing if \p AT's element type has not been emitted into
386 /// \c DebugScopeRegs.
387 std::optional<MCRegister> emitDebugTypeArray(const DICompositeType *AT,
388 MCRegister ExtInstSetReg,
390
391 /// Emit \c DebugTypeMember for the data member \p M (a \c DIDerivedType with
392 /// \c DW_TAG_member). Operands: Name, Type, Source, Line, Column, Offset,
393 /// Size, Flags. NonSemantic \c DebugTypeMember carries no Parent operand: the
394 /// enclosing \c DebugTypeComposite references its members, not the reverse.
395 ///
396 /// \returns The result id register on success. Returns \c std::nullopt and
397 /// emits nothing if \p M's type has not been emitted into \c DebugScopeRegs.
398 std::optional<MCRegister> emitDebugTypeMember(const DIDerivedType *M,
399 MCRegister VoidTypeReg,
400 MCRegister I32TypeReg,
401 MCRegister ExtInstSetReg,
403
404 /// Emit \c DebugTypeComposite for the struct, class, or union \p CT, listing
405 /// the already-emitted \p MemberRegs in its Members operand. A forward
406 /// declaration emits \c DebugInfoNone for Size and no members.
407 ///
408 /// \returns The result id register on success. Returns \c std::nullopt and
409 /// emits nothing if the Parent scope cannot be resolved.
410 std::optional<MCRegister> emitDebugTypeComposite(
411 const DICompositeType *CT, ArrayRef<MCRegister> MemberRegs,
412 MCRegister VoidTypeReg, MCRegister I32TypeReg, MCRegister ExtInstSetReg,
414
415 /// Emit \c DebugTypedef for the typedef derived type \p TD (a \c
416 /// DIDerivedType with \c DW_TAG_typedef). Operands: Name, Base Type, Source,
417 /// Line, Column, Parent. Parent is the enclosing type when \c TD->getScope()
418 /// is an emitted \c DIType, otherwise the first module \c
419 /// DebugCompilationUnit.
420 ///
421 /// \returns The result id register on success. Returns \c std::nullopt and
422 /// emits nothing if \p TD's base type has not been emitted into \c
423 /// DebugScopeRegs.
424 std::optional<MCRegister> emitDebugTypedef(const DIDerivedType *TD,
425 MCRegister VoidTypeReg,
426 MCRegister I32TypeReg,
427 MCRegister ExtInstSetReg,
429
430 /// Map a \c DISubroutineType::getTypeArray() element to an operand register
431 /// for
432 /// \c DebugTypeFunction. Non-null \p Ty resolves via \c DebugScopeRegs; if
433 /// the type was never emitted, returns \c std::nullopt.
434 ///
435 /// LLVM encodes a void return as a null first element (and may use null in
436 /// later slots). NonSemantic \c DebugTypeFunction
437 /// requires a concrete return-type operand, so when \p ReturnType is true and
438 /// \p Ty is null, this returns \p VoidTypeReg (\c OpTypeVoid). When
439 /// \p ReturnType is false and \p Ty is null, this returns
440 /// \c CachedDebugInfoNoneReg (\c DebugInfoNone).
441 std::optional<MCRegister> mapDISignatureTypeToReg(const DIType *Ty,
442 MCRegister VoidTypeReg,
443 bool ReturnType);
444
445 /// Map a DWARF source language code to a NonSemantic.Shader.DebugInfo.100
446 /// source language code.
447 static unsigned toNSDISrcLang(unsigned DwarfSrcLang);
448
449 /// Build a full path from debug \p Scope for OpString / DebugSource, matching
450 /// SPIRV-LLVM-Translator \c getFullPath (OCLUtil.h): \c DIScope::getFilename,
451 /// \c getDirectory, and \c sys::path::Style::native. Works for any \c DIScope
452 /// that carries file path fields (e.g. \c DIFile, \c DISubprogram,
453 /// \c DICompileUnit). Returns an empty path when \p Scope is null.
454 SmallString<128> getDebugFullPath(const DIScope *Scope) const;
455
456 /// Return an existing \c DebugSource id for file path \c OpString \p
457 /// FileStrReg or emit \c DebugSource and cache it (keyed by \p FileStrReg
458 /// id).
459 MCRegister getOrEmitDebugSourceForFileStrReg(MCRegister FileStrReg,
460 MCRegister VoidTypeReg,
461 MCRegister ExtInstSetReg,
463
464 /// Map \p Scope to the NonSemantic debug id used as a \c Parent operand.
465 ///
466 /// Checks \c DebugScopeRegs in order by scope kind. When \p Scope is null, a
467 /// \c DIFile, or another scope without a dedicated debug instruction, falls
468 /// back to \p FallbackCU or the first module \c DebugCompilationUnit
469 /// recorded in \c DebugScopeRegs.
470 ///
471 /// \returns \c std::nullopt when \p Scope names an emitted scope that has
472 /// not been recorded yet, or when no fallback compile unit is available.
473 std::optional<MCRegister>
474 resolveScope(const DIScope *Scope,
475 const DICompileUnit *FallbackCU = nullptr) const;
476
477 /// Emit \c DebugLexicalBlock for \p S, which must be a \c DILexicalBlock or
478 /// a \c DINamespace. A \c DILexicalBlock supplies Line/Column
479 /// from \c getLine()/getColumn(); a \c DINamespace has neither, so both are
480 /// emitted as 0, and its Name is appended as an extra \c OpString operand.
481 ///
482 /// \returns The result id register on success. Returns \c std::nullopt and
483 /// emits nothing if \c resolveScope returns no id for \c S->getScope().
484 std::optional<MCRegister>
485 emitDebugLexicalBlock(const DIScope *S, MCRegister VoidTypeReg,
486 MCRegister I32TypeReg, MCRegister ExtInstSetReg,
488};
489
490} // namespace llvm
491
492#endif // LLVM_LIB_TARGET_SPIRV_SPIRVNONSEMANTICDEBUGHANDLER_H
This file defines the StringMap class.
This file defines the DenseMap class.
IRTranslator LLVM IR MI
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
static NVPTX::Scope resolveScope(NVPTX::Scope S, const NVPTXSubtarget *T)
SI Fold Operands
This file implements a set that has insertion order iteration characteristics.
This file defines the SmallString class.
This file defines the SmallVector class.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition ArrayRef.h:40
This class is intended to be used as a driving class for all asm writers.
Definition AsmPrinter.h:91
DWARF expression.
Base class for scope-like contexts.
Subprogram description. Uses SubclassData1.
Type array for a subprogram.
Base class for types.
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:188
Wrapper class representing physical registers. Should be passed by value.
Definition MCRegister.h:41
Representation of each machine instruction.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:68
void beginInstruction(const MachineInstr *MI) override
Process beginning of an instruction.
void endModule() override
Emit all sections that should come after the content.
void emitNonSemanticDebugStrings(SPIRV::ModuleAnalysisInfo &MAI)
Emit OpString instructions for all NSDI file paths and basic type names into the debug section (secti...
void beginModule(Module *M) override
Collect compile-unit metadata from the module.
void endFunctionImpl(const MachineFunction *MF) override
void beginFunctionImpl(const MachineFunction *MF) override
void emitNonSemanticGlobalDebugInfo(SPIRV::ModuleAnalysisInfo &MAI)
Emit module-scope NSDI instructions (DebugSource, DebugCompilationUnit, DebugTypeBasic,...
void prepareModuleOutput(const SPIRVSubtarget &ST, SPIRV::ModuleAnalysisInfo &MAI)
Add SPV_KHR_non_semantic_info extension and NonSemantic.Shader.DebugInfo.100 ext inst set entry to MA...
void endInstruction() override
Process end of an instruction.
void notifyEntryLabelEmitted(const MachineFunction &MF)
Called after the synthesized entry OpLabel has been emitted.
A vector that has set insertion semantics.
Definition SetVector.h:57
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
Definition SmallString.h:26
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition StringMap.h:129
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
LLVM Value Representation.
Definition Value.h:75
This is an optimization pass for GlobalISel generic memory operations.