Skip to content

Commit 82cbb02

Browse files
[mlir][vector][NFC] Fix typos in tests (llvm#126662)
[mlir][vector] Fix typos in tests (nfc) Fix typos in `{insert|extract}_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_constant` - the intention was to use `f32` rather than `i32`.
1 parent f15a6c9 commit 82cbb02

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -530,22 +530,22 @@ func.func @extract_scalar_from_vec_0d_index(%arg0: vector<index>) -> index {
530530

531531
// -----
532532

533-
func.func @extract_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_const(%arg : vector<32x1xi32>) -> i32 {
533+
func.func @extract_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_const(%arg : vector<32x1xf32>) -> f32 {
534534
%0 = arith.constant 0 : index
535-
%1 = vector.extract %arg[%0, %0] : i32 from vector<32x1xi32>
536-
return %1 : i32
535+
%1 = vector.extract %arg[%0, %0] : f32 from vector<32x1xf32>
536+
return %1 : f32
537537
}
538538

539539
// At compile time, since the indices of extractOp are constants,
540540
// they will be collapsed and folded away; therefore, the lowering works.
541541

542542
// CHECK-LABEL: @extract_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_const
543-
// CHECK-SAME: %[[ARG:.*]]: vector<32x1xi32>) -> i32 {
544-
// CHECK: %[[CAST:.*]] = builtin.unrealized_conversion_cast %[[ARG]] : vector<32x1xi32> to !llvm.array<32 x vector<1xi32>>
545-
// CHECK: %[[VEC_0:.*]] = llvm.extractvalue %[[CAST]][0] : !llvm.array<32 x vector<1xi32>>
543+
// CHECK-SAME: %[[ARG:.*]]: vector<32x1xf32>) -> f32 {
544+
// CHECK: %[[CAST:.*]] = builtin.unrealized_conversion_cast %[[ARG]] : vector<32x1xf32> to !llvm.array<32 x vector<1xf32>>
545+
// CHECK: %[[VEC_0:.*]] = llvm.extractvalue %[[CAST]][0] : !llvm.array<32 x vector<1xf32>>
546546
// CHECK: %[[C0:.*]] = llvm.mlir.constant(0 : i64) : i64
547-
// CHECK: %[[RES:.*]] = llvm.extractelement %[[VEC_0]]{{\[}}%[[C0]] : i64] : vector<1xi32>
548-
// CHECK: return %[[RES]] : i32
547+
// CHECK: %[[RES:.*]] = llvm.extractelement %[[VEC_0]]{{\[}}%[[C0]] : i64] : vector<1xf32>
548+
// CHECK: return %[[RES]] : f32
549549

550550
// -----
551551

@@ -800,26 +800,26 @@ func.func @insert_scalar_into_vec_2d_f32_dynamic_idx_scalable(%arg0: vector<1x[1
800800

801801
// -----
802802

803-
func.func @insert_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_const(%arg : vector<4x1xi32>) -> vector<4x1xi32> {
803+
func.func @insert_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_const(%arg : vector<4x1xf32>) -> vector<4x1xf32> {
804804
%0 = arith.constant 0 : index
805-
%1 = arith.constant 1 : i32
806-
%res = vector.insert %1, %arg[%0, %0] : i32 into vector<4x1xi32>
807-
return %res : vector<4x1xi32>
805+
%1 = arith.constant 1.0 : f32
806+
%res = vector.insert %1, %arg[%0, %0] : f32 into vector<4x1xf32>
807+
return %res : vector<4x1xf32>
808808
}
809809

810810
// At compile time, since the indices of insertOp are constants,
811811
// they will be collapsed and folded away; therefore, the lowering works.
812812

813813
// CHECK-LABEL: @insert_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_const
814-
// CHECK-SAME: %[[ARG:.*]]: vector<4x1xi32>) -> vector<4x1xi32> {
815-
// CHECK: %[[CAST:.*]] = builtin.unrealized_conversion_cast %[[ARG]] : vector<4x1xi32> to !llvm.array<4 x vector<1xi32>>
816-
// CHECK: %[[C1:.*]] = arith.constant 1 : i32
817-
// CHECK: %[[VEC_0:.*]] = llvm.extractvalue %[[CAST]][0] : !llvm.array<4 x vector<1xi32>>
814+
// CHECK-SAME: %[[ARG:.*]]: vector<4x1xf32>) -> vector<4x1xf32> {
815+
// CHECK: %[[CAST:.*]] = builtin.unrealized_conversion_cast %[[ARG]] : vector<4x1xf32> to !llvm.array<4 x vector<1xf32>>
816+
// CHECK: %[[C1:.*]] = arith.constant 1.000000e+00 : f32
817+
// CHECK: %[[VEC_0:.*]] = llvm.extractvalue %[[CAST]][0] : !llvm.array<4 x vector<1xf32>>
818818
// CHECK: %[[C0:.*]] = llvm.mlir.constant(0 : i64) : i64
819-
// CHECK: %[[VEC_1:.*]] = llvm.insertelement %[[C1]], %[[VEC_0]]{{\[}}%[[C0]] : i64] : vector<1xi32>
820-
// CHECK: %[[VEC_2:.*]] = llvm.insertvalue %[[VEC_1]], %[[CAST]][0] : !llvm.array<4 x vector<1xi32>>
821-
// CHECK: %[[RES:.*]] = builtin.unrealized_conversion_cast %[[VEC_2]] : !llvm.array<4 x vector<1xi32>> to vector<4x1xi32>
822-
// CHECK: return %[[RES]] : vector<4x1xi32>
819+
// CHECK: %[[VEC_1:.*]] = llvm.insertelement %[[C1]], %[[VEC_0]]{{\[}}%[[C0]] : i64] : vector<1xf32>
820+
// CHECK: %[[VEC_2:.*]] = llvm.insertvalue %[[VEC_1]], %[[CAST]][0] : !llvm.array<4 x vector<1xf32>>
821+
// CHECK: %[[RES:.*]] = builtin.unrealized_conversion_cast %[[VEC_2]] : !llvm.array<4 x vector<1xf32>> to vector<4x1xf32>
822+
// CHECK: return %[[RES]] : vector<4x1xf32>
823823

824824
// -----
825825

0 commit comments

Comments
 (0)