1#ifndef MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_PASSES_H
2#define MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_PASSES_H
10class FunctionOpInterface;
13class RewritePatternSet;
32#include "mlir/Dialect/Bufferization/Transforms/Passes.h.inc"
120 SymbolTable &symbolTable);
151 return memref::AllocOp::create(builder, loc, type, dynamicSizes)
159 memref::CopyOp::create(builder, loc, from, to);
198#define GEN_PASS_REGISTRATION
199#include "mlir/Dialect/Bufferization/Transforms/Passes.h.inc"
static llvm::ManagedStatic< PassManagerOptions > options
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
This class helps build Operations.
This class represents a collection of SymbolTables.
This class provides an abstraction over the different types of ranges over Values.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
LogicalResult deallocateBuffersOwnershipBased(FunctionOpInterface op, DeallocationOptions options, SymbolTableCollection &symbolTables)
Run the ownership-based buffer deallocation.
std::unique_ptr<::mlir::Pass > createPromoteBuffersToStackPass()
LogicalResult promoteBufferResultsToOutParams(ModuleOp module, const BufferResultsToOutParamsOpts &options)
Replace buffers that are returned from a function with an out parameter.
void populateBufferizationDeallocLoweringPattern(RewritePatternSet &patterns, const DeallocHelperMap &deallocHelperFuncMap)
Adds the conversion pattern of the bufferization.dealloc operation to the given pattern set for use i...
llvm::DenseMap< Operation *, func::FuncOp > DeallocHelperMap
Maps from symbol table to its corresponding dealloc helper function.
func::FuncOp buildDeallocationLibraryFunction(OpBuilder &builder, Location loc, SymbolTable &symbolTable)
Construct the library function needed for the fully generic bufferization.dealloc lowering implemente...
LogicalResult dropEquivalentBufferResults(ModuleOp module)
Drop all memref function results that are equivalent to a function argument.
Include the generated interface declarations.
const FrozenRewritePatternSet & patterns
bool hoistDynamicAllocs
If true, the pass eliminates the memref.alloc and memcpy if the returned memref is allocated in the c...
bool modifyPublicFunctions
If true, the pass modifies the function signatures of public functions.
MemCpyFn memCpyFn
Memcpy function; used to create a copy between two memrefs.
bool hoistStaticAllocs
If true, the pass eliminates the memref.alloc and memcpy if the returned memref is allocated in the c...
std::function< LogicalResult(OpBuilder &, Location, Value, Value)> MemCpyFn
Memcpy function: Generate a memcpy between two memrefs.
std::function< FailureOr< Value >(OpBuilder &, Location, MemRefType, ValueRange)> AllocationFn
Allocator function: Generate a memref allocation with the given type.
AllocationFn allocationFn
Allocation function; used to allocate a memref.
bool addResultAttribute
If true, the pass adds a "bufferize.result" attribute to each output parameter.
std::function< bool(func::FuncOp *)> filterFn
Options for BufferDeallocationOpInterface-based buffer deallocation.
Options for analysis-enabled bufferization.