[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
+ ins(%input:tensor<i32>)
+ outs(%init:tensor<32x2xi32>)
+ dimensions = [0, 1]
+ func.return %bcast : tensor<32x2xi32>
+}
+// CHECK-LABEL: func @broadcast_0d_to_2d
+// CHECK: linalg.broadcast ins(%{{.*}} : tensor<i32>)
+// CHECK-SAME: outs(%{{.*}} : tensor<32x2xi32>)
+// CHECK-SAME: dimensions = [0, 1]
+
+// -----
+
+func.func @broadcast_0d_to_1d(%input: tensor<f32>,
----------------
nujaa wrote:
could we have an example with `%input: f32` (not a tensor)
https://github.com/llvm/llvm-project/pull/211203
More information about the Mlir-commits
mailing list