MLIR  20.0.0git
Public Member Functions | List of all members
mlir::DominanceInfo Class Reference

A class for computing basic dominance information. More...

#include "mlir/IR/Dominance.h"

+ Inheritance diagram for mlir::DominanceInfo:

Public Member Functions

bool properlyDominates (Operation *a, Operation *b, bool enclosingOpOk=true) const
 Return true if operation A properly dominates operation B, i.e. More...
 
bool dominates (Operation *a, Operation *b) const
 Return true if operation A dominates operation B, i.e. More...
 
bool properlyDominates (Value a, Operation *b) const
 Return true if the a value properly dominates operation b, i.e if the operation that defines a properlyDominates b and the operation that defines a does not contain b. More...
 
bool dominates (Value a, Operation *b) const
 Return true if the a value dominates operation b. More...
 
bool dominates (Block *a, Block *b) const
 Return true if the specified block A dominates block B, i.e. More...
 
bool properlyDominates (Block *a, Block *b) const
 Return true if the specified block A properly dominates block B, i.e. More...
 
- Public Member Functions inherited from mlir::detail::DominanceInfoBase< false >
 DominanceInfoBase (Operation *op=nullptr)
 
 DominanceInfoBase (DominanceInfoBase &&)=default
 
 DominanceInfoBase (const DominanceInfoBase &)=delete
 
DominanceInfoBaseoperator= (DominanceInfoBase &&)=default
 
DominanceInfoBaseoperator= (const DominanceInfoBase &)=delete
 
 ~DominanceInfoBase ()
 
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...
 
BlockfindNearestCommonDominator (BlockRangeT &&blocks) const
 Finds the nearest common dominator block for the given range of blocks. 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
 

Additional Inherited Members

- Protected Types inherited from mlir::detail::DominanceInfoBase< false >
using super = DominanceInfoBase< IsPostDom >
 
- Protected Member Functions inherited from mlir::detail::DominanceInfoBase< false >
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 inherited from mlir::detail::DominanceInfoBase< false >
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

A class for computing basic dominance information.

Note that this class is aware of different types of regions and returns a region-kind specific concept of dominance. See RegionKindInterface.

Definition at line 136 of file Dominance.h.

Member Function Documentation

◆ dominates() [1/3]

bool mlir::DominanceInfo::dominates ( Block a,
Block b 
) const
inline

Return true if the specified block A dominates block B, i.e.

if block A and block B are the same block or block A properly dominates block B.

Definition at line 172 of file Dominance.h.

◆ dominates() [2/3]

bool mlir::DominanceInfo::dominates ( Operation a,
Operation b 
) const
inline

Return true if operation A dominates operation B, i.e.

if A and B are the same operation or A properly dominates B.

Definition at line 156 of file Dominance.h.

Referenced by forwardStoreToLoad(), loadCSE(), mlir::memref::multiBuffer(), replaceForAllWithNewSignature(), and transformToReduceLoop().

◆ dominates() [3/3]

bool mlir::DominanceInfo::dominates ( Value  a,
Operation b 
) const
inline

Return true if the a value dominates operation b.

Definition at line 166 of file Dominance.h.

References mlir::Value::getDefiningOp().

◆ properlyDominates() [1/3]

bool mlir::DominanceInfo::properlyDominates ( Block a,
Block b 
) const
inline

Return true if the specified block A properly dominates block B, i.e.

: if block A contains block B, or if the region which contains block A also contains block B or some parent of block B and block A dominates that block in that kind of region. In an SSACFG region, block A dominates block B if all control flow paths from the entry block to block B flow through block A. In a Graph region, all blocks dominate all other blocks.

Definition at line 182 of file Dominance.h.

◆ properlyDominates() [2/3]

bool mlir::DominanceInfo::properlyDominates ( Operation a,
Operation b,
bool  enclosingOpOk = true 
) const
inline

Return true if operation A properly dominates operation B, i.e.

if A and B are in the same block and A properly dominates B within the block, or if the block that contains A properly dominates the block that contains B. In an SSACFG region, Operation A dominates Operation B in the same block if A preceeds B. In a Graph region, all operations in a block dominate all other operations in the same block.

The enclosingOpOk flag says whether we should return true if the B op is enclosed by a region on A.

Definition at line 149 of file Dominance.h.

Referenced by fuseIfLegal(), happensBefore(), mlir::linalg::hoistRedundantVectorTransfers(), isOpSibling(), FoldAddIntoDest::matchAndRewrite(), and neededValuesDominateInsertionPoint().

◆ properlyDominates() [3/3]

bool DominanceInfo::properlyDominates ( Value  a,
Operation b 
) const

Return true if the a value properly dominates operation b, i.e if the operation that defines a properlyDominates b and the operation that defines a does not contain b.

Definition at line 312 of file Dominance.cpp.

References mlir::Operation::getBlock(), and mlir::Value::getDefiningOp().


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