MLIR 22.0.0git
BufferResultsToOutParams.cpp File Reference
#include "mlir/Dialect/Bufferization/IR/AllocationOpInterface.h"
#include "mlir/Dialect/Bufferization/Transforms/Passes.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/IR/Operation.h"
#include "mlir/Dialect/Bufferization/Transforms/Passes.h.inc"

Go to the source code of this file.

Classes

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

Namespaces

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

Macros

#define GEN_PASS_DEF_BUFFERRESULTSTOOUTPARAMSPASS

Typedefs

using AllocationFn = bufferization::BufferResultsToOutParamsOpts::AllocationFn
using MemCpyFn = bufferization::BufferResultsToOutParamsOpts::MemCpyFn
using AllocDynamicSizesMap

Functions

std::unique_ptr<::mlir::Passmlir::bufferization::impl::createBufferResultsToOutParamsPass ()
std::unique_ptr<::mlir::Passmlir::bufferization::impl::createBufferResultsToOutParamsPass (BufferResultsToOutParamsPassOptions options)
std::unique_ptr<::mlir::Passmlir::bufferization::createBufferResultsToOutParamsPass ()
std::unique_ptr<::mlir::Passmlir::bufferization::createBufferResultsToOutParamsPass (BufferResultsToOutParamsPassOptions options)
static bool hasFullyDynamicLayoutMap (MemRefType type)
 Return true if the given MemRef type has a fully dynamic layout.
static bool hasStaticIdentityLayout (MemRefType type)
 Return true if the given MemRef type has a static identity layout (i.e., no layout).
static SmallVector< ValuegetDynamicSize (Value memref, func::FuncOp funcOp)
 Return the dynamic shapes of the memref based on the defining op.
static SmallVector< ValuemapDynamicSizeAtCaller (func::CallOp call, func::FuncOp callee, ValueRange dynamicSizes)
 Returns the dynamic sizes at the callee, through the call relationship between the caller and callee.
static LogicalResult updateFuncOp (func::FuncOp func, SmallVectorImpl< BlockArgument > &appendedEntryArgs, bool addResultAttribute)
static LogicalResult updateReturnOps (func::FuncOp func, ArrayRef< BlockArgument > appendedEntryArgs, AllocDynamicSizesMap &map, const bufferization::BufferResultsToOutParamsOpts &options)
static LogicalResult updateCalls (ModuleOp module, const AllocDynamicSizesMap &map, const bufferization::BufferResultsToOutParamsOpts &options)

Macro Definition Documentation

◆ GEN_PASS_DEF_BUFFERRESULTSTOOUTPARAMSPASS

#define GEN_PASS_DEF_BUFFERRESULTSTOOUTPARAMSPASS

Definition at line 18 of file BufferResultsToOutParams.cpp.

Typedef Documentation

◆ AllocationFn

◆ AllocDynamicSizesMap

◆ MemCpyFn

Function Documentation

◆ getDynamicSize()

SmallVector< Value > getDynamicSize ( Value memref,
func::FuncOp funcOp )
static

Return the dynamic shapes of the memref based on the defining op.

If the complete dynamic shape fails to be captured, return an empty value. Currently, only function block arguments are supported for capturing.

Definition at line 51 of file BufferResultsToOutParams.cpp.

References mlir::Operation::getOperands().

Referenced by updateReturnOps().

◆ hasFullyDynamicLayoutMap()

bool hasFullyDynamicLayoutMap ( MemRefType type)
static

Return true if the given MemRef type has a fully dynamic layout.

Definition at line 30 of file BufferResultsToOutParams.cpp.

Referenced by updateCalls(), and updateFuncOp().

◆ hasStaticIdentityLayout()

bool hasStaticIdentityLayout ( MemRefType type)
static

Return true if the given MemRef type has a static identity layout (i.e., no layout).

Definition at line 44 of file BufferResultsToOutParams.cpp.

Referenced by updateCalls(), and updateFuncOp().

◆ mapDynamicSizeAtCaller()

SmallVector< Value > mapDynamicSizeAtCaller ( func::CallOp call,
func::FuncOp callee,
ValueRange dynamicSizes )
static

Returns the dynamic sizes at the callee, through the call relationship between the caller and callee.

Definition at line 75 of file BufferResultsToOutParams.cpp.

Referenced by updateCalls().

◆ updateCalls()

LogicalResult updateCalls ( ModuleOp module,
const AllocDynamicSizesMap & map,
const bufferization::BufferResultsToOutParamsOpts & options )
static

◆ updateFuncOp()

LogicalResult updateFuncOp ( func::FuncOp func,
SmallVectorImpl< BlockArgument > & appendedEntryArgs,
bool addResultAttribute )
static

◆ updateReturnOps()

LogicalResult updateReturnOps ( func::FuncOp func,
ArrayRef< BlockArgument > appendedEntryArgs,
AllocDynamicSizesMap & map,
const bufferization::BufferResultsToOutParamsOpts & options )
static