Thanks to visit codestin.com
Credit goes to llvm.org

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
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 }
105 MCSymbol *Sym = Ctx.getOrCreateSymbol(StringRef(MO.getSymbolName()));
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();
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
179 MCInst &OutMI) const {
180 unsigned Opcode = MI->getOpcode();
181 const auto *TII = static_cast<const SIInstrInfo *>(ST.getInstrInfo());
182 const SIRegisterInfo &TRI = TII->getRegisterInfo();
183
184 int VDstIdx = AMDGPU::getNamedOperandIdx(Opcode, llvm::AMDGPU::OpName::vdst);
185 const MachineOperand &VDst = MI->getOperand(VDstIdx);
186 bool IsHi = AMDGPU::isHi16Reg(VDst.getReg(), TRI);
187 switch (Opcode) {
188 case AMDGPU::V_FMA_MIX_F16_t16:
189 Opcode = IsHi ? AMDGPU::V_FMA_MIXHI_F16 : AMDGPU::V_FMA_MIXLO_F16;
190 break;
191 case AMDGPU::V_FMA_MIX_BF16_t16:
192 Opcode = IsHi ? AMDGPU::V_FMA_MIXHI_BF16 : AMDGPU::V_FMA_MIXLO_BF16;
193 break;
194 }
195 int MCOpcode = TII->pseudoToMCOpcode(Opcode);
196 assert(MCOpcode != -1 &&
197 "Pseudo instruction doesn't have a target-specific version");
198 OutMI.setOpcode(MCOpcode);
199
200 // lower operands
201 for (int I = 0, E = MI->getNumExplicitOperands(); I < E; I++) {
202 const MachineOperand &MO = MI->getOperand(I);
203 MCOperand MCOp;
204 if (I == VDstIdx)
205 MCOp = MCOperand::createReg(TRI.get32BitRegister(VDst.getReg()));
206 else
207 lowerOperand(MO, MCOp);
208 OutMI.addOperand(MCOp);
209 }
210}
211
212void AMDGPUMCInstLower::lower(const MachineInstr *MI, MCInst &OutMI) const {
213 unsigned Opcode = MI->getOpcode();
214 const auto *TII = static_cast<const SIInstrInfo *>(ST.getInstrInfo());
215
216 // FIXME: Should be able to handle this with lowerPseudoInstExpansion. We
217 // need to select it to the subtarget specific version, and there's no way to
218 // do that with a single pseudo source operation.
219 if (Opcode == AMDGPU::S_SETPC_B64_return)
220 Opcode = AMDGPU::S_SETPC_B64;
221 else if (Opcode == AMDGPU::SI_CALL) {
222 // SI_CALL is just S_SWAPPC_B64 with an additional operand to track the
223 // called function (which we need to remove here).
224 OutMI.setOpcode(TII->pseudoToMCOpcode(AMDGPU::S_SWAPPC_B64));
225 MCOperand Dest, Src;
226 lowerOperand(MI->getOperand(0), Dest);
227 lowerOperand(MI->getOperand(1), Src);
228 OutMI.addOperand(Dest);
229 OutMI.addOperand(Src);
230 return;
231 } else if (Opcode == AMDGPU::SI_TCRETURN ||
232 Opcode == AMDGPU::SI_TCRETURN_GFX) {
233 // TODO: How to use branch immediate and avoid register+add?
234 Opcode = AMDGPU::S_SETPC_B64;
235 } else if (AMDGPU::getT16D16Helper(Opcode)) {
236 lowerT16D16Helper(MI, OutMI);
237 return;
238 } else if (Opcode == AMDGPU::V_FMA_MIX_F16_t16 ||
239 Opcode == AMDGPU::V_FMA_MIX_BF16_t16) {
240 lowerT16FmaMixFP16(MI, OutMI);
241 return;
242 }
243
244 int MCOpcode = TII->pseudoToMCOpcode(Opcode);
245 if (MCOpcode == -1) {
246 LLVMContext &C = MI->getParent()->getParent()->getFunction().getContext();
247 C.emitError("AMDGPUMCInstLower::lower - Pseudo instruction doesn't have "
248 "a target-specific version: " + Twine(MI->getOpcode()));
249 }
250
251 OutMI.setOpcode(MCOpcode);
252
253 for (const MachineOperand &MO : MI->explicit_operands()) {
254 MCOperand MCOp;
255 lowerOperand(MO, MCOp);
256 OutMI.addOperand(MCOp);
257 }
258
259 int FIIdx = AMDGPU::getNamedOperandIdx(MCOpcode, AMDGPU::OpName::fi);
260 if (FIIdx >= (int)OutMI.getNumOperands())
262}
263
265 MCOperand &MCOp) const {
266 const GCNSubtarget &STI = MF->getSubtarget<GCNSubtarget>();
267 AMDGPUMCInstLower MCInstLowering(OutContext, STI, *this);
268 return MCInstLowering.lowerOperand(MO, MCOp);
269}
270
272 const Constant *BaseCV,
274
275 // Intercept LDS variables with known addresses
277 if (std::optional<uint32_t> Address =
279 auto *IntTy = Type::getInt32Ty(CV->getContext());
280 return AsmPrinter::lowerConstant(ConstantInt::get(IntTy, *Address),
281 BaseCV, Offset);
282 }
283 }
284
285 if (const MCExpr *E = lowerAddrSpaceCast(TM, CV, OutContext))
286 return E;
287 return AsmPrinter::lowerConstant(CV, BaseCV, Offset);
288}
289
291 const TargetRegisterInfo *TRI,
292 const SIMachineFunctionInfo *MFI,
293 MCStreamer &OS) {
294 // The instruction will only transfer a subset of the registers in the block,
295 // based on the mask that is stored in m0. We could search for the instruction
296 // that sets m0, but most of the time we'll already have the mask stored in
297 // the machine function info. Try to use that. This assumes that we only use
298 // block loads/stores for CSR spills.
299 Register RegBlock =
300 TII->getNamedOperand(*MI, MI->mayLoad() ? AMDGPU::OpName::vdst
301 : AMDGPU::OpName::vdata)
302 ->getReg();
303 Register FirstRegInBlock = TRI->getSubReg(RegBlock, AMDGPU::sub0);
304 uint32_t Mask = MFI->getMaskForVGPRBlockOps(RegBlock);
305
306 if (!Mask)
307 return; // Nothing to report
308
309 SmallString<512> TransferredRegs;
310 for (unsigned I = 0; I < sizeof(Mask) * 8; ++I) {
311 if (Mask & (1 << I)) {
312 (llvm::Twine(" ") + TRI->getRegAsmName(FirstRegInBlock + I))
313 .toVector(TransferredRegs);
314 }
315 }
316
317 OS.emitRawComment(" transferring at most " + TransferredRegs);
318}
319
321 // FIXME: Enable feature predicate checks once all the test pass.
322 // AMDGPU_MC::verifyInstructionPredicates(MI->getOpcode(),
323 // getSubtargetInfo().getFeatureBits());
324
325 if (MCInst OutInst; lowerPseudoInstExpansion(MI, OutInst)) {
326 EmitToStreamer(*OutStreamer, OutInst);
327 return;
328 }
329
330 const GCNSubtarget &STI = MF->getSubtarget<GCNSubtarget>();
331 AMDGPUMCInstLower MCInstLowering(OutContext, STI, *this);
332
333 StringRef Err;
334 if (!STI.getInstrInfo()->verifyInstruction(*MI, Err)) {
335 LLVMContext &C = MI->getParent()->getParent()->getFunction().getContext();
336 C.emitError("Illegal instruction detected: " + Err);
337 MI->print(errs());
338 }
339
340 if (MI->isBundle()) {
341 const MachineBasicBlock *MBB = MI->getParent();
343 while (I != MBB->instr_end() && I->isInsideBundle()) {
345 ++I;
346 }
347 } else {
348 // We don't want these pseudo instructions encoded. They are
349 // placeholder terminator instructions and should only be printed as
350 // comments.
351 if (MI->getOpcode() == AMDGPU::SI_RETURN_TO_EPILOG) {
352 if (isVerbose())
353 OutStreamer->emitRawComment(" return to shader part epilog");
354 return;
355 }
356
357 if (MI->getOpcode() == AMDGPU::WAVE_BARRIER) {
358 if (isVerbose())
359 OutStreamer->emitRawComment(" wave barrier");
360 return;
361 }
362
363 if (MI->getOpcode() == AMDGPU::SCHED_BARRIER) {
364 if (isVerbose()) {
365 std::string HexString;
366 raw_string_ostream HexStream(HexString);
367 HexStream << format_hex(MI->getOperand(0).getImm(), 10, true);
368 OutStreamer->emitRawComment(" sched_barrier mask(" + HexString + ")");
369 }
370 return;
371 }
372
373 if (MI->getOpcode() == AMDGPU::SCHED_GROUP_BARRIER) {
374 if (isVerbose()) {
375 std::string HexString;
376 raw_string_ostream HexStream(HexString);
377 HexStream << format_hex(MI->getOperand(0).getImm(), 10, true);
378 OutStreamer->emitRawComment(
379 " sched_group_barrier mask(" + HexString + ") size(" +
380 Twine(MI->getOperand(1).getImm()) + ") SyncID(" +
381 Twine(MI->getOperand(2).getImm()) + ")");
382 }
383 return;
384 }
385
386 if (MI->getOpcode() == AMDGPU::IGLP_OPT) {
387 if (isVerbose()) {
388 std::string HexString;
389 raw_string_ostream HexStream(HexString);
390 HexStream << format_hex(MI->getOperand(0).getImm(), 10, true);
391 OutStreamer->emitRawComment(" iglp_opt mask(" + HexString + ")");
392 }
393 return;
394 }
395
396 if (MI->getOpcode() == AMDGPU::SI_MASKED_UNREACHABLE) {
397 if (isVerbose())
398 OutStreamer->emitRawComment(" divergent unreachable");
399 return;
400 }
401
402 if (MI->isMetaInstruction()) {
403 if (isVerbose())
404 OutStreamer->emitRawComment(" meta instruction");
405 return;
406 }
407
408 if (isVerbose())
409 if (STI.getInstrInfo()->isBlockLoadStore(MI->getOpcode()))
411 MF->getInfo<SIMachineFunctionInfo>(),
412 *OutStreamer);
413
414 if (isVerbose() && MI->getOpcode() == AMDGPU::S_SET_VGPR_MSB) {
415 unsigned V = MI->getOperand(0).getImm();
416 OutStreamer->AddComment(
417 " msbs: dst=" + Twine(V >> 6) + " src0=" + Twine(V & 3) +
418 " src1=" + Twine((V >> 2) & 3) + " src2=" + Twine((V >> 4) & 3));
419 }
420
421 MCInst TmpInst;
422 MCInstLowering.lower(MI, TmpInst);
423 EmitToStreamer(*OutStreamer, TmpInst);
424
425#ifdef EXPENSIVE_CHECKS
426 // Check getInstSizeInBytes on explicitly specified CPUs (it cannot
427 // work correctly for the generic CPU).
428 //
429 // The isPseudo check really shouldn't be here, but unfortunately there are
430 // some negative lit tests that depend on being able to continue through
431 // here even when pseudo instructions haven't been lowered.
432 //
433 // We also overestimate branch sizes with the offset bug.
434 if (!MI->isPseudo() && STI.isCPUStringValid(STI.getCPU()) &&
435 (!STI.hasOffset3fBug() || !MI->isBranch())) {
437 SmallVector<char, 16> CodeBytes;
438
439 std::unique_ptr<MCCodeEmitter> InstEmitter(createAMDGPUMCCodeEmitter(
440 *STI.getInstrInfo(), OutContext));
441 InstEmitter->encodeInstruction(TmpInst, CodeBytes, Fixups, STI);
442
443 assert(CodeBytes.size() == STI.getInstrInfo()->getInstSizeInBytes(*MI));
444 }
445#endif
446
447 if (DumpCodeInstEmitter) {
448 // Disassemble instruction/operands to text
449 DisasmLines.resize(DisasmLines.size() + 1);
450 std::string &DisasmLine = DisasmLines.back();
451 raw_string_ostream DisasmStream(DisasmLine);
452
453 AMDGPUInstPrinter InstPrinter(*TM.getMCAsmInfo(), *STI.getInstrInfo(),
454 *STI.getRegisterInfo());
455 InstPrinter.printInst(&TmpInst, 0, StringRef(), STI, DisasmStream);
456
457 // Disassemble instruction/operands to hex representation.
459 SmallVector<char, 16> CodeBytes;
460
461 DumpCodeInstEmitter->encodeInstruction(
462 TmpInst, CodeBytes, Fixups, MF->getSubtarget<MCSubtargetInfo>());
463 HexLines.resize(HexLines.size() + 1);
464 std::string &HexLine = HexLines.back();
465 raw_string_ostream HexStream(HexLine);
466
467 for (size_t i = 0; i < CodeBytes.size(); i += 4) {
468 unsigned int CodeDWord =
469 support::endian::read32le(CodeBytes.data() + i);
470 HexStream << format("%s%08X", (i > 0 ? " " : ""), CodeDWord);
471 }
472
473 DisasmLineMaxLen = std::max(DisasmLineMaxLen, DisasmLine.size());
474 }
475 }
476}
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
This file contains the declarations for the subclasses of Constant, which represent the different fla...
const HexagonInstrInfo * TII
IRTranslator LLVM IR MI
#define I(x, y, z)
Definition MD5.cpp:58
Register const TargetRegisterInfo * TRI
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.
void lowerT16FmaMixFP16(const MachineInstr *MI, MCInst &OutMI) const
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:91
void EmitToStreamer(MCStreamer &S, const MCInst &Inst)
TargetMachine & TM
Target machine description.
Definition AsmPrinter.h:94
MachineFunction * MF
The current machine function.
Definition AsmPrinter.h:109
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:101
std::unique_ptr< MCStreamer > OutStreamer
This is the MCStreamer object for the file we are generating.
Definition AsmPrinter.h:106
bool isVerbose() const
Return true if assembly output should contain comments.
Definition AsmPrinter.h:308
This is an important base class in LLVM.
Definition Constant.h:43
const SIInstrInfo * getInstrInfo() const override
bool hasOffset3fBug() const
const SIRegisterInfo * getRegisterInfo() const override
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
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
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
virtual void emitRawComment(const Twine &T, bool TabPrefix=true)
Print T and prefix it with the comment string (normally #) and optionally a tab.
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
const MCExpr * getVariableValue() const
Get the expression of the variable symbol.
Definition MCSymbol.h:270
LLVM_ABI MCSymbol * getSymbol() const
Return the MCSymbol for this basic block.
Instructions::const_iterator const_instr_iterator
Representation of each machine instruction.
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.
Wrapper class representing virtual and physical registers.
Definition Register.h:19
unsigned getInstSizeInBytes(const MachineInstr &MI) const override
static bool isBlockLoadStore(uint16_t Opcode)
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
pointer data()
Return a pointer to the vector's buffer, even if empty().
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
TargetSubtargetInfo - Generic base class for all target subtargets.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition Twine.h:82
static LLVM_ABI IntegerType * getInt32Ty(LLVMContext &C)
Definition Type.cpp:297
LLVM_ABI LLVMContext & getContext() const
All values hold a context through their type.
Definition Value.cpp:1099
A raw_ostream that writes to an std::string.
#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:432
This is an optimization pass for GlobalISel generic memory operations.
@ Offset
Definition DWP.cpp:477
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
Definition Casting.h:644
FormattedNumber format_hex(uint64_t N, unsigned Width, bool Upper=false)
format_hex - Output N as a fixed width hexadecimal.
Definition Format.h:180
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Definition Format.h:118
LLVM_ABI raw_fd_ostream & errs()
This returns a reference to a raw_ostream for standard error.
static uint16_t getSpecifier(const MCSymbolRefExpr *SRE)
MCCodeEmitter * createAMDGPUMCCodeEmitter(const MCInstrInfo &MCII, MCContext &Ctx)