26#define DEBUG_TYPE "amdgpu-reserve-wwm-regs"
39 return "AMDGPU Reserve WWM Registers";
48class AMDGPUReserveWWMRegs {
56 "AMDGPU Reserve WWM Registers",
false,
false)
58char AMDGPUReserveWWMRegsLegacy::
ID = 0;
62bool AMDGPUReserveWWMRegsLegacy::runOnMachineFunction(
MachineFunction &MF) {
63 return AMDGPUReserveWWMRegs().run(MF);
69 AMDGPUReserveWWMRegs().run(MF);
81 unsigned Opc =
MI.getOpcode();
82 if (
Opc != AMDGPU::SI_SPILL_S32_TO_VGPR &&
83 Opc != AMDGPU::SI_RESTORE_S32_FROM_VGPR)
87 ?
MI.getOperand(0).getReg()
88 :
MI.getOperand(1).getReg();
91 "All WWM registers should have been allocated by now.");
104 MO.setIsRenamable(
false);
unsigned const MachineRegisterInfo * MRI
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
Provides AMDGPU specific target descriptions.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
PreservedAnalyses run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
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.
Ty * getInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
MachineRegisterInfo - Keep track of information for virtual and physical registers,...
A set of analyses that are preserved following a run of a transformation pass.
static PreservedAnalyses all()
Construct a special preserved set that preserves all passes.
Wrapper class representing virtual and physical registers.
This class keeps track of the SPI_SP_INPUT_ADDR config register, which tells the hardware which inter...
void clearNonWWMRegAllocMask()
const ReservedRegSet & getWWMReservedRegs() const
void reserveWWMRegister(Register Reg)
StringRef - Represent a constant reference to a string, i.e.
unsigned ID
LLVM IR allows to use arbitrary numbers as calling convention identifiers.
This is an optimization pass for GlobalISel generic memory operations.
char & AMDGPUReserveWWMRegsLegacyID
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager