Lines Matching defs:Dialect
20 ## Defining a Dialect
24 [C++ `Dialect` class](https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/IR/Dialect.h).
37 Below showcases an example simple Dialect definition. We generally recommend defining
38 the Dialect class in a different `.td` file from the attributes, operations, types,
50 def MyDialect : Dialect {
79 // Dialect initialization logic should be defined in here.
142 dialect. Dialect dependencies can be recorded using the `dependentDialects` dialects field:
145 def MyDialect : Dialect {
156 The declarative Dialect definitions try to auto-generate as much logic and methods
159 field will be copied literally to the generated C++ Dialect class.
193 This field should be used when the Dialect class has a custom destructor, i.e.
195 only the declaration of the destructor is generated for the Dialect class.
205 by our dialect, several hooks on the Dialect may be used:
278 `Dialect::parseAttribute`/`Dialect::printAttribute` or
279 `Dialect::parseType`/`Dialect::printType` methods. In these cases, the dialect must
287 ### Dialect-wide Canonicalization Patterns
393 #include "mlir/Dialect/Foo/FooDialectBytecode.cpp.inc"
396 FooDialectBytecodeInterface(Dialect *dialect)
438 runtime by inheriting from `mlir::ExtensibleDialect` instead of `mlir::Dialect`
439 (note that `ExtensibleDialect` inherits from `Dialect`). The `ExtensibleDialect`
453 def Test_Dialect : Dialect {
459 An extensible `Dialect` can be casted back to `ExtensibleDialect` using
489 Dialect *dialect = ctx->getOrLoadDialect("dialectName");
505 Dialect* dialect = ctx->getOrLoadDialect<MyDialect>();
554 Note that the `Dialect` given to the operation should be the one registering
595 Dialect* dialect = ctx->getOrLoadDialect<MyDialect>();
694 Dialect* dialect = ctx->getOrLoadDialect<MyDialect>();
783 In order to cast a `Dialect` back to an `ExtensibleDialect`, we implement the
785 by checking if the `Dialect` implements `IsExtensibleDialect` or not.
806 Types are registered using the `Dialect::addType` method, which expect a
814 `Dialect`, all `DynamicType` define a `IsDynamicTypeTrait`, so casting a `Type`