LLVM API Documentation
#include <Dominators.h>
Public Member Functions | |
DominatorTree () | |
~DominatorTree () | |
DominatorTreeBase< BasicBlock > & | getBase () |
const std::vector< BasicBlock * > & | getRoots () const |
BasicBlock * | getRoot () const |
DomTreeNode * | getRootNode () const |
void | getDescendants (BasicBlock *R, SmallVectorImpl< BasicBlock * > &Result) const |
Get all nodes dominated by R, including R itself. Return true on success. More... | |
bool | compare (DominatorTree &Other) const |
virtual bool | runOnFunction (Function &F) |
virtual void | verifyAnalysis () const |
virtual void | getAnalysisUsage (AnalysisUsage &AU) const |
bool | dominates (const DomTreeNode *A, const DomTreeNode *B) const |
bool | dominates (const BasicBlock *A, const BasicBlock *B) const |
bool | dominates (const Instruction *Def, const Use &U) const |
bool | dominates (const Instruction *Def, const Instruction *User) const |
bool | dominates (const Instruction *Def, const BasicBlock *BB) const |
bool | dominates (const BasicBlockEdge &BBE, const Use &U) const |
bool | dominates (const BasicBlockEdge &BBE, const BasicBlock *BB) const |
bool | properlyDominates (const DomTreeNode *A, const DomTreeNode *B) const |
bool | properlyDominates (const BasicBlock *A, const BasicBlock *B) const |
BasicBlock * | findNearestCommonDominator (BasicBlock *A, BasicBlock *B) |
const BasicBlock * | findNearestCommonDominator (const BasicBlock *A, const BasicBlock *B) |
DomTreeNode * | operator[] (BasicBlock *BB) const |
DomTreeNode * | getNode (BasicBlock *BB) const |
DomTreeNode * | addNewBlock (BasicBlock *BB, BasicBlock *DomBB) |
void | changeImmediateDominator (BasicBlock *N, BasicBlock *NewIDom) |
void | changeImmediateDominator (DomTreeNode *N, DomTreeNode *NewIDom) |
void | eraseNode (BasicBlock *BB) |
void | splitBlock (BasicBlock *NewBB) |
bool | isReachableFromEntry (const BasicBlock *A) const |
bool | isReachableFromEntry (const Use &U) const |
virtual void | releaseMemory () |
virtual void | print (raw_ostream &OS, const Module *M=0) 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) |
Public Attributes | |
DominatorTreeBase< BasicBlock > * | DT |
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) |
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
Definition at line 740 of file Dominators.h.
|
inline |
Definition at line 745 of file Dominators.h.
References DT, llvm::PassRegistry::getPassRegistry(), and llvm::initializeDominatorTreePass().
|
inline |
Definition at line 750 of file Dominators.h.
References DT.
|
inline |
addNewBlock - Add a new node to the dominator tree information. This creates a new node as a child of DomBB dominator node,linking it into the children list of the immediate dominator.
Definition at line 851 of file Dominators.h.
References DT.
Referenced by llvm::SplitCriticalEdge().
|
inline |
changeImmediateDominator - This method is used to update the dominator tree information when a node's immediate dominator changes.
Definition at line 858 of file Dominators.h.
References DT.
Referenced by llvm::MergeBasicBlockIntoOnlyPred(), and llvm::SplitCriticalEdge().
|
inline |
Definition at line 862 of file Dominators.h.
References DT.
|
inline |
compare - Return false if the other dominator tree matches this dominator tree. Otherwise return true.
Definition at line 780 of file Dominators.h.
References DT, getBase(), llvm::DomTreeNodeBase< NodeT >::getBlock(), and getRootNode().
Referenced by verifyAnalysis().
|
inline |
Definition at line 801 of file Dominators.h.
References DT.
Referenced by BlockDominatesAnExit(), llvm::Region::contains(), dominates(), llvm::ScalarEvolution::getAddRecExpr(), llvm::Region::getExpandedRegion(), getInsertPointForUses(), llvm::SCEVExpander::getIVIncOperand(), llvm::RegionInfo::getMaxRegionExit(), llvm::SCEVExpander::hoistIVInc(), isPotentiallyReachableInner(), IVUseShouldUsePostIncValue(), llvm::PHITransAddr::PHITranslateValue(), PickMostRelevantLoop(), rewriteSingleStoreAlloca(), llvm::SplitCriticalEdge(), and ValueDominatesPHI().
|
inline |
Definition at line 805 of file Dominators.h.
References DT.
bool DominatorTree::dominates | ( | const Instruction * | Def, |
const Use & | U | ||
) | const |
Definition at line 237 of file Dominators.cpp.
References dominates(), llvm::Instruction::getParent(), llvm::Use::getUser(), I, and isReachableFromEntry().
bool DominatorTree::dominates | ( | const Instruction * | Def, |
const Instruction * | User | ||
) | const |
Definition at line 99 of file Dominators.cpp.
References llvm::BasicBlock::begin(), llvm::tgtok::Def, dominates(), llvm::Instruction::getParent(), I, and isReachableFromEntry().
bool DominatorTree::dominates | ( | const Instruction * | Def, |
const BasicBlock * | BB | ||
) | const |
Definition at line 136 of file Dominators.cpp.
References llvm::tgtok::Def, dominates(), llvm::dyn_cast(), llvm::InvokeInst::getNormalDest(), llvm::Instruction::getParent(), and isReachableFromEntry().
bool DominatorTree::dominates | ( | const BasicBlockEdge & | BBE, |
const Use & | U | ||
) | const |
Definition at line 213 of file Dominators.cpp.
References dominates(), llvm::dyn_cast(), llvm::BasicBlockEdge::getEnd(), llvm::BasicBlock::getParent(), llvm::BasicBlockEdge::getStart(), llvm::Use::getUser(), and llvm::BasicBlockEdge::isSingleEdge().
bool DominatorTree::dominates | ( | const BasicBlockEdge & | BBE, |
const BasicBlock * | BB | ||
) | const |
Definition at line 162 of file Dominators.cpp.
References dominates(), llvm::BasicBlockEdge::getEnd(), llvm::BasicBlock::getSinglePredecessor(), llvm::BasicBlockEdge::getStart(), llvm::BasicBlockEdge::isSingleEdge(), llvm::pred_begin(), and llvm::pred_end().
|
inline |
eraseNode - Removes a node from the dominator tree. Block must not dominate any other blocks. Removes node from its immediate dominator's children list. Deletes dominator node associated with basic block BB.
Definition at line 869 of file Dominators.h.
References DT.
Referenced by llvm::MergeBasicBlockIntoOnlyPred().
|
inline |
findNearestCommonDominator - Find nearest common dominator basic block for basic block A and B. If there is no such block then return NULL.
Definition at line 828 of file Dominators.h.
References DT.
Referenced by getInsertPointForUses().
|
inline |
Definition at line 832 of file Dominators.h.
References DT.
|
inlinevirtual |
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 797 of file Dominators.h.
References llvm::AnalysisUsage::setPreservesAll().
|
inline |
Definition at line 754 of file Dominators.h.
References DT.
Referenced by compare(), and verifyAnalysis().
|
inline |
Get all nodes dominated by R, including R itself. Return true on success.
Definition at line 773 of file Dominators.h.
References DT.
|
inline |
getNode - return the (Post)DominatorTree node for the specified basic block. This is the same as using operator[] on this class.
Definition at line 844 of file Dominators.h.
References DT.
Referenced by BlockDominatesAnExit(), llvm::Region::contains(), llvm::Region::getEnteringBlock(), isSimplifiedLoopNest(), llvm::MergeBasicBlockIntoOnlyPred(), and llvm::SplitCriticalEdge().
|
inline |
|
inline |
Definition at line 768 of file Dominators.h.
References DT.
Referenced by compare(), llvm::GraphTraits< DominatorTree * >::getEntryNode(), and llvm::DOTGraphTraits< DominatorTree * >::getNodeLabel().
|
inline |
getRoots - Return the root blocks of the current CFG. This may include multiple blocks if we are computing post dominators. For forward dominators, this will always be a single block (the entry node).
Definition at line 760 of file Dominators.h.
References DT.
Referenced by llvm::DominanceFrontier::runOnFunction().
|
inline |
Definition at line 879 of file Dominators.h.
References DT.
Referenced by dominates(), FindUnconditionalPreds(), llvm::Loop::isLCSSAForm(), isPotentiallyReachableInner(), isReachableFromEntry(), and ValueDominatesPHI().
Definition at line 289 of file Dominators.cpp.
References llvm::dyn_cast(), llvm::Instruction::getParent(), llvm::Use::getUser(), I, and isReachableFromEntry().
|
inline |
Definition at line 837 of file Dominators.h.
References DT.
|
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 92 of file Dominators.cpp.
References DT.
Referenced by verifyAnalysis().
|
inline |
Definition at line 818 of file Dominators.h.
References DT.
Referenced by llvm::DominanceFrontier::calculate(), and isLoopInvariant().
|
inline |
Definition at line 822 of file Dominators.h.
References DT.
|
inlinevirtual |
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused.
Optionally implement this function to release pass memory when it is no longer used.
Reimplemented from llvm::Pass.
Definition at line 886 of file Dominators.h.
References DT.
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
Implements llvm::FunctionPass.
|
inline |
splitBlock - BB is split and now it has one successor. Update dominator tree to reflect this change.
Definition at line 875 of file Dominators.h.
References DT.
Referenced by UpdateAnalysisInformation().
|
virtual |
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.
Reimplemented from llvm::Pass.
Definition at line 76 of file Dominators.cpp.
References compare(), llvm::errs(), F(), getBase(), llvm::BasicBlock::getParent(), getRoot(), print(), and VerifyDomInfo.
DominatorTreeBase<BasicBlock>* llvm::DominatorTree::DT |
Definition at line 743 of file Dominators.h.
Referenced by addNewBlock(), changeImmediateDominator(), compare(), dominates(), DominatorTree(), eraseNode(), findNearestCommonDominator(), getBase(), getDescendants(), getNode(), getRoot(), getRootNode(), getRoots(), isReachableFromEntry(), operator[](), print(), properlyDominates(), releaseMemory(), splitBlock(), and ~DominatorTree().
|
static |
Definition at line 742 of file Dominators.h.