LLVM 24.0.0git
VEAsmPrinter.cpp
Go to the documentation of this file.
1//===-- VEAsmPrinter.cpp - VE LLVM assembly writer ------------------------===//
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 GAS-format VE assembly language.
11//
12//===----------------------------------------------------------------------===//
13
14#include "VEAsmPrinter.h"
19#include "VE.h"
20#include "VEInstrInfo.h"
26#include "llvm/IR/Mangler.h"
27#include "llvm/MC/MCAsmInfo.h"
28#include "llvm/MC/MCContext.h"
29#include "llvm/MC/MCInst.h"
30#include "llvm/MC/MCStreamer.h"
31#include "llvm/MC/MCSymbol.h"
35using namespace llvm;
36
37#define DEBUG_TYPE "ve-asmprinter"
38
39namespace {
40class VEAsmPrinter : public AsmPrinter {
41 VETargetStreamer &getTargetStreamer() {
42 return static_cast<VETargetStreamer &>(*OutStreamer->getTargetStreamer());
43 }
44
45public:
46 explicit VEAsmPrinter(TargetMachine &TM, std::unique_ptr<MCStreamer> Streamer)
47 : AsmPrinter(TM, std::move(Streamer), ID) {}
48
49 StringRef getPassName() const override { return "VE Assembly Printer"; }
50
51 void lowerGETGOTAndEmitMCInsts(const MachineInstr *MI,
52 const MCSubtargetInfo &STI);
53 void lowerGETFunPLTAndEmitMCInsts(const MachineInstr *MI,
54 const MCSubtargetInfo &STI);
55 void lowerGETTLSAddrAndEmitMCInsts(const MachineInstr *MI,
56 const MCSubtargetInfo &STI);
57
58 void emitInstruction(const MachineInstr *MI) override;
59
60 static const char *getRegisterName(MCRegister Reg) {
62 }
63 void printOperand(const MachineInstr *MI, int OpNum, raw_ostream &OS);
64 bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
65 const char *ExtraCode, raw_ostream &O) override;
66 bool PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
67 const char *ExtraCode, raw_ostream &O) override;
68
69 static char ID;
70};
71} // end of anonymous namespace
72
74 MCContext &OutContext) {
75 const MCSymbolRefExpr *MCSym = MCSymbolRefExpr::create(Sym, OutContext);
77 MCSpecifierExpr::create(MCSym, Kind, OutContext));
78}
79
81 MCContext &OutContext) {
82 const MCSymbolRefExpr *GOT = MCSymbolRefExpr::create(GOTLabel, OutContext);
83 return MCOperand::createExpr(MCSpecifierExpr::create(GOT, Kind, OutContext));
84}
85
86static void emitSIC(MCStreamer &OutStreamer, MCOperand &RD,
87 const MCSubtargetInfo &STI) {
88 MCInst SICInst;
89 SICInst.setOpcode(VE::SIC);
90 SICInst.addOperand(RD);
91 OutStreamer.emitInstruction(SICInst, STI);
92}
93
94static void emitBSIC(MCStreamer &OutStreamer, MCOperand &R1, MCOperand &R2,
95 const MCSubtargetInfo &STI) {
96 MCInst BSICInst;
97 BSICInst.setOpcode(VE::BSICrii);
98 BSICInst.addOperand(R1);
99 BSICInst.addOperand(R2);
101 BSICInst.addOperand(czero);
102 BSICInst.addOperand(czero);
103 OutStreamer.emitInstruction(BSICInst, STI);
104}
105
106static void emitLEAzzi(MCStreamer &OutStreamer, MCOperand &Imm, MCOperand &RD,
107 const MCSubtargetInfo &STI) {
108 MCInst LEAInst;
109 LEAInst.setOpcode(VE::LEAzii);
110 LEAInst.addOperand(RD);
112 LEAInst.addOperand(CZero);
113 LEAInst.addOperand(CZero);
114 LEAInst.addOperand(Imm);
115 OutStreamer.emitInstruction(LEAInst, STI);
116}
117
118static void emitLEASLzzi(MCStreamer &OutStreamer, MCOperand &Imm, MCOperand &RD,
119 const MCSubtargetInfo &STI) {
120 MCInst LEASLInst;
121 LEASLInst.setOpcode(VE::LEASLzii);
122 LEASLInst.addOperand(RD);
124 LEASLInst.addOperand(CZero);
125 LEASLInst.addOperand(CZero);
126 LEASLInst.addOperand(Imm);
127 OutStreamer.emitInstruction(LEASLInst, STI);
128}
129
130static void emitLEAzii(MCStreamer &OutStreamer, MCOperand &RS1, MCOperand &Imm,
131 MCOperand &RD, const MCSubtargetInfo &STI) {
132 MCInst LEAInst;
133 LEAInst.setOpcode(VE::LEAzii);
134 LEAInst.addOperand(RD);
136 LEAInst.addOperand(CZero);
137 LEAInst.addOperand(RS1);
138 LEAInst.addOperand(Imm);
139 OutStreamer.emitInstruction(LEAInst, STI);
140}
141
142static void emitLEASLrri(MCStreamer &OutStreamer, MCOperand &RS1,
143 MCOperand &RS2, MCOperand &Imm, MCOperand &RD,
144 const MCSubtargetInfo &STI) {
145 MCInst LEASLInst;
146 LEASLInst.setOpcode(VE::LEASLrri);
147 LEASLInst.addOperand(RD);
148 LEASLInst.addOperand(RS1);
149 LEASLInst.addOperand(RS2);
150 LEASLInst.addOperand(Imm);
151 OutStreamer.emitInstruction(LEASLInst, STI);
152}
153
154static void emitBinary(MCStreamer &OutStreamer, unsigned Opcode, MCOperand &RS1,
155 MCOperand &Src2, MCOperand &RD,
156 const MCSubtargetInfo &STI) {
157 MCInst Inst;
158 Inst.setOpcode(Opcode);
159 Inst.addOperand(RD);
160 Inst.addOperand(RS1);
161 Inst.addOperand(Src2);
162 OutStreamer.emitInstruction(Inst, STI);
163}
164
165static void emitANDrm(MCStreamer &OutStreamer, MCOperand &RS1, MCOperand &Imm,
166 MCOperand &RD, const MCSubtargetInfo &STI) {
167 emitBinary(OutStreamer, VE::ANDrm, RS1, Imm, RD, STI);
168}
169
170static void emitHiLo(MCStreamer &OutStreamer, MCSymbol *GOTSym,
171 VE::Specifier HiKind, VE::Specifier LoKind, MCOperand &RD,
172 MCContext &OutContext, const MCSubtargetInfo &STI) {
173
174 MCOperand hi = createVEMCOperand(HiKind, GOTSym, OutContext);
175 MCOperand lo = createVEMCOperand(LoKind, GOTSym, OutContext);
176 emitLEAzzi(OutStreamer, lo, RD, STI);
178 emitANDrm(OutStreamer, RD, M032, RD, STI);
179 emitLEASLzzi(OutStreamer, hi, RD, STI);
180}
181
182void VEAsmPrinter::lowerGETGOTAndEmitMCInsts(const MachineInstr *MI,
183 const MCSubtargetInfo &STI) {
184 MCSymbol *GOTLabel =
185 OutContext.getOrCreateSymbol(Twine("_GLOBAL_OFFSET_TABLE_"));
186
187 const MachineOperand &MO = MI->getOperand(0);
188 MCOperand MCRegOP = MCOperand::createReg(MO.getReg());
189
190 if (!isPositionIndependent()) {
191 // Just load the address of GOT to MCRegOP.
192 switch (TM.getCodeModel()) {
193 default:
194 llvm_unreachable("Unsupported absolute code model");
195 case CodeModel::Small:
197 case CodeModel::Large:
198 emitHiLo(*OutStreamer, GOTLabel, VE::S_HI32, VE::S_LO32, MCRegOP,
199 OutContext, STI);
200 break;
201 }
202 return;
203 }
204
205 MCOperand RegGOT = MCOperand::createReg(VE::SX15); // GOT
206 MCOperand RegPLT = MCOperand::createReg(VE::SX16); // PLT
207
208 // lea %got, _GLOBAL_OFFSET_TABLE_@PC_LO(-24)
209 // and %got, %got, (32)0
210 // sic %plt
211 // lea.sl %got, _GLOBAL_OFFSET_TABLE_@PC_HI(%plt, %got)
212 MCOperand cim24 = MCOperand::createImm(-24);
213 MCOperand loImm = createGOTRelExprOp(VE::S_PC_LO32, GOTLabel, OutContext);
214 emitLEAzii(*OutStreamer, cim24, loImm, MCRegOP, STI);
215 MCOperand M032 = MCOperand::createImm(M0(32));
216 emitANDrm(*OutStreamer, MCRegOP, M032, MCRegOP, STI);
217 emitSIC(*OutStreamer, RegPLT, STI);
218 MCOperand hiImm = createGOTRelExprOp(VE::S_PC_HI32, GOTLabel, OutContext);
219 emitLEASLrri(*OutStreamer, RegGOT, RegPLT, hiImm, MCRegOP, STI);
220}
221
222void VEAsmPrinter::lowerGETFunPLTAndEmitMCInsts(const MachineInstr *MI,
223 const MCSubtargetInfo &STI) {
224 const MachineOperand &MO = MI->getOperand(0);
225 MCOperand MCRegOP = MCOperand::createReg(MO.getReg());
226 const MachineOperand &Addr = MI->getOperand(1);
227 MCSymbol *AddrSym = nullptr;
228
229 switch (Addr.getType()) {
230 default:
231 llvm_unreachable("<unknown operand type>");
232 return;
234 report_fatal_error("MBB is not supported yet");
235 return;
237 report_fatal_error("ConstantPool is not supported yet");
238 return;
240 AddrSym = GetExternalSymbolSymbol(Addr.getSymbolName());
241 break;
243 AddrSym = getSymbol(Addr.getGlobal());
244 break;
245 }
246
247 if (!isPositionIndependent()) {
248 llvm_unreachable("Unsupported uses of %plt in not PIC code");
249 return;
250 }
251
252 MCOperand RegPLT = MCOperand::createReg(VE::SX16); // PLT
253
254 // lea %dst, func@plt_lo(-24)
255 // and %dst, %dst, (32)0
256 // sic %plt ; FIXME: is it safe to use %plt here?
257 // lea.sl %dst, func@plt_hi(%plt, %dst)
258 MCOperand cim24 = MCOperand::createImm(-24);
259 MCOperand loImm = createGOTRelExprOp(VE::S_PLT_LO32, AddrSym, OutContext);
260 emitLEAzii(*OutStreamer, cim24, loImm, MCRegOP, STI);
261 MCOperand M032 = MCOperand::createImm(M0(32));
262 emitANDrm(*OutStreamer, MCRegOP, M032, MCRegOP, STI);
263 emitSIC(*OutStreamer, RegPLT, STI);
264 MCOperand hiImm = createGOTRelExprOp(VE::S_PLT_HI32, AddrSym, OutContext);
265 emitLEASLrri(*OutStreamer, MCRegOP, RegPLT, hiImm, MCRegOP, STI);
266}
267
268void VEAsmPrinter::lowerGETTLSAddrAndEmitMCInsts(const MachineInstr *MI,
269 const MCSubtargetInfo &STI) {
270 const MachineOperand &Addr = MI->getOperand(0);
271 MCSymbol *AddrSym = nullptr;
272
273 switch (Addr.getType()) {
274 default:
275 llvm_unreachable("<unknown operand type>");
276 return;
278 report_fatal_error("MBB is not supported yet");
279 return;
281 report_fatal_error("ConstantPool is not supported yet");
282 return;
284 AddrSym = GetExternalSymbolSymbol(Addr.getSymbolName());
285 break;
287 AddrSym = getSymbol(Addr.getGlobal());
288 break;
289 }
290
291 MCOperand RegLR = MCOperand::createReg(VE::SX10); // LR
292 MCOperand RegS0 = MCOperand::createReg(VE::SX0); // S0
293 MCOperand RegS12 = MCOperand::createReg(VE::SX12); // S12
294 MCSymbol *GetTLSLabel = OutContext.getOrCreateSymbol(Twine("__tls_get_addr"));
295
296 // lea %s0, sym@tls_gd_lo(-24)
297 // and %s0, %s0, (32)0
298 // sic %lr
299 // lea.sl %s0, sym@tls_gd_hi(%lr, %s0)
300 // lea %s12, __tls_get_addr@plt_lo(8)
301 // and %s12, %s12, (32)0
302 // lea.sl %s12, __tls_get_addr@plt_hi(%s12, %lr)
303 // bsic %lr, (, %s12)
304 MCOperand cim24 = MCOperand::createImm(-24);
305 MCOperand loImm = createGOTRelExprOp(VE::S_TLS_GD_LO32, AddrSym, OutContext);
306 emitLEAzii(*OutStreamer, cim24, loImm, RegS0, STI);
307 MCOperand M032 = MCOperand::createImm(M0(32));
308 emitANDrm(*OutStreamer, RegS0, M032, RegS0, STI);
309 emitSIC(*OutStreamer, RegLR, STI);
310 MCOperand hiImm = createGOTRelExprOp(VE::S_TLS_GD_HI32, AddrSym, OutContext);
311 emitLEASLrri(*OutStreamer, RegS0, RegLR, hiImm, RegS0, STI);
312 MCOperand ci8 = MCOperand::createImm(8);
313 MCOperand loImm2 =
314 createGOTRelExprOp(VE::S_PLT_LO32, GetTLSLabel, OutContext);
315 emitLEAzii(*OutStreamer, ci8, loImm2, RegS12, STI);
316 emitANDrm(*OutStreamer, RegS12, M032, RegS12, STI);
317 MCOperand hiImm2 =
318 createGOTRelExprOp(VE::S_PLT_HI32, GetTLSLabel, OutContext);
319 emitLEASLrri(*OutStreamer, RegS12, RegLR, hiImm2, RegS12, STI);
320 emitBSIC(*OutStreamer, RegLR, RegS12, STI);
321}
322
323void VEAsmPrinter::emitInstruction(const MachineInstr *MI) {
324 VE_MC::verifyInstructionPredicates(MI->getOpcode(),
325 getSubtargetInfo().getFeatureBits());
326
327 switch (MI->getOpcode()) {
328 default:
329 break;
330 case TargetOpcode::DBG_VALUE:
331 // FIXME: Debug Value.
332 return;
333 case VE::GETGOT:
334 lowerGETGOTAndEmitMCInsts(MI, getSubtargetInfo());
335 return;
336 case VE::GETFUNPLT:
337 lowerGETFunPLTAndEmitMCInsts(MI, getSubtargetInfo());
338 return;
339 case VE::GETTLSADDR:
340 lowerGETTLSAddrAndEmitMCInsts(MI, getSubtargetInfo());
341 return;
342 }
343
345 MachineBasicBlock::const_instr_iterator E = MI->getParent()->instr_end();
346 do {
347 MCInst TmpInst;
348 LowerVEMachineInstrToMCInst(&*I, TmpInst, *this);
349 EmitToStreamer(*OutStreamer, TmpInst);
350 } while ((++I != E) && I->isInsideBundle()); // Delay slot check.
351}
352
353void VEAsmPrinter::printOperand(const MachineInstr *MI, int OpNum,
354 raw_ostream &O) {
355 const MachineOperand &MO = MI->getOperand(OpNum);
356
357 switch (MO.getType()) {
359 O << "%" << StringRef(getRegisterName(MO.getReg())).lower();
360 break;
362 O << (int)MO.getImm();
363 break;
364 default:
365 llvm_unreachable("<unknown operand type>");
366 }
367}
368
369// PrintAsmOperand - Print out an operand for an inline asm expression.
370bool VEAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
371 const char *ExtraCode, raw_ostream &O) {
372 if (ExtraCode && ExtraCode[0]) {
373 if (ExtraCode[1] != 0)
374 return true; // Unknown modifier.
375
376 switch (ExtraCode[0]) {
377 default:
378 // See if this is a generic print operand
379 return AsmPrinter::PrintAsmOperand(MI, OpNo, ExtraCode, O);
380 case 'r':
381 case 'v':
382 break;
383 }
384 }
385
386 printOperand(MI, OpNo, O);
387
388 return false;
389}
390
391bool VEAsmPrinter::PrintAsmMemoryOperand(const MachineInstr *MI, unsigned OpNo,
392 const char *ExtraCode,
393 raw_ostream &O) {
394 if (ExtraCode && ExtraCode[0])
395 return true; // Unknown modifier
396
397 if (MI->getOperand(OpNo+1).isImm() &&
398 MI->getOperand(OpNo+1).getImm() == 0) {
399 // don't print "+0"
400 } else {
401 printOperand(MI, OpNo+1, O);
402 }
403 if (MI->getOperand(OpNo).isImm() &&
404 MI->getOperand(OpNo).getImm() == 0) {
405 if (MI->getOperand(OpNo+1).isImm() &&
406 MI->getOperand(OpNo+1).getImm() == 0) {
407 O << "0";
408 } else {
409 // don't print "(0)"
410 }
411 } else {
412 O << "(";
413 printOperand(MI, OpNo, O);
414 O << ")";
415 }
416 return false;
417}
418
419char VEAsmPrinter::ID = 0;
420
421INITIALIZE_PASS(VEAsmPrinter, "ve-asm-printer", "VE Assembly Printer", false,
422 false)
423
424// Force static initialization.
425extern "C" LLVM_ABI LLVM_EXTERNAL_VISIBILITY void LLVMInitializeVEAsmPrinter() {
427}
428
431 VEAsmPrinter &AsmPrinter = static_cast<VEAsmPrinter &>(
432 MAM.getResult<AsmPrinterAnalysis>(M).getPrinter());
435 return PreservedAnalyses::all();
436}
437
440 VEAsmPrinter &AsmPrinter = static_cast<VEAsmPrinter &>(
442 .getCachedResult<AsmPrinterAnalysis>(*MF.getFunction().getParent())
443 ->getPrinter());
446 return PreservedAnalyses::all();
447}
448
451 VEAsmPrinter &AsmPrinter = static_cast<VEAsmPrinter &>(
452 MAM.getResult<AsmPrinterAnalysis>(M).getPrinter());
455 return PreservedAnalyses::all();
456}
uint64_t Imm
static const Function * getParent(const Value *V)
#define X(NUM, ENUM, NAME)
Definition ELF.h:665
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
#define LLVM_ABI
Definition Compiler.h:211
#define LLVM_EXTERNAL_VISIBILITY
Definition Compiler.h:132
IRTranslator LLVM IR MI
#define I(x, y, z)
Definition MD5.cpp:57
static std::string getRegisterName(const TargetRegisterInfo *TRI, Register Reg)
Register Reg
#define R2(n)
ModuleAnalysisManager MAM
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Definition PassSupport.h:56
static bool printOperand(raw_ostream &OS, const SelectionDAG *G, const SDValue Value)
static void emitHiLo(MCStreamer &OutStreamer, MCSymbol *GOTSym, uint16_t HiKind, uint16_t LoKind, MCOperand &RD, MCContext &OutContext, const MCSubtargetInfo &STI)
std::unique_ptr< MCStreamer > && Streamer
static void emitSIC(MCStreamer &OutStreamer, MCOperand &RD, const MCSubtargetInfo &STI)
static void emitHiLo(MCStreamer &OutStreamer, MCSymbol *GOTSym, VE::Specifier HiKind, VE::Specifier LoKind, MCOperand &RD, MCContext &OutContext, const MCSubtargetInfo &STI)
static void emitBinary(MCStreamer &OutStreamer, unsigned Opcode, MCOperand &RS1, MCOperand &Src2, MCOperand &RD, const MCSubtargetInfo &STI)
static void emitLEAzii(MCStreamer &OutStreamer, MCOperand &RS1, MCOperand &Imm, MCOperand &RD, const MCSubtargetInfo &STI)
static void emitLEASLzzi(MCStreamer &OutStreamer, MCOperand &Imm, MCOperand &RD, const MCSubtargetInfo &STI)
static MCOperand createGOTRelExprOp(VE::Specifier Kind, MCSymbol *GOTLabel, MCContext &OutContext)
static void emitBSIC(MCStreamer &OutStreamer, MCOperand &R1, MCOperand &R2, const MCSubtargetInfo &STI)
static MCOperand createVEMCOperand(VE::Specifier Kind, MCSymbol *Sym, MCContext &OutContext)
static void emitLEAzzi(MCStreamer &OutStreamer, MCOperand &Imm, MCOperand &RD, const MCSubtargetInfo &STI)
static void emitANDrm(MCStreamer &OutStreamer, MCOperand &RS1, MCOperand &Imm, MCOperand &RD, const MCSubtargetInfo &STI)
static void emitLEASLrri(MCStreamer &OutStreamer, MCOperand &RS1, MCOperand &RS2, MCOperand &Imm, MCOperand &RD, const MCSubtargetInfo &STI)
PassT::Result & getResult(IRUnitT &IR, ExtraArgTs... ExtraArgs)
Get the result of an analysis pass for a given IR unit.
This class is intended to be used as a driving class for all asm writers.
Definition AsmPrinter.h:95
bool doInitialization(Module &M) override
Set up the AsmPrinter when we are working on a new module.
bool doFinalization(Module &M) override
Shut down the asmprinter.
bool runOnMachineFunction(MachineFunction &MF) override
Emit the specified function out to the OutStreamer.
Definition AsmPrinter.h:478
virtual bool PrintAsmOperand(const MachineInstr *MI, unsigned OpNo, const char *ExtraCode, raw_ostream &OS)
Print the specified operand of MI, an INLINEASM instruction, using the specified assembler variant.
Context object for machine code objects.
Definition MCContext.h:83
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:188
void addOperand(const MCOperand Op)
Definition MCInst.h:215
void setOpcode(unsigned Op)
Definition MCInst.h:201
Instances of this class represent operands of the MCInst class.
Definition MCInst.h:40
static MCOperand createExpr(const MCExpr *Val)
Definition MCInst.h:166
static MCOperand createReg(MCRegister Reg)
Definition MCInst.h:138
static MCOperand createImm(int64_t Val)
Definition MCInst.h:145
Wrapper class representing physical registers. Should be passed by value.
Definition MCRegister.h:41
static const MCSpecifierExpr * create(const MCExpr *Expr, Spec S, MCContext &Ctx, SMLoc Loc=SMLoc())
Definition MCExpr.cpp:743
Streaming machine code generation interface.
Definition MCStreamer.h:222
virtual void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
Generic base class for all target subtargets.
Represent a reference to a symbol from inside an expression.
Definition MCExpr.h:190
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())
Definition MCExpr.h:213
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition MCSymbol.h:42
Instructions::const_iterator const_instr_iterator
Function & getFunction()
Return the LLVM function that this machine code represents.
Representation of each machine instruction.
const GlobalValue * getGlobal() const
int64_t getImm() const
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
const char * getSymbolName() const
Register getReg() const
getReg - Returns the register number.
@ MO_Immediate
Immediate operand.
@ MO_ConstantPoolIndex
Address of indexed Constant in Constant Pool.
@ MO_GlobalAddress
Address of a global value.
@ MO_MachineBasicBlock
MachineBasicBlock reference.
@ MO_Register
Register operand.
@ MO_ExternalSymbol
Name of external global symbol.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:68
A set of analyses that are preserved following a run of a transformation pass.
Definition Analysis.h:112
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Definition Analysis.h:118
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
Primary interface to the complete machine description for the target machine.
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MFAM)
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MFAM)
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
static const char * getRegisterName(MCRegister Reg, unsigned AltIdx=VE::NoRegAltName)
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ S_TLS_GD_LO32
Definition VEMCAsmInfo.h:52
@ S_TLS_GD_HI32
Definition VEMCAsmInfo.h:51
This is an optimization pass for GlobalISel generic memory operations.
OuterAnalysisManagerProxy< ModuleAnalysisManager, MachineFunction > ModuleAnalysisManagerMachineFunctionProxy
Provide the ModuleAnalysisManager to Function proxy.
void LowerVEMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI, AsmPrinter &AP)
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
Target & getTheVETarget()
LLVM_ABI void setupModuleAsmPrinter(Module &M, ModuleAnalysisManager &MAM, AsmPrinter &AsmPrinter)
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
Definition Error.cpp:163
unsigned M0(unsigned Val)
Definition VE.h:393
LLVM_ABI void setupMachineFunctionAsmPrinter(MachineFunctionAnalysisManager &MFAM, MachineFunction &MF, AsmPrinter &AsmPrinter)
AnalysisManager< Module > ModuleAnalysisManager
Convenience typedef for the Module analysis manager.
Definition MIRParser.h:39
RegisterAsmPrinter - Helper template for registering a target specific assembly printer,...