MLIR  16.0.0git
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
mlir::detail::DominanceInfoBase< IsPostDom > Class Template Reference

#include "mlir/IR/Dominance.h"

+ Inheritance diagram for mlir::detail::DominanceInfoBase< IsPostDom >:
+ Collaboration diagram for mlir::detail::DominanceInfoBase< IsPostDom >:

Public Member Functions

 DominanceInfoBase (Operation *op=nullptr)
 
 DominanceInfoBase (DominanceInfoBase &&)=default
 
DominanceInfoBaseoperator= (DominanceInfoBase &&)=default
 
 ~DominanceInfoBase ()
 
 DominanceInfoBase (const DominanceInfoBase &)=delete
 
DominanceInfoBaseoperator= (const DominanceInfoBase &)=delete
 
void invalidate ()
 Invalidate dominance info. More...
 
void invalidate (Region *region)
 
BlockfindNearestCommonDominator (Block *a, Block *b) const
 Finds the nearest common dominator block for the two given blocks a and b. More...
 
DominanceInfoNodegetRootNode (Region *region)
 Get the root dominance node of the given region. More...
 
DominanceInfoNodegetNode (Block *a)
 Return the dominance node from the Region containing block A. More...
 
bool isReachableFromEntry (Block *a) const
 Return true if the specified block is reachable from the entry block of its region. More...
 
bool hasSSADominance (Block *block) const
 Return true if operations in the specified block are known to obey SSA dominance requirements. More...
 
bool hasSSADominance (Region *region) const
 Return true if operations in the specified block are known to obey SSA dominance requirements. More...
 
DomTree & getDomTree (Region *region) const
 

Protected Types

using super = DominanceInfoBase< IsPostDom >
 

Protected Member Functions

llvm::PointerIntPair< DomTree *, 1, bool > getDominanceInfo (Region *region, bool needsDomTree) const
 Return the dom tree and "hasSSADominance" bit for the given region. More...
 
bool properlyDominates (Block *a, Block *b) const
 Return true if the specified block A properly dominates block B. More...
 

Protected Attributes

DenseMap< Region *, llvm::PointerIntPair< DomTree *, 1, bool > > dominanceInfos
 A mapping of regions to their base dominator tree and a cached "hasSSADominance" bit. More...
 

Detailed Description

template<bool IsPostDom>
class mlir::detail::DominanceInfoBase< IsPostDom >

Definition at line 34 of file Dominance.h.

Member Typedef Documentation

◆ super

template<bool IsPostDom>
using mlir::detail::DominanceInfoBase< IsPostDom >::super = DominanceInfoBase<IsPostDom>
protected

Definition at line 92 of file Dominance.h.

Constructor & Destructor Documentation

◆ DominanceInfoBase() [1/3]

template<bool IsPostDom>
mlir::detail::DominanceInfoBase< IsPostDom >::DominanceInfoBase ( Operation op = nullptr)
inline

Definition at line 38 of file Dominance.h.

◆ DominanceInfoBase() [2/3]

template<bool IsPostDom>
mlir::detail::DominanceInfoBase< IsPostDom >::DominanceInfoBase ( DominanceInfoBase< IsPostDom > &&  )
default

◆ ~DominanceInfoBase()

template<bool IsPostDom>
DominanceInfoBase::~DominanceInfoBase ( )

Definition at line 32 of file Dominance.cpp.

◆ DominanceInfoBase() [3/3]

template<bool IsPostDom>
mlir::detail::DominanceInfoBase< IsPostDom >::DominanceInfoBase ( const DominanceInfoBase< IsPostDom > &  )
delete

Member Function Documentation

◆ findNearestCommonDominator()

template<bool IsPostDom>
Block * DominanceInfoBase::findNearestCommonDominator ( Block a,
Block b 
) const

Finds the nearest common dominator block for the two given blocks a and b.

If no common dominator can be found, this function will return nullptr.

Definition at line 176 of file Dominance.cpp.

