14#ifndef LLVM_IR_DOMINATORS_H
15#define LLVM_IR_DOMINATORS_H
73 Start(Start_), End(End_) {}
76 : Start(Pair.first), End(Pair.second) {}
78 BasicBlockEdge(
const std::pair<const BasicBlock *, const BasicBlock *> &Pair)
79 : Start(Pair.first), End(Pair.second) {}
94 return hash_combine(BBInfo::getHashValue(Edge.getStart()),
95 BBInfo::getHashValue(Edge.getEnd()));
99 return BBInfo::isEqual(
LHS.getStart(),
RHS.getStart()) &&
100 BBInfo::isEqual(
LHS.getEnd(),
RHS.getEnd());
134 FunctionAnalysisManager::Invalidator &);
225 DomTreeNode::const_iterator> {};
This file implements a class to represent arbitrary precision integral constant values and operations...
static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)
#define LLVM_TEMPLATE_ABI
This file defines DenseMapInfo traits for DenseMap.
This file builds on the ADT/GraphTraits.h file to build generic depth first graph iterator.
This file defines a set of templates that efficiently compute a dominator tree over a generic graph.
This file provides various utilities for inspecting and working with the control flow graph in LLVM I...
This header defines various interfaces for pass management in LLVM.
This defines the Use class.
This file defines the PointerIntPair class.
This file defines the SmallVector class.
Represent the analysis usage information of a pass.
void setPreservesAll()
Set by analyses that do not transform their input at all.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
const BasicBlock * getEnd() const
const BasicBlock * getStart() const
BasicBlockEdge(const std::pair< const BasicBlock *, const BasicBlock * > &Pair)
BasicBlockEdge(const BasicBlock *Start_, const BasicBlock *End_)
BasicBlockEdge(const std::pair< BasicBlock *, BasicBlock * > &Pair)
LLVM Basic Block Representation.
InstListType::iterator iterator
Instruction iterators...
Base class for the actual dominator tree node.
Analysis pass which computes a DominatorTree.
LLVM_ABI DominatorTree run(Function &F, FunctionAnalysisManager &)
Run the analysis pass over a function and produce a dominator tree.
DominatorTree Result
Provide the result typedef for this analysis pass.
Core dominator tree base class.
DomTreeNodeBase< NodeT > * getRootNode()
getRootNode - This returns the entry node for the CFG of the function.
BasicBlock * findNearestCommonDominator(BasicBlock *A, BasicBlock *B) const
DominatorTreeBase()=default
bool dominates(const DomTreeNodeBase< BasicBlock > *A, const DomTreeNodeBase< BasicBlock > *B) const
void recalculate(ParentType &Func)
bool isReachableFromEntry(const BasicBlock *A) const
LLVM_ABI DominatorTreePrinterPass(raw_ostream &OS)
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
bool runOnFunction(Function &F) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass.
DominatorTreeWrapperPass()
DominatorTree & getDomTree()
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
const DominatorTree & getDomTree() const
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
void verifyAnalysis() const override
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis infor...
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
bool dominates(const Value *Def, BasicBlock::iterator User) const
LLVM_ABI bool isReachableFromEntry(const Use &U) const
Provide an overload for a Use.
LLVM_ABI Instruction * findNearestCommonDominator(Instruction *I1, Instruction *I2) const
Find the nearest instruction I that dominates both I1 and I2, in the sense that a result produced bef...
LLVM_ABI bool dominates(const BasicBlock *BB, const Use &U) const
Return true if the (end of the) basic block BB dominates the use U.
LLVM_ABI void viewGraph()
DominatorTreeBase< BasicBlock, false > Base
DominatorTree(Function &F)
LLVM_ABI bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &)
Handle invalidation explicitly.
DominatorTree(DominatorTree &DT, DomTreeBuilder::BBUpdates U)
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
A Use represents the edge between a Value definition and its users.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
GraphDiff< BasicBlock *, false > BBDomTreeGraphDiff
ArrayRef< llvm::cfg::Update< BasicBlock * > > BBUpdates
GraphDiff< BasicBlock *, true > BBPostDomTreeGraphDiff
PostDomTreeBase< BasicBlock > BBPostDomTree
DomTreeBase< BasicBlock > BBDomTree
This is an optimization pass for GlobalISel generic memory operations.
df_iterator< T > df_begin(const T &G)
DominatorTreeBase< T, true > PostDomTreeBase
DomTreeNodeBase< BasicBlock > DomTreeNode
DominatorTreeBase< T, false > DomTreeBase
LLVM_ABI bool VerifyDomInfo
Enables verification of dominator trees.
df_iterator< T > df_end(const T &G)
AnalysisManager< Function > FunctionAnalysisManager
Convenience typedef for the Function analysis manager.
hash_code hash_combine(const Ts &...args)
Combine values into a single hash_code.
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...
DenseMapInfo< const BasicBlock * > BBInfo
static unsigned getHashValue(const BasicBlockEdge &Edge)
static LLVM_ABI unsigned getHashValue(const BasicBlockEdge *V)
static bool isEqual(const BasicBlockEdge &LHS, const BasicBlockEdge &RHS)
An information struct used to provide DenseMap with the various necessary components for a given valu...
static ChildIteratorType child_end(NodeRef N)
static NodeRef getEntryNode(NodeRef N)
ChildIterator ChildIteratorType
df_iterator< Node *, df_iterator_default_set< Node * > > nodes_iterator
static nodes_iterator nodes_begin(NodeRef N)
static nodes_iterator nodes_end(NodeRef N)
static ChildIteratorType child_begin(NodeRef N)
Verifier pass for the DominatorTree.
LLVM_ABI PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM)
static nodes_iterator nodes_end(DominatorTree *N)
static NodeRef getEntryNode(DominatorTree *DT)
static nodes_iterator nodes_begin(DominatorTree *N)
typename DominatorTree *::UnknownGraphTypeError NodeRef
A CRTP mix-in for passes that should not be skipped.