21 #ifndef LLVM_CODEGEN_REACHINGDEFSANALYSIS_H 22 #define LLVM_CODEGEN_REACHINGDEFSANALYSIS_H 32 class MachineBasicBlock;
45 using LiveRegsDefInfo = std::vector<int>;
46 LiveRegsDefInfo LiveRegs;
65 using MBBDefsInfo = std::vector<MBBRegUnitDefs>;
71 const int ReachingDefDefaultVal = -(1 << 20);
159 #endif // LLVM_CODEGEN_REACHINGDEFSANALYSIS_H bool hasSameReachingDef(MachineInstr *A, MachineInstr *B, int PhysReg)
Return whether A and B use the same def of PhysReg.
void initializeReachingDefAnalysisPass(PassRegistry &)
void getAllInstWithUseBefore(MachineInstr *MI, int PhysReg, SmallVectorImpl< MachineInstr *> &Uses)
Provides all instructions before MI that uses PhysReg.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This class represents lattice values for constants.
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
This class provides the reaching def analysis.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
unsigned getNumUses(MachineInstr *MI, int PhysReg)
Provide the number of uses, in the same block as MI, of the register that MI defines.
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
MachineInstr * getInstFromId(MachineBasicBlock *MBB, int InstId)
Provides the MI, from the given block, corresponding to the Id or a nullptr if the id does not refer ...
Represent the analysis usage information of a pass.
MachineInstr * getReachingMIDef(MachineInstr *MI, int PhysReg)
Provides the instruction of the closest reaching def instruction of PhysReg that reaches MI...
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
void getReachingLocalUses(MachineInstr *MI, int PhysReg, SmallVectorImpl< MachineInstr *> &Uses)
Provides the uses, in the same block as MI, of register that MI defines.
bool isReachingDefLiveOut(MachineInstr *MI, int PhysReg)
Return whether the reaching def for MI also is live out of its parent block.
bool isRegUsedAfter(MachineInstr *MI, int PhysReg)
Return whether the given register is used after MI, whether it's a local use or a live out...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
MachineInstr * getInstWithUseBefore(MachineInstr *MI, int PhysReg)
Provides the first instruction before MI that uses PhysReg.
void setPreservesAll()
Set by analyses that do not transform their input at all.
MachineFunctionProperties & set(Property P)
Representation of each machine instruction.
int getClearance(MachineInstr *MI, MCPhysReg PhysReg)
Provides the clearance - the number of instructions since the closest reaching def instuction of Phys...
int getReachingDef(MachineInstr *MI, int PhysReg)
Provides the instruction id of the closest reaching def instruction of PhysReg that reaches MI...
MachineFunctionProperties getRequiredProperties() const override
MachineInstr * getLocalLiveOutMIDef(MachineBasicBlock *MBB, int PhysReg)
Return the local MI that produces the live out value for PhysReg, or nullptr for a non-live out or no...
Properties which a MachineFunction may have at a given point in time.