LLVM 23.0.0git
llvm::DominanceFrontierBase< BlockT, IsPostDom > Class Template Reference

DominanceFrontierBase - Common base class for computing forward and inverse dominance frontiers for a function. More...

#include "llvm/Analysis/DominanceFrontier.h"

Inheritance diagram for llvm::DominanceFrontierBase< BlockT, IsPostDom >:
[legend]

Public Types

using DomSetType = SetVector<BlockT *>
using DomSetMapType = DenseMap<BlockT *, DomSetType>
using DomTreeT = DominatorTreeBase<BlockT, IsPostDom>
using DomTreeNodeT = DomTreeNodeBase<BlockT>
using iterator = typename DomSetMapType::iterator
using const_iterator = typename DomSetMapType::const_iterator

Public Member Functions

 DominanceFrontierBase ()=default
const SmallVectorImpl< BlockT * > & getRoots () const
 getRoots - Return the root blocks of the current CFG.
BlockT * getRoot () const
bool isPostDominator () const
 isPostDominator - Returns true if analysis based of postdoms
void releaseMemory ()
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
iterator find (BlockT *B)
const_iterator find (BlockT *B) const
void print (raw_ostream &OS) const
 print - Convert to human readable form
void dump () const
 dump - Dump the dominance frontier to dbgs().
void analyze (DomTreeT &DT)
void calculate (const DomTreeT &DT, const DomTreeNodeT *Node)

Protected Types

using GraphTy = std::conditional_t<IsPostDom, Inverse<BlockT *>, BlockT *>
using BlockTraits = GraphTraits<GraphTy>

Protected Attributes

DomSetMapType Frontiers
SmallVector< BlockT *, IsPostDom ? 4 :1 > Roots

Static Protected Attributes

static constexpr bool IsPostDominators = IsPostDom

Detailed Description

template<class BlockT, bool IsPostDom>
class llvm::DominanceFrontierBase< BlockT, IsPostDom >

DominanceFrontierBase - Common base class for computing forward and inverse dominance frontiers for a function.

Definition at line 43 of file DominanceFrontier.h.

Member Typedef Documentation

◆ BlockTraits

template<class BlockT, bool IsPostDom>
using llvm::DominanceFrontierBase< BlockT, IsPostDom >::BlockTraits = GraphTraits<GraphTy>
protected

Definition at line 54 of file DominanceFrontier.h.

◆ const_iterator

template<class BlockT, bool IsPostDom>
using llvm::DominanceFrontierBase< BlockT, IsPostDom >::const_iterator = typename DomSetMapType::const_iterator

Definition at line 85 of file DominanceFrontier.h.

◆ DomSetMapType

template<class BlockT, bool IsPostDom>
using llvm::DominanceFrontierBase< BlockT, IsPostDom >::DomSetMapType = DenseMap<BlockT *, DomSetType>

Definition at line 48 of file DominanceFrontier.h.

◆ DomSetType

template<class BlockT, bool IsPostDom>
using llvm::DominanceFrontierBase< BlockT, IsPostDom >::DomSetType = SetVector<BlockT *>

Definition at line 47 of file DominanceFrontier.h.

◆ DomTreeNodeT

template<class BlockT, bool IsPostDom>
using llvm::DominanceFrontierBase< BlockT, IsPostDom >::DomTreeNodeT = DomTreeNodeBase<BlockT>

Definition at line 50 of file DominanceFrontier.h.

◆ DomTreeT

template<class BlockT, bool IsPostDom>
using llvm::DominanceFrontierBase< BlockT, IsPostDom >::DomTreeT = DominatorTreeBase<BlockT, IsPostDom>

Definition at line 49 of file DominanceFrontier.h.

◆ GraphTy

template<class BlockT, bool IsPostDom>
using llvm::DominanceFrontierBase< BlockT, IsPostDom >::GraphTy = std::conditional_t<IsPostDom, Inverse<BlockT *>, BlockT *>
protected

Definition at line 53 of file DominanceFrontier.h.

◆ iterator

template<class BlockT, bool IsPostDom>
using llvm::DominanceFrontierBase< BlockT, IsPostDom >::iterator = typename DomSetMapType::iterator

Definition at line 84 of file DominanceFrontier.h.

Constructor & Destructor Documentation

◆ DominanceFrontierBase()

template<class BlockT, bool IsPostDom>
llvm::DominanceFrontierBase< BlockT, IsPostDom >::DominanceFrontierBase ( )
default

