[Mlir-commits] [mlir] [mlir][Vector] Fix vector.insert folder for scalar to 0-d inserts (PR #113828)
Kunwar Grover
llvmlistbot at llvm.org
Mon Oct 28 08:06:24 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>
+}
----------------
Groverkss wrote:
- Renamed extract_from_0d_regression -> extract_no_fold_scalar_to_0d
- Added insert folder tests: insert_fold_same_rank, insert_no_fold_scalar_to_0d
- Moved insert tests right after extract folding tests
Let me know if i missed something :)
https://github.com/llvm/llvm-project/pull/113828
More information about the Mlir-commits
mailing list