15 #ifndef LLVM_IR_DOMINATORS_H
16 #define LLVM_IR_DOMINATORS_H
36 extern template class DomTreeNodeBase<BasicBlock>;
37 extern template class DominatorTreeBase<BasicBlock, false>;
38 extern template class DominatorTreeBase<BasicBlock, true>;
40 namespace DomTreeBuilder {
72 Start(Start_), End(End_) {}
77 BasicBlockEdge(
const std::pair<const BasicBlock *, const BasicBlock *> &Pair)
89 bool isSingleEdge()
const;
98 return BasicBlockEdge(BBInfo::getEmptyKey(), BBInfo::getEmptyKey());
102 return BasicBlockEdge(BBInfo::getTombstoneKey(), BBInfo::getTombstoneKey());
107 BBInfo::getHashValue(Edge.
getEnd()));
155 using Base::dominates;
173 using Base::isReachableFromEntry;
176 bool isReachableFromEntry(
const Use &U)
const;
182 void verifyDomTree()
const;
227 return df_end(getEntryNode(N));
289 #endif // LLVM_IR_DOMINATORS_H
bool compare(const DominatorTree &Other) const
Returns false if the other dominator tree matches this dominator tree.
template void Calculate< BBPostDomTree, Function >(BBPostDomTree &DT, Function &F)
typename std::vector< DomTreeNodeBase * >::const_iterator const_iterator
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
DominatorTree(Function &F)
A Module instance is used to store all the information related to an LLVM module. ...
static bool isEqual(const BasicBlockEdge &LHS, const BasicBlockEdge &RHS)
template void DeleteEdge< BBPostDomTree >(BBPostDomTree &DT, BasicBlock *From, BasicBlock *To)
static NodeRef getEntryNode(NodeRef N)
const BasicBlock * getStart() const
template bool Verify< BBDomTree >(const BBDomTree &DT)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
BasicBlockEdge(const std::pair< BasicBlock *, BasicBlock * > &Pair)
Analysis pass which computes a DominatorTree.
const DominatorTree & getDomTree() const
static nodes_iterator nodes_begin(NodeRef N)
static nodes_iterator nodes_begin(DominatorTree *N)
BasicBlockEdge(const std::pair< const BasicBlock *, const BasicBlock * > &Pair)
void initializeDominatorTreeWrapperPassPass(PassRegistry &)
template void Calculate< BBDomTree, Function >(BBDomTree &DT, Function &F)
void verifyAnalysis() const override
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
DominatorTreeWrapperPass()
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass...
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static BasicBlockEdge getEmptyKey()
A Use represents the edge between a Value definition and its users.
DominatorTree & getDomTree()
DomTreeNode::iterator ChildIteratorType
static bool isEqual(const Function &Caller, const Function &Callee)
static nodes_iterator nodes_end(DominatorTree *N)
A CRTP mix-in to automatically provide informational APIs needed for passes.
Base class for the actual dominator tree node.
DominatorTreePrinterPass(raw_ostream &OS)
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree...
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
static nodes_iterator nodes_end(NodeRef N)
Core dominator tree base class.
A set of analyses that are preserved following a run of a transformation pass.
LLVM Basic Block Representation.
DominatorTree run(Function &F, FunctionAnalysisManager &)
Run the analysis pass over a function and produce a dominator tree.
df_iterator< T > df_end(const T &G)
A CRTP mix-in that provides informational APIs needed for analysis passes.
Represent the analysis usage information of a pass.
static const unsigned End
FunctionPass class - This class is used to implement most global optimizations.
Printer pass for the DominatorTree.
Verifier pass for the DominatorTree.
const BasicBlock * getEnd() const
static ChildIteratorType child_begin(NodeRef N)
static ChildIteratorType child_end(NodeRef N)
template void InsertEdge< BBPostDomTree >(BBPostDomTree &DT, BasicBlock *From, BasicBlock *To)
df_iterator< T > df_begin(const T &G)
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
void setPreservesAll()
Set by analyses that do not transform their input at all.
void print(raw_ostream &OS, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
template void DeleteEdge< BBDomTree >(BBDomTree &DT, BasicBlock *From, BasicBlock *To)
static unsigned getHashValue(const BasicBlockEdge &Edge)
static NodeRef getEntryNode(DominatorTree *DT)
API to communicate dependencies between analyses during invalidation.
int compare(DigitsT LDigits, int16_t LScale, DigitsT RDigits, int16_t RScale)
Compare two scaled numbers.
BasicBlockEdge(const BasicBlock *Start_, const BasicBlock *End_)
DomTreeNodeBase< BasicBlock > DomTreeNode
DomTreeNodeBase< NodeT > * getRootNode()
getRootNode - This returns the entry node for the CFG of the function.
template bool Verify< BBPostDomTree >(const BBPostDomTree &DT)
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
This class implements an extremely fast bulk output stream that can only output to a stream...
This file defines a set of templates that efficiently compute a dominator tree over a generic graph...
A container for analyses that lazily runs them and caches their results.
Legacy analysis pass which computes a DominatorTree.
This header defines various interfaces for pass management in LLVM.
A special type used by analysis passes to provide an address that identifies that particular analysis...
template void InsertEdge< BBDomTree >(BBDomTree &DT, BasicBlock *From, BasicBlock *To)
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
static BasicBlockEdge getTombstoneKey()