Member Function Documentation

◆ analyze()

template<class BlockT, bool IsPostDom>
void llvm::DominanceFrontierBase< BlockT, IsPostDom >::analyze ( DomTreeT & DT)
inline

◆ begin() [1/2]

template<class BlockT, bool IsPostDom>
iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::begin ( )
inline

Definition at line 87 of file DominanceFrontier.h.

References Frontiers.

Referenced by print().

◆ begin() [2/2]

template<class BlockT, bool IsPostDom>
const_iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::begin ( ) const
inline

Definition at line 88 of file DominanceFrontier.h.

References Frontiers.

◆ calculate()

◆ dump()

template<class BlockT, bool IsPostDom>
void llvm::DominanceFrontierBase< BlockT, IsPostDom >::dump ( ) const

dump - Dump the dominance frontier to dbgs().

Definition at line 71 of file DominanceFrontierImpl.h.

References llvm::dbgs(), and llvm::print().

◆ end() [1/2]

template<class BlockT, bool IsPostDom>
iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::end ( )
inline

Definition at line 89 of file DominanceFrontier.h.

References Frontiers.

Referenced by print().

◆ end() [2/2]

template<class BlockT, bool IsPostDom>
const_iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::end ( ) const
inline

Definition at line 90 of file DominanceFrontier.h.

References Frontiers.

◆ find() [1/2]

template<class BlockT, bool IsPostDom>
iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::find ( BlockT * B)
inline

Definition at line 91 of file DominanceFrontier.h.

References B(), and Frontiers.

◆ find() [2/2]

template<class BlockT, bool IsPostDom>
const_iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::find ( BlockT * B) const
inline

Definition at line 92 of file DominanceFrontier.h.

References B(), and Frontiers.

◆ getRoot()

template<class BlockT, bool IsPostDom>
BlockT * llvm::DominanceFrontierBase< BlockT, IsPostDom >::getRoot ( ) const
inline

Definition at line 69 of file DominanceFrontier.h.

References assert(), and Roots.

◆ getRoots()

template<class BlockT, bool IsPostDom>
const SmallVectorImpl< BlockT * > & llvm::DominanceFrontierBase< BlockT, IsPostDom >::getRoots ( ) const
inline

getRoots - Return the root blocks of the current CFG.

This may include multiple blocks if we are computing post dominators. For forward dominators, this will always be a single block (the entry node).

Definition at line 67 of file DominanceFrontier.h.

References Roots.

◆ isPostDominator()

template<class BlockT, bool IsPostDom>
bool llvm::DominanceFrontierBase< BlockT, IsPostDom >::isPostDominator ( ) const
inline

isPostDominator - Returns true if analysis based of postdoms

Definition at line 75 of file DominanceFrontier.h.

References IsPostDominators.

◆ print()

template<class BlockT, bool IsPostDom>
void llvm::DominanceFrontierBase< BlockT, IsPostDom >::print ( raw_ostream & OS) const

print - Convert to human readable form

Definition at line 47 of file DominanceFrontierImpl.h.

References begin(), E(), end(), and I.

◆ releaseMemory()

template<class BlockT, bool IsPostDom>
void llvm::DominanceFrontierBase< BlockT, IsPostDom >::releaseMemory ( )
inline

Definition at line 79 of file DominanceFrontier.h.

References Frontiers.

Member Data Documentation

◆ Frontiers

template<class BlockT, bool IsPostDom>
DomSetMapType llvm::DominanceFrontierBase< BlockT, IsPostDom >::Frontiers
protected

Definition at line 56 of file DominanceFrontier.h.

Referenced by begin(), begin(), calculate(), end(), end(), find(), find(), and releaseMemory().

◆ IsPostDominators

template<class BlockT, bool IsPostDom>
bool llvm::DominanceFrontierBase< BlockT, IsPostDom >::IsPostDominators = IsPostDom
staticconstexprprotected

Definition at line 59 of file DominanceFrontier.h.

Referenced by isPostDominator().

◆ Roots

template<class BlockT, bool IsPostDom>
SmallVector<BlockT *, IsPostDom ? 4 : 1> llvm::DominanceFrontierBase< BlockT, IsPostDom >::Roots
protected

Definition at line 58 of file DominanceFrontier.h.

Referenced by getRoot(), and getRoots().


The documentation for this class was generated from the following files: