[llvm] [LV] Add support for uniform parameters on vectorized function variants (PR #68879)

Maciej Gabka via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 01:35:21 PST 2023


================
@@ -0,0 +1,117 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
+; RUN: opt < %s -passes=loop-vectorize,instcombine -force-vector-interleave=1 -S | FileCheck %s
+
+target triple = "aarch64-unknown-linux-gnu"
+
+; A call whose argument can remain a scalar for a vectorized function variant
+; with a uniform argument because it's loop invariant
+define void @test_uniform(ptr noalias %dst, ptr readonly %src, i64 %uniform , i64 %n) #0 {
----------------
mgabka wrote:

Hi @huntergr-arm,
I think it would be good to add more tests, I am thinking about extra test when the mask is required, for example tail-folding is enabled.

But I am also thinking about test where the scalar, uniform type does not match the size of vector element type for example when the available mapping is:

@foo_uniform(<vscale x 2 x double>, i32, <vscale x 2 x i1>)

such mappings seems to crash the compiler at the moment on assertion failure, I think we could do better job in handling this cases, what do you think?


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


More information about the llvm-commits mailing list