MLIR  20.0.0git
Public Types | 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:

Public Types

enum class  AnalysisHeuristic { BottomUp , TopDown , BottomUpFromTerminators , Fuzzer }
 
- Public Types inherited from mlir::bufferization::BufferizationOptions
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 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, FunctionOpInterface, const BufferizationOptions &)>
 Tensor -> MemRef type converter. More...
 
using UnknownTypeConverterFn = std::function< BaseMemRefType(Value, Attribute memorySpace, const BufferizationOptions &)>
 Tensor -> MemRef type converter. More...
 
using DefaultMemorySpaceFn = std::function< std::optional< Attribute >(TensorType t)>
 

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 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 allowReturnAllocsFromLoops = false
 Specifies whether returning newly allocated memrefs from loops 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...
 
unsigned analysisFuzzerSeed = 0
 Seed for the analysis fuzzer. 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...
 
std::optional< AllocationFnallocationFn
 Helper functions for allocation and memory copying. More...
 
std::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...
 
bool checkParallelRegions = true
 
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...
 
DefaultMemorySpaceFn defaultMemorySpaceFn
 
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< AnalysisStateInitFnstateInitializers
 Initializer functions for analysis state. More...
 

Detailed Description

Options for analysis-enabled bufferization.

Definition at line 26 of file OneShotAnalysis.h.

Member Enumeration Documentation

◆ AnalysisHeuristic

Enumerator
BottomUp 
TopDown 
BottomUpFromTerminators 
Fuzzer 

Definition at line 27 of file OneShotAnalysis.h.

Constructor & Destructor Documentation

◆ OneShotBufferizationOptions()

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

Member Data Documentation

◆ allowReturnAllocsFromLoops

bool mlir::bufferization::OneShotBufferizationOptions::allowReturnAllocsFromLoops = false

Specifies whether returning newly allocated memrefs from loops should be allowed.

Otherwise, a pass failure is triggered.

Definition at line 38 of file OneShotAnalysis.h.

◆ analysisFuzzerSeed

unsigned mlir::bufferization::OneShotBufferizationOptions::analysisFuzzerSeed = 0

Seed for the analysis fuzzer.

Used only if the heuristic is set to AnalysisHeuristic::Fuzzer. The fuzzer should be used only with testAnalysisOnly = true.

Definition at line 54 of file OneShotAnalysis.h.

◆ analysisHeuristic

AnalysisHeuristic mlir::bufferization::OneShotBufferizationOptions::analysisHeuristic = AnalysisHeuristic::BottomUp

The heuristic controls the order in which ops are traversed during the analysis.

Definition at line 45 of file OneShotAnalysis.h.

◆ dumpAliasSets

bool mlir::bufferization::OneShotBufferizationOptions::dumpAliasSets = false

Specifies whether the tensor IR should be annotated with alias sets.

Definition at line 41 of file OneShotAnalysis.h.

◆ noAnalysisFuncFilter

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 49 of file OneShotAnalysis.h.


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