18 #ifndef LLVM_ANALYSIS_DOMINANCEFRONTIER_H
19 #define LLVM_ANALYSIS_DOMINANCEFRONTIER_H
31 template <
class BlockT>
51 inline const std::vector<BlockT *> &
getRoots()
const {
56 assert(
Roots.size() == 1 &&
"Should always have entry node!");
71 typedef typename DomSetMapType::iterator
iterator;
81 assert(
find(BB) ==
end() &&
"Block already in DominanceFrontier!");
82 return Frontiers.insert(std::make_pair(BB, frontier)).first;
105 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
114 template <
class BlockT>
128 assert(this->
Roots.size() == 1 &&
129 "Only one entry block for forward domfronts!");
152 inline const std::vector<BasicBlock *> &
getRoots()
const {
153 return Base.getRoots();
173 return Base.addBasicBlock(BB, frontier);
179 return Base.addToFrontier(I, Node);
183 return Base.removeFromFrontier(I, Node);
187 return Base.compareDomSet(DS1, DS2);
191 return Base.compare(Other);
205 extern template class DominanceFrontierBase<BasicBlock>;
206 extern template class ForwardDominanceFrontierBase<BasicBlock>;
const bool IsPostDominators
DominanceFrontierBase< BasicBlock >::const_iterator const_iterator
void removeFromFrontier(iterator I, BasicBlock *Node)
iterator find(BasicBlock *B)
A Module instance is used to store all the information related to an LLVM module. ...
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
std::set< BlockT * > DomSetType
DominatorTreeBase< BlockT > DomTreeT
DominanceFrontierBase - Common base class for computing forward and inverse dominance frontiers for a...
const_iterator find(BasicBlock *B) const
bool compareDomSet(DomSetType &DS1, const DomSetType &DS2) const
compareDomSet - Return false if two domsets match.
const_iterator begin() const
DominanceFrontierBase< BasicBlock >::DomSetType DomSetType
GraphTraits< BlockT * > BlockTraits
const_iterator find(BlockT *B) const
const std::vector< BasicBlock * > & getRoots() const
BasicBlock * getRoot() const
DomTreeNodeBase< BlockT > DomTreeNodeT
const_iterator begin() const
void print(raw_ostream &OS, const Module *=nullptr) const override
print - Print out the internal state of the pass.
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
Base class for the actual dominator tree node.
iterator addBasicBlock(BasicBlock *BB, const DomSetType &frontier)
const_iterator end() const
void removeBlock(BasicBlock *BB)
Core dominator tree base class.
DominanceFrontierBase< BasicBlock >::iterator iterator
const std::vector< NodeT * > & getRoots() const
getRoots - Return the root blocks of the current CFG.
LLVM Basic Block Representation.
DominatorTreeBase< BasicBlock > DomTreeT
Represent the analysis usage information of a pass.
FunctionPass class - This class is used to implement most global optimizations.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do t...
void removeFromFrontier(iterator I, BlockT *Node)
void analyze(DomTreeT &DT)
DominanceFrontierBase(bool isPostDom)
ForwardDominanceFrontierBase< BasicBlock > & getBase()
void addToFrontier(iterator I, BasicBlock *Node)
ForwardDominanceFrontierBase()
std::vector< BlockT * > Roots
bool compareDomSet(DomSetType &DS1, const DomSetType &DS2) const
DomTreeNodeBase< BasicBlock > DomTreeNodeT
std::map< BlockT *, DomSetType > DomSetMapType
bool isPostDominator() const
void dump() const
dump - Dump the dominance frontier to dbgs().
bool runOnFunction(Function &) override
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass...
DomSetMapType::iterator iterator
DominanceFrontierBase< BlockT >::DomSetType DomSetType
bool compare(DominanceFrontierBase< BasicBlock > &Other) const
void removeBlock(BlockT *BB)
removeBlock - Remove basic block BB's frontier.
const std::vector< BlockT * > & getRoots() const
getRoots - Return the root blocks of the current CFG.
void print(raw_ostream &OS) const
print - Convert to human readable form
void addToFrontier(iterator I, BlockT *Node)
const DomSetType & calculate(const DomTreeT &DT, const DomTreeNodeT *Node)
This class implements an extremely fast bulk output stream that can only output to a stream...
DomSetMapType::const_iterator const_iterator
iterator addBasicBlock(BlockT *BB, const DomSetType &frontier)
bool compare(DominanceFrontierBase< BlockT > &Other) const
compare - Return true if the other dominance frontier base matches this dominance frontier base...
bool isPostDominator() const
isPostDominator - Returns true if analysis based of postdoms
const_iterator end() const
DominanceFrontier Class - Concrete subclass of DominanceFrontierBase that is used to compute a forwar...