18 #ifndef LLVM_ANALYSIS_DOMINANCEFRONTIER_H
19 #define LLVM_ANALYSIS_DOMINANCEFRONTIER_H
32 template <
class BlockT,
bool IsPostDom>
52 inline const std::vector<BlockT *> &
getRoots()
const {
57 assert(
Roots.size() == 1 &&
"Should always have entry node!");
72 typedef typename DomSetMapType::iterator
iterator;
82 assert(
find(BB) ==
end() &&
"Block already in DominanceFrontier!");
83 return Frontiers.insert(std::make_pair(BB, frontier)).first;
106 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
115 template <
class BlockT>
129 "Only one entry block for forward domfronts!");
171 extern template class DominanceFrontierBase<BasicBlock, false>;
172 extern template class DominanceFrontierBase<BasicBlock, true>;
173 extern template class ForwardDominanceFrontierBase<BasicBlock>;
const_iterator end() const
DomSetMapType::const_iterator const_iterator
A Module instance is used to store all the information related to an LLVM module. ...
void addToFrontier(iterator I, BlockT *Node)
DominanceFrontierWrapperPass()
DominanceFrontier Result
Provide the result typedef for this analysis pass.
DomSetMapType::iterator iterator
Printer pass for the DominanceFrontier.
DominanceFrontierBase - Common base class for computing forward and inverse dominance frontiers for a...
Analysis pass which computes a DominanceFrontier.
static constexpr bool IsPostDominators
DomTreeNodeBase< BlockT > DomTreeNodeT
const_iterator find(BlockT *B) const
Base class for the actual dominator tree node.
void removeFromFrontier(iterator I, BlockT *Node)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
Core dominator tree base class.
A set of analyses that are preserved following a run of a transformation pass.
const_iterator begin() const
std::set< BlockT * > DomSetType
DomTreeBase< BlockT > DomTreeT
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
bool isPostDominator() const
isPostDominator - Returns true if analysis based of postdoms
bool compareDomSet(DomSetType &DS1, const DomSetType &DS2) const
compareDomSet - Return false if two domsets match.
void print(raw_ostream &OS) const
print - Convert to human readable form
void analyze(DomTreeT &DT)
const DominanceFrontier & getDominanceFrontier() const
std::vector< BlockT * > Roots
GraphTraits< BlockT * > BlockTraits
void dump() const
dump - Dump the dominance frontier to dbgs().
DomTreeNodeBase< BasicBlock > DomTreeNodeT
std::map< BlockT *, DomSetType > DomSetMapType
DominanceFrontierBase< BlockT, false >::DomSetType DomSetType
iterator addBasicBlock(BlockT *BB, const DomSetType &frontier)
DomTreeBase< BasicBlock > DomTreeT
void print(raw_ostream &OS, const Module *=nullptr) const override
print - Print out the internal state of the pass.
bool runOnFunction(Function &) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass...
bool invalidate(Function &F, const PreservedAnalyses &PA, FunctionAnalysisManager::Invalidator &)
Handle invalidation explicitly.
const std::vector< BlockT * > & getRoots() const
getRoots - Return the root blocks of the current CFG.
DominanceFrontier & getDominanceFrontier()
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
bool compare(DominanceFrontierBase &Other) const
compare - Return true if the other dominance frontier base matches this dominance frontier base...
void removeBlock(BlockT *BB)
removeBlock - Remove basic block BB's frontier.
API to communicate dependencies between analyses during invalidation.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const DomSetType & calculate(const DomTreeT &DT, const DomTreeNodeT *Node)
DominanceFrontierBase< BasicBlock, false >::iterator iterator
This class implements an extremely fast bulk output stream that can only output to a stream...
A container for analyses that lazily runs them and caches their results.
DominanceFrontierBase< BasicBlock, false >::const_iterator const_iterator
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...
DominanceFrontier Class - Concrete subclass of DominanceFrontierBase that is used to compute a forwar...
const std::vector< NodeT * > & getRoots() const
getRoots - Return the root blocks of the current CFG.
DominanceFrontierBase< BasicBlock, false >::DomSetType DomSetType