[Mlir-commits] [mlir] [mlir][vector][wip] Add more tests for ConvertVectorToLLVM (6/n) (PR #111121)
Hugo Trachino
llvmlistbot at llvm.org
Fri Oct 4 03:02:50 PDT 2024
================
@@ -1903,26 +1938,31 @@ func.func @insert_strided_slice3(%arg0: vector<2x4xf32>, %arg1: vector<16x4x8xf3
// CHECK: %[[R8_3:.*]] = llvm.shufflevector %[[R8_2]], %[[V4_0_1]] [8, 9, 0, 1, 2, 3, 14, 15] : vector<8xf32>
// CHECK: llvm.insertvalue %[[R8_3]], {{.*}}[1] : !llvm.array<4 x vector<8xf32>>
-// -----
+// NOTE: For scalable dimensions, the corresponding "base" size must match
+// (i.e. we can only insert "full" scalable dimensions, e.g. [4] into [4], but
+// not [4] from [8]).
-func.func @insert_strided_slice_scalable(%arg0 : vector<1x1x[4]xi32>, %arg1: vector<1x4x[4]xi32>) -> vector<1x4x[4]xi32> {
- %0 = vector.insert_strided_slice %arg0, %arg1 {offsets = [0, 3, 0], strides = [1, 1, 1]} : vector<1x1x[4]xi32> into vector<1x4x[4]xi32>
- return %0 : vector<1x4x[4]xi32>
+func.func @insert_strided_slice_f32_2d_into_3d_scalable(%arg0: vector<2x[4]xf32>, %arg1: vector<16x4x[4]xf32>) -> vector<16x4x[4]xf32> {
+ %0 = vector.insert_strided_slice %arg0, %arg1 {offsets = [3, 2, 0], strides = [1, 1]}:
+ vector<2x[4]xf32> into vector<16x4x[4]xf32>
+ return %0 : vector<16x4x[4]xf32>
}
-// CHECK-LABEL: func.func @insert_strided_slice_scalable(
-// CHECK-SAME: %[[ARG_0:.*]]: vector<1x1x[4]xi32>,
-// CHECK-SAME: %[[ARG_1:.*]]: vector<1x4x[4]xi32>) -> vector<1x4x[4]xi32> {
-// CHECK-DAG: %[[CAST_1:.*]] = builtin.unrealized_conversion_cast %[[ARG_0]] : vector<1x1x[4]xi32> to !llvm.array<1 x array<1 x vector<[4]xi32>>>
-// CHECK-DAG: %[[CAST_2:.*]] = builtin.unrealized_conversion_cast %[[ARG_1]] : vector<1x4x[4]xi32> to !llvm.array<1 x array<4 x vector<[4]xi32>>>
+// CHECK-LABEL: func.func @insert_strided_slice_f32_2d_into_3d_scalable(
+
+// Subvector vector4x[4]xf32> from vector<16x4x[4]xf32> @3
----------------
nujaa wrote:
I am not sure about those subvector* lines. Are these supposed to be CHECKs ?
And a tiny NIT
```suggestion
// Subvector vector<4x[4]xf32> from vector<16x4x[4]xf32> @3
```
https://github.com/llvm/llvm-project/pull/111121
More information about the Mlir-commits
mailing list