LLVM 22.0.0git
AMDGPUMCInstLower.cpp
Go to the documentation of this file.
1//===- AMDGPUMCInstLower.cpp - Lower AMDGPU MachineInstr to an MCInst -----===//
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/// \file
10/// Code to lower AMDGPU MachineInstrs to their corresponding MCInst.
11//
12//===----------------------------------------------------------------------===//
13//
14
15#include "AMDGPUMCInstLower.h"
16#include "AMDGPU.h"
17#include "AMDGPUAsmPrinter.h"
25#include "llvm/IR/Constants.h"
26#include "llvm/IR/Function.h"
29#include "llvm/MC/MCContext.h"
30#include "llvm/MC/MCExpr.h"
31#include "llvm/MC/MCInst.h"
33#include "llvm/MC/MCStreamer.h"
34#include "llvm/Support/Endian.h"
36#include "llvm/Support/Format.h"
37#include <algorithm>
38
39using namespace llvm;
40
41#include "AMDGPUGenMCPseudoLowering.inc"
42
44 const TargetSubtargetInfo &st,
45 const AsmPrinter &ap):
46 Ctx(ctx), ST(st), AP(ap) { }
47
48static AMDGPUMCExpr::Specifier getSpecifier(unsigned MOFlags) {
49 switch (MOFlags) {
50 default:
71 }
72}
73
75 MCOperand &MCOp) const {
76 switch (MO.getType()) {
77 default:
78 break;
80 MCOp = MCOperand::createImm(MO.getImm());
81 return true;
84 return true;
88 return true;
90 const GlobalValue *GV = MO.getGlobal();
91 SmallString<128> SymbolName;
92 AP.getNameWithPrefix(SymbolName, GV);
93 MCSymbol *Sym = Ctx.getOrCreateSymbol(SymbolName);
94 const MCExpr *Expr =
96 int64_t Offset = MO.getOffset();
97 if (Offset != 0) {
98 Expr = MCBinaryExpr::createAdd(Expr,
100 }
101 MCOp = MCOperand::createExpr(Expr);
102 return true;
103 }
106 const MCSymbolRefExpr *Expr = MCSymbolRefExpr::create(Sym, Ctx);
107 MCOp = MCOperand::createExpr(Expr);
108 return true;
109 }
111 // Regmasks are like implicit defs.
112 return false;
115 MCSymbol *Sym = MO.getMCSymbol();
116 MCOp = MCOperand::createExpr(Sym->getVariableValue());
117 return true;
118 }
119 break;
120 }
121 llvm_unreachable("unknown operand type");
122}
123
124// Lower true16 D16 Pseudo instruction to d16_lo/d16_hi MCInst based on
125// Dst/Data's .l/.h selection
127 MCInst &OutMI) const {
128 unsigned Opcode = MI->getOpcode();
129 const auto *TII = static_cast<const SIInstrInfo*>(ST.getInstrInfo());
130 const SIRegisterInfo &TRI = TII->getRegisterInfo();
131 const auto *Info = AMDGPU::getT16D16Helper(Opcode);
132
133 llvm::AMDGPU::OpName OpName;
134 if (TII->isDS(Opcode)) {
135 if (MI->mayLoad())
136 OpName = llvm::AMDGPU::OpName::vdst;
137 else if (MI->mayStore())
138 OpName = llvm::AMDGPU::OpName::data0;
139 else
140 llvm_unreachable("LDS load or store expected");
141 } else {
142 OpName = AMDGPU::hasNamedOperand(Opcode, llvm::AMDGPU::OpName::vdata)
143 ? llvm::AMDGPU::OpName::vdata
144 : llvm::AMDGPU::OpName::vdst;
145 }
146
147 // select Dst/Data
148 int VDstOrVDataIdx = AMDGPU::getNamedOperandIdx(Opcode, OpName);
149 const MachineOperand &MIVDstOrVData = MI->getOperand(VDstOrVDataIdx);
150
151 // select hi/lo MCInst
152 bool IsHi = AMDGPU::isHi16Reg(MIVDstOrVData.getReg(), TRI);
153 Opcode = IsHi ? Info->HiOp : Info->LoOp;
154
155 int MCOpcode = TII->pseudoToMCOpcode(Opcode);
156 assert(MCOpcode != -1 &&
157 "Pseudo instruction doesn't have a target-specific version");
158 OutMI.setOpcode(MCOpcode);
159
160 // lower operands
161 for (int I = 0, E = MI->getNumExplicitOperands(); I < E; I++) {
162 const MachineOperand &MO = MI->getOperand(I);
163 MCOperand MCOp;
164 if (I == VDstOrVDataIdx)
165 MCOp = MCOperand::createReg(TRI.get32BitRegister(MIVDstOrVData.getReg()));
166 else
167 lowerOperand(MO, MCOp);
168 OutMI.addOperand(MCOp);
169 }
170
171 if (AMDGPU::hasNamedOperand(MCOpcode, AMDGPU::OpName::vdst_in)) {
172 MCOperand MCOp;
173 lowerOperand(MIVDstOrVData, MCOp);
174 OutMI.addOperand(MCOp);
175 }
176}
177
178void AMDGPUMCInstLower::lower(const MachineInstr *MI, MCInst &OutMI) const {
179 unsigned Opcode = MI->getOpcode();
180 const auto *TII = static_cast<const SIInstrInfo *>(ST.getInstrInfo());
181
182 // FIXME: Should be able to handle this with lowerPseudoInstExpansion. We
183 // need to select it to the subtarget specific version, and there's no way to
184 // do that with a single pseudo source operation.
185 if (Opcode == AMDGPU::S_SETPC_B64_return)
186 Opcode = AMDGPU::S_SETPC_B64;
187 else if (Opcode == AMDGPU::SI_CALL) {
188 // SI_CALL is just S_SWAPPC_B64 with an additional operand to track the
189 // called function (which we need to remove here).
190 OutMI.setOpcode(TII->pseudoToMCOpcode(AMDGPU::S_SWAPPC_B64));
191 MCOperand Dest, Src;
192 lowerOperand(MI->getOperand(0), Dest);
193 lowerOperand(MI->getOperand(1), Src);
194 OutMI.addOperand(Dest);
195 OutMI.addOperand(Src);
196 return;
197 } else if (Opcode == AMDGPU::SI_TCRETURN ||
198 Opcode == AMDGPU::SI_TCRETURN_GFX) {
199 // TODO: How to use branch immediate and avoid register+add?
200 Opcode = AMDGPU::S_SETPC_B64;
201 } else if (AMDGPU::getT16D16Helper(Opcode)) {
202 lowerT16D16Helper(MI, OutMI);
203 return;
204 }
205
206 int MCOpcode = TII->pseudoToMCOpcode(Opcode);
207 if (MCOpcode == -1) {
208 LLVMContext &C = MI->getParent()->getParent()->getFunction().getContext();
209 C.emitError("AMDGPUMCInstLower::lower - Pseudo instruction doesn't have "
210 "a target-specific version: " + Twine(MI->getOpcode()));
211 }
212
213 OutMI.setOpcode(MCOpcode);
214
215 for (const MachineOperand &MO : MI->explicit_operands()) {
216 MCOperand MCOp;
217 lowerOperand(MO, MCOp);
218 OutMI.addOperand(MCOp);
219 }
220
221 int FIIdx = AMDGPU::getNamedOperandIdx(MCOpcode, AMDGPU::OpName::fi);
222 if (FIIdx >= (int)OutMI.getNumOperands())
224}
225
227 MCOperand &MCOp) const {
228 const GCNSubtarget &STI = MF->getSubtarget<GCNSubtarget>();
229 AMDGPUMCInstLower MCInstLowering(OutContext, STI, *this);
230 return MCInstLowering.lowerOperand(MO, MCOp);
231}
232
234 const Constant *BaseCV,
236
237 // Intercept LDS variables with known addresses
238 if (const GlobalVariable *GV = dyn_cast<const GlobalVariable>(CV)) {
239 if (std::optional<uint32_t> Address =
241 auto *IntTy = Type::getInt32Ty(CV->getContext());
242 return AsmPrinter::lowerConstant(ConstantInt::get(IntTy, *Address),
243 BaseCV, Offset);
244 }
245 }
246
247 if (const MCExpr *E = lowerAddrSpaceCast(TM, CV, OutContext))
248 return E;
249 return AsmPrinter::lowerConstant(CV, BaseCV, Offset);
250}
251
253 const TargetRegisterInfo *TRI,
254 const SIMachineFunctionInfo *MFI,
255 MCStreamer &OS) {
256 // The instruction will only transfer a subset of the registers in the block,
257 // based on the mask that is stored in m0. We could search for the instruction
258 // that sets m0, but most of the time we'll already have the mask stored in
259 // the machine function info. Try to use that. This assumes that we only use
260 // block loads/stores for CSR spills.
261 Register RegBlock =
262 TII->getNamedOperand(*MI, MI->mayLoad() ? AMDGPU::OpName::vdst
263 : AMDGPU::OpName::vdata)
264 ->getReg();
265 Register FirstRegInBlock = TRI->getSubReg(RegBlock, AMDGPU::sub0);
266 uint32_t Mask = MFI->getMaskForVGPRBlockOps(RegBlock);
267
268 if (!Mask)
269 return; // Nothing to report
270
271 SmallString<512> TransferredRegs;
272 for (unsigned I = 0; I < sizeof(Mask) * 8; ++I) {
273 if (Mask & (1 << I)) {
274 (llvm::Twine(" ") + TRI->getRegAsmName(FirstRegInBlock + I))
275 .toVector(TransferredRegs);
276 }
277 }
278
279 OS.emitRawComment(" transferring at most " + TransferredRegs);
280}
281
283 // FIXME: Enable feature predicate checks once all the test pass.
284 // AMDGPU_MC::verifyInstructionPredicates(MI->getOpcode(),
285 // getSubtargetInfo().getFeatureBits());
286
287 if (MCInst OutInst; lowerPseudoInstExpansion(MI, OutInst)) {
288 EmitToStreamer(*OutStreamer, OutInst);
289 return;
290 }
291
292 const GCNSubtarget &STI = MF->getSubtarget<GCNSubtarget>();
293 AMDGPUMCInstLower MCInstLowering(OutContext, STI, *this);
294
295 StringRef Err;
296 if (!STI.getInstrInfo()->verifyInstruction(*MI, Err)) {
297 LLVMContext &C = MI->getParent()->getParent()->getFunction().getContext();
298 C.emitError("Illegal instruction detected: " + Err);
299 MI->print(errs());
300 }
301
302 if (MI->isBundle()) {
303 const MachineBasicBlock *MBB = MI->getParent();
305 while (I != MBB->instr_end() && I->isInsideBundle()) {
307 ++I;
308 }
309 } else {
310 // We don't want these pseudo instructions encoded. They are
311 // placeholder terminator instructions and should only be printed as
312 // comments.
313 if (MI->getOpcode() == AMDGPU::SI_RETURN_TO_EPILOG) {
314 if (isVerbose())
315 OutStreamer->emitRawComment(" return to shader part epilog");
316 return;
317 }
318
319 if (MI->getOpcode() == AMDGPU::WAVE_BARRIER) {
320 if (isVerbose())
321 OutStreamer->emitRawComment(" wave barrier");
322 return;
323 }
324
325 if (MI->getOpcode() == AMDGPU::SCHED_BARRIER) {
326 if (isVerbose()) {
327 std::string HexString;
328 raw_string_ostream HexStream(HexString);
329 HexStream << format_hex(MI->getOperand(0).getImm(), 10, true);
330 OutStreamer->emitRawComment(" sched_barrier mask(" + HexString + ")");
331 }
332 return;
333 }
334
335 if (MI->getOpcode() == AMDGPU::SCHED_GROUP_BARRIER) {
336 if (isVerbose()) {
337 std::string HexString;
338 raw_string_ostream HexStream(HexString);
339 HexStream << format_hex(MI->getOperand(0).getImm(), 10, true);
340 OutStreamer->emitRawComment(
341 " sched_group_barrier mask(" + HexString + ") size(" +
342 Twine(MI->getOperand(1).getImm()) + ") SyncID(" +
343 Twine(MI->getOperand(2).getImm()) + ")");
344 }
345 return;
346 }
347
348 if (MI->getOpcode() == AMDGPU::IGLP_OPT) {
349 if (isVerbose()) {
350 std::string HexString;
351 raw_string_ostream HexStream(HexString);
352 HexStream << format_hex(MI->getOperand(0).getImm(), 10, true);
353 OutStreamer->emitRawComment(" iglp_opt mask(" + HexString + ")");
354 }
355 return;
356 }
357
358 if (MI->getOpcode() == AMDGPU::SI_MASKED_UNREACHABLE) {
359 if (isVerbose())
360 OutStreamer->emitRawComment(" divergent unreachable");
361 return;
362 }
363
364 if (MI->isMetaInstruction()) {
365 if (isVerbose())
366 OutStreamer->emitRawComment(" meta instruction");
367 return;
368 }
369
370 if (isVerbose())
371 if (STI.getInstrInfo()->isBlockLoadStore(MI->getOpcode()))
374 *OutStreamer);
375
376 MCInst TmpInst;
377 MCInstLowering.lower(MI, TmpInst);
378 EmitToStreamer(*OutStreamer, TmpInst);
379
380#ifdef EXPENSIVE_CHECKS
381 // Check getInstSizeInBytes on explicitly specified CPUs (it cannot
382 // work correctly for the generic CPU).
383 //
384 // The isPseudo check really shouldn't be here, but unfortunately there are
385 // some negative lit tests that depend on being able to continue through
386 // here even when pseudo instructions haven't been lowered.
387 //
388 // We also overestimate branch sizes with the offset bug.
389 if (!MI->isPseudo() && STI.isCPUStringValid(STI.getCPU()) &&
390 (!STI.hasOffset3fBug() || !MI->isBranch())) {
392 SmallVector<char, 16> CodeBytes;
393
394 std::unique_ptr<MCCodeEmitter> InstEmitter(createAMDGPUMCCodeEmitter(
395 *STI.getInstrInfo(), OutContext));
396 InstEmitter->encodeInstruction(TmpInst, CodeBytes, Fixups, STI);
397
398 assert(CodeBytes.size() == STI.getInstrInfo()->getInstSizeInBytes(*MI));
399 }
400#endif
401
402 if (DumpCodeInstEmitter) {
403 // Disassemble instruction/operands to text
404 DisasmLines.resize(DisasmLines.size() + 1);
405 std::string &DisasmLine = DisasmLines.back();
406 raw_string_ostream DisasmStream(DisasmLine);
407
408 AMDGPUInstPrinter InstPrinter(*TM.getMCAsmInfo(), *STI.getInstrInfo(),
409 *STI.getRegisterInfo());
410 InstPrinter.printInst(&TmpInst, 0, StringRef(), STI, DisasmStream);
411
412 // Disassemble instruction/operands to hex representation.
414 SmallVector<char, 16> CodeBytes;
415
416 DumpCodeInstEmitter->encodeInstruction(
417 TmpInst, CodeBytes, Fixups, MF->getSubtarget<MCSubtargetInfo>());
418 HexLines.resize(HexLines.size() + 1);
419 std::string &HexLine = HexLines.back();
420 raw_string_ostream HexStream(HexLine);
421
422 for (size_t i = 0; i < CodeBytes.size(); i += 4) {
423 unsigned int CodeDWord =
424 support::endian::read32le(CodeBytes.data() + i);
425 HexStream << format("%s%08X", (i > 0 ? " " : ""), CodeDWord);
426 }
427
428 DisasmLineMaxLen = std::max(DisasmLineMaxLen, DisasmLine.size());
429 }
430 }
431}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
AMDGPU Assembly printer class.
static void emitVGPRBlockComment(const MachineInstr *MI, const SIInstrInfo *TII, const TargetRegisterInfo *TRI, const SIMachineFunctionInfo *MFI, MCStreamer &OS)
Header of lower AMDGPU MachineInstrs to their corresponding MCInst.
Provides AMDGPU specific target descriptions.
MachineBasicBlock & MBB
Analysis containing CSE Info
Definition: CSEInfo.cpp:27
This file contains the declarations for the subclasses of Constant, which represent the different fla...
Symbol * Sym
Definition: ELF_riscv.cpp:479
const HexagonInstrInfo * TII
IRTranslator LLVM IR MI
#define I(x, y, z)
Definition: MD5.cpp:58
Register const TargetRegisterInfo * TRI
raw_pwrite_stream & OS
static SDValue lowerAddrSpaceCast(SDValue Op, SelectionDAG &DAG)
std::vector< std::string > DisasmLines
std::vector< std::string > HexLines
bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp) const
Wrapper for MCInstLowering.lowerOperand() for the tblgen'erated pseudo lowering.
bool lowerPseudoInstExpansion(const MachineInstr *MI, MCInst &Inst)
tblgen'erated driver function for lowering simple MI->MC pseudo instructions.
const MCExpr * lowerConstant(const Constant *CV, const Constant *BaseCV, uint64_t Offset) override
Lower the specified LLVM Constant to an MCExpr.
void emitInstruction(const MachineInstr *MI) override
Implemented in AMDGPUMCInstLower.cpp.
void printInst(const MCInst *MI, uint64_t Address, StringRef Annot, const MCSubtargetInfo &STI, raw_ostream &O) override
Print the specified MCInst to the specified raw_ostream.
bool lowerOperand(const MachineOperand &MO, MCOperand &MCOp) const
void lowerT16D16Helper(const MachineInstr *MI, MCInst &OutMI) const
AMDGPUMCInstLower(MCContext &ctx, const TargetSubtargetInfo &ST, const AsmPrinter &AP)
void lower(const MachineInstr *MI, MCInst &OutMI) const
Lower a MachineInstr to an MCInst.
static std::optional< uint32_t > getLDSAbsoluteAddress(const GlobalValue &GV)
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:90
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
Definition: AsmPrinter.cpp:433
TargetMachine & TM
Target machine description.
Definition: AsmPrinter.h:93
MachineFunction * MF
The current machine function.
Definition: AsmPrinter.h:108
virtual const MCExpr * lowerConstant(const Constant *CV, const Constant *BaseCV=nullptr, uint64_t Offset=0)
Lower the specified LLVM Constant to an MCExpr.
MCContext & OutContext
This is the context for the output file that we are streaming.
Definition: AsmPrinter.h:100
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
Definition: AsmPrinter.h:105
bool isVerbose() const
Return true if assembly output should contain comments.
Definition: AsmPrinter.h:307
void getNameWithPrefix(SmallVectorImpl< char > &Name, const GlobalValue *GV) const
Definition: AsmPrinter.cpp:701
This is an important base class in LLVM.
Definition: Constant.h:43
const SIInstrInfo * getInstrInfo() const override
Definition: GCNSubtarget.h:308
bool hasOffset3fBug() const
const SIRegisterInfo * getRegisterInfo() const override
Definition: GCNSubtarget.h:320
This is an important class for using LLVM in a threaded context.
Definition: LLVMContext.h:68
static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())
Definition: MCExpr.h:343
virtual void encodeInstruction(const MCInst &Inst, SmallVectorImpl< char > &CB, SmallVectorImpl< MCFixup > &Fixups, const MCSubtargetInfo &STI) const =0
Encode the given Inst to bytes and append to CB.
static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)
Definition: MCExpr.cpp:212
Context object for machine code objects.
Definition: MCContext.h:83
LLVM_ABI MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Definition: MCContext.cpp:203
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:34
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:188
unsigned getNumOperands() const
Definition: MCInst.h:212
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
Streaming machine code generation interface.
Definition: MCStreamer.h:220
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:214
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
LLVM_ABI MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
instr_iterator instr_end()
Instructions::const_iterator const_instr_iterator
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Representation of each machine instruction.
Definition: MachineInstr.h:72
MachineOperand class - Representation of each machine instruction operand.
const GlobalValue * getGlobal() const
int64_t getImm() const
MachineBasicBlock * getMBB() const
unsigned getTargetFlags() const
MachineOperandType getType() const
getType - Returns the MachineOperandType for this operand.
const char * getSymbolName() const
Register getReg() const
getReg - Returns the register number.
MCSymbol * getMCSymbol() const
@ MO_Immediate
Immediate operand.
@ MO_MCSymbol
MCSymbol reference (for debug/eh info)
@ MO_GlobalAddress
Address of a global value.
@ MO_RegisterMask
Mask of preserved registers.
@ MO_MachineBasicBlock
MachineBasicBlock reference.
@ MO_Register
Register operand.
@ MO_ExternalSymbol
Name of external global symbol.
int64_t getOffset() const
Return the offset from the symbol in this operand.
virtual void print(raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
Definition: Pass.cpp:140
Wrapper class representing virtual and physical registers.
Definition: Register.h:19
unsigned getInstSizeInBytes(const MachineInstr &MI) const override
static bool isBlockLoadStore(uint16_t Opcode)
Definition: SIInstrInfo.h:687
bool verifyInstruction(const MachineInstr &MI, StringRef &ErrInfo) const override
This class keeps track of the SPI_SP_INPUT_ADDR config register, which tells the hardware which inter...
uint32_t getMaskForVGPRBlockOps(Register RegisterBlock) const
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
Definition: SmallString.h:26
size_t size() const
Definition: SmallVector.h:79
pointer data()
Return a pointer to the vector's buffer, even if empty().
Definition: SmallVector.h:287
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1197
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
TargetSubtargetInfo - Generic base class for all target subtargets.
virtual const TargetInstrInfo * getInstrInfo() const
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:82
static LLVM_ABI IntegerType * getInt32Ty(LLVMContext &C)
LLVM_ABI LLVMContext & getContext() const
All values hold a context through their type.
Definition: Value.cpp:1098
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:662
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
MCRegister getMCReg(MCRegister Reg, const MCSubtargetInfo &STI)
If Reg is a pseudo reg, return the correct hardware register given STI otherwise return Reg.
bool isHi16Reg(MCRegister Reg, const MCRegisterInfo &MRI)
LLVM_READONLY bool hasNamedOperand(uint64_t Opcode, OpName NamedIdx)
@ C
The default llvm calling convention, compatible with C.
Definition: CallingConv.h:34
uint32_t read32le(const void *P)
Definition: Endian.h:429
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
@ Offset
Definition: DWP.cpp:477
FormattedNumber format_hex(uint64_t N, unsigned Width, bool Upper=false)
format_hex - Output N as a fixed width hexadecimal.
Definition: Format.h:188
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Definition: Format.h:126
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
static uint16_t getSpecifier(const MCSymbolRefExpr *SRE)
Definition: PPCMCAsmInfo.h:134
MCCodeEmitter * createAMDGPUMCCodeEmitter(const MCInstrInfo &MCII, MCContext &Ctx)