#include "AMDGPU.h"
#include "GCNSubtarget.h"
#include "MCTargetDesc/AMDGPUMCTargetDesc.h"
#include "SIInstrInfo.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/InitializePasses.h"
#include "llvm/Support/Allocator.h"
usingnamespacellvm;
#define DEBUG_TYPE …
static cl::opt<unsigned> DefaultVALUInstsThreshold(
"amdgpu-set-wave-priority-valu-insts-threshold",
cl::desc("VALU instruction count threshold for adjusting wave priority"),
cl::init(100), cl::Hidden);
namespace {
struct MBBInfo { … };
MBBInfoSet;
class AMDGPUSetWavePriority : public MachineFunctionPass { … };
}
INITIALIZE_PASS(…)
char AMDGPUSetWavePriority::ID = …;
FunctionPass *llvm::createAMDGPUSetWavePriorityPass() { … }
MachineInstr *
AMDGPUSetWavePriority::BuildSetprioMI(MachineBasicBlock &MBB,
MachineBasicBlock::iterator I,
unsigned priority) const { … }
static bool CanLowerPriorityDirectlyInPredecessors(const MachineBasicBlock &MBB,
MBBInfoSet &MBBInfos) { … }
static bool isVMEMLoad(const MachineInstr &MI) { … }
bool AMDGPUSetWavePriority::runOnMachineFunction(MachineFunction &MF) { … }