MLIR  16.0.0git
Functions
AllocTensorElimination.cpp File Reference
#include "PassDetail.h"
#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h"
#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
#include "mlir/Dialect/Bufferization/Transforms/AllocTensorElimination.h"
#include "mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h"
#include "mlir/Dialect/Bufferization/Transforms/Passes.h"
#include "mlir/Dialect/Tensor/IR/Tensor.h"
#include "mlir/IR/Dominance.h"
#include "mlir/Pass/Pass.h"
+ Include dependency graph for AllocTensorElimination.cpp:

Go to the source code of this file.

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 *allocTensorOp)
 Return true if the given insertionPoint dominates all uses of allocTensorOp. More...
 
static OperationfindValidInsertionPoint (Operation *allocTensorOp, const SmallVector< Value > &neededValues)
 Find a valid insertion point for a replacement of allocTensorOp, assuming that the replacement may use any value from neededValues. More...
 

Function Documentation

◆ findValidInsertionPoint()

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

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

Definition at line 57 of file AllocTensorElimination.cpp.

References insertionPointDominatesUses(), and neededValuesDominateInsertionPoint().

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

◆ insertionPointDominatesUses()

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

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

Definition at line 45 of file AllocTensorElimination.cpp.

References mlir::DominanceInfo::dominates(), and 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 26 of file AllocTensorElimination.cpp.

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

Referenced by findValidInsertionPoint().