[Mlir-commits] [mlir] [mlir][vector] Constrain broadcast->shape_cast folding (PR #190230)

Andrzej WarzyƄski llvmlistbot at llvm.org
Tue Apr 7 04:29:38 PDT 2026


================
@@ -10,7 +10,12 @@ func.func @mmt4d_to_fma(%A: tensor<16x16x8x1xf32>, %B: tensor<16x16x8x1xf32>, %C
 
 
 // CHECK-LABEL:     @mmt4d_to_fma
-// CHECK-COUNT-8:         vector.fma
+// CHECK-NOT:         linalg.mmt4d
+// Lowering may produce vector.fma (outerproduct) or elementwise arith.mulf +
+// vector.reduction depending on vector.contract lowering; both are valid.
----------------
banach-space wrote:

Folks, the point of this test was to document a pipeline that lowers `linalg.mmt4d` to `vector.fma` and to demonstrate that that's possible. While there could be a better location for such a test, I have a kind request that we preserve it in some form :)

If it is no longer possible to lower from `linalg.mmt4d` to `vector.fma`, we should document that via e.g. a GitHub issue.

> (...) how to lower vector.multi_reduction op is the details of vector lowering, which should be tested in vector dialect instead.

That's a good point. If there are tests demonstrating the following:
* `linalg.mmt4d` --> `vector.multireduction` (yes, there is: [test](https://github.com/llvm/llvm-project/blob/8d7823ea8f40cf5df1c623018bf9c0a308fa4a36/mlir/test/Dialect/Linalg/vectorization/linalg-ops.mlir?plain=1#L849-L870))
* `vector.multireduction` -> `vector.fma` (couldn't find one),

then we are good.

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


More information about the Mlir-commits mailing list