[Mlir-commits] [mlir] [mlir][linalg] Consolidate tests for scalable vectorization (PR #141469)
Han-Chung Wang
llvmlistbot at llvm.org
Tue May 27 01:22:20 PDT 2025
================
@@ -36,6 +40,42 @@ module attributes {transform.with_named_sequence} {
// -----
+func.func @vectorize_dynamic_identity_scalable(%arg0: tensor<?xf32>,
+ %arg1: tensor<?xf32>,
+ %arg2: tensor<?xf32>) -> tensor<?xf32> {
+ %0 = linalg.generic { indexing_maps = [affine_map<(d0) -> (d0)>,
+ affine_map<(d0) -> (d0)>,
+ affine_map<(d0) -> (d0)>],
+ iterator_types = ["parallel"] }
+ ins(%arg0, %arg1 : tensor<?xf32>, tensor<?xf32>)
+ outs(%arg2 : tensor<?xf32>) {
+ ^bb(%in0: f32, %in1: f32, %out: f32) :
+ %0 = arith.addf %in0, %in1 : f32
+ linalg.yield %0 : f32
+ } -> tensor<?xf32>
+ return %0 : tensor<?xf32>
+}
+
+// CHECK-LABEL: @vectorize_dynamic_identity_scalable
----------------
hanhanW wrote:
optional: I personally don't like a blank line between the end of the function and the start of the check. I don't find any LLVM style guide about it, so I marked it optional. Also, I think different people have different style.
The rule from google c++ style guide has something like: `The more code that fits on one screen, the easier it is to follow and understand the control flow of the program.`, and I think it can be applied to checks. (https://google.github.io/styleguide/cppguide.html#Vertical_Whitespace)
Note: it already happens on my laptop monitor. E.g., the last line is cut in my laptop monitor in the below `vectorize_dynamic_reduction_2d_scalable` test.
<img width="684" alt="image" src="https://github.com/user-attachments/assets/e927e026-51d6-49c2-8a22-f3effdf2a56d" />
https://github.com/llvm/llvm-project/pull/141469
More information about the Mlir-commits
mailing list