|
MLIR 22.0.0git
|
This class represents the base of an operation interface. More...
#include "mlir/IR/OpDefinition.h"
Public Types | |
| using | Base = OpInterface<ConcreteType, Traits> |
| using | InterfaceBase |
| Public Types inherited from mlir::detail::Interface< ConcreteType, Operation *, Traits, Op< ConcreteType >, OpTrait::TraitBase > | |
| using | Concept |
| using | Model |
| using | FallbackModel |
| using | InterfaceBase |
| using | ExternalModel |
| using | ValueType |
| Public Types inherited from mlir::Op< ConcreteType, Traits > | |
| using | ConcreteOpType = ConcreteType |
| Expose the type we are instantiated on to template machinery that may want to introspect traits on this operation. | |
| template<typename T> | |
| using | InferredProperties = typename PropertiesSelector<T>::type |
Static Protected Member Functions | |
| static InterfaceBase::Concept * | getInterfaceFor (Operation *op) |
| Returns the impl interface instance for the given operation. | |
| Static Protected Member Functions inherited from mlir::OpState | |
| static ParseResult | parse (OpAsmParser &parser, OperationState &result) |
| Parse the custom form of an operation. | |
| static void | print (Operation *op, OpAsmPrinter &p, StringRef defaultDialect) |
| Print the operation. | |
| static ParseResult | genericParseProperties (OpAsmParser &parser, Attribute &result) |
| Parse properties as a Attribute. | |
| static void | genericPrintProperties (OpAsmPrinter &p, Attribute properties, ArrayRef< StringRef > elidedProps={}) |
| Print the properties as a Attribute with names not included within 'elidedProps'. | |
| static void | printOpName (Operation *op, OpAsmPrinter &p, StringRef defaultDialect) |
| Print an operation name, eliding the dialect prefix if necessary. | |
| static EmptyProperties & | getEmptyProperties () |
| For all op which don't have properties, we keep a single instance of EmptyProperties to be used where a reference to a properties is needed: this allow to bind a pointer to the reference without triggering UB. | |
Protected Attributes | |
| friend | InterfaceBase |
| Allow access to getInterfaceFor. | |
Additional Inherited Members | |
| Public Member Functions inherited from mlir::detail::Interface< ConcreteType, Operation *, Traits, Op< ConcreteType >, OpTrait::TraitBase > | |
| Interface (Operation *t=Operation *()) | |
| Construct an interface from an instance of the value type. | |
| Interface (std::nullptr_t) | |
| Interface (T t) | |
| Construct an interface instance from a type that implements this interface's trait. | |
| Interface (Operation *t, const Concept *conceptImpl) | |
| Constructor for a known concept. | |
| Interface (Operation *t, std::nullptr_t) | |
| Constructor for DenseMapInfo's empty key and tombstone key. | |
| Public Member Functions inherited from mlir::Op< ConcreteType, Traits > | |
| ConcreteType | clone () |
| Create a deep copy of this operation. | |
| ConcreteType | cloneWithoutRegions () |
| Create a partial copy of this operation without traversing into attached regions. | |
| Op () | |
| This is a public constructor. Any op can be initialized to null. | |
| Op (std::nullptr_t) | |
| Op (Operation *state) | |
| This is a public constructor to enable access via the llvm::cast family of methods. | |
| const void * | getAsOpaquePointer () const |
| Methods for supporting PointerLikeTypeTraits. | |
| template<typename T = ConcreteType> | |
| InferredProperties< T > & | getProperties () |
| Operation * | getOperation () |
| Inherit getOperation from OpState. | |
| LogicalResult | verify () |
| If the concrete type didn't implement a custom verifier hook, just fall back to this one which accepts everything. | |
| LogicalResult | verifyRegions () |
| Public Member Functions inherited from mlir::OpState | |
| operator bool () | |
| Ops are pointer-like, so we allow conversion to bool. | |
| operator Operation * () const | |
| This implicitly converts to Operation*. | |
| Operation * | operator-> () const |
| Shortcut of -> to access a member of Operation. | |
| Operation * | getOperation () |
| Return the operation that this refers to. | |
| MLIRContext * | getContext () |
| Return the context this operation belongs to. | |
| void | print (raw_ostream &os, OpPrintingFlags flags={}) |
| Print the operation to the given stream. | |
| void | print (raw_ostream &os, AsmState &asmState) |
| void | dump () |
| Dump this operation. | |
| Location | getLoc () |
| The source location the operation was defined or derived from. | |
| bool | use_empty () |
| Return true if there are no users of any results of this operation. | |
| void | erase () |
| Remove this operation from its parent block and delete it. | |
| InFlightDiagnostic | emitOpError (const Twine &message={}) |
| Emit an error with the op name prefixed, like "'dim' op " which is convenient for verifiers. | |
| InFlightDiagnostic | emitError (const Twine &message={}) |
| Emit an error about fatal conditions with this operation, reporting up to any diagnostic handlers that may be listening. | |
| InFlightDiagnostic | emitWarning (const Twine &message={}) |
| Emit a warning about this operation, reporting up to any diagnostic handlers that may be listening. | |
| InFlightDiagnostic | emitRemark (const Twine &message={}) |
| Emit a remark about this operation, reporting up to any diagnostic handlers that may be listening. | |
| template<WalkOrder Order = WalkOrder::PostOrder, typename Iterator = ForwardIterator, typename FnT, typename RetT = detail::walkResultType<FnT>> | |
| std::enable_if_t< llvm::function_traits< std::decay_t< FnT > >::num_args==1, RetT > | walk (FnT &&callback) |
| Walk the operation by calling the callback for each nested operation (including this one), block or region, depending on the callback provided. | |
| template<typename FnT, typename RetT = detail::walkResultType<FnT>> | |
| std::enable_if_t< llvm::function_traits< std::decay_t< FnT > >::num_args==2, RetT > | walk (FnT &&callback) |
| Generic walker with a stage aware callback. | |
| Static Public Member Functions inherited from mlir::detail::Interface< ConcreteType, Operation *, Traits, Op< ConcreteType >, OpTrait::TraitBase > | |
| static bool | classof (Operation *t) |
| Support 'classof' by checking if the given object defines the concrete interface. | |
| static TypeID | getInterfaceID () |
| Define an accessor for the ID of this interface. | |
| Static Public Member Functions inherited from mlir::Op< ConcreteType, Traits > | |
| template<template< typename T > class Trait> | |
| static constexpr bool | hasTrait () |
| Return if this operation contains the provided trait. | |
| static bool | classof (Operation *op) |
| Return true if this "op class" can match against the specified operation. | |
| template<typename T> | |
| static std::enable_if_t< std::is_base_of< OpState, T >::value, bool > | classof (const T *op) |
| Provide classof support for other OpBase derived classes, such as Interfaces. | |
| static ConcreteOpType | getFromOpaquePointer (const void *pointer) |
| template<typename... Models> | |
| static void | attachInterface (MLIRContext &context) |
| Attach the given models as implementations of the corresponding interfaces for the concrete operation. | |
| template<typename PropertiesTy> | |
| static LogicalResult | setPropertiesFromAttr (PropertiesTy &prop, Attribute attr, function_ref< InFlightDiagnostic()> emitError) |
| Convert the provided attribute to a property and assigned it to the provided properties. | |
| template<typename PropertiesTy> | |
| static Attribute | getPropertiesAsAttr (MLIRContext *ctx, const PropertiesTy &prop) |
| Convert the provided properties to an attribute. | |
| template<typename PropertiesTy> | |
| static llvm::hash_code | computePropertiesHash (const PropertiesTy &prop) |
| Hash the provided properties. | |
| static constexpr bool | hasProperties () |
| Returns true if this operation defines a Properties inner type. | |
| template<typename T = ConcreteType> | |
| static void | populateDefaultProperties (OperationName opName, InferredProperties< T > &properties) |
| This hook populates any unset default attrs when mapped to properties. | |
| template<typename T> | |
| static void | printProperties (MLIRContext *ctx, OpAsmPrinter &p, const T &properties, ArrayRef< StringRef > elidedProps={}) |
| Print the operation properties with names not included within 'elidedProps'. | |
| template<typename T = ConcreteType> | |
| static ParseResult | parseProperties (OpAsmParser &parser, OperationState &result) |
| Parses 'prop-dict' for the operation. | |
| Static Public Member Functions inherited from mlir::OpState | |
| static void | getCanonicalizationPatterns (RewritePatternSet &results, MLIRContext *context) |
| This hook returns any canonicalization pattern rewrites that the operation supports, for use by the canonicalization pass. | |
| static void | populateDefaultAttrs (const OperationName &, NamedAttrList &) |
| This hook populates any unset default attrs. | |
| Protected Member Functions inherited from mlir::detail::Interface< ConcreteType, Operation *, Traits, Op< ConcreteType >, OpTrait::TraitBase > | |
| const Concept * | getImpl () const |
| Get the raw concept in the correct derived concept type. | |
| Concept * | getImpl () |
| Protected Member Functions inherited from mlir::OpState | |
| LogicalResult | verify () |
| If the concrete type didn't implement a custom verifier hook, just fall back to this one which accepts everything. | |
| LogicalResult | verifyRegions () |
| OpState (Operation *state) | |
| Mutability management is handled by the OpWrapper/OpConstWrapper classes, so we can cast it away here. | |
This class represents the base of an operation interface.
See the definition of detail::Interface for requirements on the Traits type.
Definition at line 2085 of file OpDefinition.h.
| using mlir::OpInterface< ConcreteType, Traits >::Base = OpInterface<ConcreteType, Traits> |
Definition at line 2089 of file OpDefinition.h.
| using mlir::OpInterface< ConcreteType, Traits >::InterfaceBase |
Definition at line 2090 of file OpDefinition.h.
|
inlinestaticprotected |
Returns the impl interface instance for the given operation.
Definition at line 2098 of file OpDefinition.h.
References mlir::OperationName::getDialect(), mlir::Operation::getName(), mlir::OperationName::getRegisteredInfo(), mlir::OperationName::getTypeID(), and mlir::dialect_extension_detail::handleUseOfUndefinedPromisedInterface().
|
protected |
Allow access to getInterfaceFor.
Definition at line 2129 of file OpDefinition.h.