25#include "mlir/Dialect/MemRef/IR/MemRefOpsDialect.cpp.inc"
32struct MemRefInlinerInterface :
public DialectInlinerInterface {
33 using DialectInlinerInterface::DialectInlinerInterface;
35 IRMapping &valueMapping)
const final {
39 IRMapping &)
const final {
45void mlir::memref::MemRefDialect::initialize() {
48#include "mlir/Dialect/MemRef/IR/MemRefOps.cpp.inc"
50 addInterfaces<MemRefInlinerInterface>();
51 declarePromisedInterface<ConvertToEmitCPatternInterface, MemRefDialect>();
52 declarePromisedInterface<ConvertToLLVMPatternInterface, MemRefDialect>();
53 declarePromisedInterfaces<bufferization::AllocationOpInterface, AllocOp,
54 AllocaOp, ReallocOp>();
55 declarePromisedInterfaces<RuntimeVerifiableOpInterface, AssumeAlignmentOp,
56 AtomicRMWOp, CastOp, CopyOp, DimOp, ExpandShapeOp,
57 GenericAtomicRMWOp, LoadOp, StoreOp, SubViewOp>();
58 declarePromisedInterfaces<ValueBoundsOpInterface, AllocOp, AllocaOp, CastOp,
59 DimOp, GetGlobalOp, RankOp, SubViewOp>();
60 declarePromisedInterface<DestructurableTypeInterface, MemRefType>();
70 if (isa<memref::ReallocOp>(user))
static bool isLegalToInline(InlinerInterface &interface, Region *src, Region *insertRegion, bool shouldCloneInlinedRegion, IRMapping &valueMapping)
Utility to check that all of the operations within 'src' can be inlined.
Operation is the basic unit of execution within MLIR.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
user_range getUsers() const
std::optional< Operation * > findDealloc(Value allocValue)
Finds a single dealloc operation for the given allocated value.
Include the generated interface declarations.
bool hasEffect(Operation *op)
Returns "true" if op has an effect of type EffectTy.