◆ getDominanceInfo()

template<bool IsPostDom>
auto DominanceInfoBase::getDominanceInfo ( Region region,
bool  needsDomTree 
) const
protected

Return the dom tree and "hasSSADominance" bit for the given region.

The DomTree will be null for single-block regions. This lazily constructs the DomTree on demand when needsDomTree=true.

Definition at line 41 of file Dominance.cpp.

◆ getDomTree()

template<bool IsPostDom>
DomTree& mlir::detail::DominanceInfoBase< IsPostDom >::getDomTree ( Region region) const
inline

Definition at line 85 of file Dominance.h.

◆ getNode()

template<bool IsPostDom>
DominanceInfoNode* mlir::detail::DominanceInfoBase< IsPostDom >::getNode ( Block a)
inline

Return the dominance node from the Region containing block A.

This only works for multi-block regions.

Definition at line 66 of file Dominance.h.

◆ getRootNode()

template<bool IsPostDom>
DominanceInfoNode* mlir::detail::DominanceInfoBase< IsPostDom >::getRootNode ( Region region)
inline

Get the root dominance node of the given region.

Note that this operation is only defined for multi-block regions!

Definition at line 58 of file Dominance.h.

◆ hasSSADominance() [1/2]

template<bool IsPostDom>
bool mlir::detail::DominanceInfoBase< IsPostDom >::hasSSADominance ( Block block) const
inline

Return true if operations in the specified block are known to obey SSA dominance requirements.

False if the block is a graph region or unknown.

Definition at line 76 of file Dominance.h.

◆ hasSSADominance() [2/2]

template<bool IsPostDom>
bool mlir::detail::DominanceInfoBase< IsPostDom >::hasSSADominance ( Region region) const
inline

Return true if operations in the specified block are known to obey SSA dominance requirements.

False if the block is a graph region or unknown.

Definition at line 81 of file Dominance.h.

◆ invalidate() [1/2]

template<bool IsPostDom>
void mlir::detail::DominanceInfoBase< IsPostDom >::invalidate ( )
inline

Invalidate dominance info.

This can be used by clients that make major changes to the CFG and don't have a good way to update it.

Definition at line 48 of file Dominance.h.

◆ invalidate() [2/2]

template<bool IsPostDom>
void mlir::detail::DominanceInfoBase< IsPostDom >::invalidate ( Region region)
inline

Definition at line 49 of file Dominance.h.

◆ isReachableFromEntry()

template<bool IsPostDom>
bool DominanceInfoBase::isReachableFromEntry ( Block a) const

Return true if the specified block is reachable from the entry block of its region.

Definition at line 232 of file Dominance.cpp.

Referenced by diagnoseInvalidOperandDominance().

◆ operator=() [1/2]

template<bool IsPostDom>
DominanceInfoBase& mlir::detail::DominanceInfoBase< IsPostDom >::operator= ( DominanceInfoBase< IsPostDom > &&  )
default

◆ operator=() [2/2]

template<bool IsPostDom>
DominanceInfoBase& mlir::detail::DominanceInfoBase< IsPostDom >::operator= ( const DominanceInfoBase< IsPostDom > &  )
delete

◆ properlyDominates()

template<bool IsPostDom>
bool DominanceInfoBase::properlyDominates ( Block a,
Block b 
) const
protected

Return true if the specified block A properly dominates block B.

Definition at line 202 of file Dominance.cpp.

Member Data Documentation

◆ dominanceInfos

template<bool IsPostDom>
DenseMap<Region *, llvm::PointerIntPair<DomTree *, 1, bool> > mlir::detail::DominanceInfoBase< IsPostDom >::dominanceInfos
mutableprotected

A mapping of regions to their base dominator tree and a cached "hasSSADominance" bit.

This map does not contain dominator trees for single block CFG regions, but we do want to cache the "hasSSADominance" bit for them. We may also not have computed the DomTree yet. In either case, the DomTree is just null.

Definition at line 110 of file Dominance.h.


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