15 #ifndef LLVM_IR_DOMINATORS_H
16 #define LLVM_IR_DOMINATORS_H
32 extern template class DomTreeNodeBase<BasicBlock>;
33 extern template class DominatorTreeBase<BasicBlock>;
36 DominatorTreeBaseByGraphTraits<GraphTraits<BasicBlock *>> &DT,
Function &
F);
37 extern template void Calculate<Function, Inverse<BasicBlock *>>(
38 DominatorTreeBaseByGraphTraits<GraphTraits<Inverse<BasicBlock *>>> &DT,
48 Start(Start_), End(End_) { }
62 return BasicBlockEdge(BBInfo::getEmptyKey(), BBInfo::getEmptyKey());
65 return BasicBlockEdge(BBInfo::getTombstoneKey(), BBInfo::getTombstoneKey());
70 BBInfo::getHashValue(Edge.
getEnd()));
184 return df_end(getEntryNode(N));
bool compare(const DominatorTree &Other) const
Returns false if the other dominator tree matches this dominator tree.
DenseMapInfo< const BasicBlock * > BBInfo
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 Calculate< Function, BasicBlock * >(DominatorTreeBaseByGraphTraits< GraphTraits< BasicBlock * >> &DT, Function &F)
static NodeRef getEntryNode(NodeRef N)
const BasicBlock * getStart() const
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Analysis pass which computes a DominatorTree.
const DominatorTree & getDomTree() const
static nodes_iterator nodes_begin(NodeRef N)
static nodes_iterator nodes_begin(DominatorTree *N)
void initializeDominatorTreeWrapperPassPass(PassRegistry &)
DominatorTree Result
Provide the result typedef for this analysis pass.
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...
static BasicBlockEdge getEmptyKey()
A Use represents the edge between a Value definition and its users.
DomTreeNodeBase< NodeT > * getRootNode()
getRootNode - This returns the entry node for the CFG of the function.
DominatorTree & getDomTree()
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.
bool isReachableFromEntry(const Use &U) const
Provide an overload for a Use.
Function Alias Analysis false
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.
df_iterator< Node *, df_iterator_default_set< Node * > > nodes_iterator
bool isReachableFromEntry(const NodeT *A) const
isReachableFromEntry - Return true if A is dominated by the entry block of the function containing it...
LLVM Basic Block Representation.
ChildIterator ChildIteratorType
bool dominates(const DomTreeNodeBase< NodeT > *A, const DomTreeNodeBase< NodeT > *B) const
dominates - Returns true iff A dominates B.
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.
FunctionPass class - This class is used to implement most global optimizations.
Printer pass for the DominatorTree.
void verifyDomTree() const
Verify the correctness of the domtree by re-computing it.
Verifier pass for the DominatorTree.
const BasicBlock * getEnd() const
bool dominates(const Instruction *Def, const Use &U) const
Return true if Def dominates a use in User.
static ChildIteratorType child_begin(NodeRef N)
static ChildIteratorType child_end(NodeRef N)
std::vector< DomTreeNodeBase< NodeT > * >::const_iterator const_iterator
DomTreeNodeBase< BasicBlock > DomTreeNode
DominatorTreeBase< BasicBlock > Base
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.
static unsigned getHashValue(const BasicBlockEdge &Edge)
static NodeRef getEntryNode(DominatorTree *DT)
bool isSingleEdge() const
BasicBlockEdge(const BasicBlock *Start_, const BasicBlock *End_)
bool compare(const DominatorTreeBase &Other) const
compare - Return false if the other dominator tree base matches this dominator tree base...
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...
void recalculate(FT &F)
recalculate - compute a dominator tree for the given function
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...
PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
static BasicBlockEdge getTombstoneKey()