Skip to content

[mlir][vector][nfc] Fix typos in tests #126662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

linuxlonelyeagle
Copy link
Member

As title,this problem was caused by my negligence.Sorry.

@llvmbot
Copy link
Member

llvmbot commented Feb 11, 2025

@llvm/pr-subscribers-mlir

Author: lonely eagle (linuxlonelyeagle)

Changes

As title,this problem was caused by my negligence.Sorry.


Full diff: https://github.com/llvm/llvm-project/pull/126662.diff

1 Files Affected:

  • (modified) mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir (+20-20)
diff --git a/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir b/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir
index d261327ec005f62..fa7c030538401e9 100644
--- a/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir
+++ b/mlir/test/Conversion/VectorToLLVM/vector-to-llvm-interface.mlir
@@ -530,22 +530,22 @@ func.func @extract_scalar_from_vec_0d_index(%arg0: vector<index>) -> index {
 
 // -----
 
-func.func @extract_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_const(%arg : vector<32x1xi32>) -> i32 {
+func.func @extract_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_const(%arg : vector<32x1xf32>) -> f32 {
   %0 = arith.constant 0 : index
-  %1 = vector.extract %arg[%0, %0] : i32 from vector<32x1xi32>
-  return %1 : i32
+  %1 = vector.extract %arg[%0, %0] : f32 from vector<32x1xf32>
+  return %1 : f32
 }
 
 // At compile time, since the indices of extractOp are constants,
 // they will be collapsed and folded away; therefore, the lowering works.
 
 // CHECK-LABEL: @extract_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_const
-//  CHECK-SAME:   %[[ARG:.*]]: vector<32x1xi32>) -> i32 {
-//       CHECK:   %[[CAST:.*]] = builtin.unrealized_conversion_cast %[[ARG]] : vector<32x1xi32> to !llvm.array<32 x vector<1xi32>>
-//       CHECK:   %[[VEC_0:.*]] = llvm.extractvalue %[[CAST]][0] : !llvm.array<32 x vector<1xi32>>
+//  CHECK-SAME:   %[[ARG:.*]]: vector<32x1xf32>) -> f32 {
+//       CHECK:   %[[CAST:.*]] = builtin.unrealized_conversion_cast %[[ARG]] : vector<32x1xf32> to !llvm.array<32 x vector<1xf32>>
+//       CHECK:   %[[VEC_0:.*]] = llvm.extractvalue %[[CAST]][0] : !llvm.array<32 x vector<1xf32>>
 //       CHECK:   %[[C0:.*]] = llvm.mlir.constant(0 : i64) : i64
-//       CHECK:   %[[RES:.*]] = llvm.extractelement %[[VEC_0]]{{\[}}%[[C0]] : i64] : vector<1xi32>
-//       CHECK:   return %[[RES]] : i32
+//       CHECK:   %[[RES:.*]] = llvm.extractelement %[[VEC_0]]{{\[}}%[[C0]] : i64] : vector<1xf32>
+//       CHECK:   return %[[RES]] : f32
 
 // -----
 
@@ -800,26 +800,26 @@ func.func @insert_scalar_into_vec_2d_f32_dynamic_idx_scalable(%arg0: vector<1x[1
 
 // -----
 
-func.func @insert_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_const(%arg : vector<4x1xi32>) -> vector<4x1xi32> {
+func.func @insert_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_const(%arg : vector<4x1xf32>) -> vector<4x1xf32> {
   %0 = arith.constant 0 : index
-  %1 = arith.constant 1 : i32
-  %res = vector.insert %1, %arg[%0, %0] : i32 into vector<4x1xi32>
-  return %res : vector<4x1xi32>
+  %1 = arith.constant 1.0 : f32
+  %res = vector.insert %1, %arg[%0, %0] : f32 into vector<4x1xf32>
+  return %res : vector<4x1xf32>
 }
 
 // At compile time, since the indices of insertOp are constants,
 // they will be collapsed and folded away; therefore, the lowering works.
 
 // CHECK-LABEL: @insert_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_const
-//  CHECK-SAME:   %[[ARG:.*]]: vector<4x1xi32>) -> vector<4x1xi32> {
-//       CHECK:   %[[CAST:.*]] = builtin.unrealized_conversion_cast %[[ARG]] : vector<4x1xi32> to !llvm.array<4 x vector<1xi32>>
-//       CHECK:   %[[C1:.*]] = arith.constant 1 : i32
-//       CHECK:   %[[VEC_0:.*]] = llvm.extractvalue %[[CAST]][0] : !llvm.array<4 x vector<1xi32>>
+//  CHECK-SAME:   %[[ARG:.*]]: vector<4x1xf32>) -> vector<4x1xf32> {
+//       CHECK:   %[[CAST:.*]] = builtin.unrealized_conversion_cast %[[ARG]] : vector<4x1xf32> to !llvm.array<4 x vector<1xf32>>
+//       CHECK:   %[[C1:.*]] = arith.constant 1.000000e+00 : f32
+//       CHECK:   %[[VEC_0:.*]] = llvm.extractvalue %[[CAST]][0] : !llvm.array<4 x vector<1xf32>>
 //       CHECK:   %[[C0:.*]] = llvm.mlir.constant(0 : i64) : i64
-//       CHECK:   %[[VEC_1:.*]] = llvm.insertelement %[[C1]], %[[VEC_0]]{{\[}}%[[C0]] : i64] : vector<1xi32>
-//       CHECK:   %[[VEC_2:.*]] = llvm.insertvalue %[[VEC_1]], %[[CAST]][0] : !llvm.array<4 x vector<1xi32>>
-//       CHECK:   %[[RES:.*]] = builtin.unrealized_conversion_cast %[[VEC_2]] : !llvm.array<4 x vector<1xi32>> to vector<4x1xi32>
-//       CHECK:   return %[[RES]] : vector<4x1xi32>
+//       CHECK:   %[[VEC_1:.*]] = llvm.insertelement %[[C1]], %[[VEC_0]]{{\[}}%[[C0]] : i64] : vector<1xf32>
+//       CHECK:   %[[VEC_2:.*]] = llvm.insertvalue %[[VEC_1]], %[[CAST]][0] : !llvm.array<4 x vector<1xf32>>
+//       CHECK:   %[[RES:.*]] = builtin.unrealized_conversion_cast %[[VEC_2]] : !llvm.array<4 x vector<1xf32>> to vector<4x1xf32>
+//       CHECK:   return %[[RES]] : vector<4x1xf32>
 
 // -----
 

Copy link
Contributor

@banach-space banach-space left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix, LGTM!

Could you try to trim your PR title, please? Please note our coding guidelines:

That document refers to the following for Git-specific suggestions:

Note in particular https://cbea.ms/git-commit/#limit-50

50 characters is not a hard limit, just a rule of thumb. Keeping subject lines at this length ensures that they are readable, and forces the author to think for a moment about the most concise way to explain what’s going on.

In practice, it is hard to stick to 50 chars. However, in your case you can easily rewrite the title as:

[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`.

Hope this helps :)

@linuxlonelyeagle linuxlonelyeagle changed the title [mlir][vector]fix insert/extract_scalar_from_vec_2d_f32_dynamic_idxs_compile_time_constant test. [mlir][vector][NFC] Fix typos in tests Feb 12, 2025
@linuxlonelyeagle linuxlonelyeagle merged commit 82cbb02 into llvm:main Feb 12, 2025
10 checks passed
@linuxlonelyeagle
Copy link
Member Author

Thanks for the fix, LGTM!

Could you try to trim your PR title, please? Please note our coding guidelines:

That document refers to the following for Git-specific suggestions:

Note in particular https://cbea.ms/git-commit/#limit-50

50 characters is not a hard limit, just a rule of thumb. Keeping subject lines at this length ensures that they are readable, and forces the author to think for a moment about the most concise way to explain what’s going on.

In practice, it is hard to stick to 50 chars. However, in your case you can easily rewrite the title as:

[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`.

Hope this helps :)

Thanks for your guidance. I read the git commit message in the link and learned something new.

@linuxlonelyeagle linuxlonelyeagle changed the title [mlir][vector][NFC] Fix typos in tests [mlir][vector][nfc] Fix typos in tests Feb 12, 2025
@linuxlonelyeagle
Copy link
Member Author

To be honest, I don’t seem to see any guides for modifying the title here https://mlir.llvm.org/getting_started/DeveloperGuide/.I made some changes based on the commit message you provided, and I think this should be fine.Thank you.

@banach-space
Copy link
Contributor

To be honest, I don’t seem to see any guides for modifying the title here https://mlir.llvm.org/getting_started/DeveloperGuide/.I

First:
Screenshot 2025-02-12 at 22 55 50

and then:

Screenshot 2025-02-12 at 23 01 32

made some changes based on the commit message you provided, and I think this should be fine.Thank you.

Thank you, looks great!

flovent pushed a commit to flovent/llvm-project that referenced this pull request Feb 13, 2025
[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`.
joaosaffran pushed a commit to joaosaffran/llvm-project that referenced this pull request Feb 14, 2025
[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`.
sivan-shani pushed a commit to sivan-shani/llvm-project that referenced this pull request Feb 24, 2025
[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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants