Go to the documentation of this file.
25 #define DEBUG_TYPE "release-vgprs"
47 class LastVGPRUseIsVMEMStore {
50 static std::optional<bool>
75 for (
const auto &
MBB : MF) {
76 auto LastUseIsStore = lastVGPRUseIsStore(
MBB);
77 if (!LastUseIsStore.has_value())
80 if (*LastUseIsStore) {
81 EndWithVMEMStoreBlocks.push_back(&
MBB);
87 for (
const auto *
MBB : EndWithVMEMStoreBlocks) {
89 BlockVMEMStore[Succ->getNumber()] =
true;
103 const LastVGPRUseIsVMEMStore &BlockVMEMStore) {
105 bool Changed =
false;
109 if (
MI.getOpcode() == AMDGPU::S_ENDPGM ||
110 MI.getOpcode() == AMDGPU::S_ENDPGM_SAVED) {
114 if (BlockVMEMStore.isLastVGPRUseVMEMStore(
MBB)) {
139 LastVGPRUseIsVMEMStore BlockVMEMStore(MF);
141 bool Changed =
false;
142 for (
auto &
MBB : MF) {
143 Changed |= runOnMachineBasicBlock(
MBB, SII, BlockVMEMStore);
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
This is an optimization pass for GlobalISel generic memory operations.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
static bool isEXP(const MachineInstr &MI)
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
unsigned getNumBlockIDs() const
getNumBlockIDs - Return the number of MBB ID's allocated.
char & AMDGPUReleaseVGPRsID
iterator_range< iterator > terminators()
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
@ ID_DEALLOC_VGPRS_GFX11Plus
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
Represent the analysis usage information of a pass.
iterator_range< df_ext_iterator< T, SetTy > > depth_first_ext(const T &G, SetTy &S)
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.
static bool isDS(const MachineInstr &MI)
StringRef getName() const
getName - Return the name of the corresponding LLVM function.
std::pair< iterator, bool > insert(NodeRef N)
int getNumber() const
MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...
Function & getFunction()
Return the LLVM function that this machine code represents.
void setPreservesAll()
Set by analyses that do not transform their input at all.
static bool isVMEM(const MachineInstr &MI)
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
static bool isVALU(const MachineInstr &MI)
auto reverse(ContainerTy &&C)
static bool isFLAT(const MachineInstr &MI)