/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Interface Declarations *| |* *| |* Automatically generated file, do not edit! *| |* *| \*===----------------------------------------------------------------------===*/ namespace mlir::bufferization { /// An op interface for the buffer view flow analysis. This interface describes /// buffer dependencies between operands and op results/region entry block /// arguments. class BufferViewFlowOpInterface; } // namespace mlir::bufferization namespace mlir::bufferization { /// An op interface for the buffer view flow analysis. This interface describes /// buffer dependencies between operands and op results/region entry block /// arguments. namespace detail { struct BufferViewFlowOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. void (*populateDependencies)(const Concept *impl, ::mlir::Operation *, ::mlir::bufferization::RegisterDependenciesFn); bool (*mayBeTerminalBuffer)(const Concept *impl, ::mlir::Operation *, Value); }; template class Model : public Concept { public: using Interface = ::mlir::bufferization::BufferViewFlowOpInterface; Model() : Concept{populateDependencies, mayBeTerminalBuffer} {} static inline void populateDependencies(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::bufferization::RegisterDependenciesFn registerDependenciesFn); static inline bool mayBeTerminalBuffer(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, Value value); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::bufferization::BufferViewFlowOpInterface; FallbackModel() : Concept{populateDependencies, mayBeTerminalBuffer} {} static inline void populateDependencies(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::bufferization::RegisterDependenciesFn registerDependenciesFn); static inline bool mayBeTerminalBuffer(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, Value value); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; bool mayBeTerminalBuffer(::mlir::Operation *tablegen_opaque_val, Value value) const; }; }; template struct BufferViewFlowOpInterfaceTrait; } // namespace detail class BufferViewFlowOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::BufferViewFlowOpInterfaceTrait {}; /// Populate buffer dependencies between operands and op results/region /// entry block arguments. /// /// Implementations should register dependencies between an operand ("X") /// and an op result/region entry block argument ("Y") if Y may depend /// on X. Y depends on X if Y and X are the same buffer or if Y is a /// subview of X. /// /// Example: /// ``` /// %r = arith.select %c, %m1, %m2 : memref<5xf32> /// ``` /// In the above example, %0 may depend on %m1 or %m2 and a correct /// interface implementation should call: /// - "registerDependenciesFn(%m1, %r)". /// - "registerDependenciesFn(%m2, %r)" void populateDependencies(::mlir::bufferization::RegisterDependenciesFn registerDependenciesFn); /// Return "true" if the given value may be a terminal buffer. A buffer /// value is "terminal" if it cannot be traced back any further in the /// buffer view flow analysis. /// /// Examples: A buffer could be terminal because: /// - it is a newly allocated buffer (e.g., "memref.alloc"), /// - or: because there is not enough compile-time information available /// to make a definite decision (e.g., "memref.realloc" may reallocate /// but we do not know for sure; another example are call ops where we /// would have to analyze the body of the callee). /// /// Implementations can assume that the given SSA value is an OpResult of /// this operation or a region entry block argument of this operation. bool mayBeTerminalBuffer(Value value); }; } // namespace mlir::bufferization namespace mlir::bufferization::detail { template struct BufferViewFlowOpInterfaceTrait : public ::mlir::OpInterface::Trait { /// Return "true" if the given value may be a terminal buffer. A buffer /// value is "terminal" if it cannot be traced back any further in the /// buffer view flow analysis. /// /// Examples: A buffer could be terminal because: /// - it is a newly allocated buffer (e.g., "memref.alloc"), /// - or: because there is not enough compile-time information available /// to make a definite decision (e.g., "memref.realloc" may reallocate /// but we do not know for sure; another example are call ops where we /// would have to analyze the body of the callee). /// /// Implementations can assume that the given SSA value is an OpResult of /// this operation or a region entry block argument of this operation. bool mayBeTerminalBuffer(Value value) { return false; } }; } // namespace mlir::bufferization::detail namespace mlir::bufferization { template void detail::BufferViewFlowOpInterfaceInterfaceTraits::Model::populateDependencies(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::bufferization::RegisterDependenciesFn registerDependenciesFn) { return (llvm::cast(tablegen_opaque_val)).populateDependencies(registerDependenciesFn); } template bool detail::BufferViewFlowOpInterfaceInterfaceTraits::Model::mayBeTerminalBuffer(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, Value value) { return (llvm::cast(tablegen_opaque_val)).mayBeTerminalBuffer(value); } template void detail::BufferViewFlowOpInterfaceInterfaceTraits::FallbackModel::populateDependencies(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::mlir::bufferization::RegisterDependenciesFn registerDependenciesFn) { return static_cast(impl)->populateDependencies(tablegen_opaque_val, registerDependenciesFn); } template bool detail::BufferViewFlowOpInterfaceInterfaceTraits::FallbackModel::mayBeTerminalBuffer(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, Value value) { return static_cast(impl)->mayBeTerminalBuffer(tablegen_opaque_val, value); } template bool detail::BufferViewFlowOpInterfaceInterfaceTraits::ExternalModel::mayBeTerminalBuffer(::mlir::Operation *tablegen_opaque_val, Value value) const { return false; } } // namespace mlir::bufferization