LLVM 23.0.0git
AMDGPUInsertDelayAlu.cpp
Go to the documentation of this file.
1//===- AMDGPUInsertDelayAlu.cpp - Insert s_delay_alu instructions ---------===//
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/// Insert s_delay_alu instructions to avoid stalls on GFX11+.
11//
12//===----------------------------------------------------------------------===//
13
14#include "AMDGPU.h"
15#include "GCNSubtarget.h"
17#include "SIInstrInfo.h"
19#include "llvm/ADT/SetVector.h"
20
21using namespace llvm;
22
23#define DEBUG_TYPE "amdgpu-insert-delay-alu"
24
25namespace {
26
27class AMDGPUInsertDelayAlu {
28public:
29 const GCNSubtarget *ST;
30 const SIInstrInfo *SII;
32
33 const TargetSchedModel *SchedModel;
34
35 // Return true if MI waits for all outstanding VALU instructions to complete.
36 static bool instructionWaitsForVALU(const MachineInstr &MI) {
37 // These instruction types wait for VA_VDST==0 before issuing.
38 const uint64_t VA_VDST_0 = SIInstrFlags::DS | SIInstrFlags::EXP |
41 if (MI.getDesc().TSFlags & VA_VDST_0)
42 return true;
43 if (MI.getOpcode() == AMDGPU::S_SENDMSG_RTN_B32 ||
44 MI.getOpcode() == AMDGPU::S_SENDMSG_RTN_B64)
45 return true;
46 if (MI.getOpcode() == AMDGPU::S_WAITCNT_DEPCTR &&
47 AMDGPU::DepCtr::decodeFieldVaVdst(MI.getOperand(0).getImm()) == 0)
48 return true;
49 return false;
50 }
51
52 static bool instructionWaitsForSGPRWrites(const MachineInstr &MI) {
53 // These instruction types wait for VA_SDST==0 before issuing.
54 uint64_t MIFlags = MI.getDesc().TSFlags;
55 if (MIFlags & SIInstrFlags::SMRD)
56 return true;
57
58 if (MIFlags & SIInstrFlags::SALU) {
59 for (auto &Op : MI.operands()) {
60 if (Op.isReg())
61 return true;
62 }
63 }
64 return false;
65 }
66
67 // Types of delay that can be encoded in an s_delay_alu instruction.
68 enum DelayType { VALU, TRANS, SALU, OTHER };
69
70 // Get the delay type for a MachineInstr.
71 DelayType getDelayType(const MachineInstr &MI) {
72 // Non-F64 TRANS instructions use a separate delay type.
74 !AMDGPU::isDPMACCInstruction(MI.getOpcode()))
75 return TRANS;
76 // WMMA XDL ops are treated the same as TRANS.
77 if (ST->hasGFX1250Insts() && SII->isXDLWMMA(MI))
78 return TRANS;
80 return VALU;
82 return SALU;
83 return OTHER;
84 }
85
86 // Information about the last instruction(s) that wrote to a particular
87 // regunit. In straight-line code there will only be one such instruction, but
88 // when control flow converges we merge the delay information from each path
89 // to represent the union of the worst-case delays of each type.
90 struct DelayInfo {
91 // One larger than the maximum number of (non-TRANS) VALU instructions we
92 // can encode in an s_delay_alu instruction.
93 static constexpr unsigned VALU_MAX = 5;
94
95 // One larger than the maximum number of TRANS instructions we can encode in
96 // an s_delay_alu instruction.
97 static constexpr unsigned TRANS_MAX = 4;
98
99 // One larger than the maximum number of SALU cycles we can encode in an
100 // s_delay_alu instruction.
101 static constexpr unsigned SALU_CYCLES_MAX = 4;
102
103 // If it was written by a (non-TRANS) VALU, remember how many clock cycles
104 // are left until it completes, and how many other (non-TRANS) VALU we have
105 // seen since it was issued.
106 uint8_t VALUCycles = 0;
107 uint8_t VALUNum = VALU_MAX;
108
109 // If it was written by a TRANS, remember how many clock cycles are left
110 // until it completes, and how many other TRANS we have seen since it was
111 // issued.
112 uint8_t TRANSCycles = 0;
113 uint8_t TRANSNum = TRANS_MAX;
114 // Also remember how many other (non-TRANS) VALU we have seen since it was
115 // issued. When an instruction depends on both a prior TRANS and a prior
116 // non-TRANS VALU, this is used to decide whether to encode a wait for just
117 // one or both of them.
118 uint8_t TRANSNumVALU = VALU_MAX;
119
120 // If it was written by an SALU, remember how many clock cycles are left
121 // until it completes.
122 uint8_t SALUCycles = 0;
123
124 DelayInfo() = default;
125
126 DelayInfo(DelayType Type, unsigned Cycles) {
127 switch (Type) {
128 default:
129 llvm_unreachable("unexpected type");
130 case VALU:
131 VALUCycles = Cycles;
132 VALUNum = 0;
133 break;
134 case TRANS:
135 TRANSCycles = Cycles;
136 TRANSNum = 0;
137 TRANSNumVALU = 0;
138 break;
139 case SALU:
140 // Guard against pseudo-instructions like SI_CALL which are marked as
141 // SALU but with a very high latency.
142 SALUCycles = std::min(Cycles, SALU_CYCLES_MAX);
143 break;
144 }
145 }
146
147 bool operator==(const DelayInfo &RHS) const {
148 return VALUCycles == RHS.VALUCycles && VALUNum == RHS.VALUNum &&
149 TRANSCycles == RHS.TRANSCycles && TRANSNum == RHS.TRANSNum &&
150 TRANSNumVALU == RHS.TRANSNumVALU && SALUCycles == RHS.SALUCycles;
151 }
152
153 bool operator!=(const DelayInfo &RHS) const { return !(*this == RHS); }
154
155 // Merge another DelayInfo into this one, to represent the union of the
156 // worst-case delays of each type.
157 void merge(const DelayInfo &RHS) {
158 VALUCycles = std::max(VALUCycles, RHS.VALUCycles);
159 VALUNum = std::min(VALUNum, RHS.VALUNum);
160 TRANSCycles = std::max(TRANSCycles, RHS.TRANSCycles);
161 TRANSNum = std::min(TRANSNum, RHS.TRANSNum);
162 TRANSNumVALU = std::min(TRANSNumVALU, RHS.TRANSNumVALU);
163 SALUCycles = std::max(SALUCycles, RHS.SALUCycles);
164 }
165
166 // Update this DelayInfo after issuing an instruction of the specified type.
167 // Cycles is the number of cycles it takes to issue the instruction. Return
168 // true if there is no longer any useful delay info.
169 bool advance(DelayType Type, unsigned Cycles) {
170 bool Erase = true;
171
172 VALUNum += (Type == VALU);
173 if (VALUNum >= VALU_MAX || VALUCycles <= Cycles) {
174 // Forget about the VALU instruction. It was too far back or has
175 // definitely completed by now.
176 VALUNum = VALU_MAX;
177 VALUCycles = 0;
178 } else {
179 VALUCycles -= Cycles;
180 Erase = false;
181 }
182
183 TRANSNum += (Type == TRANS);
184 TRANSNumVALU += (Type == VALU);
185 if (TRANSNum >= TRANS_MAX || TRANSCycles <= Cycles) {
186 // Forget about any TRANS instruction. It was too far back or has
187 // definitely completed by now.
188 TRANSNum = TRANS_MAX;
189 TRANSNumVALU = VALU_MAX;
190 TRANSCycles = 0;
191 } else {
192 TRANSCycles -= Cycles;
193 Erase = false;
194 }
195
196 if (SALUCycles <= Cycles) {
197 // Forget about any SALU instruction. It has definitely completed by
198 // now.
199 SALUCycles = 0;
200 } else {
201 SALUCycles -= Cycles;
202 Erase = false;
203 }
204
205 return Erase;
206 }
207
208#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
209 void dump() const {
210 if (VALUCycles)
211 dbgs() << " VALUCycles=" << (int)VALUCycles;
212 if (VALUNum < VALU_MAX)
213 dbgs() << " VALUNum=" << (int)VALUNum;
214 if (TRANSCycles)
215 dbgs() << " TRANSCycles=" << (int)TRANSCycles;
216 if (TRANSNum < TRANS_MAX)
217 dbgs() << " TRANSNum=" << (int)TRANSNum;
218 if (TRANSNumVALU < VALU_MAX)
219 dbgs() << " TRANSNumVALU=" << (int)TRANSNumVALU;
220 if (SALUCycles)
221 dbgs() << " SALUCycles=" << (int)SALUCycles;
222 }
223#endif
224 };
225
226 // A map from regunits to the delay info for that regunit.
227 struct DelayState : DenseMap<MCRegUnit, DelayInfo> {
228 // Merge another DelayState into this one by merging the delay info for each
229 // regunit.
230 void merge(const DelayState &RHS) {
231 for (const auto &KV : RHS) {
232 iterator It;
233 bool Inserted;
234 std::tie(It, Inserted) = insert(KV);
235 if (!Inserted)
236 It->second.merge(KV.second);
237 }
238 }
239
240 // Advance the delay info for each regunit, erasing any that are no longer
241 // useful.
242 void advance(DelayType Type, unsigned Cycles) {
244 for (auto I = begin(), E = end(); I != E; I = Next) {
245 Next = std::next(I);
246 if (I->second.advance(Type, Cycles))
247 erase(I);
248 }
249 }
250
251 void advanceByVALUNum(unsigned VALUNum) {
253 for (auto I = begin(), E = end(); I != E; I = Next) {
254 Next = std::next(I);
255 if (I->second.VALUNum >= VALUNum && I->second.VALUCycles > 0) {
256 erase(I);
257 }
258 }
259 }
260
261#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
262 void dump(const TargetRegisterInfo *TRI) const {
263 if (empty()) {
264 dbgs() << " empty\n";
265 return;
266 }
267
268 // Dump DelayInfo for each RegUnit in numerical order.
270 Order.reserve(size());
271 for (const_iterator I = begin(), E = end(); I != E; ++I)
272 Order.push_back(I);
273 llvm::sort(Order, [](const const_iterator &A, const const_iterator &B) {
274 return A->first < B->first;
275 });
276 for (const_iterator I : Order) {
277 dbgs() << " " << printRegUnit(I->first, TRI);
278 I->second.dump();
279 dbgs() << "\n";
280 }
281 }
282#endif
283 };
284
285 // The saved delay state at the end of each basic block.
287
288 // Emit an s_delay_alu instruction if necessary before MI.
289 MachineInstr *emitDelayAlu(MachineInstr &MI, DelayInfo Delay,
290 MachineInstr *LastDelayAlu) {
291 unsigned Imm = 0;
292
293 // Wait for a TRANS instruction.
294 if (Delay.TRANSNum < DelayInfo::TRANS_MAX)
295 Imm |= 4 + Delay.TRANSNum;
296
297 // Wait for a VALU instruction (if it's more recent than any TRANS
298 // instruction that we're also waiting for).
299 if (Delay.VALUNum < DelayInfo::VALU_MAX &&
300 Delay.VALUNum <= Delay.TRANSNumVALU) {
301 if (Imm & 0xf)
302 Imm |= Delay.VALUNum << 7;
303 else
304 Imm |= Delay.VALUNum;
305 }
306
307 // Wait for an SALU instruction.
308 if (Delay.SALUCycles) {
309 assert(Delay.SALUCycles < DelayInfo::SALU_CYCLES_MAX);
310 if (Imm & 0x780) {
311 // We have already encoded a VALU and a TRANS delay. There's no room in
312 // the encoding for an SALU delay as well, so just drop it.
313 } else if (Imm & 0xf) {
314 Imm |= (Delay.SALUCycles + 8) << 7;
315 } else {
316 Imm |= Delay.SALUCycles + 8;
317 }
318 }
319
320 // Don't emit the s_delay_alu instruction if there's nothing to wait for.
321 if (!Imm)
322 return LastDelayAlu;
323
324 // If we only need to wait for one instruction, try encoding it in the last
325 // s_delay_alu that we emitted.
326 if (!(Imm & 0x780) && LastDelayAlu) {
327 unsigned Skip = 0;
328 for (auto I = MachineBasicBlock::instr_iterator(LastDelayAlu),
330 ++I != E;) {
331 if (I->getOpcode() == AMDGPU::S_SET_VGPR_MSB) {
332 // It is not deterministic whether the skip count counts
333 // S_SET_VGPR_MSB instructions or not, so do not include them in a
334 // skip region.
335 Skip = 6;
336 break;
337 }
338 if (!I->isBundle() && !I->isMetaInstruction())
339 ++Skip;
340 }
341 if (Skip < 6) {
342 MachineOperand &Op = LastDelayAlu->getOperand(0);
343 unsigned LastImm = Op.getImm();
344 assert((LastImm & ~0xf) == 0 &&
345 "Remembered an s_delay_alu with no room for another delay!");
346 LastImm |= Imm << 7 | Skip << 4;
347 Op.setImm(LastImm);
348 return nullptr;
349 }
350 }
351
352 auto &MBB = *MI.getParent();
353 MachineInstr *DelayAlu =
354 BuildMI(MBB, MI, DebugLoc(), SII->get(AMDGPU::S_DELAY_ALU)).addImm(Imm);
355 // Remember the s_delay_alu for next time if there is still room in it to
356 // encode another delay.
357 return (Imm & 0x780) ? nullptr : DelayAlu;
358 }
359
360 bool runOnMachineBasicBlock(MachineBasicBlock &MBB, bool Emit) {
361 DelayState State;
362 for (auto *Pred : MBB.predecessors())
363 State.merge(BlockState[Pred]);
364
365 LLVM_DEBUG(dbgs() << " State at start of " << printMBBReference(MBB)
366 << "\n";
367 State.dump(TRI););
368
369 bool Changed = false;
370 MachineInstr *LastDelayAlu = nullptr;
371
372 // FIXME: 0 is a valid register unit.
373 MCRegUnit LastSGPRFromVALU = static_cast<MCRegUnit>(0);
374 // Iterate over the contents of bundles, but don't emit any instructions
375 // inside a bundle.
376 for (auto &MI : MBB.instrs()) {
377 if (MI.isBundle() || MI.isMetaInstruction())
378 continue;
379
380 // Ignore some more instructions that do not generate any code.
381 switch (MI.getOpcode()) {
382 case AMDGPU::SI_RETURN_TO_EPILOG:
383 continue;
384 }
385
386 DelayType Type = getDelayType(MI);
387
388 if (instructionWaitsForSGPRWrites(MI)) {
389 auto It = State.find(LastSGPRFromVALU);
390 if (It != State.end()) {
391 DelayInfo Info = It->getSecond();
392 State.advanceByVALUNum(Info.VALUNum);
393 // FIXME: 0 is a valid register unit.
394 LastSGPRFromVALU = static_cast<MCRegUnit>(0);
395 }
396 }
397
398 if (instructionWaitsForVALU(MI)) {
399 // Forget about all outstanding VALU delays.
400 // TODO: This is overkill since it also forgets about SALU delays.
401 State = DelayState();
402 } else if (Type != OTHER) {
403 DelayInfo Delay;
404 // TODO: Scan implicit uses too?
405 for (const auto &Op : MI.explicit_uses()) {
406 if (Op.isReg()) {
407 // One of the operands of the writelane is also the output operand.
408 // This creates the insertion of redundant delays. Hence, we have to
409 // ignore this operand.
410 if (MI.getOpcode() == AMDGPU::V_WRITELANE_B32 && Op.isTied())
411 continue;
412 for (MCRegUnit Unit : TRI->regunits(Op.getReg())) {
413 auto It = State.find(Unit);
414 if (It != State.end()) {
415 Delay.merge(It->second);
416 State.erase(Unit);
417 }
418 }
419 }
420 }
421
422 if (SII->isVALU(MI.getOpcode())) {
423 for (const auto &Op : MI.defs()) {
424 Register Reg = Op.getReg();
425 if (AMDGPU::isSGPR(Reg, TRI)) {
426 LastSGPRFromVALU = *TRI->regunits(Reg).begin();
427 break;
428 }
429 }
430 }
431
432 if (Emit && !MI.isBundledWithPred()) {
433 // TODO: For VALU->SALU delays should we use s_delay_alu or s_nop or
434 // just ignore them?
435 LastDelayAlu = emitDelayAlu(MI, Delay, LastDelayAlu);
436 }
437 }
438
439 if (Type != OTHER) {
440 // TODO: Scan implicit defs too?
441 for (const auto &Op : MI.defs()) {
442 unsigned Latency = SchedModel->computeOperandLatency(
443 &MI, Op.getOperandNo(), nullptr, 0);
444 for (MCRegUnit Unit : TRI->regunits(Op.getReg()))
445 State[Unit] = DelayInfo(Type, Latency);
446 }
447 }
448
449 // Advance by the number of cycles it takes to issue this instruction.
450 // TODO: Use a more advanced model that accounts for instructions that
451 // take multiple cycles to issue on a particular pipeline.
452 unsigned Cycles = SIInstrInfo::getNumWaitStates(MI);
453 // TODO: In wave64 mode, double the number of cycles for VALU and VMEM
454 // instructions on the assumption that they will usually have to be issued
455 // twice?
456 State.advance(Type, Cycles);
457
458 LLVM_DEBUG(dbgs() << " State after " << MI; State.dump(TRI););
459 }
460
461 if (Emit) {
462 assert(State == BlockState[&MBB] &&
463 "Basic block state should not have changed on final pass!");
464 } else if (DelayState &BS = BlockState[&MBB]; State != BS) {
465 BS = std::move(State);
466 Changed = true;
467 }
468 return Changed;
469 }
470
471 bool run(MachineFunction &MF) {
472 LLVM_DEBUG(dbgs() << "AMDGPUInsertDelayAlu running on " << MF.getName()
473 << "\n");
474
475 ST = &MF.getSubtarget<GCNSubtarget>();
476 if (!ST->hasDelayAlu())
477 return false;
478
480
481 if (MFI.getMaxWavesPerEU() == 1)
482 return false;
483
484 SII = ST->getInstrInfo();
485 TRI = ST->getRegisterInfo();
486 SchedModel = &SII->getSchedModel();
487
488 // Calculate the delay state for each basic block, iterating until we reach
489 // a fixed point.
491 for (auto &MBB : reverse(MF))
492 WorkList.insert(&MBB);
493 while (!WorkList.empty()) {
494 auto &MBB = *WorkList.pop_back_val();
495 bool Changed = runOnMachineBasicBlock(MBB, false);
496 if (Changed)
497 WorkList.insert_range(MBB.successors());
498 }
499
500 LLVM_DEBUG(dbgs() << "Final pass over all BBs\n");
501
502 // Make one last pass over all basic blocks to emit s_delay_alu
503 // instructions.
504 bool Changed = false;
505 for (auto &MBB : MF)
506 Changed |= runOnMachineBasicBlock(MBB, true);
507 return Changed;
508 }
509};
510
511class AMDGPUInsertDelayAluLegacy : public MachineFunctionPass {
512public:
513 static char ID;
514
515 AMDGPUInsertDelayAluLegacy() : MachineFunctionPass(ID) {}
516
517 void getAnalysisUsage(AnalysisUsage &AU) const override {
518 AU.setPreservesCFG();
520 }
521
522 bool runOnMachineFunction(MachineFunction &MF) override {
523 if (skipFunction(MF.getFunction()))
524 return false;
525 AMDGPUInsertDelayAlu Impl;
526 return Impl.run(MF);
527 }
528};
529} // namespace
530
534 if (!AMDGPUInsertDelayAlu().run(MF))
535 return PreservedAnalyses::all();
537 PA.preserveSet<CFGAnalyses>();
538 return PA;
539} // end namespace llvm
540
541char AMDGPUInsertDelayAluLegacy::ID = 0;
542
543char &llvm::AMDGPUInsertDelayAluID = AMDGPUInsertDelayAluLegacy::ID;
544
545INITIALIZE_PASS(AMDGPUInsertDelayAluLegacy, DEBUG_TYPE,
546 "AMDGPU Insert Delay ALU", false, false)
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Provides AMDGPU specific target descriptions.
MachineBasicBlock & MBB
static GCRegistry::Add< ErlangGC > A("erlang", "erlang-compatible garbage collector")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
AMD GCN specific subclass of TargetSubtarget.
#define DEBUG_TYPE
IRTranslator LLVM IR MI
static LoopDeletionResult merge(LoopDeletionResult A, LoopDeletionResult B)
#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
Interface definition for SIInstrInfo.
This file implements a set that has insertion order iteration characteristics.
#define LLVM_DEBUG(...)
Definition Debug.h:119
Value * RHS
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
Instructions::iterator instr_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.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
Function & getFunction()
Return the LLVM function that this machine code represents.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
Representation of each machine instruction.
const MachineOperand & getOperand(unsigned i) const
MachineOperand class - Representation of each machine instruction operand.
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
Wrapper class representing virtual and physical registers.
Definition Register.h:20
bool isXDLWMMA(const MachineInstr &MI) const
static bool isSALU(const MachineInstr &MI)
const TargetSchedModel & getSchedModel() const
static bool isTRANS(const MachineInstr &MI)
static unsigned getNumWaitStates(const MachineInstr &MI)
Return the number of wait states that result from executing this instruction.
static bool isVALU(const MachineInstr &MI)
This class keeps track of the SPI_SP_INPUT_ADDR config register, which tells the hardware which inter...
A vector that has set insertion semantics.
Definition SetVector.h:57
void insert_range(Range &&R)
Definition SetVector.h:176
bool empty() const
Determine if the SetVector is empty or not.
Definition SetVector.h:100
bool insert(const value_type &X)
Insert a new element into the SetVector.
Definition SetVector.h:151
value_type pop_back_val()
Definition SetVector.h:279
void reserve(size_type N)
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
Provide an instruction scheduling machine model to CodeGen passes.
LLVM_ABI unsigned computeOperandLatency(const MachineInstr *DefMI, unsigned DefOperIdx, const MachineInstr *UseMI, unsigned UseOperIdx) const
Compute operand latency based on the available machine model.
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:46
Changed
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
unsigned decodeFieldVaVdst(unsigned Encoded)
bool isSGPR(MCRegister Reg, const MCRegisterInfo *TRI)
Is Reg - scalar register.
bool isDPMACCInstruction(unsigned Opc)
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.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
auto size(R &&Range, std::enable_if_t< std::is_base_of< std::random_access_iterator_tag, typename std::iterator_traits< decltype(Range.begin())>::iterator_category >::value, void > *=nullptr)
Get the size of a range.
Definition STLExtras.h:1668
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
bool operator!=(uint64_t V1, const APInt &V2)
Definition APInt.h:2142
LLVM_ABI Printable printRegUnit(MCRegUnit Unit, const TargetRegisterInfo *TRI)
Create Printable object to print register units on a raw_ostream.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
bool operator==(const AddressRangeValuePair &LHS, const AddressRangeValuePair &RHS)
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
void erase(Container &C, ValueType V)
Wrapper function to remove a value from a container:
Definition STLExtras.h:2199
auto reverse(ContainerTy &&C)
Definition STLExtras.h:407
void sort(IteratorTy Start, IteratorTy End)
Definition STLExtras.h:1635
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition Debug.cpp:209
char & AMDGPUInsertDelayAluID
FunctionAddr VTableAddr Next
Definition InstrProf.h:141
DWARFExpression::Operation Op
LLVM_ABI Printable printMBBReference(const MachineBasicBlock &MBB)
Prints a machine basic block reference.
PreservedAnalyses run(MachineFunction &F, MachineFunctionAnalysisManager &MFAM)