MLIR  20.0.0git
Namespaces | Macros | Functions
EmptyTensorElimination.cpp File Reference
#include "mlir/Dialect/Bufferization/Transforms/Passes.h"
#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h"
#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
#include "mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h"
#include "mlir/Dialect/Bufferization/Transforms/OneShotModuleBufferize.h"
#include "mlir/Dialect/Bufferization/Transforms/Transforms.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/IR/Dominance.h"
#include "mlir/Interfaces/SubsetOpInterface.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Dialect/Bufferization/Transforms/Passes.h.inc"

Go to the source code of this file.

Namespaces

 mlir
 Include the generated interface declarations.
 
 mlir::bufferization
 

Macros

#define GEN_PASS_DEF_EMPTYTENSORELIMINATION
 

Functions

static bool neededValuesDominateInsertionPoint (const DominanceInfo &domInfo, Operation *insertionPoint, const SmallVector< Value > &neededValues)
 Return true if all neededValues are in scope at the given insertionPoint. More...
 
static bool insertionPointDominatesUses (const DominanceInfo &domInfo, Operation *insertionPoint, Operation *emptyTensorOp)
 Return true if the given insertionPoint dominates all uses of emptyTensorOp. More...
 
static OperationfindValidInsertionPoint (Operation *emptyTensorOp, const SmallVector< Value > &neededValues)
 Find a valid insertion point for a replacement of emptyTensorOp, assuming that the replacement may use any value from neededValues. More...
 

Macro Definition Documentation

◆ GEN_PASS_DEF_EMPTYTENSORELIMINATION

#define GEN_PASS_DEF_EMPTYTENSORELIMINATION

Definition at line 23 of file EmptyTensorElimination.cpp.

Function Documentation

◆ findValidInsertionPoint()

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

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

Definition at line 64 of file EmptyTensorElimination.cpp.

References insertionPointDominatesUses(), and neededValuesDominateInsertionPoint().

◆ insertionPointDominatesUses()

static bool insertionPointDominatesUses ( const DominanceInfo domInfo,
Operation insertionPoint,
Operation emptyTensorOp 
)
static

Return true if the given insertionPoint dominates all uses of emptyTensorOp.

Definition at line 53 of file EmptyTensorElimination.cpp.

References mlir::Operation::getUsers().

Referenced by findValidInsertionPoint().

◆ neededValuesDominateInsertionPoint()

static 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 34 of file EmptyTensorElimination.cpp.

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

Referenced by findValidInsertionPoint().