MLIR
17.0.0git
|
Options for analysis-enabled bufferization. More...
#include "mlir/Dialect/Bufferization/Transforms/OneShotAnalysis.h"
Public Types | |
enum class | AnalysisHeuristic { BottomUp , TopDown } |
![]() | |
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 | FunctionArgTypeConverterFn = std::function< BaseMemRefType(TensorType, Attribute memorySpace, func::FuncOp, const BufferizationOptions &)> |
Tensor -> MemRef type converter. More... | |
using | UnknownTypeConverterFn = std::function< BaseMemRefType(Value, Attribute memorySpace, const BufferizationOptions &)> |
Tensor -> MemRef type converter. More... | |
Public Member Functions | |
OneShotBufferizationOptions ()=default | |
![]() | |
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< Value > | createAlloc (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 | setFunctionBoundaryTypeConversion (LayoutMapOption layoutMapOption) |
This function controls buffer types on function signatures. More... | |
Public Attributes | |
bool | allowReturnAllocs = false |
Specifies whether returning newly allocated memrefs should be allowed. More... | |
bool | dumpAliasSets = false |
Specifies whether the tensor IR should be annotated with alias sets. More... | |
AnalysisHeuristic | analysisHeuristic = AnalysisHeuristic::BottomUp |
The heuristic controls the order in which ops are traversed during the analysis. More... | |
llvm::ArrayRef< std::string > | noAnalysisFuncFilter |
Specify the functions that should not be analyzed. More... | |
![]() | |
OpFilter | opFilter |
A filter that specifies which ops should be bufferized and which ops should be ignored. More... | |
std::optional< AllocationFn > | allocationFn |
Helper functions for allocation, deallocation, memory copying. More... | |
std::optional< DeallocationFn > | deallocationFn |
std::optional< MemCpyFn > | memCpyFn |
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... | |
std::optional< Attribute > | defaultMemorySpace = Attribute() |
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... | |
FunctionArgTypeConverterFn | functionArgTypeConverterFn = nullptr |
Type converter from tensors to memrefs. More... | |
bool | inferFunctionResultLayout = true |
If true, function result types are inferred from the body of the function. 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 | copyBeforeWrite = false |
If set to true , the analysis is skipped. 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 = 64 |
Buffer alignment for new memory allocations. More... | |
SmallVector< AnalysisStateInitFn > | stateInitializers |
Initializer functions for analysis state. More... | |
Options for analysis-enabled bufferization.
Definition at line 26 of file OneShotAnalysis.h.
Enumerator | |
---|---|
BottomUp | |
TopDown |
Definition at line 27 of file OneShotAnalysis.h.
|
default |
bool mlir::bufferization::OneShotBufferizationOptions::allowReturnAllocs = false |
Specifies whether returning newly allocated memrefs should be allowed.
Otherwise, a pass failure is triggered.
Definition at line 33 of file OneShotAnalysis.h.
AnalysisHeuristic mlir::bufferization::OneShotBufferizationOptions::analysisHeuristic = AnalysisHeuristic::BottomUp |
The heuristic controls the order in which ops are traversed during the analysis.
Definition at line 40 of file OneShotAnalysis.h.
bool mlir::bufferization::OneShotBufferizationOptions::dumpAliasSets = false |
Specifies whether the tensor IR should be annotated with alias sets.
Definition at line 36 of file OneShotAnalysis.h.
llvm::ArrayRef<std::string> mlir::bufferization::OneShotBufferizationOptions::noAnalysisFuncFilter |
Specify the functions that should not be analyzed.
copyBeforeWrite will be set to true when bufferizing them.
Definition at line 44 of file OneShotAnalysis.h.