Go to the documentation of this file.
27 #define DEBUG_TYPE "amdgpu-set-wave-priority"
33 bool MayReachVMEMLoad =
false;
44 StringRef getPassName()
const override {
return "Set wave priority"; }
59 char AMDGPUSetWavePriority::
ID = 0;
62 return new AMDGPUSetWavePriority();
66 unsigned priority)
const {
73 MBBInfoSet &MBBInfos) {
75 if (!MBBInfos[Pred].MayReachVMEMLoad)
78 if (MBBInfos[Succ].MayReachVMEMLoad)
90 const unsigned HighPriority = 3;
91 const unsigned LowPriority = 0;
98 TII =
ST.getInstrInfo();
104 Worklist.push_back(&
MBB);
108 while (!Worklist.empty()) {
111 if (!
Info.MayReachVMEMLoad) {
112 Info.MayReachVMEMLoad =
true;
118 if (!MBBInfos[&Entry].MayReachVMEMLoad)
125 Entry.insert(
I, BuildSetprioMI(MF, HighPriority));
131 if (MBBInfos[&
MBB].MayReachVMEMLoad) {
139 if (MBBInfos[Pred].MayReachVMEMLoad)
140 PriorityLoweringBlocks.
insert(Pred);
162 MBB->
insert(
I, BuildSetprioMI(MF, LowPriority));
pred_iterator pred_begin()
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
This is an optimization pass for GlobalISel generic memory operations.
FunctionPass * createAMDGPUSetWavePriorityPass()
static bool isVMEMLoad(const MachineInstr &MI)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
static bool CanLowerPriorityDirectlyInPredecessors(const MachineBasicBlock &MBB, MBBInfoSet &MBBInfos)
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
LLVM_NODISCARD T pop_back_val()
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
void append(in_iter in_start, in_iter in_end)
Add the specified range to the end of the SmallVector.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
const HexagonInstrInfo * TII
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
Analysis containing CSE Info
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
bool isEntryFunctionCC(CallingConv::ID CC)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
Representation of each machine instruction.
iterator_range< pred_iterator > predecessors()
bool any_of(R &&range, UnaryPredicate P)
Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.
iterator_range< succ_iterator > successors()
StringRef - Represent a constant reference to a string, i.e.
std::pair< NoneType, bool > insert(const T &V)
insert - Insert an element into the set if it isn't already there.
Function & getFunction()
Return the LLVM function that this machine code represents.
instr_iterator insert(instr_iterator I, MachineInstr *M)
Insert MI into the instruction list before I, possibly inside a bundle.
static bool isVMEM(const MachineInstr &MI)
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
static bool isVALU(const MachineInstr &MI)
FunctionPass class - This class is used to implement most global optimizations.