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

Javed Absar llvmlistbot at llvm.org
Tue Aug 19 08:01:48 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.
----------------
javedabsar1 wrote:

softmax is not subsumed if we mean 1:1. You mentioned 'structured-ops' specifically above so then perhaps its ok.

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


More information about the Mlir-commits mailing list