MLIR
20.0.0git
|
The definition of a dynamic op. More...
#include "mlir/IR/ExtensibleDialect.h"
Public Types | |
using | GetCanonicalizationPatternsFn = llvm::unique_function< void(RewritePatternSet &, MLIRContext *) const > |
Static Public Member Functions | |
static std::unique_ptr< DynamicOpDefinition > | get (StringRef name, ExtensibleDialect *dialect, OperationName::VerifyInvariantsFn &&verifyFn, OperationName::VerifyRegionInvariantsFn &&verifyRegionFn) |
Create a new op at runtime. More... | |
static std::unique_ptr< DynamicOpDefinition > | get (StringRef name, ExtensibleDialect *dialect, OperationName::VerifyInvariantsFn &&verifyFn, OperationName::VerifyRegionInvariantsFn &&verifyRegionFn, OperationName::ParseAssemblyFn &&parseFn, OperationName::PrintAssemblyFn &&printFn) |
static std::unique_ptr< DynamicOpDefinition > | get (StringRef name, ExtensibleDialect *dialect, OperationName::VerifyInvariantsFn &&verifyFn, OperationName::VerifyRegionInvariantsFn &&verifyRegionFn, OperationName::ParseAssemblyFn &&parseFn, OperationName::PrintAssemblyFn &&printFn, OperationName::FoldHookFn &&foldHookFn, GetCanonicalizationPatternsFn &&getCanonicalizationPatternsFn, OperationName::PopulateDefaultAttrsFn &&populateDefaultAttrsFn) |
Additional Inherited Members | |
Protected Attributes inherited from mlir::OperationName::Impl | |
StringAttr | name |
The name of the operation. More... | |
TypeID | typeID |
The unique identifier of the derived Op class. More... | |
Dialect * | dialect |
The following fields are only populated when the operation is registered. More... | |
detail::InterfaceMap | interfaceMap |
A map of interfaces that were registered to this operation. More... | |
ArrayRef< StringAttr > | attributeNames |
A list of attribute names registered to this operation in StringAttr form. More... | |
The definition of a dynamic op.
A dynamic op is an op that is defined at runtime, and that can be registered at runtime by an extensible dialect (a dialect inheriting ExtensibleDialect). This class implements the method exposed by the OperationName class, and in addition defines the TypeID of the op that will be defined. Each dynamic operation definition refers to one instance of this class.
Definition at line 367 of file ExtensibleDialect.h.
using mlir::DynamicOpDefinition::GetCanonicalizationPatternsFn = llvm::unique_function<void(RewritePatternSet &, MLIRContext *) const> |
Definition at line 369 of file ExtensibleDialect.h.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 497 of file ExtensibleDialect.h.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 496 of file ExtensibleDialect.h.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 484 of file ExtensibleDialect.h.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 440 of file ExtensibleDialect.h.
Referenced by setFoldHookFn().
|
static |
Create a new op at runtime.
The op is registered only after passing it to the dialect using registerDynamicOp.
Definition at line 310 of file ExtensibleDialect.cpp.
References mlir::OperationName::Impl::dialect, mlir::AsmParser::emitError(), mlir::AsmParser::getCurrentLocation(), and mlir::OperationName::Impl::name.
Referenced by get(), and loadOperation().
|
static |
Definition at line 329 of file ExtensibleDialect.cpp.
References mlir::OperationName::Impl::dialect, get(), and mlir::OperationName::Impl::name.
|
static |
Definition at line 352 of file ExtensibleDialect.cpp.
References mlir::OperationName::Impl::dialect, and mlir::OperationName::Impl::name.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 444 of file ExtensibleDialect.h.
Referenced by setGetCanonicalizationPatternsFn().
|
inlinefinalvirtual |
Implementation for properties (unsupported right now here).
Implements mlir::OperationName::InterfaceConcept.
Definition at line 468 of file ExtensibleDialect.h.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 481 of file ExtensibleDialect.h.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 449 of file ExtensibleDialect.h.
Implements mlir::OperationName::InterfaceConcept.
Definition at line 495 of file ExtensibleDialect.h.
|
inline |
Returns the op typeID.
Definition at line 395 of file ExtensibleDialect.h.
References mlir::OperationName::Impl::typeID.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 498 of file ExtensibleDialect.h.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 448 of file ExtensibleDialect.h.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 482 of file ExtensibleDialect.h.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 454 of file ExtensibleDialect.h.
References mlir::OperationName::Impl::name.
Referenced by setPopulateDefaultAttrsFn().
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 485 of file ExtensibleDialect.h.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 475 of file ExtensibleDialect.h.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 458 of file ExtensibleDialect.h.
References mlir::OperationName::Impl::name.
|
inline |
Sets the hook implementing a generalized folder for the op.
See RegisteredOperationName::foldHook
for more details
Definition at line 423 of file ExtensibleDialect.h.
References foldHook().
|
inline |
Set the hook returning any canonicalization pattern rewrites that the op supports, for use by the canonicalization pass.
Definition at line 429 of file ExtensibleDialect.h.
References getCanonicalizationPatterns().
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 472 of file ExtensibleDialect.h.
|
inline |
Sets the static hook for parsing this op assembly.
Definition at line 412 of file ExtensibleDialect.h.
References mlir::query::parse().
|
inline |
Set the hook populating default attributes.
Definition at line 435 of file ExtensibleDialect.h.
References populateDefaultAttrs().
|
inline |
Sets the static hook for printing this op assembly.
Definition at line 417 of file ExtensibleDialect.h.
References print().
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 489 of file ExtensibleDialect.h.
References mlir::emitError().
|
inline |
Sets the verifier function for this operation.
It should emits an error message and returns failure if a problem is detected, or returns success if everything is ok.
Definition at line 400 of file ExtensibleDialect.h.
References mlir::verify().
|
inline |
Sets the region verifier function for this operation.
It should emits an error message and returns failure if a problem is detected, or returns success if everything is ok.
Definition at line 407 of file ExtensibleDialect.h.
References mlir::verify().
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 477 of file ExtensibleDialect.h.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 462 of file ExtensibleDialect.h.
|
inlinefinalvirtual |
Implements mlir::OperationName::InterfaceConcept.
Definition at line 463 of file ExtensibleDialect.h.