[Mlir-commits] [mlir] [mlir][vector] Disallow vector broadcast along scalable dim (PR #212197)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Tue Aug 4 02:26:39 PDT 2026
=?utf-8?q?Mattéo?= Rizza Murgier,=?utf-8?q?Mattéo?= Rizza Murgier
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/212197 at github.com>
================
@@ -254,6 +254,23 @@ func.func @broadcast_vec2d_from_vec1d_scalable_leading(%arg0: vector<2xf32>) ->
// -----
+// TODO: Add support for scalable vectors
+
+func.func @broadcast_vec2d_from_vec1d_scalable_inner(%arg0: vector<2xf32>) -> vector<3x[4]x2xf32> {
+ %0 = vector.broadcast %arg0 : vector<2xf32> to vector<3x[4]x2xf32>
+ return %0 : vector<3x[4]x2xf32>
+}
+// CHECK-LABEL: @broadcast_vec2d_from_vec1d_scalable_inner
+// CHECK-SAME: %[[A:.*]]: vector<2xf32>)
+// CHECK: %[[T0:.*]] = ub.poison : vector<3x[4]x2xf32>
+// CHECK: %[[T1:.*]] = vector.broadcast %[[A]] : vector<2xf32> to vector<[4]x2xf32>
+// CHECK: %[[T2:.*]] = vector.insert %[[T1]], %[[T0]] [0] : vector<[4]x2xf32> into vector<3x[4]x2xf32>
+// CHECK: %[[T3:.*]] = vector.insert %[[T1]], %[[T2]] [1] : vector<[4]x2xf32> into vector<3x[4]x2xf32>
+// CHECK: %[[T4:.*]] = vector.insert %[[T1]], %[[T3]] [2] : vector<[4]x2xf32> into vector<3x[4]x2xf32>
+// CHECK: return %[[T4]] : vector<3x[4]x2xf32>
+
+// -----
+
----------------
Brythzz wrote:
I feel like this example may be redundant due to the recursive nature of the pattern.
https://github.com/llvm/llvm-project/pull/212197
More information about the Mlir-commits
mailing list