[llvm] [LV] Linear argument tests for vectorization of function calls (PR #73936)

Maciej Gabka via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 06:50:03 PST 2023


================
@@ -0,0 +1,253 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter "call" --version 2
+; RUN: opt < %s -passes=loop-vectorize -force-vector-interleave=1 -S | FileCheck %s --check-prefixes=NEON
+; RUN: opt < %s -mattr=+sve -passes=loop-vectorize -force-vector-interleave=1 -S | FileCheck %s --check-prefixes=SVE_OR_NEON
+; RUN: opt < %s -mattr=+sve -passes=loop-vectorize -force-vector-interleave=1 -S -prefer-predicate-over-epilogue=predicate-dont-vectorize | FileCheck %s --check-prefixes=SVE_TF
+
+target triple = "aarch64-unknown-linux-gnu"
+
+; A call whose argument can remain a scalar because it's sequential and only the
+; starting value is required.
+define void @test_linear(ptr noalias %a, ptr readnone %b, i64 %n) {
----------------
mgabka wrote:

thanks for extending the test coverage, looks much better now, I've read the tests and they look correct to me.

 I have one more suggestion, and that is just to make reading of those tests easier.

I would suggest to:
1. name each of the IR functions following the same scheme, i.e this one for example **test_linear8**
2. name each of the vector mappings based on the expected behaviour so here:
- **vec_foo_linear8_nomask_sve**
- **vec_foo_linear8_mask_sve**
- **vec_foo_linear8_nomask_neon**

it will just make the reviewing much easier.

https://github.com/llvm/llvm-project/pull/73936


More information about the llvm-commits mailing list