MLIR 24.0.0git
mlir::bufferization::func_ext Namespace Reference

Classes

struct  CallOpInterface
struct  FuncAnalysisState
 Extra analysis state that is required for bufferization of function boundaries. More...
struct  FuncOpInterface
struct  ReturnOpInterface

Enumerations

enum class  FuncOpAnalysisState { NotAnalyzed , InProgress , Analyzed }
 The state of analysis of a FuncOp. More...

Functions

void registerBufferizableOpInterfaceExternalModels (DialectRegistry &registry)
static FailureOr< Attribute > getFunctionResultMemorySpace (FuncOp funcOp, int64_t index, const BufferizationOptions &options)
 Return the memory space for the index-th function result.
static FailureOr< BufferLikeType > getBufferizedFunctionArgType (FuncOp funcOp, int64_t index, const BufferizationOptions &options)
 Return the index-th bufferized function argument type.
static FuncOp getCalledFunction (CallOpInterface callOp, SymbolTableCollection &symbolTables)
 Return the FuncOp called by callOp.
static FuncOp getCalledFunction (CallOpInterface callOp, const AnalysisState &state)
 Return the FuncOp called by callOp.
static const FuncAnalysisState & getFuncAnalysisState (const AnalysisState &state)
 Get FuncAnalysisState.
static FuncOpAnalysisState getFuncOpAnalysisState (const AnalysisState &state, FuncOp funcOp)
 Return the state (phase) of analysis of the FuncOp.
static std::optional< int64_t > getEquivalentFuncArgIdx (FuncOp funcOp, const FuncAnalysisState &state, int64_t returnValIdx)
 Return the index of the bbArg in the given FuncOp that is equivalent to the specified return value (if any).

Enumeration Type Documentation

◆ FuncOpAnalysisState

The state of analysis of a FuncOp.

Enumerator
NotAnalyzed 
InProgress 
Analyzed 

Definition at line 30 of file FuncBufferizableOpInterfaceImpl.h.

Function Documentation

◆ getBufferizedFunctionArgType()

FailureOr< BufferLikeType > mlir::bufferization::func_ext::getBufferizedFunctionArgType ( FuncOp funcOp,
int64_t index,
const BufferizationOptions & options )
static

Return the index-th bufferized function argument type.

This assumes that the specified argument is a tensor. If the tensor is ranked, a layout map may be specified by the user (as per options.functionArgTypeConverterFn). Emits an error on funcOp and returns failure if options.defaultMemorySpaceFn returns std::nullopt.

Definition at line 79 of file FuncBufferizableOpInterfaceImpl.cpp.

References options.

Referenced by mlir::bufferization::func_ext::FuncOpInterface::bufferize(), and mlir::bufferization::func_ext::FuncOpInterface::getBufferType().

◆ getCalledFunction() [1/2]

FuncOp mlir::bufferization::func_ext::getCalledFunction ( CallOpInterface callOp,
const AnalysisState & state )
static

Return the FuncOp called by callOp.

Definition at line 117 of file FuncBufferizableOpInterfaceImpl.cpp.

References getCalledFunction().

◆ getCalledFunction() [2/2]

◆ getEquivalentFuncArgIdx()

std::optional< int64_t > mlir::bufferization::func_ext::getEquivalentFuncArgIdx ( FuncOp funcOp,
const FuncAnalysisState & state,
int64_t returnValIdx )
static

Return the index of the bbArg in the given FuncOp that is equivalent to the specified return value (if any).

Definition at line 162 of file FuncBufferizableOpInterfaceImpl.cpp.

References mlir::bufferization::func_ext::FuncAnalysisState::equivalentFuncArgs.

Referenced by mlir::bufferization::func_ext::CallOpInterface::getAliasingValues().

◆ getFuncAnalysisState()

◆ getFuncOpAnalysisState()

◆ getFunctionResultMemorySpace()

FailureOr< Attribute > mlir::bufferization::func_ext::getFunctionResultMemorySpace ( FuncOp funcOp,
int64_t index,
const BufferizationOptions & options )
static

Return the memory space for the index-th function result.

Emits an error on funcOp and returns failure if options.defaultMemorySpaceFn returns std::nullopt.

Definition at line 60 of file FuncBufferizableOpInterfaceImpl.cpp.

References options.

Referenced by mlir::bufferization::func_ext::FuncOpInterface::bufferize(), and mlir::bufferization::func_ext::CallOpInterface::getBufferType().

◆ registerBufferizableOpInterfaceExternalModels()

void mlir::bufferization::func_ext::registerBufferizableOpInterfaceExternalModels ( DialectRegistry & registry)