[Mlir-commits] [mlir] [mlir] Add the concept of ASM dialect aliases (PR #86033)

Fabian Mora llvmlistbot at llvm.org
Thu Mar 28 09:22:04 PDT 2024


================
@@ -1715,7 +1715,10 @@ class OpAsmDialectInterface
     OverridableAlias,
     /// An alias was provided and it should be used
     /// (no other hooks will be checked).
-    FinalAlias
+    FinalAlias,
+    /// A dialect alias was provided and it will be used
+    /// (no other hooks will be checked).
+    DialectAlias
----------------
fabianmcg wrote:

`DialectAlias` is different from the `TypeAsmAliasTypeInterface`.
- With `DialectAlias` you can alias any type or attribute, however, the type might not always be printed using the alias.
- `TypeAsmAliasTypeInterface`, you can only alias objects that allow aliases. So it has more constraints in what it can do.

For example, with the first mechanism you can alias `IntegerType::get(2^exp)` to `p2_int<exp>`, and keep `i3` as `i3`, however the second mechanism allows aliasing the type to only one dialect (unless the type implements a specific alias rule).

https://github.com/llvm/llvm-project/pull/86033


More information about the Mlir-commits mailing list