/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Interface Declarations *| |* *| |* Automatically generated file, do not edit! *| |* *| \*===----------------------------------------------------------------------===*/ namespace mlir::bufferization { /// This interface provides general allocation-related methods that are /// designed for allocation operations. For example, it offers the ability to /// construct associated deallocation and clone operations that are compatible /// with the current allocation operation. class AllocationOpInterface; } // namespace mlir::bufferization namespace mlir::bufferization { /// This interface provides general allocation-related methods that are /// designed for allocation operations. For example, it offers the ability to /// construct associated deallocation and clone operations that are compatible /// with the current allocation operation. namespace detail { struct AllocationOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. ::std::optional<::mlir::Operation*> (*buildDealloc)(::mlir::OpBuilder&, ::mlir::Value); ::std::optional<::mlir::Value> (*buildClone)(::mlir::OpBuilder&, ::mlir::Value); ::mlir::HoistingKind (*getHoistingKind)(); ::std::optional<::mlir::Operation*> (*buildPromotedAlloc)(::mlir::OpBuilder&, ::mlir::Value); }; template class Model : public Concept { public: using Interface = ::mlir::bufferization::AllocationOpInterface; Model() : Concept{buildDealloc, buildClone, getHoistingKind, buildPromotedAlloc} {} static inline ::std::optional<::mlir::Operation*> buildDealloc(::mlir::OpBuilder& builder, ::mlir::Value alloc); static inline ::std::optional<::mlir::Value> buildClone(::mlir::OpBuilder& builder, ::mlir::Value alloc); static inline ::mlir::HoistingKind getHoistingKind(); static inline ::std::optional<::mlir::Operation*> buildPromotedAlloc(::mlir::OpBuilder& builder, ::mlir::Value alloc); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::bufferization::AllocationOpInterface; FallbackModel() : Concept{buildDealloc, buildClone, getHoistingKind, buildPromotedAlloc} {} static inline ::std::optional<::mlir::Operation*> buildDealloc(::mlir::OpBuilder& builder, ::mlir::Value alloc); static inline ::std::optional<::mlir::Value> buildClone(::mlir::OpBuilder& builder, ::mlir::Value alloc); static inline ::mlir::HoistingKind getHoistingKind(); static inline ::std::optional<::mlir::Operation*> buildPromotedAlloc(::mlir::OpBuilder& builder, ::mlir::Value alloc); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; static ::std::optional<::mlir::Operation*> buildDealloc(::mlir::OpBuilder&builder, ::mlir::Value alloc); static ::std::optional<::mlir::Value> buildClone(::mlir::OpBuilder&builder, ::mlir::Value alloc); static ::mlir::HoistingKind getHoistingKind(); static ::std::optional<::mlir::Operation*> buildPromotedAlloc(::mlir::OpBuilder&builder, ::mlir::Value alloc); }; }; template struct AllocationOpInterfaceTrait; } // namespace detail class AllocationOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::AllocationOpInterfaceTrait {}; /// Builds a deallocation operation using the provided builder and the /// current allocation value (which refers to the current Op implementing /// this interface). The allocation value is a result of the current /// operation implementing this interface. If there is no compatible /// deallocation operation, this method can return ::std::nullopt. ::std::optional<::mlir::Operation*> buildDealloc(::mlir::OpBuilder& builder, ::mlir::Value alloc); /// Builds a clone operation using the provided builder and the current /// allocation value (which refers to the current Op implementing this /// interface). The allocation value is a result of the current operation /// implementing this interface. If there is no compatible clone operation, /// this method can return ::std::nullopt. ::std::optional<::mlir::Value> buildClone(::mlir::OpBuilder& builder, ::mlir::Value alloc); /// Returns the kind of hoisting supported for the buffer allocated by this /// operation. ::mlir::HoistingKind getHoistingKind(); /// Builds a stack allocation operation using the provided builder and the /// current allocation value (which refers to the current Op implementing this /// interface). The allocation value is a result of the current /// operation implementing this interface. If there is no compatible /// stack allocation operation, this method can return ::std::nullopt. ::std::optional<::mlir::Operation*> buildPromotedAlloc(::mlir::OpBuilder& builder, ::mlir::Value alloc); }; } // namespace mlir::bufferization namespace mlir::bufferization::detail { template struct AllocationOpInterfaceTrait : public ::mlir::OpInterface::Trait { /// Builds a deallocation operation using the provided builder and the /// current allocation value (which refers to the current Op implementing /// this interface). The allocation value is a result of the current /// operation implementing this interface. If there is no compatible /// deallocation operation, this method can return ::std::nullopt. static ::std::optional<::mlir::Operation*> buildDealloc(::mlir::OpBuilder& builder, ::mlir::Value alloc) { return std::nullopt; } /// Builds a clone operation using the provided builder and the current /// allocation value (which refers to the current Op implementing this /// interface). The allocation value is a result of the current operation /// implementing this interface. If there is no compatible clone operation, /// this method can return ::std::nullopt. static ::std::optional<::mlir::Value> buildClone(::mlir::OpBuilder& builder, ::mlir::Value alloc) { return std::nullopt; } /// Returns the kind of hoisting supported for the buffer allocated by this /// operation. static ::mlir::HoistingKind getHoistingKind() { return HoistingKind::None; } /// Builds a stack allocation operation using the provided builder and the /// current allocation value (which refers to the current Op implementing this /// interface). The allocation value is a result of the current /// operation implementing this interface. If there is no compatible /// stack allocation operation, this method can return ::std::nullopt. static ::std::optional<::mlir::Operation*> buildPromotedAlloc(::mlir::OpBuilder& builder, ::mlir::Value alloc) { return std::nullopt; } }; } // namespace mlir::bufferization::detail namespace mlir::bufferization { template ::std::optional<::mlir::Operation*> detail::AllocationOpInterfaceInterfaceTraits::Model::buildDealloc(::mlir::OpBuilder& builder, ::mlir::Value alloc) { return ConcreteOp::buildDealloc(builder, alloc); } template ::std::optional<::mlir::Value> detail::AllocationOpInterfaceInterfaceTraits::Model::buildClone(::mlir::OpBuilder& builder, ::mlir::Value alloc) { return ConcreteOp::buildClone(builder, alloc); } template ::mlir::HoistingKind detail::AllocationOpInterfaceInterfaceTraits::Model::getHoistingKind() { return ConcreteOp::getHoistingKind(); } template ::std::optional<::mlir::Operation*> detail::AllocationOpInterfaceInterfaceTraits::Model::buildPromotedAlloc(::mlir::OpBuilder& builder, ::mlir::Value alloc) { return ConcreteOp::buildPromotedAlloc(builder, alloc); } template ::std::optional<::mlir::Operation*> detail::AllocationOpInterfaceInterfaceTraits::FallbackModel::buildDealloc(::mlir::OpBuilder& builder, ::mlir::Value alloc) { return ConcreteOp::buildDealloc(builder, alloc); } template ::std::optional<::mlir::Value> detail::AllocationOpInterfaceInterfaceTraits::FallbackModel::buildClone(::mlir::OpBuilder& builder, ::mlir::Value alloc) { return ConcreteOp::buildClone(builder, alloc); } template ::mlir::HoistingKind detail::AllocationOpInterfaceInterfaceTraits::FallbackModel::getHoistingKind() { return ConcreteOp::getHoistingKind(); } template ::std::optional<::mlir::Operation*> detail::AllocationOpInterfaceInterfaceTraits::FallbackModel::buildPromotedAlloc(::mlir::OpBuilder& builder, ::mlir::Value alloc) { return ConcreteOp::buildPromotedAlloc(builder, alloc); } template ::std::optional<::mlir::Operation*> detail::AllocationOpInterfaceInterfaceTraits::ExternalModel::buildDealloc(::mlir::OpBuilder&builder, ::mlir::Value alloc) { return std::nullopt; } template ::std::optional<::mlir::Value> detail::AllocationOpInterfaceInterfaceTraits::ExternalModel::buildClone(::mlir::OpBuilder&builder, ::mlir::Value alloc) { return std::nullopt; } template ::mlir::HoistingKind detail::AllocationOpInterfaceInterfaceTraits::ExternalModel::getHoistingKind() { return HoistingKind::None; } template ::std::optional<::mlir::Operation*> detail::AllocationOpInterfaceInterfaceTraits::ExternalModel::buildPromotedAlloc(::mlir::OpBuilder&builder, ::mlir::Value alloc) { return std::nullopt; } } // namespace mlir::bufferization