LLVM API Documentation

Public Member Functions | Static Public Attributes
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]

List of all members.

Public Member Functions

 RegionInfo ()
 ~RegionInfo ()
RegiongetRegionFor (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.
Regionoperator[] (BasicBlock *BB) const
 A shortcut for getRegionFor().
BasicBlockgetMaxRegionExit (BasicBlock *BB) const
 Return the exit of the maximal refined region, that starts at a BasicBlock.
RegiongetCommonRegion (Region *A, Region *B) const
 Find the smallest region that contains two regions.
RegiongetCommonRegion (BasicBlock *A, BasicBlock *B) const
 Find the smallest region that contains two basic blocks.
RegiongetCommonRegion (SmallVectorImpl< Region * > &Regions) const
 Find the smallest region that contains a set of regions.
RegiongetCommonRegion (SmallVectorImpl< BasicBlock * > &BBs) const
 Find the smallest region that contains a set of basic blocks.
RegiongetTopLevelRegion () 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

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 694 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 724 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 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.

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 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.

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

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.

Parameters:
BBThe 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
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 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.

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 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.

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

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


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: