Hi All,

When using --param=aarch64-autovec-mode=VNx4QI, we currently still allow the
vectorizer to try an automatically selected mode first.

The generic code starts the candidate list with VOIDmode, which asks the
vectorizer to choose a mode from the loop's element types.  It then calls the
target hook to add the other candidates.

When aarch64_force_autovec_mode is set, the AArch64 hook appends that mode and
returns zero. But returning zero only disables cost comparisons between
candidates.  It doesn't remove the VOIDmode entry already in the list.  If the
first attempt succeeds, we can therefore finish without trying the mode
requested on the command line.

For example, with

  --param=aarch64-autovec-mode=VNx4QI

we want to use the partial-vector policy with 32-bit containers for byte and
halfword elements. Starting from a full vector can instead leave us with
widening unpacks that the partial mode was intended to avoid.

This patch clears the candidate list before adding the forced mode.  That leaves
the requested mode as the only candidate and avoids the initial autodetection
attempt.

The tests cover full and partial SVE modes and the Advanced SIMD policies, using
loops over bytes, halfwords and words.  They also check that the forced mode
takes priority over a conflicting -mautovec-preference, including with the
unlimited cost model, and that VNx4QI uses widening byte loads without integer
unpacks.

Bootstrapped Regtested on aarch64-none-linux-gnu, arm-none-linux-gnueabihf,
x86_64-pc-linux-gnu -m32, -m64 and no issues.

Ok for master?

Thanks,
Tamar

gcc/ChangeLog:

        * config/aarch64/aarch64.cc (aarch64_autovectorize_vector_modes):
        Clear the candidate list before adding aarch64_force_autovec_mode,
        removing the initial autodetection entry when a mode is forced.

gcc/testsuite/ChangeLog:

        * gcc.target/aarch64/force_autovec_mode.h: New test support header.
        * gcc.target/aarch64/force_autovec_mode_1.c: New test.
        * gcc.target/aarch64/force_autovec_mode_2.c: New test.
        * gcc.target/aarch64/force_autovec_mode_3.c: New test.
        * gcc.target/aarch64/force_autovec_mode_4.c: New test.
        * gcc.target/aarch64/sve/force_autovec_mode_1.c: New test.
        * gcc.target/aarch64/sve/force_autovec_mode_2.c: New test.
        * gcc.target/aarch64/sve/force_autovec_mode_3.c: New test.
        * gcc.target/aarch64/sve/force_autovec_mode_4.c: New test.
        * gcc.target/aarch64/sve/force_autovec_mode_5.c: New test.

---
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 
850ae300337ae17356bd3413c3dc65d590e5f7ba..6fa83b81b42b5998c12f278ae7de484c7a946a2f
 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -24231,6 +24231,7 @@ aarch64_autovectorize_vector_modes (vector_modes 
*modes, bool)
 
   if (aarch64_force_autovec_mode != VOIDmode)
     {
+      modes->truncate (0);
       modes->safe_push (aarch64_force_autovec_mode);
       return 0;
     }
diff --git a/gcc/testsuite/gcc.target/aarch64/force_autovec_mode.h 
b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode.h
new file mode 100644
index 
0000000000000000000000000000000000000000..169e8bea95d47ab0fbf5ac3a2bc5d9031bb5cad2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode.h
@@ -0,0 +1,24 @@
+/* Exercise the mode policy with different element widths.  */
+
+void
+add_byte (unsigned char *restrict dst, const unsigned char *restrict src,
+         unsigned n)
+{
+  for (unsigned i = 0; i < n; ++i)
+    dst[i] = src[i] + 1;
+}
+
+void
+add_halfword (unsigned short *restrict dst, const unsigned short *restrict src,
+             unsigned n)
+{
+  for (unsigned i = 0; i < n; ++i)
+    dst[i] = src[i] + 1;
+}
+
+void
+add_word (unsigned *restrict dst, const unsigned *restrict src, unsigned n)
+{
+  for (unsigned i = 0; i < n; ++i)
+    dst[i] = src[i] + 1;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_1.c 
b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_1.c
new file mode 100644
index 
0000000000000000000000000000000000000000..d032f46db78c41565a8986298c4780425e145fb3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=armv8.2-a+sve -msve-vector-bits=scalable 
-mautovec-preference=sve-only --param=aarch64-autovec-mode=V8QI 
-fdump-tree-vect-details" } */
+
+/* The forced Advanced SIMD mode takes priority over the SVE preference.  */
+#include "force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" 
} } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode V8QI" 3 "vect" } } 
*/
diff --git a/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_2.c 
b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_2.c
new file mode 100644
index 
0000000000000000000000000000000000000000..ce761f4f58b7dff329a4e73aa1063b0508ce4d26
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=armv8-a --param=aarch64-autovec-mode=V16QI 
-fdump-tree-vect-details" } */
+
+#include "force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" 
} } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode V16QI" 3 "vect" } } 
*/
diff --git a/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_3.c 
b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_3.c
new file mode 100644
index 
0000000000000000000000000000000000000000..5cbd06ef8b3b0e810741fc3caec942250c074e48
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_3.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=armv8-a --param=aarch64-autovec-mode=V4HI 
-fdump-tree-vect-details" } */
+
+#include "force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" 
} } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode V4HI" 3 "vect" } } 
*/
diff --git a/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_4.c 
b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_4.c
new file mode 100644
index 
0000000000000000000000000000000000000000..6f82daa3051f86f3af900d27a3942f5dbcce5564
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_4.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=armv8-a --param=aarch64-autovec-mode=V2SI 
-fdump-tree-vect-details" } */
+
+#include "force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" 
} } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode V2SI" 3 "vect" } } 
*/
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_1.c 
b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_1.c
new file mode 100644
index 
0000000000000000000000000000000000000000..a65c0d64ca44c163ec5ac6e70246db26b451787b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msve-vector-bits=scalable -mautovec-preference=sve-only 
--param=aarch64-autovec-mode=VNx4QI -fdump-tree-vect-details" } */
+
+void
+byte_first (unsigned *restrict dst, const unsigned char *restrict src,
+           unsigned bias, unsigned n)
+{
+  for (unsigned i = 0; i < n; ++i)
+    dst[i] = (unsigned) src[i] + bias;
+}
+
+/* The first data reference selects a full float vector.  The byte load
+   must still follow the forced partial-vector policy.  */
+void
+float_first (float *restrict dst, const float *restrict x,
+            const unsigned char *restrict src, unsigned n)
+{
+  for (unsigned i = 0; i < n; ++i)
+    dst[i] = x[i] + (float) src[i];
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 2 "vect" 
} } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode VNx4QI" 2 "vect" } 
} */
+/* { dg-final { scan-assembler {\tld1b\tz[0-9]+\.s,} } } */
+/* { dg-final { scan-assembler-not {\t[su]unpk} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_2.c 
b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_2.c
new file mode 100644
index 
0000000000000000000000000000000000000000..689bef25910ffaec119ab3479fd547a1924f2b87
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msve-vector-bits=scalable 
-mautovec-preference=asimd-only --param=aarch64-autovec-mode=VNx4QI 
-fvect-cost-model=unlimited -fdump-tree-vect-details" } */
+
+/* The forced SVE mode takes priority over the Advanced SIMD preference,
+   including when cost comparisons are disabled.  */
+#include "force_autovec_mode_1.c"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 2 "vect" 
} } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode VNx4QI" 2 "vect" } 
} */
+/* { dg-final { scan-assembler {\tld1b\tz[0-9]+\.s,} } } */
+/* { dg-final { scan-assembler-not {\t[su]unpk} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_3.c 
b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_3.c
new file mode 100644
index 
0000000000000000000000000000000000000000..b3f4161f5e52aec32213355c21f361e3fbc44490
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_3.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msve-vector-bits=scalable -mautovec-preference=sve-only 
--param=aarch64-autovec-mode=VNx16QI -fdump-tree-vect-details" } */
+
+#include "../force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" 
} } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode VNx16QI" 3 "vect" } 
} */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_4.c 
b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_4.c
new file mode 100644
index 
0000000000000000000000000000000000000000..6f8d1f552e38a34198a74d0111d43563a6d8d2b9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_4.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msve-vector-bits=scalable -mautovec-preference=sve-only 
--param=aarch64-autovec-mode=VNx8QI -fdump-tree-vect-details" } */
+
+#include "../force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" 
} } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode VNx8QI" 3 "vect" } 
} */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_5.c 
b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_5.c
new file mode 100644
index 
0000000000000000000000000000000000000000..c32355a8e0bef4b3910da44a2a601924554f2e0c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_5.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msve-vector-bits=scalable -mautovec-preference=sve-only 
--param=aarch64-autovec-mode=VNx2QI -fdump-tree-vect-details" } */
+
+#include "../force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" 
} } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode VNx2QI" 3 "vect" } 
} */


-- 
diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 850ae300337ae17356bd3413c3dc65d590e5f7ba..6fa83b81b42b5998c12f278ae7de484c7a946a2f 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -24231,6 +24231,7 @@ aarch64_autovectorize_vector_modes (vector_modes *modes, bool)
 
   if (aarch64_force_autovec_mode != VOIDmode)
     {
+      modes->truncate (0);
       modes->safe_push (aarch64_force_autovec_mode);
       return 0;
     }
diff --git a/gcc/testsuite/gcc.target/aarch64/force_autovec_mode.h b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode.h
new file mode 100644
index 0000000000000000000000000000000000000000..169e8bea95d47ab0fbf5ac3a2bc5d9031bb5cad2
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode.h
@@ -0,0 +1,24 @@
+/* Exercise the mode policy with different element widths.  */
+
+void
+add_byte (unsigned char *restrict dst, const unsigned char *restrict src,
+	  unsigned n)
+{
+  for (unsigned i = 0; i < n; ++i)
+    dst[i] = src[i] + 1;
+}
+
+void
+add_halfword (unsigned short *restrict dst, const unsigned short *restrict src,
+	      unsigned n)
+{
+  for (unsigned i = 0; i < n; ++i)
+    dst[i] = src[i] + 1;
+}
+
+void
+add_word (unsigned *restrict dst, const unsigned *restrict src, unsigned n)
+{
+  for (unsigned i = 0; i < n; ++i)
+    dst[i] = src[i] + 1;
+}
diff --git a/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_1.c b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_1.c
new file mode 100644
index 0000000000000000000000000000000000000000..d032f46db78c41565a8986298c4780425e145fb3
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_1.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=armv8.2-a+sve -msve-vector-bits=scalable -mautovec-preference=sve-only --param=aarch64-autovec-mode=V8QI -fdump-tree-vect-details" } */
+
+/* The forced Advanced SIMD mode takes priority over the SVE preference.  */
+#include "force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode V8QI" 3 "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_2.c b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_2.c
new file mode 100644
index 0000000000000000000000000000000000000000..ce761f4f58b7dff329a4e73aa1063b0508ce4d26
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_2.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=armv8-a --param=aarch64-autovec-mode=V16QI -fdump-tree-vect-details" } */
+
+#include "force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode V16QI" 3 "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_3.c b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_3.c
new file mode 100644
index 0000000000000000000000000000000000000000..5cbd06ef8b3b0e810741fc3caec942250c074e48
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_3.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=armv8-a --param=aarch64-autovec-mode=V4HI -fdump-tree-vect-details" } */
+
+#include "force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode V4HI" 3 "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_4.c b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_4.c
new file mode 100644
index 0000000000000000000000000000000000000000..6f82daa3051f86f3af900d27a3942f5dbcce5564
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/force_autovec_mode_4.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -march=armv8-a --param=aarch64-autovec-mode=V2SI -fdump-tree-vect-details" } */
+
+#include "force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode V2SI" 3 "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_1.c b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_1.c
new file mode 100644
index 0000000000000000000000000000000000000000..a65c0d64ca44c163ec5ac6e70246db26b451787b
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_1.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msve-vector-bits=scalable -mautovec-preference=sve-only --param=aarch64-autovec-mode=VNx4QI -fdump-tree-vect-details" } */
+
+void
+byte_first (unsigned *restrict dst, const unsigned char *restrict src,
+	    unsigned bias, unsigned n)
+{
+  for (unsigned i = 0; i < n; ++i)
+    dst[i] = (unsigned) src[i] + bias;
+}
+
+/* The first data reference selects a full float vector.  The byte load
+   must still follow the forced partial-vector policy.  */
+void
+float_first (float *restrict dst, const float *restrict x,
+	     const unsigned char *restrict src, unsigned n)
+{
+  for (unsigned i = 0; i < n; ++i)
+    dst[i] = x[i] + (float) src[i];
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode VNx4QI" 2 "vect" } } */
+/* { dg-final { scan-assembler {\tld1b\tz[0-9]+\.s,} } } */
+/* { dg-final { scan-assembler-not {\t[su]unpk} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_2.c b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_2.c
new file mode 100644
index 0000000000000000000000000000000000000000..689bef25910ffaec119ab3479fd547a1924f2b87
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_2.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msve-vector-bits=scalable -mautovec-preference=asimd-only --param=aarch64-autovec-mode=VNx4QI -fvect-cost-model=unlimited -fdump-tree-vect-details" } */
+
+/* The forced SVE mode takes priority over the Advanced SIMD preference,
+   including when cost comparisons are disabled.  */
+#include "force_autovec_mode_1.c"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 2 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode VNx4QI" 2 "vect" } } */
+/* { dg-final { scan-assembler {\tld1b\tz[0-9]+\.s,} } } */
+/* { dg-final { scan-assembler-not {\t[su]unpk} } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_3.c b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_3.c
new file mode 100644
index 0000000000000000000000000000000000000000..b3f4161f5e52aec32213355c21f361e3fbc44490
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_3.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msve-vector-bits=scalable -mautovec-preference=sve-only --param=aarch64-autovec-mode=VNx16QI -fdump-tree-vect-details" } */
+
+#include "../force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode VNx16QI" 3 "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_4.c b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_4.c
new file mode 100644
index 0000000000000000000000000000000000000000..6f8d1f552e38a34198a74d0111d43563a6d8d2b9
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_4.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msve-vector-bits=scalable -mautovec-preference=sve-only --param=aarch64-autovec-mode=VNx8QI -fdump-tree-vect-details" } */
+
+#include "../force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode VNx8QI" 3 "vect" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_5.c b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_5.c
new file mode 100644
index 0000000000000000000000000000000000000000..c32355a8e0bef4b3910da44a2a601924554f2e0c
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/force_autovec_mode_5.c
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -msve-vector-bits=scalable -mautovec-preference=sve-only --param=aarch64-autovec-mode=VNx2QI -fdump-tree-vect-details" } */
+
+#include "../force_autovec_mode.h"
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops in function" 3 "vect" } } */
+/* { dg-final { scan-tree-dump-times "Choosing vector mode VNx2QI" 3 "vect" } } */

Reply via email to