MLIR 22.0.0git
EmptyTensorElimination.cpp File Reference

Go to the source code of this file.

Classes

class  mlir::bufferization::impl::EmptyTensorEliminationPassBase< DerivedT >

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::bufferization
namespace  mlir::bufferization::impl

Macros

#define GEN_PASS_DEF_EMPTYTENSORELIMINATIONPASS

Functions

std::unique_ptr<::mlir::Passmlir::bufferization::impl::createEmptyTensorEliminationPass ()
std::unique_ptr<::mlir::Passmlir::bufferization::createEmptyTensorEliminationPass ()
static bool neededValuesDominateInsertionPoint (const DominanceInfo &domInfo, Operation *insertionPoint, const SmallVector< Value > &neededValues)
 Return true if all neededValues are in scope at the given insertionPoint.
static OperationfindValidInsertionPoint (Operation *emptyTensorOp, Operation *user, const SmallVector< Value > &neededValues)
 Find a valid insertion point for a replacement of emptyTensorOp's use of user operation, assuming that the replacement may use any value from neededValues.

Macro Definition Documentation

◆ GEN_PASS_DEF_EMPTYTENSORELIMINATIONPASS

#define GEN_PASS_DEF_EMPTYTENSORELIMINATIONPASS

Definition at line 22 of file EmptyTensorElimination.cpp.

Function Documentation

◆ findValidInsertionPoint()

Operation * findValidInsertionPoint ( Operation * emptyTensorOp,
Operation * user,
const SmallVector< Value > & neededValues )
static

Find a valid insertion point for a replacement of emptyTensorOp's use of user operation, assuming that the replacement may use any value from neededValues.

Definition at line 54 of file EmptyTensorElimination.cpp.

References mlir::DominanceInfo::dominates(), and neededValuesDominateInsertionPoint().

Referenced by mlir::bufferization::buildSubsetExtraction().

◆ neededValuesDominateInsertionPoint()

bool neededValuesDominateInsertionPoint ( const DominanceInfo & domInfo,
Operation * insertionPoint,
const SmallVector< Value > & neededValues )
static

Return true if all neededValues are in scope at the given insertionPoint.

Definition at line 33 of file EmptyTensorElimination.cpp.

References mlir::Block::findAncestorOpInBlock(), and mlir::DominanceInfo::properlyDominates().

Referenced by findValidInsertionPoint().