MLIR  16.0.0git
Public Member Functions | Public Attributes | List of all members
mlir::bufferization::OneShotBufferizationOptions Struct Reference

Options for analysis-enabled bufferization. More...

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

+ Inheritance diagram for mlir::bufferization::OneShotBufferizationOptions:
+ Collaboration diagram for mlir::bufferization::OneShotBufferizationOptions:

Public Member Functions

 OneShotBufferizationOptions ()=default
 
- Public Member Functions inherited from mlir::bufferization::BufferizationOptions
 BufferizationOptions ()
 
BufferizableOpInterface dynCastBufferizableOp (Operation *op) const
 Try to cast the given op to BufferizableOpInterface if the op is allow listed. More...
 
BufferizableOpInterface dynCastBufferizableOp (Value value) const
 Try to cast the given value to BufferizableOpInterface if the op is allow listed. More...
 
bool isOpAllowed (Operation *op) const
 Return true if the given op should be bufferized. More...
 
FailureOr< ValuecreateAlloc (OpBuilder &b, Location loc, MemRefType type, ValueRange dynShape) const
 Create a memref allocation with the given type and dynamic extents. More...
 
LogicalResult createDealloc (OpBuilder &b, Location loc, Value allocatedBuffer) const
 Creates a memref deallocation. More...
 
LogicalResult createMemCpy (OpBuilder &b, Location loc, Value from, Value to) const
 Creates a memcpy between two given buffers. More...
 
void addDialectStateInitializer (StringRef name, const DialectStateInitFn &fn)
 Add a analysis state initializer that initializes the specified dialect-specific analysis state. More...
 

Public Attributes

bool allowReturnAllocs = false
 Specifies whether returning newly allocated memrefs should be allowed. More...
 
- Public Attributes inherited from mlir::bufferization::BufferizationOptions
OpFilter opFilter
 A filter that specifies which ops should be bufferized and which ops should be ignored. More...
 
Optional< AllocationFnallocationFn
 Helper functions for allocation, deallocation, memory copying. More...
 
Optional< DeallocationFndeallocationFn
 
Optional< MemCpyFnmemCpyFn
 
bool allowUnknownOps = false
 Specifies whether not bufferizable ops are allowed in the input. More...
 
bool bufferizeFunctionBoundaries = false
 Specifies whether function boundaries (ops in the func dialect) should be bufferized or not. More...
 
Optional< unsigneddefaultMemorySpace = 0
 The default memory space that should be used when it cannot be inferred from the context. More...
 
bool enforceAliasingInvariants = true
 Certain ops have aliasing OpOperand/OpResult invariants (e.g., scf.for). More...
 
LayoutMapOption functionBoundaryTypeConversion
 This flag controls buffer types on function signatures. More...
 
UnknownTypeConverterFn unknownTypeConverterFn = nullptr
 Type converter from tensors to memrefs. More...
 
bool createDeallocs = true
 Specifies whether dealloc ops should be generated along with alloc ops. More...
 
unsigned analysisFuzzerSeed = 0
 Seed for the analysis fuzzer. More...
 
bool testAnalysisOnly = false
 If set to true, does not modify the IR apart from adding attributes (for checking the results of the analysis) and post analysis steps. More...
 
bool printConflicts = false
 If set to true, the IR is annotated with details about RaW conflicts. More...
 
unsigned int bufferAlignment = 128
 Buffer alignment for new memory allocations. More...
 
SmallVector< AnalysisStateInitFnstateInitializers
 Initializer functions for analysis state. More...
 

Additional Inherited Members

- Public Types inherited from mlir::bufferization::BufferizationOptions
enum  LayoutMapOption : int8_t { LayoutMapOption::InferLayoutMap = 0, LayoutMapOption::IdentityLayoutMap = 1, LayoutMapOption::FullyDynamicLayoutMap = 2 }
 
using AllocationFn = std::function< FailureOr< Value >(OpBuilder &, Location, MemRefType, ValueRange, unsigned int)>
 Allocator function: Generate a memref allocation with the given type, dynamic extents and alignment. More...
 
using DeallocationFn = std::function< LogicalResult(OpBuilder &, Location, Value)>
 Deallocator function: Deallocate a buffer that was allocated with AllocatorFn. More...
 
using MemCpyFn = std::function< LogicalResult(OpBuilder &, Location, Value, Value)>
 Memcpy function: Generate a memcpy between two buffers. More...
 
using AnalysisStateInitFn = std::function< void(AnalysisState &)>
 Initializer function for analysis state. More...
 
using DialectStateInitFn = std::function< std::unique_ptr< DialectAnalysisState >()>
 Initializer function for dialect-specific analysis state. More...
 
using UnknownTypeConverterFn = std::function< BaseMemRefType(Value, unsigned, const BufferizationOptions &)>
 Tensor -> MemRef type converter. More...
 

Detailed Description

Options for analysis-enabled bufferization.

Definition at line 23 of file OneShotAnalysis.h.

Constructor & Destructor Documentation

◆ OneShotBufferizationOptions()

mlir::bufferization::OneShotBufferizationOptions::OneShotBufferizationOptions ( )
default

Member Data Documentation

◆ allowReturnAllocs

bool mlir::bufferization::OneShotBufferizationOptions::allowReturnAllocs = false

Specifies whether returning newly allocated memrefs should be allowed.

Otherwise, a pass failure is triggered.

Definition at line 28 of file OneShotAnalysis.h.

Referenced by mlir::bufferization::insertTensorCopies(), and mlir::bufferization::populateEliminateBufferizeMaterializationsPatterns().


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