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. | |
| void | setRegionFor (BasicBlock *BB, Region *R) |
| Set the smallest region that surrounds a basic block. | |
| Region * | operator[] (BasicBlock *BB) const |
| A shortcut for getRegionFor(). | |
| BasicBlock * | getMaxRegionExit (BasicBlock *BB) const |
| Return the exit of the maximal refined region, that starts at a BasicBlock. | |
| Region * | getCommonRegion (Region *A, Region *B) const |
| Find the smallest region that contains two regions. | |
| Region * | getCommonRegion (BasicBlock *A, BasicBlock *B) const |
| Find the smallest region that contains two basic blocks. | |
| Region * | getCommonRegion (SmallVectorImpl< Region * > &Regions) const |
| Find the smallest region that contains a set of regions. | |
| Region * | getCommonRegion (SmallVectorImpl< BasicBlock * > &BBs) const |
| Find the smallest region that contains a set of basic blocks. | |
| Region * | getTopLevelRegion () const |
| void | splitBlock (BasicBlock *NewBB, BasicBlock *OldBB) |
| Update RegionInfo after a basic block was split. | |
| void | clearNodeCache () |
| Clear the Node Cache for all Regions. | |
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 |
Static Public Attributes | |
| static char | ID = 0 |
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.
| RegionInfo::RegionInfo | ( | ) | [explicit] |
Definition at line 689 of file RegionInfo.cpp.
References llvm::PassRegistry::getPassRegistry(), and llvm::initializeRegionInfoPass().
| RegionInfo::~RegionInfo | ( | ) |
Definition at line 694 of file RegionInfo.cpp.
| void llvm::RegionInfo::clearNodeCache | ( | ) | [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().
| void RegionInfo::getAnalysisUsage | ( | AnalysisUsage & | ) | const [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 724 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 800 of file RegionInfo.cpp.
References llvm::Region::contains(), and llvm::Region::getParent().
Referenced by getCommonRegion().
| Region* llvm::RegionInfo::getCommonRegion | ( | BasicBlock * | A, |
| BasicBlock * | B | ||
| ) | const [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 812 of file RegionInfo.cpp.
References llvm::SmallVectorTemplateCommon< T >::back(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::SmallVectorTemplateCommon< T >::end(), getCommonRegion(), llvm::ARM_PROC::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 824 of file RegionInfo.cpp.
References llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), getCommonRegion(), getRegionFor(), llvm::ARM_PROC::I, and llvm::SmallVectorTemplateBase< T, isPodLike >::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 761 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 747 of file RegionInfo.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), and llvm::ARM_PROC::I.
Referenced by getCommonRegion(), llvm::DOTGraphTraits< RegionInfo * >::getEdgeAttributes(), llvm::Region::getExpandedRegion(), getMaxRegionExit(), llvm::Region::getSubRegionNode(), operator[](), llvm::DOTGraphTraits< RegionInfo * >::printRegionCluster(), and splitBlock().
| Region* llvm::RegionInfo::getTopLevelRegion | ( | ) | const [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 757 of file RegionInfo.cpp.
References getRegionFor().
| void RegionInfo::print | ( | raw_ostream & | O, |
| const Module * | M | ||
| ) | const [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 731 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 709 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 753 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 835 of file RegionInfo.cpp.
References llvm::Region::getEntry(), llvm::Region::getParent(), getRegionFor(), llvm::Region::isTopLevelRegion(), llvm::Region::replaceEntry(), and setRegionFor().
| void RegionInfo::verifyAnalysis | ( | ) | const [virtual] |
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.
Reimplemented from llvm::Pass.
Definition at line 737 of file RegionInfo.cpp.
References VerifyRegionInfo.
char RegionInfo::ID = 0 [static] |
Definition at line 645 of file RegionInfo.h.