LLVM 23.0.0git
AMDGPULowerVGPREncoding.cpp
Go to the documentation of this file.
1//===- AMDGPULowerVGPREncoding.cpp - lower VGPRs above v255 ---------------===//
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/// Lower VGPRs above first 256 on gfx1250.
11///
12/// The pass scans used VGPRs and inserts S_SET_VGPR_MSB instructions to switch
13/// VGPR addressing mode. The mode change is effective until the next change.
14/// This instruction provides high bits of a VGPR address for four of the
15/// operands: vdst, src0, src1, and src2, or other 4 operands depending on the
16/// instruction encoding. If bits are set they are added as MSB to the
17/// corresponding operand VGPR number.
18///
19/// There is no need to replace actual register operands because encoding of the
20/// high and low VGPRs is the same. I.e. v0 has the encoding 0x100, so does
21/// v256. v1 has the encoding 0x101 and v257 has the same encoding. So high
22/// VGPRs will survive until actual encoding and will result in a same actual
23/// bit encoding.
24///
25/// As a result the pass only inserts S_SET_VGPR_MSB to provide an actual offset
26/// to a VGPR address of the subseqent instructions. The InstPrinter will take
27/// care of the printing a low VGPR instead of a high one. In prinicple this
28/// shall be viable to print actual high VGPR numbers, but that would disagree
29/// with a disasm printing and create a situation where asm text is not
30/// deterministic.
31///
32/// This pass creates a convention where non-fall through basic blocks shall
33/// start with all 4 MSBs zero. Otherwise a disassembly would not be readable.
34/// An optimization here is possible but deemed not desirable because of the
35/// readbility concerns.
36///
37/// Consequentially the ABI is set to expect all 4 MSBs to be zero on entry.
38/// The pass must run very late in the pipeline to make sure no changes to VGPR
39/// operands will be made after it.
40//
41//===----------------------------------------------------------------------===//
42
44#include "AMDGPU.h"
45#include "GCNSubtarget.h"
46#include "SIDefines.h"
47#include "SIInstrInfo.h"
48#include "llvm/ADT/bit.h"
50
51using namespace llvm;
52
53#define DEBUG_TYPE "amdgpu-lower-vgpr-encoding"
54
55namespace {
56
57class AMDGPULowerVGPREncoding {
58 static constexpr unsigned OpNum = 4;
59 static constexpr unsigned BitsPerField = 2;
60 static constexpr unsigned NumFields = 4;
61 static constexpr unsigned ModeWidth = NumFields * BitsPerField;
62 static constexpr unsigned ModeMask = (1 << ModeWidth) - 1;
63 static constexpr unsigned VGPRMSBShift =
65
66 struct OpMode {
67 // No MSBs set means they are not required to be of a particular value.
68 std::optional<unsigned> MSBits;
69
70 bool update(const OpMode &New, bool &Rewritten) {
71 bool Updated = false;
72 if (New.MSBits) {
73 if (*New.MSBits != MSBits.value_or(0)) {
74 Updated = true;
75 Rewritten |= MSBits.has_value();
76 }
77 MSBits = New.MSBits;
78 }
79 return Updated;
80 }
81 };
82
83 struct ModeTy {
84 OpMode Ops[OpNum];
85
86 bool update(const ModeTy &New, bool &Rewritten) {
87 bool Updated = false;
88 for (unsigned I : seq(OpNum))
89 Updated |= Ops[I].update(New.Ops[I], Rewritten);
90 return Updated;
91 }
92
93 unsigned encode() const {
94 // Layout: [src0 msb, src1 msb, src2 msb, dst msb].
95 unsigned V = 0;
96 for (const auto &[I, Op] : enumerate(Ops))
97 V |= Op.MSBits.value_or(0) << (I * 2);
98 return V;
99 }
100
101 // Check if this mode is compatible with required \p NewMode without
102 // modification.
103 bool isCompatible(const ModeTy NewMode) const {
104 for (unsigned I : seq(OpNum)) {
105 if (!NewMode.Ops[I].MSBits.has_value())
106 continue;
107 if (Ops[I].MSBits.value_or(0) != NewMode.Ops[I].MSBits.value_or(0))
108 return false;
109 }
110 return true;
111 }
112 };
113
114public:
115 bool run(MachineFunction &MF);
116
117private:
118 const SIInstrInfo *TII;
119 const SIRegisterInfo *TRI;
120
121 // Current basic block.
123
124 /// Most recent s_set_* instruction.
125 MachineInstr *MostRecentModeSet;
126
127 /// Current mode bits.
128 ModeTy CurrentMode;
129
130 /// Number of current hard clause instructions.
131 unsigned ClauseLen;
132
133 /// Number of hard clause instructions remaining.
134 unsigned ClauseRemaining;
135
136 /// Clause group breaks.
137 unsigned ClauseBreaks;
138
139 /// Last hard clause instruction.
141
142 /// Insert mode change before \p I. \returns true if mode was changed.
143 bool setMode(ModeTy NewMode, MachineBasicBlock::instr_iterator I);
144
145 /// Reset mode to default.
146 void resetMode(MachineBasicBlock::instr_iterator I) {
147 ModeTy Mode;
148 for (OpMode &Op : Mode.Ops)
149 Op.MSBits = 0;
150 setMode(Mode, I);
151 }
152
153 /// If \p MO references VGPRs, return the MSBs. Otherwise, return nullopt.
154 std::optional<unsigned> getMSBs(const MachineOperand &MO) const;
155
156 /// Handle single \p MI. \return true if changed.
157 bool runOnMachineInstr(MachineInstr &MI);
158
159 /// Compute the mode for a single \p MI given \p Ops operands
160 /// bit mapping. Optionally takes second array \p Ops2 for VOPD.
161 /// If provided and an operand from \p Ops is not a VGPR, then \p Ops2
162 /// is checked.
163 void computeMode(ModeTy &NewMode, const MachineInstr &MI,
164 const AMDGPU::OpName Ops[OpNum],
165 const AMDGPU::OpName *Ops2 = nullptr);
166
167 /// Check if an instruction \p I is within a clause and returns a suitable
168 /// iterator to insert mode change. It may also modify the S_CLAUSE
169 /// instruction to extend it or drop the clause if it cannot be adjusted.
172
173 /// Check if an instruction \p I is immediately after another program state
174 /// instruction which it cannot coissue with. If so, insert before that
175 /// instruction to encourage more coissuing.
178
179 /// Handle S_SETREG_IMM32_B32 targeting MODE register. On certain hardware,
180 /// this instruction clobbers VGPR MSB bits[12:19], so we need to restore
181 /// the current mode. \returns true if the instruction was modified or a
182 /// new one was inserted.
183 bool handleSetregMode(MachineInstr &MI);
184
185 /// Update bits[12:19] of the imm operand in S_SETREG_IMM32_B32 to contain
186 /// the VGPR MSB mode value. \returns true if the immediate was changed.
187 bool updateSetregModeImm(MachineInstr &MI, int64_t ModeValue);
188};
189
190bool AMDGPULowerVGPREncoding::setMode(ModeTy NewMode,
192 // Record previous mode into high 8 bits of the immediate.
193 int64_t OldModeBits = CurrentMode.encode() << ModeWidth;
194
195 bool Rewritten = false;
196 if (!CurrentMode.update(NewMode, Rewritten))
197 return false;
198
199 if (MostRecentModeSet && !Rewritten) {
200 // Update MostRecentModeSet with the new mode. It can be either
201 // S_SET_VGPR_MSB or S_SETREG_IMM32_B32 (with Size <= 12).
202 if (MostRecentModeSet->getOpcode() == AMDGPU::S_SET_VGPR_MSB) {
203 MachineOperand &Op = MostRecentModeSet->getOperand(0);
204 // Carry old mode bits from the existing instruction.
205 int64_t OldModeBits = Op.getImm() & (ModeMask << ModeWidth);
206 Op.setImm(CurrentMode.encode() | OldModeBits);
207 } else {
208 assert(MostRecentModeSet->getOpcode() == AMDGPU::S_SETREG_IMM32_B32 &&
209 "unexpected MostRecentModeSet opcode");
210 updateSetregModeImm(*MostRecentModeSet, CurrentMode.encode());
211 }
212
213 return true;
214 }
215
216 I = handleClause(I);
217 I = handleCoissue(I);
218 MostRecentModeSet = BuildMI(*MBB, I, {}, TII->get(AMDGPU::S_SET_VGPR_MSB))
219 .addImm(NewMode.encode() | OldModeBits);
220
221 CurrentMode = NewMode;
222 return true;
223}
224
225std::optional<unsigned>
226AMDGPULowerVGPREncoding::getMSBs(const MachineOperand &MO) const {
227 if (!MO.isReg())
228 return std::nullopt;
229
230 MCRegister Reg = MO.getReg();
231 const TargetRegisterClass *RC = TRI->getPhysRegBaseClass(Reg);
232 if (!RC || !TRI->isVGPRClass(RC))
233 return std::nullopt;
234
235 unsigned Idx = TRI->getHWRegIndex(Reg);
236 return Idx >> 8;
237}
238
239void AMDGPULowerVGPREncoding::computeMode(ModeTy &NewMode,
240 const MachineInstr &MI,
241 const AMDGPU::OpName Ops[OpNum],
242 const AMDGPU::OpName *Ops2) {
243 NewMode = {};
244
245 for (unsigned I = 0; I < OpNum; ++I) {
246 const MachineOperand *Op = TII->getNamedOperand(MI, Ops[I]);
247
248 std::optional<unsigned> MSBits;
249 if (Op)
250 MSBits = getMSBs(*Op);
251
252#if !defined(NDEBUG)
253 if (MSBits.has_value() && Ops2) {
254 const MachineOperand *Op2 = TII->getNamedOperand(MI, Ops2[I]);
255 if (Op2) {
256 std::optional<unsigned> MSBits2;
257 MSBits2 = getMSBs(*Op2);
258 if (MSBits2.has_value() && MSBits != MSBits2)
259 llvm_unreachable("Invalid VOPD pair was created");
260 }
261 }
262#endif
263
264 if (!MSBits.has_value() && Ops2) {
265 Op = TII->getNamedOperand(MI, Ops2[I]);
266 if (Op)
267 MSBits = getMSBs(*Op);
268 }
269
270 if (!MSBits.has_value())
271 continue;
272
273 // Skip tied uses of src2 of VOP2, these will be handled along with defs and
274 // only vdst bit affects these operands. We cannot skip tied uses of VOP3,
275 // these uses are real even if must match the vdst.
276 if (Ops[I] == AMDGPU::OpName::src2 && !Op->isDef() && Op->isTied() &&
279 TII->hasVALU32BitEncoding(MI.getOpcode()))))
280 continue;
281
282 NewMode.Ops[I].MSBits = MSBits.value();
283 }
284}
285
286bool AMDGPULowerVGPREncoding::runOnMachineInstr(MachineInstr &MI) {
288 if (Ops.first) {
289 ModeTy NewMode;
290 computeMode(NewMode, MI, Ops.first, Ops.second);
291 if (!CurrentMode.isCompatible(NewMode) && MI.isCommutable() &&
292 TII->commuteInstruction(MI)) {
293 ModeTy NewModeCommuted;
294 computeMode(NewModeCommuted, MI, Ops.first, Ops.second);
295 if (CurrentMode.isCompatible(NewModeCommuted)) {
296 // Update CurrentMode with mode bits the commuted instruction relies on.
297 // This prevents later instructions from piggybacking and corrupting
298 // those bits (e.g., a nullopt src treated as 0 could be overwritten).
299 bool Unused = false;
300 CurrentMode.update(NewModeCommuted, Unused);
301 // MI was modified by the commute above.
302 return true;
303 }
304 // Commute back.
305 if (!TII->commuteInstruction(MI))
306 llvm_unreachable("Failed to restore commuted instruction.");
307 }
308 return setMode(NewMode, MI.getIterator());
309 }
310 assert(!TII->hasVGPRUses(MI) || MI.isMetaInstruction() || MI.isPseudo());
311
312 return false;
313}
314
316AMDGPULowerVGPREncoding::handleClause(MachineBasicBlock::instr_iterator I) {
317 if (!ClauseRemaining)
318 return I;
319
320 // A clause cannot start with a special instruction, place it right before
321 // the clause.
322 if (ClauseRemaining == ClauseLen) {
323 I = Clause->getPrevNode()->getIterator();
324 assert(I->isBundle());
325 return I;
326 }
327
328 // If a clause defines breaks each group cannot start with a mode change.
329 // just drop the clause.
330 if (ClauseBreaks) {
331 Clause->eraseFromBundle();
332 ClauseRemaining = 0;
333 return I;
334 }
335
336 // Otherwise adjust a number of instructions in the clause if it fits.
337 // If it does not clause will just become shorter. Since the length
338 // recorded in the clause is one less, increment the length after the
339 // update. Note that SIMM16[5:0] must be 1-62, not 0 or 63.
340 if (ClauseLen < 63)
341 Clause->getOperand(0).setImm(ClauseLen | (ClauseBreaks << 8));
342
343 ++ClauseLen;
344
345 return I;
346}
347
349AMDGPULowerVGPREncoding::handleCoissue(MachineBasicBlock::instr_iterator I) {
350 if (I.isEnd())
351 return I;
352
353 // "Program State instructions" are instructions which are used to control
354 // operation of the GPU rather than performing arithmetic. Such instructions
355 // have different coissuing rules w.r.t s_set_vgpr_msb.
356 auto isProgramStateInstr = [this](MachineInstr *MI) {
357 unsigned Opc = MI->getOpcode();
358 return TII->isBarrier(Opc) || TII->isWaitcnt(Opc) ||
359 Opc == AMDGPU::S_DELAY_ALU;
360 };
361
362 while (!I.isEnd() && I != I->getParent()->begin()) {
363 auto Prev = std::prev(I);
364 if (!isProgramStateInstr(&*Prev))
365 return I;
366 I = Prev;
367 }
368
369 return I;
370}
371
372/// Convert mode value from S_SET_VGPR_MSB format to MODE register format.
373/// S_SET_VGPR_MSB uses: (src0[0-1], src1[2-3], src2[4-5], dst[6-7])
374/// MODE register uses: (dst[0-1], src0[2-3], src1[4-5], src2[6-7])
375/// This is a left rotation by 2 bits on an 8-bit value.
376static int64_t convertModeToSetregFormat(int64_t Mode) {
377 assert(isUInt<8>(Mode) && "Mode expected to be 8-bit");
378 return llvm::rotl<uint8_t>(static_cast<uint8_t>(Mode), /*R=*/2);
379}
380
381bool AMDGPULowerVGPREncoding::updateSetregModeImm(MachineInstr &MI,
382 int64_t ModeValue) {
383 assert(MI.getOpcode() == AMDGPU::S_SETREG_IMM32_B32);
384
385 // Convert from S_SET_VGPR_MSB format to MODE register format
386 int64_t SetregMode = convertModeToSetregFormat(ModeValue);
387
388 MachineOperand *ImmOp = TII->getNamedOperand(MI, AMDGPU::OpName::imm);
389 int64_t OldImm = ImmOp->getImm();
390 int64_t NewImm =
391 (OldImm & ~AMDGPU::Hwreg::VGPR_MSB_MASK) | (SetregMode << VGPRMSBShift);
392 ImmOp->setImm(NewImm);
393 return NewImm != OldImm;
394}
395
396bool AMDGPULowerVGPREncoding::handleSetregMode(MachineInstr &MI) {
397 using namespace AMDGPU::Hwreg;
398
399 assert(MI.getOpcode() == AMDGPU::S_SETREG_IMM32_B32 &&
400 "only S_SETREG_IMM32_B32 needs to be handled");
401
402 MachineOperand *SIMM16Op = TII->getNamedOperand(MI, AMDGPU::OpName::simm16);
403 assert(SIMM16Op && "SIMM16Op must be present");
404
405 auto [HwRegId, Offset, Size] = HwregEncoding::decode(SIMM16Op->getImm());
406 (void)Offset;
407 if (HwRegId != ID_MODE)
408 return false;
409
410 int64_t ModeValue = CurrentMode.encode();
411
412 // Case 1: Size <= 12 - the original instruction uses imm32[0:Size-1], so
413 // imm32[12:19] is unused. Safe to set imm32[12:19] to the correct VGPR
414 // MSBs.
415 if (Size <= VGPRMSBShift) {
416 // This instruction now acts as MostRecentModeSet so it can be updated if
417 // CurrentMode changes via piggybacking.
418 MostRecentModeSet = &MI;
419 return updateSetregModeImm(MI, ModeValue);
420 }
421
422 // Case 2: Size > 12 - the original instruction uses bits beyond 11, so we
423 // cannot arbitrarily modify imm32[12:19]. Check if it already matches VGPR
424 // MSBs. Note: imm32[12:19] is in MODE register format, while ModeValue is
425 // in S_SET_VGPR_MSB format, so we need to convert before comparing.
426 MachineOperand *ImmOp = TII->getNamedOperand(MI, AMDGPU::OpName::imm);
427 assert(ImmOp && "ImmOp must be present");
428 int64_t ImmBits12To19 = (ImmOp->getImm() & VGPR_MSB_MASK) >> VGPRMSBShift;
429 int64_t SetregModeValue = convertModeToSetregFormat(ModeValue);
430 if (ImmBits12To19 == SetregModeValue) {
431 // Already correct, but we must invalidate MostRecentModeSet because this
432 // instruction will overwrite mode[12:19]. We can't update this instruction
433 // via piggybacking (bits[12:19] are meaningful), so if CurrentMode changes,
434 // a new s_set_vgpr_msb will be inserted after this instruction.
435 MostRecentModeSet = nullptr;
436 return false;
437 }
438
439 // imm32[12:19] doesn't match VGPR MSBs - insert s_set_vgpr_msb after
440 // the original instruction to restore the correct value.
441 MachineBasicBlock::iterator InsertPt = std::next(MI.getIterator());
442 MostRecentModeSet = BuildMI(*MBB, InsertPt, MI.getDebugLoc(),
443 TII->get(AMDGPU::S_SET_VGPR_MSB))
444 .addImm(ModeValue);
445 return true;
446}
447
448bool AMDGPULowerVGPREncoding::run(MachineFunction &MF) {
449 const GCNSubtarget &ST = MF.getSubtarget<GCNSubtarget>();
450 if (!ST.has1024AddressableVGPRs())
451 return false;
452
453 TII = ST.getInstrInfo();
454 TRI = ST.getRegisterInfo();
455
456 bool Changed = false;
457 ClauseLen = ClauseRemaining = 0;
458 CurrentMode = {};
459 for (auto &MBB : MF) {
460 MostRecentModeSet = nullptr;
461 this->MBB = &MBB;
462
463 for (auto &MI : llvm::make_early_inc_range(MBB.instrs())) {
464 if (MI.isMetaInstruction())
465 continue;
466
467 if (MI.isTerminator() || MI.isCall()) {
468 if (MI.getOpcode() == AMDGPU::S_ENDPGM ||
469 MI.getOpcode() == AMDGPU::S_ENDPGM_SAVED)
470 CurrentMode = {};
471 else
472 resetMode(MI.getIterator());
473 continue;
474 }
475
476 if (MI.isInlineAsm()) {
477 if (TII->hasVGPRUses(MI))
478 resetMode(MI.getIterator());
479 continue;
480 }
481
482 if (MI.getOpcode() == AMDGPU::S_CLAUSE) {
483 assert(!ClauseRemaining && "Nested clauses are not supported");
484 ClauseLen = MI.getOperand(0).getImm();
485 ClauseBreaks = (ClauseLen >> 8) & 15;
486 ClauseLen = ClauseRemaining = (ClauseLen & 63) + 1;
487 Clause = &MI;
488 continue;
489 }
490
491 if (MI.getOpcode() == AMDGPU::S_SETREG_IMM32_B32 &&
492 ST.hasSetregVGPRMSBFixup()) {
493 Changed |= handleSetregMode(MI);
494 continue;
495 }
496
497 Changed |= runOnMachineInstr(MI);
498
499 if (ClauseRemaining)
500 --ClauseRemaining;
501 }
502
503 // Reset the mode if we are falling through.
504 resetMode(MBB.instr_end());
505 }
506
507 return Changed;
508}
509
510class AMDGPULowerVGPREncodingLegacy : public MachineFunctionPass {
511public:
512 static char ID;
513
514 AMDGPULowerVGPREncodingLegacy() : MachineFunctionPass(ID) {}
515
516 bool runOnMachineFunction(MachineFunction &MF) override {
517 return AMDGPULowerVGPREncoding().run(MF);
518 }
519
520 void getAnalysisUsage(AnalysisUsage &AU) const override {
521 AU.setPreservesCFG();
523 }
524};
525
526} // namespace
527
528char AMDGPULowerVGPREncodingLegacy::ID = 0;
529
530char &llvm::AMDGPULowerVGPREncodingLegacyID = AMDGPULowerVGPREncodingLegacy::ID;
531
532INITIALIZE_PASS(AMDGPULowerVGPREncodingLegacy, DEBUG_TYPE,
533 "AMDGPU Lower VGPR Encoding", false, false)
534
538 if (!AMDGPULowerVGPREncoding().run(MF))
539 return PreservedAnalyses::all();
540
542}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
MachineBasicBlock & MBB
AMD GCN specific subclass of TargetSubtarget.
#define DEBUG_TYPE
const HexagonInstrInfo * TII
IRTranslator LLVM IR MI
const AbstractManglingParser< Derived, Alloc >::OperatorInfo AbstractManglingParser< Derived, Alloc >::Ops[]
#define I(x, y, z)
Definition MD5.cpp:57
Register Reg
Register const TargetRegisterInfo * TRI
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Definition PassSupport.h:56
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
Interface definition for SIInstrInfo.
This file implements the C++20 <bit> header.
Represent the analysis usage information of a pass.
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
Definition Pass.cpp:270
Represents analyses that only rely on functions' control flow.
Definition Analysis.h:73
Wrapper class representing physical registers. Should be passed by value.
Definition MCRegister.h:41
Instructions::iterator instr_iterator
MachineInstrBundleIterator< MachineInstr > iterator
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
Representation of each machine instruction.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const MachineOperand & getOperand(unsigned i) const
MachineOperand class - Representation of each machine instruction operand.
void setImm(int64_t immVal)
int64_t getImm() const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
Register getReg() const
getReg - Returns the register number.
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
PreservedAnalyses & preserveSet()
Mark an analysis set as preserved.
Definition Analysis.h:151
static bool isVOP2(const MachineInstr &MI)
static bool isVOP3(const MCInstrDesc &Desc)
Changed
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
std::pair< const AMDGPU::OpName *, const AMDGPU::OpName * > getVGPRLoweringOperandTables(const MCInstrDesc &Desc)
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
Definition CallingConv.h:24
This is an optimization pass for GlobalISel generic memory operations.
Definition Types.h:26
@ Offset
Definition DWP.cpp:532
unsigned encode(MaybeAlign A)
Returns a representation of the alignment that encodes undefined as 0.
Definition Alignment.h:206
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
auto enumerate(FirstRange &&First, RestRanges &&...Rest)
Given two or more input ranges, returns a new range whose values are tuples (A, B,...
Definition STLExtras.h:2554
iterator_range< early_inc_iterator_impl< detail::IterOfRange< RangeT > > > make_early_inc_range(RangeT &&Range)
Make a range that does early increment to allow mutation of the underlying range without disrupting i...
Definition STLExtras.h:634
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
constexpr bool isUInt(uint64_t x)
Checks if an unsigned integer fits into the given bit width.
Definition MathExtras.h:189
DWARFExpression::Operation Op
constexpr int countr_zero_constexpr(T Val)
Count number of 0's from the least significant bit to the most stopping at the first 1.
Definition bit.h:188
char & AMDGPULowerVGPREncodingLegacyID
auto seq(T Begin, T End)
Iterate over an integral type from Begin up to - but not including - End.
Definition Sequence.h:305
constexpr T rotl(T V, int R)
Definition bit.h:369