LLVM 23.0.0git
AMDGPUWaitSGPRHazards.cpp
Go to the documentation of this file.
1//===- AMDGPUWaitSGPRHazards.cpp - Insert waits for SGPR read hazards -----===//
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_wait_alu instructions to mitigate SGPR read hazards on GFX12.
11//
12//===----------------------------------------------------------------------===//
13
15#include "AMDGPU.h"
16#include "GCNSubtarget.h"
18#include "SIInstrInfo.h"
19#include "llvm/ADT/SetVector.h"
21
22using namespace llvm;
23
24#define DEBUG_TYPE "amdgpu-wait-sgpr-hazards"
25
27 "amdgpu-sgpr-hazard-boundary-cull", cl::init(false), cl::Hidden,
28 cl::desc("Cull hazards on function boundaries"));
29
30static cl::opt<bool>
31 GlobalCullSGPRHazardsAtMemWait("amdgpu-sgpr-hazard-mem-wait-cull",
32 cl::init(false), cl::Hidden,
33 cl::desc("Cull hazards on memory waits"));
34
36 "amdgpu-sgpr-hazard-mem-wait-cull-threshold", cl::init(8), cl::Hidden,
37 cl::desc("Number of tracked SGPRs before initiating hazard cull on memory "
38 "wait"));
39
40namespace {
41
42class AMDGPUWaitSGPRHazards {
43public:
44 const GCNSubtarget *ST;
45 const SIInstrInfo *TII;
46 const SIRegisterInfo *TRI;
47 const MachineRegisterInfo *MRI;
48 unsigned DsNopCount;
49
50 bool CullSGPRHazardsOnFunctionBoundary;
51 bool CullSGPRHazardsAtMemWait;
52 unsigned CullSGPRHazardsMemWaitThreshold;
53
54 AMDGPUWaitSGPRHazards() = default;
55
56 // Return the numeric ID 0-127 for a given SGPR.
57 static std::optional<unsigned> sgprNumber(Register Reg,
58 const SIRegisterInfo &TRI) {
59 switch (Reg) {
60 case AMDGPU::M0:
61 case AMDGPU::EXEC:
62 case AMDGPU::EXEC_LO:
63 case AMDGPU::EXEC_HI:
64 case AMDGPU::SGPR_NULL:
65 case AMDGPU::SGPR_NULL64:
66 return {};
67 default:
68 break;
69 }
70 unsigned RegN = TRI.getHWRegIndex(Reg);
71 if (RegN > 127)
72 return {};
73 return RegN;
74 }
75
76 static inline bool isVCC(Register Reg) {
77 return Reg == AMDGPU::VCC || Reg == AMDGPU::VCC_LO || Reg == AMDGPU::VCC_HI;
78 }
79
80 // Adjust global offsets for instructions bundled with S_GETPC_B64 after
81 // insertion of a new instruction.
82 static void updateGetPCBundle(MachineInstr *NewMI) {
83 if (!NewMI->isBundled())
84 return;
85
86 // Find start of bundle.
87 auto I = NewMI->getIterator();
88 while (I->isBundledWithPred())
89 I--;
90 if (I->isBundle())
91 I++;
92
93 // Bail if this is not an S_GETPC bundle.
94 if (I->getOpcode() != AMDGPU::S_GETPC_B64)
95 return;
96
97 // Update offsets of any references in the bundle.
98 const unsigned NewBytes = 4;
99 assert(NewMI->getOpcode() == AMDGPU::S_WAITCNT_DEPCTR &&
100 "Unexpected instruction insertion in bundle");
101 auto NextMI = std::next(NewMI->getIterator());
102 auto End = NewMI->getParent()->end();
103 while (NextMI != End && NextMI->isBundledWithPred()) {
104 for (auto &Operand : NextMI->operands()) {
105 if (Operand.isGlobal())
106 Operand.setOffset(Operand.getOffset() + NewBytes);
107 }
108 NextMI++;
109 }
110 }
111
112 struct HazardState {
113 static constexpr unsigned None = 0;
114 static constexpr unsigned SALU = (1 << 0);
115 static constexpr unsigned VALU = (1 << 1);
116
117 std::bitset<64> Tracked; // SGPR banks ever read by VALU
118 std::bitset<128> SALUHazards; // SGPRs with uncommitted values from SALU
119 std::bitset<128> VALUHazards; // SGPRs with uncommitted values from VALU
120 unsigned VCCHazard = None; // Source of current VCC writes
121 bool ActiveFlat = false; // Has unwaited flat instructions
122
123 bool merge(const HazardState &RHS) {
124 HazardState Orig(*this);
125 *this |= RHS;
126 return (*this != Orig);
127 }
128
129 bool operator==(const HazardState &RHS) const {
130 return Tracked == RHS.Tracked && SALUHazards == RHS.SALUHazards &&
131 VALUHazards == RHS.VALUHazards && VCCHazard == RHS.VCCHazard &&
132 ActiveFlat == RHS.ActiveFlat;
133 }
134
135 bool operator!=(const HazardState &RHS) const { return !(*this == RHS); }
136
137 void operator|=(const HazardState &RHS) {
138 Tracked |= RHS.Tracked;
139 SALUHazards |= RHS.SALUHazards;
140 VALUHazards |= RHS.VALUHazards;
141 VCCHazard |= RHS.VCCHazard;
142 ActiveFlat |= RHS.ActiveFlat;
143 }
144 };
145
146 struct BlockHazardState {
147 HazardState In;
148 HazardState Out;
149 };
150
151 DenseMap<const MachineBasicBlock *, BlockHazardState> BlockState;
152
153 static constexpr unsigned WAVE32_NOPS = 4;
154 static constexpr unsigned WAVE64_NOPS = 8;
155
156 void insertHazardCull(MachineBasicBlock &MBB,
158 assert(!MI->isBundled());
159 unsigned Count = DsNopCount;
160 while (Count--)
161 BuildMI(MBB, MI, MI->getDebugLoc(), TII->get(AMDGPU::DS_NOP));
162 }
163
164 unsigned mergeMasks(unsigned Mask1, unsigned Mask2) {
167 Mask, std::min(AMDGPU::DepCtr::decodeFieldSaSdst(Mask1),
170 Mask, std::min(AMDGPU::DepCtr::decodeFieldVaVcc(Mask1),
173 Mask, std::min(AMDGPU::DepCtr::decodeFieldVmVsrc(Mask1),
176 Mask, std::min(AMDGPU::DepCtr::decodeFieldVaSdst(Mask1),
179 Mask, std::min(AMDGPU::DepCtr::decodeFieldVaVdst(Mask1),
181 const AMDGPU::IsaVersion &Version = AMDGPU::getIsaVersion(ST->getCPU());
183 Mask,
186 Version);
188 Mask, std::min(AMDGPU::DepCtr::decodeFieldVaSsrc(Mask1),
190 return Mask;
191 }
192
193 bool mergeConsecutiveWaitAlus(MachineBasicBlock::instr_iterator &MI,
194 unsigned Mask) {
195 auto MBB = MI->getParent();
196 if (MI == MBB->instr_begin())
197 return false;
198
199 auto It = prev_nodbg(MI, MBB->instr_begin());
200 if (It->getOpcode() != AMDGPU::S_WAITCNT_DEPCTR)
201 return false;
202
203 It->getOperand(0).setImm(mergeMasks(Mask, It->getOperand(0).getImm()));
204 return true;
205 }
206
207 bool runOnMachineBasicBlock(MachineBasicBlock &MBB, bool Emit) {
208 enum { WA_VALU = 0x1, WA_SALU = 0x2, WA_VCC = 0x4 };
209
210 HazardState State = BlockState[&MBB].In;
211 SmallSet<Register, 8> SeenRegs;
212 bool Emitted = false;
213 unsigned DsNops = 0;
214
216 E = MBB.instr_end();
217 MI != E; ++MI) {
218 if (MI->isMetaInstruction())
219 continue;
220
221 // Clear tracked SGPRs if sufficient DS_NOPs occur
222 if (MI->getOpcode() == AMDGPU::DS_NOP) {
223 if (++DsNops >= DsNopCount)
224 State.Tracked.reset();
225 continue;
226 }
227 DsNops = 0;
228
229 // Snoop FLAT instructions to avoid adding culls before scratch/lds loads.
230 // Culls could be disproportionate in cost to load time.
232 State.ActiveFlat = true;
233
234 // SMEM or VMEM clears hazards
235 // FIXME: adapt to add FLAT without VALU (so !isLDSDMA())?
238 State.VCCHazard = HazardState::None;
239 State.SALUHazards.reset();
240 State.VALUHazards.reset();
241 continue;
242 }
243
244 // Existing S_WAITALU can clear hazards
245 if (MI->getOpcode() == AMDGPU::S_WAITCNT_DEPCTR) {
246 unsigned int Mask = MI->getOperand(0).getImm();
248 State.VCCHazard &= ~HazardState::VALU;
249 if (AMDGPU::DepCtr::decodeFieldSaSdst(Mask) == 0) {
250 State.SALUHazards.reset();
251 State.VCCHazard &= ~HazardState::SALU;
252 }
254 State.VALUHazards.reset();
255 continue;
256 }
257
258 // Snoop counter waits to insert culls
259 if (CullSGPRHazardsAtMemWait &&
260 (MI->getOpcode() == AMDGPU::S_WAIT_LOADCNT ||
261 MI->getOpcode() == AMDGPU::S_WAIT_SAMPLECNT ||
262 MI->getOpcode() == AMDGPU::S_WAIT_BVHCNT) &&
263 (MI->getOperand(0).isImm() && MI->getOperand(0).getImm() == 0) &&
264 (State.Tracked.count() >= CullSGPRHazardsMemWaitThreshold)) {
265 if (MI->getOpcode() == AMDGPU::S_WAIT_LOADCNT && State.ActiveFlat) {
266 State.ActiveFlat = false;
267 } else {
268 State.Tracked.reset();
269 if (Emit)
270 insertHazardCull(MBB, MI);
271 continue;
272 }
273 }
274
275 // Process only VALUs and SALUs
276 bool IsVALU = SIInstrInfo::isVALU(*MI, /*AllowLDSDMA=*/true);
277 bool IsSALU = SIInstrInfo::isSALU(*MI);
278 if (!IsVALU && !IsSALU)
279 continue;
280
281 unsigned Wait = 0;
282
283 auto processOperand = [&](const MachineOperand &Op, bool IsUse) {
284 if (!Op.isReg())
285 return;
286 Register Reg = Op.getReg();
287 assert(!Op.getSubReg());
288 if (!TRI->isSGPRReg(*MRI, Reg))
289 return;
290
291 // Only visit each register once
292 if (!SeenRegs.insert(Reg).second)
293 return;
294
295 auto RegNumber = sgprNumber(Reg, *TRI);
296 if (!RegNumber)
297 return;
298
299 // Track SGPRs by pair -- numeric ID of an 64b SGPR pair.
300 // i.e. SGPR0 = SGPR0_SGPR1 = 0, SGPR3 = SGPR2_SGPR3 = 1, etc
301 unsigned RegN = *RegNumber;
302 unsigned PairN = (RegN >> 1) & 0x3f;
303
304 // Read/write of untracked register is safe; but must record any new
305 // reads.
306 if (!State.Tracked[PairN]) {
307 if (IsVALU && IsUse)
308 State.Tracked.set(PairN);
309 return;
310 }
311
312 uint8_t SGPRCount =
313 AMDGPU::getRegBitWidth(*TRI->getRegClassForReg(*MRI, Reg)) / 32;
314
315 if (IsUse) {
316 // SALU reading SGPR clears VALU hazards
317 if (IsSALU) {
318 if (isVCC(Reg)) {
319 if (State.VCCHazard & HazardState::VALU)
320 State.VCCHazard = HazardState::None;
321 } else {
322 State.VALUHazards.reset();
323 }
324 }
325 // Compute required waits
326 for (uint8_t RegIdx = 0; RegIdx < SGPRCount; ++RegIdx) {
327 Wait |= State.SALUHazards[RegN + RegIdx] ? WA_SALU : 0;
328 Wait |= IsVALU && State.VALUHazards[RegN + RegIdx] ? WA_VALU : 0;
329 }
330 if (isVCC(Reg) && State.VCCHazard) {
331 // Note: it's possible for both SALU and VALU to exist if VCC
332 // was updated differently by merged predecessors.
333 if (State.VCCHazard & HazardState::SALU)
334 Wait |= WA_SALU;
335 if (State.VCCHazard & HazardState::VALU)
336 Wait |= WA_VCC;
337 }
338 } else {
339 // Update hazards
340 if (isVCC(Reg)) {
341 State.VCCHazard = IsSALU ? HazardState::SALU : HazardState::VALU;
342 } else {
343 for (uint8_t RegIdx = 0; RegIdx < SGPRCount; ++RegIdx) {
344 if (IsSALU)
345 State.SALUHazards.set(RegN + RegIdx);
346 else
347 State.VALUHazards.set(RegN + RegIdx);
348 }
349 }
350 }
351 };
352
353 const bool IsSetPC =
354 (MI->isCall() || MI->isReturn() || MI->isIndirectBranch()) &&
355 MI->getOpcode() != AMDGPU::S_ENDPGM &&
356 MI->getOpcode() != AMDGPU::S_ENDPGM_SAVED;
357
358 // Only consider implicit VCC specified by instruction descriptor.
359 const bool HasImplicitVCC =
360 llvm::any_of(MI->getDesc().implicit_uses(), isVCC) ||
361 llvm::any_of(MI->getDesc().implicit_defs(), isVCC);
362
363 if (IsSetPC) {
364 // All SGPR writes before a call/return must be flushed as the
365 // callee/caller will not will not see the hazard chain.
366 if (State.VCCHazard & HazardState::VALU)
367 Wait |= WA_VCC;
368 if (State.SALUHazards.any() || (State.VCCHazard & HazardState::SALU))
369 Wait |= WA_SALU;
370 if (State.VALUHazards.any())
371 Wait |= WA_VALU;
372 if (CullSGPRHazardsOnFunctionBoundary && State.Tracked.any()) {
373 State.Tracked.reset();
374 if (Emit)
375 insertHazardCull(MBB, MI);
376 }
377 } else {
378 // Process uses to determine required wait.
379 SeenRegs.clear();
380 for (const MachineOperand &Op : MI->all_uses()) {
381 if (Op.isImplicit() &&
382 (!HasImplicitVCC || !Op.isReg() || !isVCC(Op.getReg())))
383 continue;
384 processOperand(Op, true);
385 }
386 }
387
388 // Apply wait
389 if (Wait) {
391 if (Wait & WA_VCC) {
392 State.VCCHazard &= ~HazardState::VALU;
394 }
395 if (Wait & WA_SALU) {
396 State.SALUHazards.reset();
397 State.VCCHazard &= ~HazardState::SALU;
399 }
400 if (Wait & WA_VALU) {
401 State.VALUHazards.reset();
403 }
404 if (Emit) {
405 if (!mergeConsecutiveWaitAlus(MI, Mask)) {
406 auto NewMI = BuildMI(MBB, MI, MI->getDebugLoc(),
407 TII->get(AMDGPU::S_WAITCNT_DEPCTR))
408 .addImm(Mask);
409 updateGetPCBundle(NewMI);
410 }
411 Emitted = true;
412 }
413 }
414
415 // On return from a call SGPR state is unknown, so all potential hazards.
416 if (MI->isCall() && !CullSGPRHazardsOnFunctionBoundary)
417 State.Tracked.set();
418
419 // Update hazards based on defs.
420 SeenRegs.clear();
421 for (const MachineOperand &Op : MI->all_defs()) {
422 if (Op.isImplicit() &&
423 (!HasImplicitVCC || !Op.isReg() || !isVCC(Op.getReg())))
424 continue;
425 processOperand(Op, false);
426 }
427 }
428
429 BlockHazardState &BS = BlockState[&MBB];
430 bool Changed = State != BS.Out;
431 if (Emit) {
432 assert(!Changed && "Hazard state should not change on emit pass");
433 return Emitted;
434 }
435 if (Changed)
436 BS.Out = State;
437 return Changed;
438 }
439
440 bool run(MachineFunction &MF) {
441 ST = &MF.getSubtarget<GCNSubtarget>();
442 if (!ST->hasVALUReadSGPRHazard())
443 return false;
444
445 // Parse settings
446 CullSGPRHazardsOnFunctionBoundary = GlobalCullSGPRHazardsOnFunctionBoundary;
447 CullSGPRHazardsAtMemWait = GlobalCullSGPRHazardsAtMemWait;
448 CullSGPRHazardsMemWaitThreshold = GlobalCullSGPRHazardsMemWaitThreshold;
449
451 CullSGPRHazardsOnFunctionBoundary =
452 MF.getFunction().hasFnAttribute("amdgpu-sgpr-hazard-boundary-cull");
454 CullSGPRHazardsAtMemWait =
455 MF.getFunction().hasFnAttribute("amdgpu-sgpr-hazard-mem-wait-cull");
456 if (!GlobalCullSGPRHazardsMemWaitThreshold.getNumOccurrences())
457 CullSGPRHazardsMemWaitThreshold =
459 "amdgpu-sgpr-hazard-mem-wait-cull-threshold",
460 CullSGPRHazardsMemWaitThreshold);
461
462 TII = ST->getInstrInfo();
463 TRI = ST->getRegisterInfo();
464 MRI = &MF.getRegInfo();
465 DsNopCount = ST->isWave64() ? WAVE64_NOPS : WAVE32_NOPS;
466
468 if (!AMDGPU::isEntryFunctionCC(CallingConv) &&
469 !CullSGPRHazardsOnFunctionBoundary) {
470 // Callee must consider all SGPRs as tracked.
471 LLVM_DEBUG(dbgs() << "Is called function, track all SGPRs.\n");
472 MachineBasicBlock &EntryBlock = MF.front();
473 BlockState[&EntryBlock].In.Tracked.set();
474 }
475
476 // Calculate the hazard state for each basic block.
477 // Iterate until a fixed point is reached.
478 // Fixed point is guaranteed as merge function only ever increases
479 // the hazard set, and all backedges will cause a merge.
480 //
481 // Note: we have to take care of the entry block as this technically
482 // has an edge from outside the function. Failure to treat this as
483 // a merge could prevent fixed point being reached.
484 SetVector<MachineBasicBlock *> Worklist;
485 for (auto &MBB : reverse(MF))
486 Worklist.insert(&MBB);
487 while (!Worklist.empty()) {
488 auto &MBB = *Worklist.pop_back_val();
489 bool Changed = runOnMachineBasicBlock(MBB, false);
490 if (Changed) {
491 // Note: take a copy of state here in case it is reallocated by map
492 HazardState NewState = BlockState[&MBB].Out;
493 // Propagate to all successor blocks
494 for (auto Succ : MBB.successors()) {
495 // We only need to merge hazards at CFG merge points.
496 auto &SuccState = BlockState[Succ];
497 if (Succ->getSinglePredecessor() && !Succ->isEntryBlock()) {
498 if (SuccState.In != NewState) {
499 SuccState.In = NewState;
500 Worklist.insert(Succ);
501 }
502 } else if (SuccState.In.merge(NewState)) {
503 Worklist.insert(Succ);
504 }
505 }
506 }
507 }
508
509 LLVM_DEBUG(dbgs() << "Emit s_wait_alu instructions\n");
510
511 // Final to emit wait instructions.
512 bool Changed = false;
513 for (auto &MBB : MF)
514 Changed |= runOnMachineBasicBlock(MBB, true);
515
516 BlockState.clear();
517 return Changed;
518 }
519};
520
521class AMDGPUWaitSGPRHazardsLegacy : public MachineFunctionPass {
522public:
523 static char ID;
524
525 AMDGPUWaitSGPRHazardsLegacy() : MachineFunctionPass(ID) {}
526
527 bool runOnMachineFunction(MachineFunction &MF) override {
528 return AMDGPUWaitSGPRHazards().run(MF);
529 }
530
531 void getAnalysisUsage(AnalysisUsage &AU) const override {
532 AU.setPreservesCFG();
534 }
535};
536
537} // namespace
538
539char AMDGPUWaitSGPRHazardsLegacy::ID = 0;
540
541char &llvm::AMDGPUWaitSGPRHazardsLegacyID = AMDGPUWaitSGPRHazardsLegacy::ID;
542
543INITIALIZE_PASS(AMDGPUWaitSGPRHazardsLegacy, DEBUG_TYPE,
544 "AMDGPU Insert waits for SGPR read hazards", false, false)
545
549 if (AMDGPUWaitSGPRHazards().run(MF))
551 return PreservedAnalyses::all();
552}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Provides AMDGPU specific target descriptions.
static cl::opt< bool > GlobalCullSGPRHazardsAtMemWait("amdgpu-sgpr-hazard-mem-wait-cull", cl::init(false), cl::Hidden, cl::desc("Cull hazards on memory waits"))
static cl::opt< unsigned > GlobalCullSGPRHazardsMemWaitThreshold("amdgpu-sgpr-hazard-mem-wait-cull-threshold", cl::init(8), cl::Hidden, cl::desc("Number of tracked SGPRs before initiating hazard cull on memory " "wait"))
static cl::opt< bool > GlobalCullSGPRHazardsOnFunctionBoundary("amdgpu-sgpr-hazard-boundary-cull", cl::init(false), cl::Hidden, cl::desc("Cull hazards on function boundaries"))
MachineBasicBlock & MBB
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
static void updateGetPCBundle(MachineInstr *NewMI)
AMD GCN specific subclass of TargetSubtarget.
#define DEBUG_TYPE
const HexagonInstrInfo * TII
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
Promote Memory to Register
Definition Mem2Reg.cpp:110
#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
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
Definition Pass.cpp:275
uint64_t getFnAttributeAsParsedInteger(StringRef Kind, uint64_t Default=0) const
For a string attribute Kind, parse attribute as an integer.
Definition Function.cpp:770
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
Definition Function.h:272
bool hasFnAttribute(Attribute::AttrKind Kind) const
Return true if the function has the attribute.
Definition Function.cpp:723
Instructions::iterator instr_iterator
iterator_range< succ_iterator > successors()
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.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Function & getFunction()
Return the LLVM function that this machine code represents.
const MachineBasicBlock & front() const
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const MachineBasicBlock * getParent() const
bool isBundled() const
Return true if this instruction part of a bundle.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
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
static bool isVMEM(const MachineInstr &MI)
static bool isSMRD(const MachineInstr &MI)
static bool isSALU(const MachineInstr &MI)
static bool isFLATGlobal(const MachineInstr &MI)
static bool isVALU(const MachineInstr &MI, bool AllowLDSDMA)
static bool isFLAT(const MachineInstr &MI)
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
std::pair< const_iterator, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
Definition SmallSet.h:184
int getNumOccurrences() const
self_iterator getIterator()
Definition ilist_node.h:123
Changed
unsigned decodeFieldVaVcc(unsigned Encoded)
unsigned encodeFieldVaVcc(unsigned Encoded, unsigned VaVcc)
unsigned decodeFieldHoldCnt(unsigned Encoded, const IsaVersion &Version)
unsigned encodeFieldHoldCnt(unsigned Encoded, unsigned HoldCnt, const IsaVersion &Version)
unsigned encodeFieldVaSsrc(unsigned Encoded, unsigned VaSsrc)
unsigned encodeFieldVaVdst(unsigned Encoded, unsigned VaVdst)
unsigned decodeFieldSaSdst(unsigned Encoded)
unsigned decodeFieldVaSdst(unsigned Encoded)
unsigned encodeFieldVmVsrc(unsigned Encoded, unsigned VmVsrc)
unsigned decodeFieldVaSsrc(unsigned Encoded)
unsigned encodeFieldSaSdst(unsigned Encoded, unsigned SaSdst)
unsigned decodeFieldVaVdst(unsigned Encoded)
int getDefaultDepCtrEncoding(const MCSubtargetInfo &STI)
unsigned decodeFieldVmVsrc(unsigned Encoded)
unsigned encodeFieldVaSdst(unsigned Encoded, unsigned VaSdst)
LLVM_ABI IsaVersion getIsaVersion(StringRef GPU)
unsigned getRegBitWidth(unsigned RCID)
Get the size in bits of a register from the register class RC.
LLVM_READNONE constexpr bool isEntryFunctionCC(CallingConv::ID CC)
constexpr std::underlying_type_t< E > Mask()
Get a bitmask with 1s in all places up to the high-order bit of E's largest value.
initializer< Ty > init(const Ty &Val)
DXILDebugInfoMap run(Module &M)
@ Emitted
Assigned address, still materializing.
Definition Core.h:570
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
@ Wait
Definition Threading.h:60
bool operator!=(uint64_t V1, const APInt &V2)
Definition APInt.h:2144
char & AMDGPUWaitSGPRHazardsLegacyID
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.
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
Definition STLExtras.h:1746
auto reverse(ContainerTy &&C)
Definition STLExtras.h:407
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Definition Debug.cpp:209
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
Definition InstrProf.h:145
DWARFExpression::Operation Op
bool operator|=(SparseBitVector< ElementSize > &LHS, const SparseBitVector< ElementSize > *RHS)
IterT prev_nodbg(IterT It, IterT Begin, bool SkipPseudoOp=true)
Decrement It, then continue decrementing it while it points to a debug instruction.