[mlir] [MLIR][Linalg] Introduce transpose/broadcast semantic to linalg.batch… (PR #130944)
Andrzej Warzyński
llvmlistbot at llvm.org
Wed Apr 23 00:52:27 PDT 2025
================
@@ -1637,6 +1637,171 @@ func.func @batch_matmul_bcast_A_transpose_B(%arg0: memref<3x5xf32>, %arg1: memre
// -----
+// CHECK: #[[$ATTR_0:.+]] = affine_map<(d0, d1, d2, d3) -> (d3)>
+// CHECK: #[[$ATTR_1:.+]] = affine_map<(d0, d1, d2, d3) -> (d0, d3, d2)>
+// CHECK: #[[$ATTR_2:.+]] = affine_map<(d0, d1, d2, d3) -> (d1, d2)>
+
+// CHECK-LABEL: func.func @batch_reduce_matmul_bcast_k_to_fill_missing_dims_A(
+// CHECK-SAME: %[[VAL_0:[0-9]+|[a-zA-Z$._-][a-zA-Z0-9$._-]*]]: memref<5xf32>,
+// CHECK-SAME: %[[VAL_1:[0-9]+|[a-zA-Z$._-][a-zA-Z0-9$._-]*]]: memref<2x5x7xf32>,
+// CHECK-SAME: %[[VAL_2:[0-9]+|[a-zA-Z$._-][a-zA-Z0-9$._-]*]]: memref<3x7xf32>) {
----------------
banach-space wrote:
These strict regex matchers `([0-9]+|[a-zA-Z$._-][a-zA-Z0-9$._-]*])` aren’t really required — they were only introduced relatively recently:
* https://github.com/llvm/llvm-project/pull/128083
I’ve proposed restoring the original default here:
* https://github.com/llvm/llvm-project/pull/136721
Also, could you reduce the indentation here and in the following tests? Some of these don’t fit on my screen when reviewing in “split” mode. I've just updated "generate-test-checks.py" to automate this:
* https://github.com/llvm/llvm-project/pull/136757
One other note: your LIT variables don’t match the MLIR variable names. You can control this via:
```bash
generate-test-checks.py --variable_names=ARG_0,ARG_1,ARG_2
```
Or even better, if you prefer cleaner names like A, B, C, you can run:
```bash
generate-test-checks.py --variable_names=A,B,C
```
:)
https://github.com/llvm/llvm-project/pull/130944
More information about the Mlir-commits
mailing list