MLIR  21.0.0git
Public Types | Public Attributes | List of all members
mlir::bufferization::BufferResultsToOutParamsOpts Struct Reference

#include "mlir/Dialect/Bufferization/Transforms/Passes.h"

Public Types

using AllocationFn = std::function< FailureOr< Value >(OpBuilder &, Location, MemRefType)>
 Allocator function: Generate a memref allocation with the given type. More...
 
using MemCpyFn = std::function< LogicalResult(OpBuilder &, Location, Value, Value)>
 Memcpy function: Generate a memcpy between two memrefs. More...
 

Public Attributes

std::function< bool(func::FuncOp *)> filterFn
 
AllocationFn allocationFn
 Allocation function; used to allocate a memref. More...
 
MemCpyFn memCpyFn
 Memcpy function; used to create a copy between two memrefs. More...
 
bool addResultAttribute = false
 If true, the pass adds a "bufferize.result" attribute to each output parameter. More...
 
bool hoistStaticAllocs = false
 If true, the pass eliminates the memref.alloc and memcpy if the returned memref is allocated in the current function. More...
 

Detailed Description

Definition at line 127 of file Passes.h.

Member Typedef Documentation

◆ AllocationFn

Allocator function: Generate a memref allocation with the given type.

Since promoteBufferResultsToOutParams doesn't allow dynamically shaped results, we don't allow passing a range of values for dynamic dims.

Definition at line 131 of file Passes.h.

◆ MemCpyFn

Memcpy function: Generate a memcpy between two memrefs.

Definition at line 135 of file Passes.h.

Member Data Documentation

◆ addResultAttribute

bool mlir::bufferization::BufferResultsToOutParamsOpts::addResultAttribute = false

If true, the pass adds a "bufferize.result" attribute to each output parameter.

Definition at line 161 of file Passes.h.

◆ allocationFn

AllocationFn mlir::bufferization::BufferResultsToOutParamsOpts::allocationFn
Initial value:
= [](OpBuilder &builder, Location loc,
MemRefType type) {
return builder.create<memref::AllocOp>(loc, type).getResult();
}

Allocation function; used to allocate a memref.

Default memref.alloc is used

Definition at line 146 of file Passes.h.

◆ filterFn

std::function<bool(func::FuncOp *)> mlir::bufferization::BufferResultsToOutParamsOpts::filterFn
Initial value:
= [](func::FuncOp *func) {
return true;
}

Definition at line 140 of file Passes.h.

◆ hoistStaticAllocs

bool mlir::bufferization::BufferResultsToOutParamsOpts::hoistStaticAllocs = false

If true, the pass eliminates the memref.alloc and memcpy if the returned memref is allocated in the current function.

Definition at line 165 of file Passes.h.

◆ memCpyFn

MemCpyFn mlir::bufferization::BufferResultsToOutParamsOpts::memCpyFn
Initial value:
= [](OpBuilder &builder, Location loc, Value from,
Value to) {
builder.create<memref::CopyOp>(loc, from, to);
return success();
}

Memcpy function; used to create a copy between two memrefs.

Default memref.copy is used.

Definition at line 153 of file Passes.h.


The documentation for this struct was generated from the following file: