LLVM 20.0.0git
Public Types | Public Member Functions | Protected Types | Protected Attributes | Static Protected Attributes | List of all members
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 >:
Inheritance graph
[legend]

Public Types

using DomSetType = SetVector< BlockT * >
 
using DomSetMapType = DenseMap< BlockT *, DomSetType >
 
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
 
iterator addBasicBlock (BlockT *BB, const DomSetType &frontier)
 
void removeBlock (BlockT *BB)
 removeBlock - Remove basic block BB's frontier.
 
void addToFrontier (iterator I, BlockT *Node)
 
void removeFromFrontier (iterator I, BlockT *Node)
 
bool compareDomSet (DomSetType &DS1, const DomSetType &DS2) const
 compareDomSet - Return false if two domsets match.
 
bool compare (DominanceFrontierBase &Other) const
 compare - Return false if the other dominance frontier base matches this dominance frontier base.
 
void print (raw_ostream &OS) const
 print - Convert to human readable form
 
void dump () const
 dump - Dump the dominance frontier to dbgs().
 

Protected Types

using BlockTraits = GraphTraits< BlockT * >
 

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 40 of file DominanceFrontier.h.

Member Typedef Documentation

◆ BlockTraits

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

Definition at line 48 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 79 of file DominanceFrontier.h.

◆ DomSetMapType

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

Definition at line 45 of file DominanceFrontier.h.

◆ DomSetType

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

Definition at line 44 of file DominanceFrontier.h.

◆ iterator

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

Definition at line 78 of file DominanceFrontier.h.

Constructor & Destructor Documentation

◆ DominanceFrontierBase()

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

Member Function Documentation

◆ addBasicBlock()

template<class BlockT , bool IsPostDom>
iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::addBasicBlock ( BlockT *  BB,
const DomSetType frontier 
)
inline

◆ addToFrontier()

template<class BlockT , bool IsPostDom>
void llvm::DominanceFrontierBase< BlockT, IsPostDom >::addToFrontier ( iterator  I,
BlockT *  Node 
)

Definition at line 57 of file DominanceFrontierImpl.h.

References assert(), and I.

◆ begin() [1/2]

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

◆ begin() [2/2]

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

◆ compare()

template<class BlockT , bool IsPostDom>
bool llvm::DominanceFrontierBase< BlockT, IsPostDom >::compare ( DominanceFrontierBase< BlockT, IsPostDom > &  Other) const

compare - Return false if the other dominance frontier base matches this dominance frontier base.

Otherwise return true.

Definition at line 97 of file DominanceFrontierImpl.h.

◆ compareDomSet()

template<class BlockT , bool IsPostDom>
bool llvm::DominanceFrontierBase< BlockT, IsPostDom >::compareDomSet ( DomSetType DS1,
const DomSetType DS2 
) const

compareDomSet - Return false if two domsets match.

Otherwise return true;

Definition at line 72 of file DominanceFrontierImpl.h.

References llvm::SetVector< T, Vector, Set, N >::begin(), E, llvm::SetVector< T, Vector, Set, N >::end(), and I.

◆ dump()

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

dump - Dump the dominance frontier to dbgs().

Definition at line 151 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

◆ end() [2/2]

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

◆ find() [1/2]

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

◆ find() [2/2]

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

◆ getRoot()

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

◆ 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 61 of file DominanceFrontier.h.

References llvm::DominanceFrontierBase< BlockT, IsPostDom >::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 69 of file DominanceFrontier.h.

References llvm::DominanceFrontierBase< BlockT, IsPostDom >::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 127 of file DominanceFrontierImpl.h.

References E, I, and OS.

Referenced by llvm::DominanceFrontierWrapperPass::print().

◆ releaseMemory()

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

◆ removeBlock()

template<class BlockT , bool IsPostDom>
void llvm::DominanceFrontierBase< BlockT, IsPostDom >::removeBlock ( BlockT *  BB)

removeBlock - Remove basic block BB's frontier.

Definition at line 49 of file DominanceFrontierImpl.h.

References assert(), E, llvm::find(), and I.

◆ removeFromFrontier()

template<class BlockT , bool IsPostDom>
void llvm::DominanceFrontierBase< BlockT, IsPostDom >::removeFromFrontier ( iterator  I,
BlockT *  Node 
)

Definition at line 64 of file DominanceFrontierImpl.h.

References assert(), and I.

Member Data Documentation

◆ Frontiers

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

◆ IsPostDominators

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

◆ Roots

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

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