[Mlir-commits] [mlir] [MLIR][Linalg][Docs] Add forms to Linalg	rationale docs (PR #156859)
    Renato Golin 
    llvmlistbot at llvm.org
       
    Thu Sep  4 05:50:17 PDT 2025
    
    
  
================
@@ -506,6 +520,65 @@ potential by introducing lower-level IR ops and *smaller* Linalg ops.
 This gradually reduces the potential, all the way to Loops + VectorOps
 and LLVMIR.
 
+### Interchangeability of Forms<a name="forms"></a>
+
+Linalg's various forms (named, generic) also carry information, and that
+information should be preserved as much as possible during the progressive
+lowering. A `matmul` operation is a special case of a `contract` operation,
+which in turn is a special case of `generic` operation. Transformations on
+the more special forms should not be converted to the more generic ones
+unnecessarily, in the same way that they should not be broken down into
+loops + arithmetic if they can still be represented as a Linalg op.
+
+#### Generic, Category, Named<a name="generic_category_named"></a>
+
+The core Linalg operation tree has three forms:
+* **Generic:** Represented by `linalg.generic` and can encode all perfectly-nested
+loop operations.
+* **Category:** Represented by `linalg.contract` and `linalg.elementwise`,
----------------
rengolin wrote:
I do make note that these are of the einsum variety below. I don't mind calling it directly if this is what people want.
https://github.com/llvm/llvm-project/pull/156859
    
    
More information about the Mlir-commits
mailing list