[Mlir-commits] [mlir] [MLIR][Linalg] Fix crash on duplicate dimensions in linalg.broadcast (PR #211203)

Hugo Trachino llvmlistbot at llvm.org
Wed Jul 22 02:21:38 PDT 2026


================
@@ -599,6 +599,66 @@ func.func @broadcast_memref(%input: memref<8x32xf32>,
 
 // -----
 
+func.func @broadcast_0d_to_2d(%input: tensor<i32>,
+                              %init: tensor<32x2xi32>) -> tensor<32x2xi32> {
+  %bcast = linalg.broadcast
----------------
nujaa wrote:

Thanks for adding this **working** tests. A bit of context @banach-space , I messed up in the previous MR. It is not the 0-D input but that was not tolerated by broadcast but flattening which generated improper code. It would create a new the LinalgOp with all attributes (among others the dimensions attribute) which is incorrect in that case and failing at `verify`.  @bruteforceboy will come submit a solution soon.

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


More information about the Mlir-commits mailing list