LLVM API Documentation
Analysis that detects all canonical Regions. More...
#include <RegionInfo.h>
Public Member Functions | |
RegionInfo () | |
~RegionInfo () | |
Region * | getRegionFor (BasicBlock *BB) const |
Get the smallest region that contains a BasicBlock. More... | |
void | setRegionFor (BasicBlock *BB, Region *R) |
Set the smallest region that surrounds a basic block. More... | |
Region * | operator[] (BasicBlock *BB) const |
A shortcut for getRegionFor(). More... | |
BasicBlock * | getMaxRegionExit (BasicBlock *BB) const |
Return the exit of the maximal refined region, that starts at a BasicBlock. More... | |
Region * | getCommonRegion (Region *A, Region *B) const |
Find the smallest region that contains two regions. More... | |
Region * | getCommonRegion (BasicBlock *A, BasicBlock *B) const |
Find the smallest region that contains two basic blocks. More... | |
Region * | getCommonRegion (SmallVectorImpl< Region * > &Regions) const |
Find the smallest region that contains a set of regions. More... | |
Region * | getCommonRegion (SmallVectorImpl< BasicBlock * > &BBs) const |
Find the smallest region that contains a set of basic blocks. More... | |
Region * | getTopLevelRegion () const |
void | splitBlock (BasicBlock *NewBB, BasicBlock *OldBB) |
Update RegionInfo after a basic block was split. More... | |
void | clearNodeCache () |
Clear the Node Cache for all Regions. More... | |
FunctionPass interface | |
virtual bool | runOnFunction (Function &F) |
virtual void | getAnalysisUsage (AnalysisUsage &AU) const |
virtual void | print (raw_ostream &OS, const Module *) const |
virtual void | verifyAnalysis () const |
![]() | |
FunctionPass (char &pid) | |
Pass * | createPrinterPass (raw_ostream &O, const std::string &Banner) const |
createPrinterPass - Get a function printer pass. More... | |
virtual void | assignPassManager (PMStack &PMS, PassManagerType T) |
virtual PassManagerType | getPotentialPassManagerType () const |
Return what kind of Pass Manager can manage this pass. More... | |
![]() | |
Pass (PassKind K, char &pid) | |
virtual | ~Pass () |
PassKind | getPassKind () const |
virtual const char * | getPassName () const |
AnalysisID | getPassID () const |
getPassID - Return the PassID number that corresponds to this pass. More... | |
virtual bool | doInitialization (Module &) |
virtual bool | doFinalization (Module &) |
void | dump () const |
virtual void | preparePassManager (PMStack &) |
Check if available pass managers are suitable for this pass or not. More... | |
void | setResolver (AnalysisResolver *AR) |
AnalysisResolver * | getResolver () const |
virtual void * | getAdjustedAnalysisPointer (AnalysisID ID) |
virtual ImmutablePass * | getAsImmutablePass () |
virtual PMDataManager * | getAsPMDataManager () |
virtual void | dumpPassStructure (unsigned Offset=0) |
template<typename AnalysisType > | |
AnalysisType * | getAnalysisIfAvailable () const |
bool | mustPreserveAnalysisID (char &AID) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis () const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis (Function &F) |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI, Function &F) |
Static Public Attributes | |
static char | ID = 0 |
Additional Inherited Members | |
![]() | |
static const PassInfo * | lookupPassInfo (const void *TI) |
static const PassInfo * | lookupPassInfo (StringRef Arg) |
static Pass * | createPass (AnalysisID ID) |
Analysis that detects all canonical Regions.
The RegionInfo pass detects all canonical regions in a function. The Regions are connected using the parent relation. This builds a Program Structure Tree.
Definition at line 577 of file RegionInfo.h.
|
explicit |
Definition at line 687 of file RegionInfo.cpp.
References llvm::PassRegistry::getPassRegistry(), and llvm::initializeRegionInfoPass().
RegionInfo::~RegionInfo | ( | ) |
Definition at line 692 of file RegionInfo.cpp.
|
inline |
Clear the Node Cache for all Regions.
Definition at line 725 of file RegionInfo.h.
References llvm::Region::clearNodeCache().
Referenced by llvm::RGPassManager::runOnFunction().
|
virtual |
getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.
Reimplemented from llvm::Pass.
Definition at line 722 of file RegionInfo.cpp.
References llvm::AnalysisUsage::addRequired(), llvm::AnalysisUsage::addRequiredTransitive(), and llvm::AnalysisUsage::setPreservesAll().
Find the smallest region that contains two regions.
A | The first region. |
B | The second region. |
Definition at line 798 of file RegionInfo.cpp.
References llvm::Region::contains(), and llvm::Region::getParent().
Referenced by getCommonRegion().
|
inline |
Find the smallest region that contains two basic blocks.
A | The first basic block. |
B | The second basic block. |
Definition at line 696 of file RegionInfo.h.
References getCommonRegion(), and getRegionFor().
Region * RegionInfo::getCommonRegion | ( | SmallVectorImpl< Region * > & | Regions | ) | const |
Find the smallest region that contains a set of regions.
Regions | A vector of regions. |
Definition at line 810 of file RegionInfo.cpp.
References llvm::SmallVectorTemplateCommon< T >::back(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::SmallVectorTemplateCommon< T >::end(), getCommonRegion(), I, and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::pop_back().
Region * RegionInfo::getCommonRegion | ( | SmallVectorImpl< BasicBlock * > & | BBs | ) | const |
Find the smallest region that contains a set of basic blocks.
BBs | A vector of basic blocks. |
Definition at line 822 of file RegionInfo.cpp.
References llvm::SmallVectorTemplateCommon< T >::back(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::SmallVectorTemplateCommon< T >::end(), getCommonRegion(), getRegionFor(), I, and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::pop_back().
BasicBlock * RegionInfo::getMaxRegionExit | ( | BasicBlock * | BB | ) | const |
Return the exit of the maximal refined region, that starts at a BasicBlock.
BB | The BasicBlock the refined region starts. |
Definition at line 759 of file RegionInfo.cpp.
References llvm::Region::contains(), llvm::DominatorTree::dominates(), llvm::Region::getEntry(), llvm::Region::getExit(), llvm::Region::getParent(), getRegionFor(), llvm::pred_begin(), llvm::pred_end(), llvm::succ_begin(), and llvm::succ_end().
Region * RegionInfo::getRegionFor | ( | BasicBlock * | BB | ) | const |
Get the smallest region that contains a BasicBlock.
BB | The basic block. |
Definition at line 745 of file RegionInfo.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), and I.
Referenced by getCommonRegion(), llvm::DOTGraphTraits< RegionInfo * >::getEdgeAttributes(), llvm::Region::getExpandedRegion(), getMaxRegionExit(), llvm::Region::getSubRegionNode(), operator[](), llvm::DOTGraphTraits< RegionInfo * >::printRegionCluster(), and splitBlock().
|
inline |
Definition at line 712 of file RegionInfo.h.
Referenced by llvm::DOTGraphTraits< RegionInfo * >::addCustomGraphFeatures(), llvm::GraphTraits< RegionInfo * >::getEntryNode(), llvm::DOTGraphTraits< RegionInfo * >::getNodeLabel(), llvm::DOTGraphTraits< RegionInfo * >::printRegionCluster(), and llvm::RGPassManager::runOnFunction().
Region * RegionInfo::operator[] | ( | BasicBlock * | BB | ) | const |
A shortcut for getRegionFor().
BB | The basic block. |
Definition at line 755 of file RegionInfo.cpp.
References getRegionFor().
|
virtual |
print - Print out the internal state of the pass. This is called by Analyze to print out the contents of an analysis. Otherwise it is not necessary to implement this method. Beware that the module pointer MAY be null. This automatically forwards to a virtual function that does not provide the Module* in case the analysis doesn't need it it can just be ignored.
Reimplemented from llvm::Pass.
Definition at line 729 of file RegionInfo.cpp.
References llvm::Region::print(), and printStyle.
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
Implements llvm::FunctionPass.
Definition at line 707 of file RegionInfo.cpp.
References llvm::Calculate(), llvm::X86II::DF, and llvm::Function::getEntryBlock().
void RegionInfo::setRegionFor | ( | BasicBlock * | BB, |
Region * | R | ||
) |
Set the smallest region that surrounds a basic block.
BB | The basic block surrounded by a region. |
R | The smallest region that surrounds BB. |
Definition at line 751 of file RegionInfo.cpp.
Referenced by llvm::Region::addSubRegion(), and splitBlock().
void RegionInfo::splitBlock | ( | BasicBlock * | NewBB, |
BasicBlock * | OldBB | ||
) |
Update RegionInfo after a basic block was split.
NewBB | The basic block that was created before OldBB. |
OldBB | The old basic block. |
Definition at line 833 of file RegionInfo.cpp.
References llvm::Region::getEntry(), llvm::Region::getParent(), getRegionFor(), llvm::Region::isTopLevelRegion(), llvm::Region::replaceEntry(), and setRegionFor().
|
virtual |
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.
Reimplemented from llvm::Pass.
Definition at line 735 of file RegionInfo.cpp.
References VerifyRegionInfo.
|
static |
Definition at line 645 of file RegionInfo.h.