[Mlir-commits] [mlir] [mlir][Vector] Fix vector.insert folder for scalar to 0-d inserts (PR #113828)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Sun Oct 27 13:20:52 PDT 2024
================
@@ -2745,6 +2745,18 @@ func.func @vector_insert_const_regression(%arg0: i8) -> vector<4xi8> {
// -----
+// CHECK-LABEL: func @insert_into_0d_regression(
+// CHECK-SAME: %[[v:.*]]: vector<f32>)
+// CHECK: %[[extract:.*]] = vector.insert %{{.*}}, %[[v]] [] : f32 into vector<f32>
+// CHECK: return %[[extract]]
+func.func @insert_into_0d_regression(%v: vector<f32>) -> vector<f32> {
+ %cst = arith.constant 0.000000e+00 : f32
+ %0 = vector.insert %cst, %v [] : f32 into vector<f32>
+ return %0 : vector<f32>
+}
----------------
banach-space wrote:
Could this be added near other tests for `vector::InsertOp::fold` so that all cases are clustered together? Then it will be much easier to see what's already tested and what isn't. And what cases are supported. Thanks!
Also, I'd avoid "regression" in test function names and instead use something that helps understand what the exercises corner case is - currently that's not clear. How about: `@insert_into_0d_ regression` -> `@insert_no_fold_type_mismatch`.
https://github.com/llvm/llvm-project/pull/113828
More information about the Mlir-commits
mailing list