68 #define DEBUG_TYPE "si-fix-wwm-liveness" 91 StringRef getPassName()
const override {
return "SI Fix WWM Liveness"; }
108 "SI fix WWM liveness",
false,
false)
115 return new SIFixWWMLiveness();
122 unsigned Reg =
Op.getReg();
123 if (
TRI->isVGPR(*
MRI, Reg))
129 bool SIFixWWMLiveness::runOnWWMInstruction(
MachineInstr &WWM) {
137 MBB->
end(); II !=
IE; ++II) {
138 addDefs(*II, LiveOut);
145 addDefs(MI, LiveOut);
153 MBB->
rend(); II !=
IE; ++II) {
154 addDefs(*II, Reachable);
161 addDefs(MI, Reachable);
166 LiveOut &= Reachable;
169 for (
unsigned Reg : LiveOut) {
173 LIS->removeInterval(
Reg);
174 LIS->createAndComputeVirtRegInterval(
Reg);
186 LIS = getAnalysisIfAvailable<LiveIntervals>();
191 TRI = &TII->getRegisterInfo();
196 if (MI.
getOpcode() == AMDGPU::EXIT_WWM) {
197 Modified |= runOnWWMInstruction(MI);
Interface definition for SIRegisterInfo.
AnalysisUsage & addPreserved()
Add the specified Pass class to the set of analyses preserved by this pass.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
AMDGPU specific subclass of TargetSubtarget.
Compute iterated dominance frontiers using a linear time algorithm.
char & MachineDominatorsID
MachineDominators - This pass is a machine dominators analysis pass.
unsigned const TargetRegisterInfo * TRI
static MachineOperand CreateReg(unsigned Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isEarlyClobber=false, unsigned SubReg=0, bool isDebug=false, bool isInternalRead=false, bool isRenamable=false)
char & MachineLoopInfoID
MachineLoopInfo - This pass is a loop analysis pass.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
AnalysisUsage & addPreservedID(const void *ID)
idf_iterator< T > idf_begin(const T &G)
idf_iterator< T > idf_end(const T &G)
char & LiveVariablesID
LiveVariables pass - This pass computes the set of blocks in which each variable is life and sets mac...
unsigned const MachineRegisterInfo * MRI
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
df_iterator< T > df_end(const T &G)
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Represent the analysis usage information of a pass.
char & SIFixWWMLivenessID
iterator_range< mop_iterator > defs()
Returns a range over all explicit operands that are register definitions.
FunctionPass class - This class is used to implement most global optimizations.
#define INITIALIZE_PASS(passName, arg, name, cfg, analysis)
FunctionPass * createSIFixWWMLivenessPass()
void addOperand(MachineFunction &MF, const MachineOperand &Op)
Add the specified operand to the instruction.
void initializeSIFixWWMLivenessPass(PassRegistry &)
MachineOperand class - Representation of each machine instruction operand.
void setPreservesCFG()
This function should be called by the pass, iff they do not:
df_iterator< T > df_begin(const T &G)
const MachineBasicBlock * getParent() const
MachineRegisterInfo - Keep track of information for virtual and physical registers, including vreg register classes, use/def chains for registers, etc.
Provides AMDGPU specific target descriptions.
Representation of each machine instruction.
Interface definition for SIInstrInfo.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
StringRef - Represent a constant reference to a string, i.e.