[Mlir-commits] [mlir] [mlir][linalg] Morphism across linalg named, category and generic ops. (PR #148424)
Renato Golin
llvmlistbot at llvm.org
Wed Jul 23 07:39:02 PDT 2025
================
@@ -89,6 +89,44 @@ def LinalgInlineScalarOperandsPass : Pass<"linalg-inline-scalar-operands"> {
];
}
+def LinalgMorphOpsPass : Pass<"linalg-morph-ops"> {
+ let summary = "Convert named op to category ops or generic and vice-versa";
+
+ let description = [{
+ Convert a linalg op from one representation to another equivalent.
+ For example, a linalg named op `linalg.add` can also be written as an
+ category op `linalg.elementwise`, and can also be re-written as
+ a `linalg.generic`, giving the morphism:
+
+ named-op <--> category_op (elementwise, contraction, ..) <--> generic
+
+ Generic is a bigger set than named and category ops and so not all generics
+ can be converted to single category-op or named-op. Similarly, category
+ ops are bigger set than named ops.
+
+ Note:
+ Legacy converters (will be deprecated):
----------------
rengolin wrote:
We could have a `Deprecated<>` tag in TableGen and `[[deprecated]]` attributes in the previous passes' methods.
@kuhar
https://github.com/llvm/llvm-project/pull/148424
More information about the Mlir-commits
mailing list