14 #include "llvm/Config/llvm-config.h" 19 #define DEBUG_TYPE "machine-region-info" 23 STATISTIC(numMachineRegions,
"The # of machine regions");
24 STATISTIC(numMachineSimpleRegions,
"The # of simple machine regions");
56 ++numMachineSimpleRegions;
69 TopLevelRegion =
new MachineRegion(Entry,
nullptr,
this, DT,
nullptr);
70 updateStatistics(TopLevelRegion);
87 auto DT = &getAnalysis<MachineDominatorTree>();
88 auto PDT = &getAnalysis<MachinePostDominatorTree>();
89 auto DF = &getAnalysis<MachineDominanceFrontier>();
122 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) 132 "Detect single entry single exit regions",
true,
true)
FunctionPass * createMachineRegionInfoPass()
MachineRegion(MachineBasicBlock *Entry, MachineBasicBlock *Exit, MachineRegionInfo *RI, MachineDominatorTree *DT, MachineRegion *Parent=nullptr)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
void print(raw_ostream &OS) const
void initializeMachineRegionInfoPassPass(PassRegistry &)
STATISTIC(NumFunctions, "Total number of functions")
INITIALIZE_PASS_BEGIN(MachineRegionInfoPass, DEBUG_TYPE, "Detect single entry single exit regions", true, true) INITIALIZE_PASS_END(MachineRegionInfoPass
Analysis that detects all canonical Regions.
Detect single entry single exit true
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
char & MachineRegionInfoPassID
MachineRegionInfo - This pass computes SESE regions for machine functions.
bool runOnMachineFunction(MachineFunction &F) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
A RegionNode represents a subregion or a BasicBlock that is part of a Region.
void verifyAnalysis() const
void updateStatistics(MachineRegion *R) final
Detect single entry single exit regions
bool isSimple() const
Is this a simple region?
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Represent the analysis usage information of a pass.
void print(raw_ostream &OS, const Module *) const override
print - Print out the internal state of the pass.
FunctionPass class - This class is used to implement most global optimizations.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
PostDominatorTree Class - Concrete subclass of DominatorTree that is used to compute the post-dominat...
~MachineRegionInfo() override
A single entry single exit Region.
void setPreservesAll()
Set by analyses that do not transform their input at all.
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
void recalculate(MachineFunction &F, MachineDominatorTree *DT, MachinePostDominatorTree *PDT, MachineDominanceFrontier *DF)
void verifyAnalysis() const override
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
~MachineRegionInfoPass() override
static bool VerifyRegionInfo
This class implements an extremely fast bulk output stream that can only output to a stream...
print Instructions which execute on loop entry
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...