LLVM  15.0.0git
SPIRVAsmPrinter.cpp
Go to the documentation of this file.
1 //===-- SPIRVAsmPrinter.cpp - SPIR-V LLVM assembly writer ------*- C++ -*--===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains a printer that converts from our internal representation
10 // of machine-dependent LLVM code to the SPIR-V assembly language.
11 //
12 //===----------------------------------------------------------------------===//
13 
15 #include "SPIRV.h"
16 #include "SPIRVInstrInfo.h"
17 #include "SPIRVMCInstLower.h"
18 #include "SPIRVModuleAnalysis.h"
19 #include "SPIRVSubtarget.h"
20 #include "SPIRVTargetMachine.h"
21 #include "SPIRVUtils.h"
23 #include "llvm/ADT/DenseMap.h"
30 #include "llvm/MC/MCAsmInfo.h"
31 #include "llvm/MC/MCInst.h"
32 #include "llvm/MC/MCStreamer.h"
33 #include "llvm/MC/MCSymbol.h"
34 #include "llvm/MC/TargetRegistry.h"
36 
37 using namespace llvm;
38 
39 #define DEBUG_TYPE "asm-printer"
40 
41 namespace {
42 class SPIRVAsmPrinter : public AsmPrinter {
43 public:
44  explicit SPIRVAsmPrinter(TargetMachine &TM,
45  std::unique_ptr<MCStreamer> Streamer)
46  : AsmPrinter(TM, std::move(Streamer)), ST(nullptr), TII(nullptr) {}
47  bool ModuleSectionsEmitted;
48  const SPIRVSubtarget *ST;
49  const SPIRVInstrInfo *TII;
50 
51  StringRef getPassName() const override { return "SPIRV Assembly Printer"; }
52  void printOperand(const MachineInstr *MI, int OpNum, raw_ostream &O);
53  bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
54  const char *ExtraCode, raw_ostream &O) override;
55 
56  void outputMCInst(MCInst &Inst);
57  void outputInstruction(const MachineInstr *MI);
58  void outputModuleSection(SPIRV::ModuleSectionType MSType);
59  void outputEntryPoints();
60  void outputDebugSourceAndStrings(const Module &M);
61  void outputOpMemoryModel();
62  void outputOpFunctionEnd();
63  void outputExtFuncDecls();
64  void outputModuleSections();
65 
66  void emitInstruction(const MachineInstr *MI) override;
67  void emitFunctionEntryLabel() override {}
68  void emitFunctionHeader() override;
69  void emitFunctionBodyStart() override {}
70  void emitFunctionBodyEnd() override;
71  void emitBasicBlockStart(const MachineBasicBlock &MBB) override;
72  void emitBasicBlockEnd(const MachineBasicBlock &MBB) override {}
73  void emitGlobalVariable(const GlobalVariable *GV) override {}
74  void emitOpLabel(const MachineBasicBlock &MBB);
75  void emitEndOfAsmFile(Module &M) override;
76  bool doInitialization(Module &M) override;
77 
78  void getAnalysisUsage(AnalysisUsage &AU) const override;
80 };
81 } // namespace
82 
83 void SPIRVAsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const {
87 }
88 
89 // If the module has no functions, we need output global info anyway.
90 void SPIRVAsmPrinter::emitEndOfAsmFile(Module &M) {
91  if (ModuleSectionsEmitted == false) {
92  outputModuleSections();
93  ModuleSectionsEmitted = true;
94  }
95 }
96 
97 void SPIRVAsmPrinter::emitFunctionHeader() {
98  if (ModuleSectionsEmitted == false) {
99  outputModuleSections();
100  ModuleSectionsEmitted = true;
101  }
102  // Get the subtarget from the current MachineFunction.
103  ST = &MF->getSubtarget<SPIRVSubtarget>();
104  TII = ST->getInstrInfo();
105  const Function &F = MF->getFunction();
106 
107  if (isVerbose()) {
108  OutStreamer->getCommentOS()
109  << "-- Begin function "
110  << GlobalValue::dropLLVMManglingEscape(F.getName()) << '\n';
111  }
112 
113  auto Section = getObjFileLowering().SectionForGlobal(&F, TM);
114  MF->setSection(Section);
115 }
116 
117 void SPIRVAsmPrinter::outputOpFunctionEnd() {
118  MCInst FunctionEndInst;
119  FunctionEndInst.setOpcode(SPIRV::OpFunctionEnd);
120  outputMCInst(FunctionEndInst);
121 }
122 
123 // Emit OpFunctionEnd at the end of MF and clear BBNumToRegMap.
124 void SPIRVAsmPrinter::emitFunctionBodyEnd() {
125  outputOpFunctionEnd();
126  MAI->BBNumToRegMap.clear();
127 }
128 
129 void SPIRVAsmPrinter::emitOpLabel(const MachineBasicBlock &MBB) {
130  MCInst LabelInst;
131  LabelInst.setOpcode(SPIRV::OpLabel);
132  LabelInst.addOperand(MCOperand::createReg(MAI->getOrCreateMBBRegister(MBB)));
133  outputMCInst(LabelInst);
134 }
135 
136 void SPIRVAsmPrinter::emitBasicBlockStart(const MachineBasicBlock &MBB) {
137  // If it's the first MBB in MF, it has OpFunction and OpFunctionParameter, so
138  // OpLabel should be output after them.
139  if (MBB.getNumber() == MF->front().getNumber()) {
140  for (const MachineInstr &MI : MBB)
141  if (MI.getOpcode() == SPIRV::OpFunction)
142  return;
143  // TODO: this case should be checked by the verifier.
144  report_fatal_error("OpFunction is expected in the front MBB of MF");
145  }
146  emitOpLabel(MBB);
147 }
148 
149 void SPIRVAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
150  raw_ostream &O) {
151  const MachineOperand &MO = MI->getOperand(OpNum);
152 
153  switch (MO.getType()) {
156  break;
157 
159  O << MO.getImm();
160  break;
161 
163  O << MO.getFPImm();
164  break;
165 
167  O << *MO.getMBB()->getSymbol();
168  break;
169 
171  O << *getSymbol(MO.getGlobal());
172  break;
173 
175  MCSymbol *BA = GetBlockAddressSymbol(MO.getBlockAddress());
176  O << BA->getName();
177  break;
178  }
179 
181  O << *GetExternalSymbolSymbol(MO.getSymbolName());
182  break;
183 
186  default:
187  llvm_unreachable("<unknown operand type>");
188  }
189 }
190 
191 bool SPIRVAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
192  const char *ExtraCode, raw_ostream &O) {
193  if (ExtraCode && ExtraCode[0])
194  return true; // Invalid instruction - SPIR-V does not have special modifiers
195 
196  printOperand(MI, OpNo, O);
197  return false;
198 }
199 
201  const SPIRVInstrInfo *TII) {
202  return TII->isHeaderInstr(*MI) || MI->getOpcode() == SPIRV::OpFunction ||
203  MI->getOpcode() == SPIRV::OpFunctionParameter;
204 }
205 
206 void SPIRVAsmPrinter::outputMCInst(MCInst &Inst) {
207  OutStreamer->emitInstruction(Inst, *OutContext.getSubtargetInfo());
208 }
209 
210 void SPIRVAsmPrinter::outputInstruction(const MachineInstr *MI) {
211  SPIRVMCInstLower MCInstLowering;
212  MCInst TmpInst;
213  MCInstLowering.lower(MI, TmpInst, MAI);
214  outputMCInst(TmpInst);
215 }
216 
217 void SPIRVAsmPrinter::emitInstruction(const MachineInstr *MI) {
218  if (!MAI->getSkipEmission(MI))
219  outputInstruction(MI);
220 
221  // Output OpLabel after OpFunction and OpFunctionParameter in the first MBB.
222  const MachineInstr *NextMI = MI->getNextNode();
223  if (!MAI->hasMBBRegister(*MI->getParent()) && isFuncOrHeaderInstr(MI, TII) &&
224  (!NextMI || !isFuncOrHeaderInstr(NextMI, TII))) {
225  assert(MI->getParent()->getNumber() == MF->front().getNumber() &&
226  "OpFunction is not in the front MBB of MF");
227  emitOpLabel(*MI->getParent());
228  }
229 }
230 
231 void SPIRVAsmPrinter::outputModuleSection(SPIRV::ModuleSectionType MSType) {
232  for (MachineInstr *MI : MAI->getMSInstrs(MSType))
233  outputInstruction(MI);
234 }
235 
236 void SPIRVAsmPrinter::outputDebugSourceAndStrings(const Module &M) {
237  // Output OpSource.
238  MCInst Inst;
239  Inst.setOpcode(SPIRV::OpSource);
240  Inst.addOperand(MCOperand::createImm(static_cast<unsigned>(MAI->SrcLang)));
241  Inst.addOperand(
242  MCOperand::createImm(static_cast<unsigned>(MAI->SrcLangVersion)));
243  outputMCInst(Inst);
244 }
245 
246 void SPIRVAsmPrinter::outputOpMemoryModel() {
247  MCInst Inst;
248  Inst.setOpcode(SPIRV::OpMemoryModel);
249  Inst.addOperand(MCOperand::createImm(static_cast<unsigned>(MAI->Addr)));
250  Inst.addOperand(MCOperand::createImm(static_cast<unsigned>(MAI->Mem)));
251  outputMCInst(Inst);
252 }
253 
254 // Before the OpEntryPoints' output, we need to add the entry point's
255 // interfaces. The interface is a list of IDs of global OpVariable instructions.
256 // These declare the set of global variables from a module that form
257 // the interface of this entry point.
258 void SPIRVAsmPrinter::outputEntryPoints() {
259  // Find all OpVariable IDs with required StorageClass.
260  DenseSet<Register> InterfaceIDs;
261  for (MachineInstr *MI : MAI->GlobalVarList) {
262  assert(MI->getOpcode() == SPIRV::OpVariable);
263  auto SC = static_cast<SPIRV::StorageClass>(MI->getOperand(2).getImm());
264  // Before version 1.4, the interface's storage classes are limited to
265  // the Input and Output storage classes. Starting with version 1.4,
266  // the interface's storage classes are all storage classes used in
267  // declaring all global variables referenced by the entry point call tree.
268  if (ST->getSPIRVVersion() >= 14 || SC == SPIRV::StorageClass::Input ||
270  MachineFunction *MF = MI->getMF();
271  Register Reg = MAI->getRegisterAlias(MF, MI->getOperand(0).getReg());
272  InterfaceIDs.insert(Reg);
273  }
274  }
275 
276  // Output OpEntryPoints adding interface args to all of them.
277  for (MachineInstr *MI : MAI->getMSInstrs(SPIRV::MB_EntryPoints)) {
278  SPIRVMCInstLower MCInstLowering;
279  MCInst TmpInst;
280  MCInstLowering.lower(MI, TmpInst, MAI);
281  for (Register Reg : InterfaceIDs) {
282  assert(Reg.isValid());
284  }
285  outputMCInst(TmpInst);
286  }
287 }
288 
289 void SPIRVAsmPrinter::outputExtFuncDecls() {
290  // Insert OpFunctionEnd after each declaration.
292  I = MAI->getMSInstrs(SPIRV::MB_ExtFuncDecls).begin(),
293  E = MAI->getMSInstrs(SPIRV::MB_ExtFuncDecls).end();
294  for (; I != E; ++I) {
295  outputInstruction(*I);
296  if ((I + 1) == E || (*(I + 1))->getOpcode() == SPIRV::OpFunction)
297  outputOpFunctionEnd();
298  }
299 }
300 
301 void SPIRVAsmPrinter::outputModuleSections() {
302  const Module *M = MMI->getModule();
303  // Get the global subtarget to output module-level info.
304  ST = static_cast<const SPIRVTargetMachine &>(TM).getSubtargetImpl();
305  TII = ST->getInstrInfo();
307  assert(ST && TII && MAI && M && "Module analysis is required");
308  // Output instructions according to the Logical Layout of a Module:
309  // TODO: 1,2. All OpCapability instructions, then optional OpExtension
310  // instructions.
311  // TODO: 3. Optional OpExtInstImport instructions.
312  // 4. The single required OpMemoryModel instruction.
313  outputOpMemoryModel();
314  // 5. All entry point declarations, using OpEntryPoint.
315  outputEntryPoints();
316  // 6. Execution-mode declarations, using OpExecutionMode or OpExecutionModeId.
317  // TODO:
318  // 7a. Debug: all OpString, OpSourceExtension, OpSource, and
319  // OpSourceContinued, without forward references.
320  outputDebugSourceAndStrings(*M);
321  // 7b. Debug: all OpName and all OpMemberName.
322  outputModuleSection(SPIRV::MB_DebugNames);
323  // 7c. Debug: all OpModuleProcessed instructions.
324  outputModuleSection(SPIRV::MB_DebugModuleProcessed);
325  // 8. All annotation instructions (all decorations).
326  outputModuleSection(SPIRV::MB_Annotations);
327  // 9. All type declarations (OpTypeXXX instructions), all constant
328  // instructions, and all global variable declarations. This section is
329  // the first section to allow use of: OpLine and OpNoLine debug information;
330  // non-semantic instructions with OpExtInst.
331  outputModuleSection(SPIRV::MB_TypeConstVars);
332  // 10. All function declarations (functions without a body).
333  outputExtFuncDecls();
334  // 11. All function definitions (functions with a body).
335  // This is done in regular function output.
336 }
337 
338 bool SPIRVAsmPrinter::doInitialization(Module &M) {
339  ModuleSectionsEmitted = false;
340  // We need to call the parent's one explicitly.
342 }
343 
344 // Force static initialization.
348 }
AsmPrinter.h
llvm::SPIRV::ModuleSectionType
ModuleSectionType
Definition: SPIRVModuleAnalysis.h:29
llvm::MachineOperand::MO_BlockAddress
@ MO_BlockAddress
Address of a basic block.
Definition: MachineOperand.h:62
MI
IRTranslator LLVM IR MI
Definition: IRTranslator.cpp:104
MachineInstr.h
llvm::MachineOperand::MO_Immediate
@ MO_Immediate
Immediate operand.
Definition: MachineOperand.h:52
llvm::SPIRV::StorageClass::Input
@ Input
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:17
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
SPIRVModuleAnalysis.h
llvm::SPIRV::MB_TypeConstVars
@ MB_TypeConstVars
Definition: SPIRVModuleAnalysis.h:36
llvm::MachineOperand::getGlobal
const GlobalValue * getGlobal() const
Definition: MachineOperand.h:572
llvm::GlobalValue::dropLLVMManglingEscape
static StringRef dropLLVMManglingEscape(StringRef Name)
If the given string begins with the GlobalValue name mangling escape character '\1',...
Definition: GlobalValue.h:530
llvm::MCOperand::createImm
static MCOperand createImm(int64_t Val)
Definition: MCInst.h:141
llvm::Function
Definition: Function.h:60
llvm::MachineOperand::getBlockAddress
const BlockAddress * getBlockAddress() const
Definition: MachineOperand.h:577
llvm::X86Disassembler::Reg
Reg
All possible values of the reg field in the ModR/M byte.
Definition: X86DisassemblerDecoder.h:462
llvm::GlobalVariable
Definition: GlobalVariable.h:39
DenseMap.h
llvm::SPIRVSubtarget
Definition: SPIRVSubtarget.h:36
printOperand
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
Definition: SelectionDAGDumper.cpp:954
llvm::SPIRV::ModuleAnalysisInfo
Definition: SPIRVModuleAnalysis.h:49
SPIRVSubtarget.h
llvm::MCInst
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:184
llvm::SPIRVMCInstLower::lower
void lower(const MachineInstr *MI, MCInst &OutMI, SPIRV::ModuleAnalysisInfo *MAI) const
Definition: SPIRVMCInstLower.cpp:23
llvm::detail::DenseSetImpl< ValueT, DenseMap< ValueT, detail::DenseSetEmpty, DenseMapInfo< ValueT >, detail::DenseSetPair< ValueT > >, DenseMapInfo< ValueT > >::insert
std::pair< iterator, bool > insert(const ValueT &V)
Definition: DenseSet.h:206
SPIRVTargetInfo.h
llvm::MachineOperand::MO_Register
@ MO_Register
Register operand.
Definition: MachineOperand.h:51
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::MCInst::setOpcode
void setOpcode(unsigned Op)
Definition: MCInst.h:197
llvm::ARMBuildAttrs::Section
@ Section
Legacy Tags.
Definition: ARMBuildAttributes.h:82
llvm::MachineBasicBlock::getSymbol
MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
Definition: MachineBasicBlock.cpp:57
llvm::getTheSPIRV32Target
Target & getTheSPIRV32Target()
Definition: SPIRVTargetInfo.cpp:14
llvm::PPCISD::SC
@ SC
CHAIN = SC CHAIN, Imm128 - System call.
Definition: PPCISelLowering.h:418
llvm::MachineOperand::MO_GlobalAddress
@ MO_GlobalAddress
Address of a global value.
Definition: MachineOperand.h:61
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
llvm::MachineOperand::getImm
int64_t getImm() const
Definition: MachineOperand.h:546
llvm::SPIRVInstPrinter::getRegisterName
static const char * getRegisterName(unsigned RegNo)
Y
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml", "ocaml 3.10-compatible collector")
llvm::AnalysisUsage
Represent the analysis usage information of a pass.
Definition: PassAnalysisSupport.h:47
MCSymbol.h
getOpcode
static Optional< unsigned > getOpcode(ArrayRef< VPValue * > Values)
Returns the opcode of Values or ~0 if they do not all agree.
Definition: VPlanSLP.cpp:190
llvm::SPIRVModuleAnalysis::MAI
static struct SPIRV::ModuleAnalysisInfo MAI
Definition: SPIRVModuleAnalysis.h:121
SPIRVInstPrinter.h
MCInst.h
TII
const HexagonInstrInfo * TII
Definition: HexagonCopyToCombine.cpp:125
llvm::MachineOperand
MachineOperand class - Representation of each machine instruction operand.
Definition: MachineOperand.h:48
SPIRVUtils.h
llvm::report_fatal_error
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Definition: Error.cpp:143
llvm::SPIRV::MB_Annotations
@ MB_Annotations
Definition: SPIRVModuleAnalysis.h:35
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:54
llvm::SPIRV::StorageClass::Output
@ Output
llvm::MCSymbol::getName
StringRef getName() const
getName - Get the symbol name.
Definition: MCSymbol.h:198
isFuncOrHeaderInstr
static bool isFuncOrHeaderInstr(const MachineInstr *MI, const SPIRVInstrInfo *TII)
Definition: SPIRVAsmPrinter.cpp:200
llvm::SPIRV::MB_DebugModuleProcessed
@ MB_DebugModuleProcessed
Definition: SPIRVModuleAnalysis.h:34
X
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:94
llvm::MCInst::addOperand
void addOperand(const MCOperand Op)
Definition: MCInst.h:210
llvm::SPIRV::MB_ExtFuncDecls
@ MB_ExtFuncDecls
Definition: SPIRVModuleAnalysis.h:37
SPIRVTargetMachine.h
llvm::DenseSet
Implements a dense probed hash-table based set.
Definition: DenseSet.h:268
SPIRVInstrInfo.h
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:240
llvm::MachineInstr
Representation of each machine instruction.
Definition: MachineInstr.h:66
llvm::SPIRV::StorageClass
StorageClass
Definition: SPIRVBaseInfo.h:255
LLVM_EXTERNAL_VISIBILITY
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:126
llvm::ARM_MB::ST
@ ST
Definition: ARMBaseInfo.h:73
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
I
#define I(x, y, z)
Definition: MD5.cpp:58
MachineConstantPool.h
llvm::MachineOperand::getType
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
Definition: MachineOperand.h:218
MachineFunctionPass.h
llvm::MachineOperand::getFPImm
const ConstantFP * getFPImm() const
Definition: MachineOperand.h:556
SPIRV.h
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
llvm::SPIRV::MB_DebugNames
@ MB_DebugNames
Definition: SPIRVModuleAnalysis.h:33
MachineModuleInfo.h
llvm::MachineOperand::MO_FPImmediate
@ MO_FPImmediate
Floating-point immediate operand.
Definition: MachineOperand.h:54
llvm::MachineOperand::getReg
Register getReg() const
getReg - Returns the register number.
Definition: MachineOperand.h:359
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:65
llvm::MachineFunction
Definition: MachineFunction.h:257
llvm::MachineOperand::MO_JumpTableIndex
@ MO_JumpTableIndex
Address of indexed Jump Table for switch.
Definition: MachineOperand.h:59
llvm::SPIRVInstrInfo
Definition: SPIRVInstrInfo.h:24
llvm::MachineOperand::getMBB
MachineBasicBlock * getMBB() const
Definition: MachineOperand.h:561
llvm::MachineBasicBlock::getNumber
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
Definition: MachineBasicBlock.h:1088
MCAsmInfo.h
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::AsmPrinter::getAnalysisUsage
void getAnalysisUsage(AnalysisUsage &AU) const override
Record analysis usage.
Definition: AsmPrinter.cpp:423
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
llvm::MCOperand::createReg
static MCOperand createReg(unsigned Reg)
Definition: MCInst.h:134
llvm::AnalysisUsage::addPreserved
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
Definition: PassAnalysisSupport.h:98
llvm::MachineOperand::MO_MachineBasicBlock
@ MO_MachineBasicBlock
MachineBasicBlock reference.
Definition: MachineOperand.h:55
llvm::SPIRVModuleAnalysis
Definition: SPIRVModuleAnalysis.h:113
llvm::getTheSPIRV64Target
Target & getTheSPIRV64Target()
Definition: SPIRVTargetInfo.cpp:18
llvm::SPIRVTargetMachine
Definition: SPIRVTargetMachine.h:20
llvm::Register
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::MachineOperand::MO_ExternalSymbol
@ MO_ExternalSymbol
Name of external global symbol.
Definition: MachineOperand.h:60
LLVMInitializeSPIRVAsmPrinter
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSPIRVAsmPrinter()
Definition: SPIRVAsmPrinter.cpp:345
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:82
SPIRVMCInstLower.h
llvm::SPIRV::MB_EntryPoints
@ MB_EntryPoints
Definition: SPIRVModuleAnalysis.h:31
llvm::MachineOperand::getSymbolName
const char * getSymbolName() const
Definition: MachineOperand.h:617
MCStreamer.h
llvm::SmallVectorImpl
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
TM
const char LLVMTargetMachineRef TM
Definition: PassBuilderBindings.cpp:47
llvm::AnalysisUsage::addRequired
AnalysisUsage & addRequired()
Definition: PassAnalysisSupport.h:75
llvm::RegisterAsmPrinter
RegisterAsmPrinter - Helper template for registering a target specific assembly printer,...
Definition: TargetRegistry.h:1381
raw_ostream.h
TargetRegistry.h
llvm::SPIRVMCInstLower
Definition: SPIRVMCInstLower.h:22
llvm::MachineOperand::MO_ConstantPoolIndex
@ MO_ConstantPoolIndex
Address of indexed Constant in Constant Pool.
Definition: MachineOperand.h:57
llvm::AsmPrinter::doInitialization
bool doInitialization(Module &M) override
Set up the AsmPrinter when we are working on a new module.
Definition: AsmPrinter.cpp:430
TargetLoweringObjectFileImpl.h