[Mlir-commits] [mlir] [NFC][MLIR] Document better linalg morphism (PR #154313)

Renato Golin llvmlistbot at llvm.org
Tue Aug 19 08:50:11 PDT 2025


================
@@ -10,6 +10,84 @@
 #define MLIR_DIALECT_LINALG_PASSES
 
 include "mlir/Pass/PassBase.td"
+include "mlir/IR/Constraints.td"
+
+// ------------------ Begin of "form" conversions
+//
+// These conversions allow for the transformation of linalg ops between different forms.
+// Structured ops can be represented in different forms, such as named ops, category ops, and generic ops.
+//
+// The operation tree is as follows:
+//   generic     category      named
+//  ---------|-------------|----------
+//  generic ---> contract ----> matmul
+//           |              \-> batch_matmul
+//           |              \-> batch_reduce_matmul
+//           |              \-> ...
+//           \-> elementwise -> add
+//                          \-> sub
+//                          \-> ...
+//
+// Morphisms between representations can happen in the following 6 ways:
+//  generic <---> category <---> named
+//      \-------------------------/
+//
+// generic subsumes category which subsumes named.
----------------
rengolin wrote:

Ah, good point. I do mention structured above, but here I just say "named". I'll clarify.

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


More information about the Mlir-commits mailing list