LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Attributes | List of all members
llvm::RegionInfo Class Reference

Analysis that detects all canonical Regions. More...

#include <RegionInfo.h>

Inheritance diagram for llvm::RegionInfo:
Inheritance graph
[legend]
Collaboration diagram for llvm::RegionInfo:
Collaboration graph
[legend]

Public Member Functions

 RegionInfo ()
 
 ~RegionInfo ()
 
RegiongetRegionFor (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...
 
Regionoperator[] (BasicBlock *BB) const
 A shortcut for getRegionFor(). More...
 
BasicBlockgetMaxRegionExit (BasicBlock *BB) const
 Return the exit of the maximal refined region, that starts at a BasicBlock. More...
 
RegiongetCommonRegion (Region *A, Region *B) const
 Find the smallest region that contains two regions. More...
 
RegiongetCommonRegion (BasicBlock *A, BasicBlock *B) const
 Find the smallest region that contains two basic blocks. More...
 
RegiongetCommonRegion (SmallVectorImpl< Region * > &Regions) const
 Find the smallest region that contains a set of regions. More...
 
RegiongetCommonRegion (SmallVectorImpl< BasicBlock * > &BBs) const
 Find the smallest region that contains a set of basic blocks. More...
 
RegiongetTopLevelRegion () 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
 
- Public Member Functions inherited from llvm::FunctionPass
 FunctionPass (char &pid)
 
PasscreatePrinterPass (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...
 
- Public Member Functions inherited from llvm::Pass
 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)
 
AnalysisResolvergetResolver () const
 
virtual void * getAdjustedAnalysisPointer (AnalysisID ID)
 
virtual ImmutablePassgetAsImmutablePass ()
 
virtual PMDataManagergetAsPMDataManager ()
 
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 Public Member Functions inherited from llvm::Pass
static const PassInfolookupPassInfo (const void *TI)
 
static const PassInfolookupPassInfo (StringRef Arg)
 
static PasscreatePass (AnalysisID ID)
 

Detailed Description

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.

Constructor & Destructor Documentation

RegionInfo::RegionInfo ( )
explicit
RegionInfo::~RegionInfo ( )

Definition at line 692 of file RegionInfo.cpp.

Member Function Documentation

void llvm::RegionInfo::clearNodeCache ( )
inline

Clear the Node Cache for all Regions.

See Also
Region::clearNodeCache()

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 722 of file RegionInfo.cpp.

References llvm::AnalysisUsage::addRequired(), llvm::AnalysisUsage::addRequiredTransitive(), and llvm::AnalysisUsage::setPreservesAll().

Region * RegionInfo::getCommonRegion ( Region A,
Region B 
) const

Find the smallest region that contains two regions.

Parameters
AThe first region.
BThe second region.
Returns
The smallest region containing A and B.

Definition at line 798 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.

Parameters
AThe first basic block.
BThe second basic block.
Returns
The smallest region that contains A and B.

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.

Parameters
RegionsA vector of regions.
Returns
The smallest region that contains all regions in 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.

Parameters
BBsA vector of basic blocks.
Returns
The smallest region that contains all basic blocks in BBS.

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.

Parameters
BBThe 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
Region* llvm::RegionInfo::getTopLevelRegion ( ) const
inline
Region * RegionInfo::operator[] ( BasicBlock BB) const

A shortcut for getRegionFor().

Parameters
BBThe basic block.
Returns
The smallest region, that contains BB or NULL, if there is no region containing BB.

Definition at line 755 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 729 of file RegionInfo.cpp.

References llvm::Region::print(), and printStyle.

bool RegionInfo::runOnFunction ( Function F)
virtual

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.

Parameters
BBThe basic block surrounded by a region.
RThe 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.

Parameters
NewBBThe basic block that was created before OldBB.
OldBBThe 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().

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 735 of file RegionInfo.cpp.

References VerifyRegionInfo.

Member Data Documentation

char RegionInfo::ID = 0
static

Definition at line 645 of file RegionInfo.h.


The documentation for this class was generated from the following files: