MLIR 22.0.0git
mlir::bufferization::BufferResultsToOutParamsOpts Struct Reference

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

Public Types

using AllocationFn
 Allocator function: Generate a memref allocation with the given type.
using MemCpyFn
 Memcpy function: Generate a memcpy between two memrefs.

Public Attributes

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

Detailed Description

Definition at line 130 of file Passes.h.

Member Typedef Documentation

◆ AllocationFn

Initial value:
std::function<FailureOr<Value>(OpBuilder &, Location,
MemRefType, ValueRange)>
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
Definition Location.h:76
This class helps build Operations.
Definition Builders.h:207
This class provides an abstraction over the different types of ranges over Values.
Definition ValueRange.h:387

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 134 of file Passes.h.

◆ MemCpyFn

Initial value:
std::function<LogicalResult(OpBuilder &, Location, Value, Value)>
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition Value.h:96

Memcpy function: Generate a memcpy between two memrefs.

Definition at line 138 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 165 of file Passes.h.

◆ allocationFn

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

Allocation function; used to allocate a memref.

Default memref.alloc is used

Definition at line 149 of file Passes.h.

◆ filterFn

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

Definition at line 143 of file Passes.h.

◆ hoistDynamicAllocs

bool mlir::bufferization::BufferResultsToOutParamsOpts::hoistDynamicAllocs = false

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

Definition at line 173 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 169 of file Passes.h.

◆ memCpyFn

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

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

Default memref.copy is used.

Definition at line 157 of file Passes.h.


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