MLIR 24.0.0git
mlir::DeadnessCache Class Reference

A cache for repeated deadness queries on nested operations. More...

#include "mlir/Interfaces/SideEffectInterfaces.h"

Public Types

enum class  State : uint8_t { Alive , Dead }

Public Member Functions

bool isOpTriviallyDead (Operation *op)
 Return true if the operation is unused and can be erased.
void scheduleInvalidation (Operation *op)
 Report a change to this operation or its nested IR.
void scheduleAncestorInvalidation (Operation *op)
 Invalidate the cached effects of this operation and its ancestors.
void scheduleBlockInvalidation (Block *block)
 Report a change to a block and its contents.
void notifyBlockErased (Block *block)
 Call before an empty block is detached and destroyed.
void notifyOperationErased (Operation *op)
 Call once for each erased operation before it is detached or destroyed.

Detailed Description

A cache for repeated deadness queries on nested operations.

Report erasure of scheduled operations and blocks before destroying them.

Definition at line 555 of file SideEffectInterfaces.h.

Member Enumeration Documentation

◆ State

enum class mlir::DeadnessCache::State : uint8_t
strong
Enumerator
Alive 
Dead 

Definition at line 557 of file SideEffectInterfaces.h.

Member Function Documentation

◆ isOpTriviallyDead()

bool DeadnessCache::isOpTriviallyDead ( Operation * op)

Return true if the operation is unused and can be erased.

Terminators and symbols cannot be erased. Uses are checked on every query.

Definition at line 145 of file SideEffectInterfaces.cpp.

References Dead, mlir::Operation::mightHaveTrait(), mlir::Operation::use_empty(), and wouldOpBeTriviallyDeadImpl().

◆ notifyBlockErased()

void DeadnessCache::notifyBlockErased ( Block * block)

Call before an empty block is detached and destroyed.

Definition at line 221 of file SideEffectInterfaces.cpp.

References mlir::Block::getParentOp(), and scheduleAncestorInvalidation().

◆ notifyOperationErased()

void DeadnessCache::notifyOperationErased ( Operation * op)

Call once for each erased operation before it is detached or destroyed.

Report descendants before their parent.

Definition at line 227 of file SideEffectInterfaces.cpp.

References mlir::Operation::getParentOp(), and scheduleAncestorInvalidation().

◆ scheduleAncestorInvalidation()

void DeadnessCache::scheduleAncestorInvalidation ( Operation * op)

Invalidate the cached effects of this operation and its ancestors.

Definition at line 208 of file SideEffectInterfaces.cpp.

Referenced by notifyBlockErased(), notifyOperationErased(), scheduleBlockInvalidation(), and scheduleInvalidation().

◆ scheduleBlockInvalidation()

void DeadnessCache::scheduleBlockInvalidation ( Block * block)

Report a change to a block and its contents.

For a move, report the previous parent operation with scheduleAncestorInvalidation.

Definition at line 213 of file SideEffectInterfaces.cpp.

References mlir::Block::getParentOp(), and scheduleAncestorInvalidation().

◆ scheduleInvalidation()

void DeadnessCache::scheduleInvalidation ( Operation * op)

Report a change to this operation or its nested IR.

For a move, report the previous parent operation with scheduleAncestorInvalidation.

Definition at line 193 of file SideEffectInterfaces.cpp.

References mlir::Operation::getNumRegions(), mlir::Operation::getParentOp(), and scheduleAncestorInvalidation().


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