MLIR  22.0.0git
Functions
mlir::bufferization::detail Namespace Reference

Functions

AliasingOpOperandList defaultGetAliasingOpOperands (Value value, const AnalysisState &state)
 This is the default implementation of BufferizableOpInterface::getAliasingOpOperands. More...
 
FailureOr< BufferLikeType > defaultGetBufferType (Value value, const BufferizationOptions &options, const BufferizationState &state, SmallVector< Value > &invocationStack)
 This is the default implementation of BufferizableOpInterface::getBufferType. More...
 
bool defaultResultBufferizesToMemoryWrite (OpResult opResult, const AnalysisState &state)
 This is the default implementation of BufferizableOpInterface::resultBufferizesToMemoryWrite. More...
 
bool defaultIsRepetitiveRegion (BufferizableOpInterface bufferizableOp, unsigned index)
 This is the default implementation of BufferizableOpInterface::isRepetitiveRegion. More...
 
AliasingOpOperandList unknownGetAliasingOpOperands (Value value)
 This is the default implementation of getAliasingOpOperands in case the defining op does not implement the BufferizableOpInterface. More...
 
AliasingValueList unknownGetAliasingValues (OpOperand &opOperand)
 This is the default implementation of getAliasingValues in case the owner op does not implement the BufferizableOpInterface. More...
 
bool defaultHasTensorSemantics (Operation *op)
 This is the default implementation of BufferizableOpInterface::hasTensorSemantics. More...
 
FailureOr< BaseMemRefTypeasMemRefType (FailureOr< BufferLikeType > bufferType)
 This is a helper function used when buffer type is guaranteed to be memref. More...
 
bool typesMatchAfterBufferization (Operation &op, Value tensor, Value buffer)
 This function is a free-standing helper that relies on bufferization::TensorLikeTypeInterface to verify the types in tensor and buffer worlds match. More...
 
SmallVector< OpOperand * > getCallerOpOperands (BlockArgument bbArg)
 Return a list of operands that are forwarded to the given block argument. More...
 

Function Documentation

◆ asMemRefType()

FailureOr< BaseMemRefType > mlir::bufferization::detail::asMemRefType ( FailureOr< BufferLikeType >  bufferType)

This is a helper function used when buffer type is guaranteed to be memref.

It performs two actions: failure state checking and an explicit llvm::cast<> from the buffer-like type interface to a BaseMemRefType. This allows easier management of differences in C++ types at the API boundaries. Valid buffer type is casted to the memref type. Otherwise, the failure state is propagated i.e. asMemRefType(mlir::failure()) returns mlir::failure().

Definition at line 1052 of file BufferizableOpInterface.cpp.

◆ defaultGetAliasingOpOperands()

AliasingOpOperandList mlir::bufferization::detail::defaultGetAliasingOpOperands ( Value  value,
const AnalysisState state 
)

This is the default implementation of BufferizableOpInterface::getAliasingOpOperands.

Should not be called from other places.

Definition at line 935 of file BufferizableOpInterface.cpp.

◆ defaultGetBufferType()

FailureOr< BufferLikeType > mlir::bufferization::detail::defaultGetBufferType ( Value  value,
const BufferizationOptions options,
const BufferizationState state,
SmallVector< Value > &  invocationStack 
)

◆ defaultHasTensorSemantics()

bool mlir::bufferization::detail::defaultHasTensorSemantics ( Operation op)

This is the default implementation of BufferizableOpInterface::hasTensorSemantics.

Definition at line 1034 of file BufferizableOpInterface.cpp.

References mlir::Operation::getRegions(), and isaTensor().

Referenced by mlir::bufferization::hasTensorSemantics().

◆ defaultIsRepetitiveRegion()

bool mlir::bufferization::detail::defaultIsRepetitiveRegion ( BufferizableOpInterface  bufferizableOp,
unsigned  index 
)

This is the default implementation of BufferizableOpInterface::isRepetitiveRegion.

Should not be called from other places.

Definition at line 988 of file BufferizableOpInterface.cpp.

◆ defaultResultBufferizesToMemoryWrite()

bool mlir::bufferization::detail::defaultResultBufferizesToMemoryWrite ( OpResult  opResult,
const AnalysisState state 
)

This is the default implementation of BufferizableOpInterface::resultBufferizesToMemoryWrite.

Should not be called from other places.

Definition at line 868 of file BufferizableOpInterface.cpp.

◆ getCallerOpOperands()

SmallVector< OpOperand * > mlir::bufferization::detail::getCallerOpOperands ( BlockArgument  bbArg)

Return a list of operands that are forwarded to the given block argument.

I.e., find all predecessors of the block argument's owner and gather the operands that are equivalent to the block argument.

Definition at line 14 of file UnstructuredControlFlow.cpp.

References mlir::BlockArgument::getArgNumber(), mlir::OperandRange::getBeginOperandIndex(), mlir::SuccessorOperands::getForwardedOperands(), mlir::BlockArgument::getOwner(), mlir::SuccessorOperands::getProducedOperandCount(), and mlir::IRObjectWithUseList< OperandType >::getUsers().

◆ typesMatchAfterBufferization()

bool mlir::bufferization::detail::typesMatchAfterBufferization ( Operation op,
Value  tensor,
Value  buffer 
)

This function is a free-standing helper that relies on bufferization::TensorLikeTypeInterface to verify the types in tensor and buffer worlds match.

Definition at line 1058 of file BufferizableOpInterface.cpp.

References mlir::Value::getType().

◆ unknownGetAliasingOpOperands()

AliasingOpOperandList mlir::bufferization::detail::unknownGetAliasingOpOperands ( Value  value)

This is the default implementation of getAliasingOpOperands in case the defining op does not implement the BufferizableOpInterface.

Definition at line 999 of file BufferizableOpInterface.cpp.

References mlir::bufferization::AliasList< T >::addAlias(), mlir::Value::getDefiningOp(), mlir::Operation::getOpOperands(), and mlir::bufferization::Unknown.

Referenced by mlir::bufferization::AnalysisState::getAliasingOpOperands().

◆ unknownGetAliasingValues()

AliasingValueList mlir::bufferization::detail::unknownGetAliasingValues ( OpOperand opOperand)

This is the default implementation of getAliasingValues in case the owner op does not implement the BufferizableOpInterface.

Definition at line 1017 of file BufferizableOpInterface.cpp.

References mlir::bufferization::AliasList< T >::addAlias(), mlir::Operation::getOpResults(), mlir::detail::IROperandBase::getOwner(), mlir::Operation::getRegions(), and mlir::bufferization::Unknown.

Referenced by mlir::bufferization::AnalysisState::getAliasingValues().