LLVM 23.0.0git
SIModeRegister.cpp
Go to the documentation of this file.
1//===-- SIModeRegister.cpp - Mode Register --------------------------------===//
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/// \file
9/// This pass inserts changes to the Mode register settings as required.
10/// Note that currently it only deals with the Double Precision Floating Point
11/// rounding mode setting, but is intended to be generic enough to be easily
12/// expanded.
13///
14//===----------------------------------------------------------------------===//
15//
16#include "AMDGPU.h"
17#include "GCNSubtarget.h"
19#include "llvm/ADT/Statistic.h"
21#include <queue>
22
23#define DEBUG_TYPE "si-mode-register"
24
25STATISTIC(NumSetregInserted, "Number of setreg of mode register inserted.");
26
27using namespace llvm;
28
29struct Status {
30 // Mask is a bitmask where a '1' indicates the corresponding Mode bit has a
31 // known value
32 unsigned Mask = 0;
33 unsigned Mode = 0;
34
35 Status() = default;
36
37 Status(unsigned NewMask, unsigned NewMode) : Mask(NewMask), Mode(NewMode) {
38 Mode &= Mask;
39 };
40
41 // merge two status values such that only values that don't conflict are
42 // preserved
43 Status merge(const Status &S) const {
44 return Status((Mask | S.Mask), ((Mode & ~S.Mask) | (S.Mode & S.Mask)));
45 }
46
47 // merge an unknown value by using the unknown value's mask to remove bits
48 // from the result
49 Status mergeUnknown(unsigned newMask) {
50 return Status(Mask & ~newMask, Mode & ~newMask);
51 }
52
53 // intersect two Status values to produce a mode and mask that is a subset
54 // of both values
55 Status intersect(const Status &S) const {
56 unsigned NewMask = (Mask & S.Mask) & (Mode ^ ~S.Mode);
57 unsigned NewMode = (Mode & NewMask);
58 return Status(NewMask, NewMode);
59 }
60
61 // produce the delta required to change the Mode to the required Mode
62 Status delta(const Status &S) const {
63 return Status((S.Mask & (Mode ^ S.Mode)) | (~Mask & S.Mask), S.Mode);
64 }
65
66 bool operator==(const Status &S) const {
67 return (Mask == S.Mask) && (Mode == S.Mode);
68 }
69
70 bool operator!=(const Status &S) const { return !(*this == S); }
71
73 return ((Mask & S.Mask) == S.Mask) && ((Mode & S.Mask) == S.Mode);
74 }
75
76 bool isCombinable(Status &S) { return !(Mask & S.Mask) || isCompatible(S); }
77};
78
79class BlockData {
80public:
81 // The Status that represents the mode register settings required by the
82 // FirstInsertionPoint (if any) in this block. Calculated in Phase 1.
84
85 // The Status that represents the net changes to the Mode register made by
86 // this block, Calculated in Phase 1.
88
89 // The Status that represents the mode register settings on exit from this
90 // block. Calculated in Phase 2.
92
93 // The Status that represents the intersection of exit Mode register settings
94 // from all predecessor blocks. Calculated in Phase 2, and used by Phase 3.
96
97 // In Phase 1 we record the first instruction that has a mode requirement,
98 // which is used in Phase 3 if we need to insert a mode change.
100
101 // A flag to indicate whether an Exit value has been set (we can't tell by
102 // examining the Exit value itself as all values may be valid results).
103 bool ExitSet = false;
104
105 BlockData() = default;
106};
107
108namespace {
109
110class SIModeRegister {
111public:
112 std::vector<std::unique_ptr<BlockData>> BlockInfo;
113 std::queue<MachineBasicBlock *> Phase2List;
114
115 // The default mode register setting currently only caters for the floating
116 // point double precision rounding mode.
117 // We currently assume the default rounding mode is Round to Nearest
118 // NOTE: this should come from a per function rounding mode setting once such
119 // a setting exists.
120 unsigned DefaultMode = FP_ROUND_ROUND_TO_NEAREST;
121 Status DefaultStatus =
122 Status(FP_ROUND_MODE_DP(0x3), FP_ROUND_MODE_DP(DefaultMode));
123
124 bool Changed = false;
125
126 bool run(MachineFunction &MF);
127
128 void processBlockPhase1(MachineBasicBlock &MBB, const SIInstrInfo *TII);
129
130 void processBlockPhase2(MachineBasicBlock &MBB, const SIInstrInfo *TII);
131
132 void processBlockPhase3(MachineBasicBlock &MBB, const SIInstrInfo *TII);
133
134 Status getInstructionMode(MachineInstr &MI, const SIInstrInfo *TII);
135
136 void insertSetreg(MachineBasicBlock &MBB, MachineInstr *I,
137 const SIInstrInfo *TII, Status InstrMode);
138};
139
140class SIModeRegisterLegacy : public MachineFunctionPass {
141public:
142 static char ID;
143
144 SIModeRegisterLegacy() : MachineFunctionPass(ID) {}
145
146 bool runOnMachineFunction(MachineFunction &MF) override;
147
148 void getAnalysisUsage(AnalysisUsage &AU) const override {
149 AU.setPreservesCFG();
151 }
152};
153} // End anonymous namespace.
154
155INITIALIZE_PASS(SIModeRegisterLegacy, DEBUG_TYPE,
156 "Insert required mode register values", false, false)
157
158char SIModeRegisterLegacy::ID = 0;
159
160char &llvm::SIModeRegisterID = SIModeRegisterLegacy::ID;
161
163 return new SIModeRegisterLegacy();
164}
165
166// Determine the Mode register setting required for this instruction.
167// Instructions which don't use the Mode register return a null Status.
168// Note this currently only deals with instructions that use the floating point
169// double precision setting.
170Status SIModeRegister::getInstructionMode(MachineInstr &MI,
171 const SIInstrInfo *TII) {
172 unsigned Opcode = MI.getOpcode();
173 if (TII->usesFPDPRounding(MI) ||
174 Opcode == AMDGPU::FPTRUNC_ROUND_F16_F32_PSEUDO ||
175 Opcode == AMDGPU::FPTRUNC_ROUND_F16_F32_PSEUDO_fake16_e32 ||
176 Opcode == AMDGPU::FPTRUNC_ROUND_F16_F32_PSEUDO_t16_e64 ||
177 Opcode == AMDGPU::FPTRUNC_ROUND_F32_F64_PSEUDO ||
178 Opcode == AMDGPU::FPTRUNC_ROUND_F16_F32_SALU_PSEUDO) {
179 switch (Opcode) {
180 case AMDGPU::V_INTERP_P1LL_F16:
181 case AMDGPU::V_INTERP_P1LV_F16:
182 case AMDGPU::V_INTERP_P2_F16:
183 // f16 interpolation instructions need double precision round to zero
184 return Status(FP_ROUND_MODE_DP(3),
186 case AMDGPU::FPTRUNC_ROUND_F16_F32_PSEUDO: {
187 unsigned Mode = MI.getOperand(2).getImm();
188 MI.removeOperand(2);
189 MI.setDesc(TII->get(AMDGPU::V_CVT_F16_F32_e32));
191 }
192 case AMDGPU::FPTRUNC_ROUND_F16_F32_PSEUDO_fake16_e32: {
193 unsigned Mode = MI.getOperand(2).getImm();
194 MI.removeOperand(2);
195 MI.setDesc(TII->get(AMDGPU::V_CVT_F16_F32_fake16_e32));
196 return Status(FP_ROUND_MODE_DP(3), FP_ROUND_MODE_DP(Mode));
197 }
198 case AMDGPU::FPTRUNC_ROUND_F16_F32_PSEUDO_t16_e64: {
199 unsigned Mode = MI.getOperand(6).getImm();
200 MI.removeOperand(6);
201 MI.setDesc(TII->get(AMDGPU::V_CVT_F16_F32_t16_e64));
202 return Status(FP_ROUND_MODE_DP(3), FP_ROUND_MODE_DP(Mode));
203 }
204 case AMDGPU::FPTRUNC_ROUND_F32_F64_PSEUDO: {
205 unsigned Mode = MI.getOperand(2).getImm();
206 MI.removeOperand(2);
207 MI.setDesc(TII->get(AMDGPU::V_CVT_F32_F64_e32));
208 return Status(FP_ROUND_MODE_DP(3), FP_ROUND_MODE_DP(Mode));
209 }
210 case AMDGPU::FPTRUNC_ROUND_F16_F32_SALU_PSEUDO: {
211 unsigned Mode = MI.getOperand(2).getImm();
212 MI.removeOperand(2);
213 MI.setDesc(TII->get(AMDGPU::S_CVT_F16_F32));
214 return Status(FP_ROUND_MODE_DP(3), FP_ROUND_MODE_DP(Mode));
215 }
216 default:
217 return DefaultStatus;
218 }
219 }
220 return Status();
221}
222
223// Insert a setreg instruction to update the Mode register.
224// It is possible (though unlikely) for an instruction to require a change to
225// the value of disjoint parts of the Mode register when we don't know the
226// value of the intervening bits. In that case we need to use more than one
227// setreg instruction.
228void SIModeRegister::insertSetreg(MachineBasicBlock &MBB, MachineInstr *MI,
229 const SIInstrInfo *TII, Status InstrMode) {
230 while (InstrMode.Mask) {
231 unsigned Offset = llvm::countr_zero<unsigned>(InstrMode.Mask);
232 unsigned Width = llvm::countr_one<unsigned>(InstrMode.Mask >> Offset);
233 unsigned Value = (InstrMode.Mode >> Offset) & ((1 << Width) - 1);
234 using namespace AMDGPU::Hwreg;
235 BuildMI(MBB, MI, nullptr, TII->get(AMDGPU::S_SETREG_IMM32_B32))
236 .addImm(Value)
237 .addImm(HwregEncoding::encode(ID_MODE, Offset, Width));
238 ++NumSetregInserted;
239 Changed = true;
240 InstrMode.Mask &= ~(((1 << Width) - 1) << Offset);
241 }
242}
243
244// In Phase 1 we iterate through the instructions of the block and for each
245// instruction we get its mode usage. If the instruction uses the Mode register
246// we:
247// - update the Change status, which tracks the changes to the Mode register
248// made by this block
249// - if this instruction's requirements are compatible with the current setting
250// of the Mode register we merge the modes
251// - if it isn't compatible and an InsertionPoint isn't set, then we set the
252// InsertionPoint to the current instruction, and we remember the current
253// mode
254// - if it isn't compatible and InsertionPoint is set we insert a seteg before
255// that instruction (unless this instruction forms part of the block's
256// entry requirements in which case the insertion is deferred until Phase 3
257// when predecessor exit values are known), and move the insertion point to
258// this instruction
259// - if this is a setreg instruction we treat it as an incompatible instruction.
260// This is sub-optimal but avoids some nasty corner cases, and is expected to
261// occur very rarely.
262// - on exit we have set the Require, Change, and initial Exit modes.
263void SIModeRegister::processBlockPhase1(MachineBasicBlock &MBB,
264 const SIInstrInfo *TII) {
265 auto NewInfo = std::make_unique<BlockData>();
266 MachineInstr *InsertionPoint = nullptr;
267 // RequirePending is used to indicate whether we are collecting the initial
268 // requirements for the block, and need to defer the first InsertionPoint to
269 // Phase 3. It is set to false once we have set FirstInsertionPoint, or when
270 // we discover an explicit setreg that means this block doesn't have any
271 // initial requirements.
272 bool RequirePending = true;
273 Status IPChange;
274 for (MachineInstr &MI : MBB) {
275 Status InstrMode = getInstructionMode(MI, TII);
276 if (MI.getOpcode() == AMDGPU::S_SETREG_B32 ||
277 MI.getOpcode() == AMDGPU::S_SETREG_B32_mode ||
278 MI.getOpcode() == AMDGPU::S_SETREG_IMM32_B32 ||
279 MI.getOpcode() == AMDGPU::S_SETREG_IMM32_B32_mode) {
280 // We preserve any explicit mode register setreg instruction we encounter,
281 // as we assume it has been inserted by a higher authority (this is
282 // likely to be a very rare occurrence).
283 unsigned Dst = TII->getNamedOperand(MI, AMDGPU::OpName::simm16)->getImm();
284 using namespace AMDGPU::Hwreg;
285 auto [Id, Offset, Width] = HwregEncoding::decode(Dst);
286 if (Id != ID_MODE)
287 continue;
288
289 unsigned Mask = maskTrailingOnes<unsigned>(Width) << Offset;
290
291 // If an InsertionPoint is set we will insert a setreg there.
292 if (InsertionPoint) {
293 insertSetreg(MBB, InsertionPoint, TII, IPChange.delta(NewInfo->Change));
294 InsertionPoint = nullptr;
295 }
296 // If this is an immediate then we know the value being set, but if it is
297 // not an immediate then we treat the modified bits of the mode register
298 // as unknown.
299 if (MI.getOpcode() == AMDGPU::S_SETREG_IMM32_B32 ||
300 MI.getOpcode() == AMDGPU::S_SETREG_IMM32_B32_mode) {
301 unsigned Val = TII->getNamedOperand(MI, AMDGPU::OpName::imm)->getImm();
302 unsigned Mode = (Val << Offset) & Mask;
303 Status Setreg = Status(Mask, Mode);
304 // If we haven't already set the initial requirements for the block we
305 // don't need to as the requirements start from this explicit setreg.
306 RequirePending = false;
307 NewInfo->Change = NewInfo->Change.merge(Setreg);
308 } else {
309 NewInfo->Change = NewInfo->Change.mergeUnknown(Mask);
310 }
311 } else if (!NewInfo->Change.isCompatible(InstrMode)) {
312 // This instruction uses the Mode register and its requirements aren't
313 // compatible with the current mode.
314 if (InsertionPoint) {
315 // If the required mode change cannot be included in the current
316 // InsertionPoint changes, we need a setreg and start a new
317 // InsertionPoint.
318 if (!IPChange.delta(NewInfo->Change).isCombinable(InstrMode)) {
319 if (RequirePending) {
320 // This is the first insertionPoint in the block so we will defer
321 // the insertion of the setreg to Phase 3 where we know whether or
322 // not it is actually needed.
323 NewInfo->FirstInsertionPoint = InsertionPoint;
324 NewInfo->Require = NewInfo->Change;
325 RequirePending = false;
326 } else {
327 insertSetreg(MBB, InsertionPoint, TII,
328 IPChange.delta(NewInfo->Change));
329 IPChange = NewInfo->Change;
330 }
331 // Set the new InsertionPoint
332 InsertionPoint = &MI;
333 }
334 NewInfo->Change = NewInfo->Change.merge(InstrMode);
335 } else {
336 // No InsertionPoint is currently set - this is either the first in
337 // the block or we have previously seen an explicit setreg.
338 InsertionPoint = &MI;
339 IPChange = NewInfo->Change;
340 NewInfo->Change = NewInfo->Change.merge(InstrMode);
341 }
342 }
343 }
344 if (RequirePending) {
345 // If we haven't yet set the initial requirements for the block we set them
346 // now.
347 NewInfo->FirstInsertionPoint = InsertionPoint;
348 NewInfo->Require = NewInfo->Change;
349 } else if (InsertionPoint) {
350 // We need to insert a setreg at the InsertionPoint
351 insertSetreg(MBB, InsertionPoint, TII, IPChange.delta(NewInfo->Change));
352 }
353 NewInfo->Exit = NewInfo->Change;
354 BlockInfo[MBB.getNumber()] = std::move(NewInfo);
355}
356
357// In Phase 2 we revisit each block and calculate the common Mode register
358// value provided by all predecessor blocks. If the Exit value for the block
359// is changed, then we add the successor blocks to the worklist so that the
360// exit value is propagated.
361void SIModeRegister::processBlockPhase2(MachineBasicBlock &MBB,
362 const SIInstrInfo *TII) {
363 bool RevisitRequired = false;
364 bool ExitSet = false;
365 unsigned ThisBlock = MBB.getNumber();
366 if (MBB.pred_empty()) {
367 // There are no predecessors, so use the default starting status.
368 BlockInfo[ThisBlock]->Pred = DefaultStatus;
369 ExitSet = true;
370 } else {
371 // Build a status that is common to all the predecessors by intersecting
372 // all the predecessor exit status values.
373 // Mask bits (which represent the Mode bits with a known value) can only be
374 // added by explicit SETREG instructions or the initial default value -
375 // the intersection process may remove Mask bits.
376 // If we find a predecessor that has not yet had an exit value determined
377 // (this can happen for example if a block is its own predecessor) we defer
378 // use of that value as the Mask will be all zero, and we will revisit this
379 // block again later (unless the only predecessor without an exit value is
380 // this block).
382 MachineBasicBlock &PB = *(*P);
383 unsigned PredBlock = PB.getNumber();
384 if ((ThisBlock == PredBlock) && (std::next(P) == E)) {
385 BlockInfo[ThisBlock]->Pred = DefaultStatus;
386 ExitSet = true;
387 } else if (BlockInfo[PredBlock]->ExitSet) {
388 BlockInfo[ThisBlock]->Pred = BlockInfo[PredBlock]->Exit;
389 ExitSet = true;
390 } else if (PredBlock != ThisBlock)
391 RevisitRequired = true;
392
393 for (P = std::next(P); P != E; P = std::next(P)) {
394 MachineBasicBlock *Pred = *P;
395 unsigned PredBlock = Pred->getNumber();
396 if (BlockInfo[PredBlock]->ExitSet) {
397 if (BlockInfo[ThisBlock]->ExitSet) {
398 BlockInfo[ThisBlock]->Pred =
399 BlockInfo[ThisBlock]->Pred.intersect(BlockInfo[PredBlock]->Exit);
400 } else {
401 BlockInfo[ThisBlock]->Pred = BlockInfo[PredBlock]->Exit;
402 }
403 ExitSet = true;
404 } else if (PredBlock != ThisBlock)
405 RevisitRequired = true;
406 }
407 }
408 Status TmpStatus =
409 BlockInfo[ThisBlock]->Pred.merge(BlockInfo[ThisBlock]->Change);
410 if (BlockInfo[ThisBlock]->Exit != TmpStatus) {
411 BlockInfo[ThisBlock]->Exit = TmpStatus;
412 // Add the successors to the work list so we can propagate the changed exit
413 // status.
414 for (MachineBasicBlock *Succ : MBB.successors())
415 Phase2List.push(Succ);
416 }
417 BlockInfo[ThisBlock]->ExitSet = ExitSet;
418 if (RevisitRequired)
419 Phase2List.push(&MBB);
420}
421
422// In Phase 3 we revisit each block and if it has an insertion point defined we
423// check whether the predecessor mode meets the block's entry requirements. If
424// not we insert an appropriate setreg instruction to modify the Mode register.
425void SIModeRegister::processBlockPhase3(MachineBasicBlock &MBB,
426 const SIInstrInfo *TII) {
427 unsigned ThisBlock = MBB.getNumber();
428 if (!BlockInfo[ThisBlock]->Pred.isCompatible(BlockInfo[ThisBlock]->Require)) {
429 Status Delta =
430 BlockInfo[ThisBlock]->Pred.delta(BlockInfo[ThisBlock]->Require);
431 if (BlockInfo[ThisBlock]->FirstInsertionPoint)
432 insertSetreg(MBB, BlockInfo[ThisBlock]->FirstInsertionPoint, TII, Delta);
433 else
434 insertSetreg(MBB, &MBB.instr_front(), TII, Delta);
435 }
436}
437
438bool SIModeRegisterLegacy::runOnMachineFunction(MachineFunction &MF) {
439 return SIModeRegister().run(MF);
440}
441
444 if (!SIModeRegister().run(MF))
445 return PreservedAnalyses::all();
447 PA.preserveSet<CFGAnalyses>();
448 return PA;
449}
450
451bool SIModeRegister::run(MachineFunction &MF) {
452 // Constrained FP intrinsics are used to support non-default rounding modes.
453 // strictfp attribute is required to mark functions with strict FP semantics
454 // having constrained FP intrinsics. This pass fixes up operations that uses
455 // a non-default rounding mode for non-strictfp functions. But it should not
456 // assume or modify any default rounding modes in case of strictfp functions.
457 const Function &F = MF.getFunction();
458 if (F.hasFnAttribute(llvm::Attribute::StrictFP))
459 return Changed;
460 BlockInfo.resize(MF.getNumBlockIDs());
461 const GCNSubtarget &ST = MF.getSubtarget<GCNSubtarget>();
462 const SIInstrInfo *TII = ST.getInstrInfo();
463
464 // Processing is performed in a number of phases
465
466 // Phase 1 - determine the initial mode required by each block, and add setreg
467 // instructions for intra block requirements.
468 for (MachineBasicBlock &BB : MF)
469 processBlockPhase1(BB, TII);
470
471 // Phase 2 - determine the exit mode from each block. We add all blocks to the
472 // list here, but will also add any that need to be revisited during Phase 2
473 // processing.
474 for (MachineBasicBlock &BB : MF)
475 Phase2List.push(&BB);
476 while (!Phase2List.empty()) {
477 processBlockPhase2(*Phase2List.front(), TII);
478 Phase2List.pop();
479 }
480
481 // Phase 3 - add an initial setreg to each block where the required entry mode
482 // is not satisfied by the exit mode of all its predecessors.
483 for (MachineBasicBlock &BB : MF)
484 processBlockPhase3(BB, TII);
485
486 BlockInfo.clear();
487
488 return Changed;
489}
Provides AMDGPU specific target descriptions.
MachineBasicBlock & MBB
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
AMD GCN specific subclass of TargetSubtarget.
#define DEBUG_TYPE
const HexagonInstrInfo * TII
IRTranslator LLVM IR MI
#define F(x, y, z)
Definition MD5.cpp:54
#define I(x, y, z)
Definition MD5.cpp:57
#define P(N)
PassBuilder PB(Machine, PassOpts->PTO, std::nullopt, &PIC)
#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")))
#define FP_ROUND_MODE_DP(x)
Definition SIDefines.h:1482
#define FP_ROUND_ROUND_TO_NEAREST
Definition SIDefines.h:1474
#define FP_ROUND_ROUND_TO_ZERO
Definition SIDefines.h:1477
This file defines the 'Statistic' class, which is designed to be an easy way to expose various metric...
#define STATISTIC(VARNAME, DESC)
Definition Statistic.h:171
BlockData()=default
MachineInstr * FirstInsertionPoint
LLVM_ABI void setPreservesCFG()
This function should be called by the pass, iff they do not:
Definition Pass.cpp:275
Represents analyses that only rely on functions' control flow.
Definition Analysis.h:73
FunctionPass class - This class is used to implement most global optimizations.
Definition Pass.h:314
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
SmallVectorImpl< MachineBasicBlock * >::iterator pred_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.
Function & getFunction()
Return the LLVM function that this machine code represents.
unsigned getNumBlockIDs() const
getNumBlockIDs - Return the number of MBB ID's allocated.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
Representation of each machine instruction.
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 run(MachineFunction &F, MachineFunctionAnalysisManager &AM)
Changed
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.
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.
@ Offset
Definition DWP.cpp:558
FunctionAddr VTableAddr Value
Definition InstrProf.h:137
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
FunctionPass * createSIModeRegisterPass()
int countr_one(T Value)
Count the number of ones from the least significant bit to the first zero bit.
Definition bit.h:315
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
int countr_zero(T Val)
Count number of 0's from the least significant bit to the most stopping at the first 1.
Definition bit.h:204
LLVM_ABI PreservedAnalyses getMachineFunctionPassPreservedAnalyses()
Returns the minimum set of Analyses that all machine function passes must preserve.
char & SIModeRegisterID
constexpr T maskTrailingOnes(unsigned N)
Create a bitmask with the N right-most bits set to 1, and all other bits set to 0.
Definition MathExtras.h:77
Status delta(const Status &S) const
Status(unsigned NewMask, unsigned NewMode)
bool isCombinable(Status &S)
bool operator==(const Status &S) const
Status()=default
bool isCompatible(Status &S)
Status merge(const Status &S) const
Status intersect(const Status &S) const
bool operator!=(const Status &S) const
unsigned Mask
unsigned Mode
Status mergeUnknown(unsigned newMask)