[Mlir-commits] [mlir] [MLIR][Linalg] Add pass to convert linalg.generic back to named ops (PR #95656)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Wed Jun 19 01:41:18 PDT 2024
================
@@ -58,6 +68,176 @@ static bool areBinOpsSwapped(GenericOp genericOp) {
return swapped;
}
+//===----------------------------------------------------------------------===//
+// Specialize linalg generic to matmul variants.
+//===----------------------------------------------------------------------===//
+/// Identifies linalg.generic that is essentially named op of the form:
+// ` linalg.{batch_}?matmul{_transpose_a | _transpose_b}? `
+//
+// It is possible that a linalg.generic may be implementing one of matmul
+// variants but not in a straight-forward way, or the linalg.generic's
+// affine map per operand capture more semantics than is possible with
+// named op (which has implicit map interpreted via name).
+//
+// But a named linalg matmul variant that was 'generalized' should be
+// convertible back to named op here.
----------------
banach-space wrote:
Not sure what this comment is meant to add? Surely this ought to always hold (i.e. round-tripping ought to be always possible):
* linalg.generic (1) -> linalg.named_op -> linalg.generic (2)
Now, can we guarantee that (1) will always be identical to (2)?
https://github.com/llvm/llvm-project/pull/95656
More information about the Mlir-commits
mailing list