/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Interface Declarations *| |* *| |* Automatically generated file, do not edit! *| |* *| \*===----------------------------------------------------------------------===*/ namespace mlir::acc { /// An interface for compute and loop construct operations. class ComputeRegionOpInterface; } // namespace mlir::acc namespace mlir::acc { /// An interface for operations that access a partial entity such as /// field or array element access. class PartialEntityAccessOpInterface; } // namespace mlir::acc namespace mlir::acc { /// An interface for operations that compute the address of a global variable /// or symbol. class AddressOfGlobalOpInterface; } // namespace mlir::acc namespace mlir::acc { /// An interface for operations that define global variables. This interface /// provides a uniform way to query properties of global variables across /// different dialects. class GlobalVariableOpInterface; } // namespace mlir::acc namespace mlir::acc { /// An interface for operations that indirectly access global symbols. /// This interface provides a way to query which global symbols are referenced /// by an operation, which is useful for tracking dependencies and performing /// analysis on global variable usage. /// /// The symbolTable parameter is optional. If null, implementations will look up /// their own symbol table. This allows callers to pass a pre-existing symbol /// table for efficiency when querying multiple operations. class IndirectGlobalAccessOpInterface; } // namespace mlir::acc namespace mlir::acc { /// An interface for operations that are candidates for rematerialization /// during outlining. These operations produce synthetic types or values /// that cannot be passed as arguments to outlined regions and must be /// rematerialized inside the region instead. /// /// Operations implementing this interface are expected to be memory effect /// free. Their results are typically used for type construction or providing /// metadata (such as shape information for arrays). /// /// `isRematerializationCandidate` refines whether a particular operation /// instance participates in rematerialization; `isa` /// requires both a registered model and this predicate. class OutlineRematerializationOpInterface; } // namespace mlir::acc namespace mlir::acc { /// An interface for operations whose regions are targets for offloading /// and outlining. Operations implementing this interface indicate that /// their regions will be extracted and compiled separately (e.g., as /// device kernels or outlined functions). class OffloadRegionOpInterface; } // namespace mlir::acc namespace mlir::acc { /// An interface for compute and loop construct operations. namespace detail { struct ComputeRegionOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. ::mlir::Block*(*getAllocaBlock)(const Concept *impl, ::mlir::Operation *); }; template class Model : public Concept { public: using Interface = ::mlir::acc::ComputeRegionOpInterface; Model() : Concept{getAllocaBlock} {} static inline ::mlir::Block*getAllocaBlock(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::acc::ComputeRegionOpInterface; FallbackModel() : Concept{getAllocaBlock} {} static inline ::mlir::Block*getAllocaBlock(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct ComputeRegionOpInterfaceTrait; } // namespace detail class ComputeRegionOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::ComputeRegionOpInterfaceTrait {}; /// Get alloca block ::mlir::Block*getAllocaBlock(); }; } // namespace mlir::acc namespace mlir::acc { /// An interface for operations that access a partial entity such as /// field or array element access. namespace detail { struct PartialEntityAccessOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. ::mlir::Value (*getBaseEntity)(const Concept *impl, ::mlir::Operation *); bool (*isCompleteView)(const Concept *impl, ::mlir::Operation *); }; template class Model : public Concept { public: using Interface = ::mlir::acc::PartialEntityAccessOpInterface; Model() : Concept{getBaseEntity, isCompleteView} {} static inline ::mlir::Value getBaseEntity(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline bool isCompleteView(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::acc::PartialEntityAccessOpInterface; FallbackModel() : Concept{getBaseEntity, isCompleteView} {} static inline ::mlir::Value getBaseEntity(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline bool isCompleteView(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct PartialEntityAccessOpInterfaceTrait; } // namespace detail class PartialEntityAccessOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::PartialEntityAccessOpInterfaceTrait {}; /// Get the base entity being accessed ::mlir::Value getBaseEntity(); /// Check if this is a complete view of the entity bool isCompleteView(); }; } // namespace mlir::acc namespace mlir::acc { /// An interface for operations that compute the address of a global variable /// or symbol. namespace detail { struct AddressOfGlobalOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. ::mlir::SymbolRefAttr (*getSymbol)(const Concept *impl, ::mlir::Operation *); }; template class Model : public Concept { public: using Interface = ::mlir::acc::AddressOfGlobalOpInterface; Model() : Concept{getSymbol} {} static inline ::mlir::SymbolRefAttr getSymbol(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::acc::AddressOfGlobalOpInterface; FallbackModel() : Concept{getSymbol} {} static inline ::mlir::SymbolRefAttr getSymbol(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct AddressOfGlobalOpInterfaceTrait; } // namespace detail class AddressOfGlobalOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::AddressOfGlobalOpInterfaceTrait {}; /// Get the symbol reference to the global ::mlir::SymbolRefAttr getSymbol(); }; } // namespace mlir::acc namespace mlir::acc { /// An interface for operations that define global variables. This interface /// provides a uniform way to query properties of global variables across /// different dialects. namespace detail { struct GlobalVariableOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. bool (*isConstant)(const Concept *impl, ::mlir::Operation *); ::mlir::Region*(*getInitRegion)(const Concept *impl, ::mlir::Operation *); bool (*isDeviceData)(const Concept *impl, ::mlir::Operation *); }; template class Model : public Concept { public: using Interface = ::mlir::acc::GlobalVariableOpInterface; Model() : Concept{isConstant, getInitRegion, isDeviceData} {} static inline bool isConstant(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline ::mlir::Region*getInitRegion(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline bool isDeviceData(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::acc::GlobalVariableOpInterface; FallbackModel() : Concept{isConstant, getInitRegion, isDeviceData} {} static inline bool isConstant(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline ::mlir::Region*getInitRegion(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline bool isDeviceData(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct GlobalVariableOpInterfaceTrait; } // namespace detail class GlobalVariableOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::GlobalVariableOpInterfaceTrait {}; /// Check if the global variable is constant bool isConstant(); /// Get the initialization region (returns nullptr if none) ::mlir::Region*getInitRegion(); /// Check if the global variable is device data bool isDeviceData(); }; } // namespace mlir::acc namespace mlir::acc { /// An interface for operations that indirectly access global symbols. /// This interface provides a way to query which global symbols are referenced /// by an operation, which is useful for tracking dependencies and performing /// analysis on global variable usage. /// /// The symbolTable parameter is optional. If null, implementations will look up /// their own symbol table. This allows callers to pass a pre-existing symbol /// table for efficiency when querying multiple operations. namespace detail { struct IndirectGlobalAccessOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. void (*getReferencedSymbols)(const Concept *impl, ::mlir::Operation *, ::llvm::SmallVectorImpl<::mlir::SymbolRefAttr>&, ::mlir::SymbolTable *); }; template class Model : public Concept { public: using Interface = ::mlir::acc::IndirectGlobalAccessOpInterface; Model() : Concept{getReferencedSymbols} {} static inline void getReferencedSymbols(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::SmallVectorImpl<::mlir::SymbolRefAttr>& symbols, ::mlir::SymbolTable * symbolTable); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::acc::IndirectGlobalAccessOpInterface; FallbackModel() : Concept{getReferencedSymbols} {} static inline void getReferencedSymbols(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::SmallVectorImpl<::mlir::SymbolRefAttr>& symbols, ::mlir::SymbolTable * symbolTable); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct IndirectGlobalAccessOpInterfaceTrait; } // namespace detail class IndirectGlobalAccessOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::IndirectGlobalAccessOpInterfaceTrait {}; /// Get the symbols referenced by this operation void getReferencedSymbols(::llvm::SmallVectorImpl<::mlir::SymbolRefAttr>& symbols, ::mlir::SymbolTable * symbolTable); }; } // namespace mlir::acc namespace mlir::acc { /// An interface for operations that are candidates for rematerialization /// during outlining. These operations produce synthetic types or values /// that cannot be passed as arguments to outlined regions and must be /// rematerialized inside the region instead. /// /// Operations implementing this interface are expected to be memory effect /// free. Their results are typically used for type construction or providing /// metadata (such as shape information for arrays). /// /// `isRematerializationCandidate` refines whether a particular operation /// instance participates in rematerialization; `isa` /// requires both a registered model and this predicate. namespace detail { struct OutlineRematerializationOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. bool (*isRematerializationCandidate)(const Concept *impl, ::mlir::Operation *); }; template class Model : public Concept { public: using Interface = ::mlir::acc::OutlineRematerializationOpInterface; Model() : Concept{isRematerializationCandidate} {} static inline bool isRematerializationCandidate(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::acc::OutlineRematerializationOpInterface; FallbackModel() : Concept{isRematerializationCandidate} {} static inline bool isRematerializationCandidate(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct OutlineRematerializationOpInterfaceTrait; } // namespace detail class OutlineRematerializationOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::OutlineRematerializationOpInterfaceTrait {}; /// Returns whether this operation instance should be treated as an outline rematerialization candidate. bool isRematerializationCandidate(); static bool classof(::mlir::Operation * base) { auto* interface = getInterfaceFor(base); if (!interface) return false; OutlineRematerializationOpInterface odsInterfaceInstance(base, interface); return odsInterfaceInstance.isRematerializationCandidate(); } }; } // namespace mlir::acc namespace mlir::acc { /// An interface for operations whose regions are targets for offloading /// and outlining. Operations implementing this interface indicate that /// their regions will be extracted and compiled separately (e.g., as /// device kernels or outlined functions). namespace detail { struct OffloadRegionOpInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. ::mlir::Region&(*getOffloadRegion)(const Concept *impl, ::mlir::Operation *); }; template class Model : public Concept { public: using Interface = ::mlir::acc::OffloadRegionOpInterface; Model() : Concept{getOffloadRegion} {} static inline ::mlir::Region&getOffloadRegion(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::acc::OffloadRegionOpInterface; FallbackModel() : Concept{getOffloadRegion} {} static inline ::mlir::Region&getOffloadRegion(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; }; }; template struct OffloadRegionOpInterfaceTrait; } // namespace detail class OffloadRegionOpInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::OffloadRegionOpInterfaceTrait {}; /// Get the offload region ::mlir::Region&getOffloadRegion(); }; } // namespace mlir::acc namespace mlir::acc::detail { template struct ComputeRegionOpInterfaceTrait : public ::mlir::OpInterface::Trait { }; } // namespace mlir::acc::detail namespace mlir::acc::detail { template struct PartialEntityAccessOpInterfaceTrait : public ::mlir::OpInterface::Trait { }; } // namespace mlir::acc::detail namespace mlir::acc::detail { template struct AddressOfGlobalOpInterfaceTrait : public ::mlir::OpInterface::Trait { }; } // namespace mlir::acc::detail namespace mlir::acc::detail { template struct GlobalVariableOpInterfaceTrait : public ::mlir::OpInterface::Trait { }; } // namespace mlir::acc::detail namespace mlir::acc::detail { template struct IndirectGlobalAccessOpInterfaceTrait : public ::mlir::OpInterface::Trait { }; } // namespace mlir::acc::detail namespace mlir::acc::detail { template struct OutlineRematerializationOpInterfaceTrait : public ::mlir::OpInterface::Trait { static ::llvm::LogicalResult verifyTrait(::mlir::Operation *op) { if (!::mlir::isMemoryEffectFree(op)) return op->emitOpError("must be memory effect free"); return ::mlir::success(); } }; } // namespace mlir::acc::detail namespace mlir::acc::detail { template struct OffloadRegionOpInterfaceTrait : public ::mlir::OpInterface::Trait { }; } // namespace mlir::acc::detail namespace mlir::acc { template ::mlir::Block*detail::ComputeRegionOpInterfaceInterfaceTraits::Model::getAllocaBlock(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return &(llvm::cast(tablegen_opaque_val)).getRegion().front(); } template ::mlir::Block*detail::ComputeRegionOpInterfaceInterfaceTraits::FallbackModel::getAllocaBlock(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getAllocaBlock(tablegen_opaque_val); } } // namespace mlir::acc namespace mlir::acc { template ::mlir::Value detail::PartialEntityAccessOpInterfaceInterfaceTraits::Model::getBaseEntity(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getBaseEntity(); } template bool detail::PartialEntityAccessOpInterfaceInterfaceTraits::Model::isCompleteView(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return false; } template ::mlir::Value detail::PartialEntityAccessOpInterfaceInterfaceTraits::FallbackModel::getBaseEntity(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getBaseEntity(tablegen_opaque_val); } template bool detail::PartialEntityAccessOpInterfaceInterfaceTraits::FallbackModel::isCompleteView(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->isCompleteView(tablegen_opaque_val); } } // namespace mlir::acc namespace mlir::acc { template ::mlir::SymbolRefAttr detail::AddressOfGlobalOpInterfaceInterfaceTraits::Model::getSymbol(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getSymbol(); } template ::mlir::SymbolRefAttr detail::AddressOfGlobalOpInterfaceInterfaceTraits::FallbackModel::getSymbol(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getSymbol(tablegen_opaque_val); } } // namespace mlir::acc namespace mlir::acc { template bool detail::GlobalVariableOpInterfaceInterfaceTraits::Model::isConstant(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return false; } template ::mlir::Region*detail::GlobalVariableOpInterfaceInterfaceTraits::Model::getInitRegion(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getInitRegion(); } template bool detail::GlobalVariableOpInterfaceInterfaceTraits::Model::isDeviceData(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return false; } template bool detail::GlobalVariableOpInterfaceInterfaceTraits::FallbackModel::isConstant(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->isConstant(tablegen_opaque_val); } template ::mlir::Region*detail::GlobalVariableOpInterfaceInterfaceTraits::FallbackModel::getInitRegion(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getInitRegion(tablegen_opaque_val); } template bool detail::GlobalVariableOpInterfaceInterfaceTraits::FallbackModel::isDeviceData(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->isDeviceData(tablegen_opaque_val); } } // namespace mlir::acc namespace mlir::acc { template void detail::IndirectGlobalAccessOpInterfaceInterfaceTraits::Model::getReferencedSymbols(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::SmallVectorImpl<::mlir::SymbolRefAttr>& symbols, ::mlir::SymbolTable * symbolTable) { return (llvm::cast(tablegen_opaque_val)).getReferencedSymbols(symbols, symbolTable); } template void detail::IndirectGlobalAccessOpInterfaceInterfaceTraits::FallbackModel::getReferencedSymbols(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, ::llvm::SmallVectorImpl<::mlir::SymbolRefAttr>& symbols, ::mlir::SymbolTable * symbolTable) { return static_cast(impl)->getReferencedSymbols(tablegen_opaque_val, symbols, symbolTable); } } // namespace mlir::acc namespace mlir::acc { template bool detail::OutlineRematerializationOpInterfaceInterfaceTraits::Model::isRematerializationCandidate(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return true; } template bool detail::OutlineRematerializationOpInterfaceInterfaceTraits::FallbackModel::isRematerializationCandidate(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->isRematerializationCandidate(tablegen_opaque_val); } } // namespace mlir::acc namespace mlir::acc { template ::mlir::Region&detail::OffloadRegionOpInterfaceInterfaceTraits::Model::getOffloadRegion(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getRegion(); } template ::mlir::Region&detail::OffloadRegionOpInterfaceInterfaceTraits::FallbackModel::getOffloadRegion(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getOffloadRegion(tablegen_opaque_val); } } // namespace mlir::acc