#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/Pass/Pass.h"
namespace mlir {
namespace bufferization {
#define GEN_PASS_DEF_BUFFERRESULTSTOOUTPARAMS
#include "mlir/Dialect/Bufferization/Transforms/Passes.h.inc"
}
}
usingnamespacemlir;
MemCpyFn;
static bool hasFullyDynamicLayoutMap(MemRefType type) { … }
static bool hasStaticIdentityLayout(MemRefType type) { … }
static LogicalResult
updateFuncOp(func::FuncOp func,
SmallVectorImpl<BlockArgument> &appendedEntryArgs,
bool addResultAttribute) { … }
static LogicalResult updateReturnOps(func::FuncOp func,
ArrayRef<BlockArgument> appendedEntryArgs,
MemCpyFn memCpyFn,
bool hoistStaticAllocs) { … }
static LogicalResult
updateCalls(ModuleOp module,
const bufferization::BufferResultsToOutParamsOpts &options) { … }
LogicalResult mlir::bufferization::promoteBufferResultsToOutParams(
ModuleOp module,
const bufferization::BufferResultsToOutParamsOpts &options) { … }
namespace {
struct BufferResultsToOutParamsPass
: bufferization::impl::BufferResultsToOutParamsBase<
BufferResultsToOutParamsPass> { … };
}
std::unique_ptr<Pass> mlir::bufferization::createBufferResultsToOutParamsPass(
const bufferization::BufferResultsToOutParamsOpts &options) { … }