27 #define DEBUG_TYPE "region"
35 STATISTIC(numRegions,
"The # of regions");
36 STATISTIC(numSimpleRegions,
"The # of simple regions");
44 cl::desc(
"Verify region info (time consuming)"));
50 cl::desc(
"style of printing regions"),
54 "print regions in detail with block_iterator"),
56 "print regions in detail with element_iterator"),
121 auto DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
122 auto PDT = &getAnalysis<PostDominatorTree>();
123 auto DF = &getAnalysis<DominanceFrontier>();
148 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
157 "Detect single entry single exit regions",
true,
true)
162 "Detect single entry single exit regions",
true, true)
170 return new RegionInfoPass();
ValuesClass< DataType > LLVM_END_WITH_NULL values(const char *Arg, DataType Val, const char *Desc,...)
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
STATISTIC(NumFunctions,"Total number of functions")
bool isSimple() const
Is this a simple region?
A Module instance is used to store all the information related to an LLVM module. ...
static RegionT::PrintStyle printStyle
void print(raw_ostream &OS, const Module *) const override
print - Print out the internal state of the pass.
FunctionPass * createRegionInfoPass()
void recalculate(Function &F, DominatorTree *DT, PostDominatorTree *PDT, DominanceFrontier *DF)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
void initializeRegionInfoPassPass(PassRegistry &)
Analysis that detects all canonical Regions.
INITIALIZE_PASS_BEGIN(RegionInfoPass,"regions","Detect single entry single exit regions", true, true) INITIALIZE_PASS_END(RegionInfoPass
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
Detect single entry single exit true
A RegionNode represents a subregion or a BasicBlock that is part of a Region.
#define INITIALIZE_PASS_END(passName, arg, name, cfg, analysis)
void print(raw_ostream &OS) const
void verifyAnalysis() const
Region(BasicBlock *Entry, BasicBlock *Exit, RegionInfo *RI, DominatorTree *DT, Region *Parent=nullptr)
void verifyAnalysis() const override
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
LLVM Basic Block Representation.
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
~RegionInfoPass() override
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
const BasicBlock & getEntryBlock() const
A single entry single exit Region.
void setPreservesAll()
Set by analyses that do not transform their input at all.
PostDominatorTree Class - Concrete subclass of DominatorTree that is used to compute the post-dominat...
#define clEnumValN(ENUMVAL, FLAGNAME, DESC)
static cl::opt< Region::PrintStyle, true > printStyleX("print-region-style", cl::location(RegionInfo::printStyle), cl::Hidden, cl::desc("style of printing regions"), cl::values(clEnumValN(Region::PrintNone,"none","print no details"), clEnumValN(Region::PrintBB,"bb","print regions in detail with block_iterator"), clEnumValN(Region::PrintRN,"rn","print regions in detail with element_iterator"), clEnumValEnd))
AnalysisUsage & addRequiredTransitive()
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass...
void updateStatistics(Region *R) final
This class implements an extremely fast bulk output stream that can only output to a stream...
Legacy analysis pass which computes a DominatorTree.
static cl::opt< bool, true > VerifyRegionInfoX("verify-region-info", cl::location(RegionInfoBase< RegionTraits< Function >>::VerifyRegionInfo), cl::desc("Verify region info (time consuming)"))
LocationClass< Ty > location(Ty &L)