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 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. 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,
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 55 of file EmptyTensorElimination.cpp.

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

◆ 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().