[ja...@redhat.com: Re: [PATCH] testsuite: Fix up vect-simd-clone1[678]*.c tests [PR108898]]

2023-03-21 Thread Jakub Jelinek via Gcc-patches

--- Begin Message ---
On Tue, Mar 21, 2023 at 12:35:19PM +, Andrew Stubbs wrote:
> > @@ -82,8 +82,7 @@ main ()
> >   /* Ensure the the in-branch simd clones are used on targets that support 
> > them.
> >  Some targets use another call for the epilogue loops.  */
> > -/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 
> > "vect" { target { ! aarch64*-*-* } } } } */
> > -/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 
> > "vect" { target aarch64*-*-* } } } */
> > +/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 
> > "vect" } } */
> 
> I suppose those comments are now obsolete.

Oops, fixed thusly, committed as obvious:

2023-03-21  Jakub Jelinek  

PR testsuite/108898
* gcc.dg/vect/vect-simd-clone-16.c: Remove parts of comment mentioning
epilogue loops.
* gcc.dg/vect/vect-simd-clone-17.c: Likewise.
* gcc.dg/vect/vect-simd-clone-18.c: Likewise.

--- gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c.jj   2023-03-21 
13:28:47.062298853 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c  2023-03-21 
13:40:04.714486518 +0100
@@ -80,8 +80,7 @@ main ()
   return 0;
 }
 
-/* Ensure the the in-branch simd clones are used on targets that support them.
-   Some targets use another call for the epilogue loops.  */
+/* Ensure the the in-branch simd clones are used on targets that support them. 
 */
 /* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" 
} } */
 
 /* The LTO test produces two dump files and we scan the wrong one.  */
--- gcc/testsuite/gcc.dg/vect/vect-simd-clone-17.c.jj   2023-03-21 
13:28:47.062298853 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-simd-clone-17.c  2023-03-21 
13:40:15.387331984 +0100
@@ -80,8 +80,7 @@ main ()
   return 0;
 }
 
-/* Ensure the the in-branch simd clones are used on targets that support them.
-   Some targets use another call for the epilogue loops.  */
+/* Ensure the the in-branch simd clones are used on targets that support them. 
 */
 /* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" 
} } */
 
 /* The LTO test produces two dump files and we scan the wrong one.  */
--- gcc/testsuite/gcc.dg/vect/vect-simd-clone-18.c.jj   2023-03-21 
13:28:47.063298839 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-simd-clone-18.c  2023-03-21 
13:40:25.894179841 +0100
@@ -80,8 +80,7 @@ main ()
   return 0;
 }
 
-/* Ensure the the in-branch simd clones are used on targets that support them.
-   Some targets use another call for the epilogue loops.  */
+/* Ensure the the in-branch simd clones are used on targets that support them. 
 */
 /* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" 
} } */
 
 /* The LTO test produces two dump files and we scan the wrong one.  */


Jakub
--- End Message ---


Re: [PATCH] testsuite: Fix up vect-simd-clone1[678]*.c tests [PR108898]

2023-03-21 Thread Andrew Stubbs

On 21/03/2023 12:14, Jakub Jelinek wrote:

Hi!

As mentioned in the PR, vect-simd-clone-1[678]{,f}.c tests FAIL on
x86_64-linux with -m64/-march=cascadelake or -m32/-march=cascadelake,
there are 3 matches for the calls rather than expected two.
As suggested by Richi, this patch changes those tests to use
--param vect-epilogues-nomask=0 such that it is more predictable on how
many calls will show up.  In the non-[a-f] suffixed tests, the


Thanks for doing this. I've had it on my to-do list but not got there yet.


scan-tree-dump-times patterns were expecting 2 for non-aarch64 and 3 for
aarch64, which is a puzzle for me, because vect_simd_clones effective
target is apparently never true on aarch64 (just on x86 in some cases and
on amdgcn; perhaps something to change for GCC14, but I guess too late
for stage4).  That said, I have looked at aarch64 dumps and see only 2
calls with --param vect-epilogues-nomask=0 and 3 with --param
vect-epilogues-nomask=1 or without it, so I have tweaked those to always
expect the same thing.  Another thing is some tests uselessly had
-fdump-tree-optimized in dg-options even when they don't scan anything
there.


I believe I did mention when I posted the original patch that I tested 
enabling vect_simd_clones on AArch64, but found that there were other 
failures. I made sure that the expected results were right in the new 
tests, but did not enable the effective target for this reason.




Tested on x86_64-linux with
make -j32 -k check-gcc RUNTESTFLAGS="vect.exp=gcc.dg/vect/vect-simd-clone-*.c 
--target_board='unix{-m64/-march=x86-64,-m64/-march=cascadelake,-m32/-march=i686,-m32/-march=cascadelake}'"
and aarch64-linux (where all tests are UNSUPPORTED before/after), ok for
trunk?

2023-03-21  Jakub Jelinek  

PR testsuite/108898
* gcc.dg/vect/vect-simd-clone-16.c: Add --param vect-epilogues-nomask=0
to dg-additional-options.  Always expect just 2 foo.simdclone calls.
* gcc.dg/vect/vect-simd-clone-16f.c: Add
--param vect-epilogues-nomask=0 to dg-additional-options.
* gcc.dg/vect/vect-simd-clone-17.c: Likewise.  Always expect just 2
foo.simdclone calls.
* gcc.dg/vect/vect-simd-clone-17d.c: Remove -fdump-tree-optimized from
dg-additional-options.
* gcc.dg/vect/vect-simd-clone-17e.c: Likewise.
* gcc.dg/vect/vect-simd-clone-17f.c: Likewise.  Add
--param vect-epilogues-nomask=0 to dg-additional-options.
* gcc.dg/vect/vect-simd-clone-18.c: Add --param vect-epilogues-nomask=0
to dg-additional-options.  Always expect just 2 foo.simdclone calls.
* gcc.dg/vect/vect-simd-clone-18f.c: Add
--param vect-epilogues-nomask=0 to dg-additional-options.

--- gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c.jj   2023-02-22 
15:58:59.661862434 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c  2023-03-21 
12:21:44.084547190 +0100
@@ -1,5 +1,5 @@
  /* { dg-require-effective-target vect_simd_clones } */
-/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-fopenmp-simd --param vect-epilogues-nomask=0" } */
  /* { dg-additional-options "-mavx" { target avx_runtime } } */
  
  /* Test that simd inbranch clones work correctly.  */

@@ -82,8 +82,7 @@ main ()
  
  /* Ensure the the in-branch simd clones are used on targets that support them.

 Some targets use another call for the epilogue loops.  */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" 
{ target { ! aarch64*-*-* } } } } */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 "vect" 
{ target aarch64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" 
} } */


I suppose those comments are now obsolete.

Andrew


Re: [PATCH] testsuite: Fix up vect-simd-clone1[678]*.c tests [PR108898]

2023-03-21 Thread Richard Biener via Gcc-patches
On Tue, 21 Mar 2023, Jakub Jelinek wrote:

> Hi!
> 
> As mentioned in the PR, vect-simd-clone-1[678]{,f}.c tests FAIL on
> x86_64-linux with -m64/-march=cascadelake or -m32/-march=cascadelake,
> there are 3 matches for the calls rather than expected two.
> As suggested by Richi, this patch changes those tests to use
> --param vect-epilogues-nomask=0 such that it is more predictable on how
> many calls will show up.  In the non-[a-f] suffixed tests, the
> scan-tree-dump-times patterns were expecting 2 for non-aarch64 and 3 for
> aarch64, which is a puzzle for me, because vect_simd_clones effective
> target is apparently never true on aarch64 (just on x86 in some cases and
> on amdgcn; perhaps something to change for GCC14, but I guess too late
> for stage4).  That said, I have looked at aarch64 dumps and see only 2
> calls with --param vect-epilogues-nomask=0 and 3 with --param
> vect-epilogues-nomask=1 or without it, so I have tweaked those to always
> expect the same thing.  Another thing is some tests uselessly had
> -fdump-tree-optimized in dg-options even when they don't scan anything
> there.
> 
> Tested on x86_64-linux with
> make -j32 -k check-gcc RUNTESTFLAGS="vect.exp=gcc.dg/vect/vect-simd-clone-*.c 
> --target_board='unix{-m64/-march=x86-64,-m64/-march=cascadelake,-m32/-march=i686,-m32/-march=cascadelake}'"
> and aarch64-linux (where all tests are UNSUPPORTED before/after), ok for
> trunk?

OK.

Thanks,
Richard.

> 2023-03-21  Jakub Jelinek  
> 
>   PR testsuite/108898
>   * gcc.dg/vect/vect-simd-clone-16.c: Add --param vect-epilogues-nomask=0
>   to dg-additional-options.  Always expect just 2 foo.simdclone calls.
>   * gcc.dg/vect/vect-simd-clone-16f.c: Add
>   --param vect-epilogues-nomask=0 to dg-additional-options.
>   * gcc.dg/vect/vect-simd-clone-17.c: Likewise.  Always expect just 2
>   foo.simdclone calls.
>   * gcc.dg/vect/vect-simd-clone-17d.c: Remove -fdump-tree-optimized from
>   dg-additional-options.
>   * gcc.dg/vect/vect-simd-clone-17e.c: Likewise.
>   * gcc.dg/vect/vect-simd-clone-17f.c: Likewise.  Add
>   --param vect-epilogues-nomask=0 to dg-additional-options.
>   * gcc.dg/vect/vect-simd-clone-18.c: Add --param vect-epilogues-nomask=0
>   to dg-additional-options.  Always expect just 2 foo.simdclone calls.
>   * gcc.dg/vect/vect-simd-clone-18f.c: Add
>   --param vect-epilogues-nomask=0 to dg-additional-options.
> 
> --- gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c.jj 2023-02-22 
> 15:58:59.661862434 +0100
> +++ gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c2023-03-21 
> 12:21:44.084547190 +0100
> @@ -1,5 +1,5 @@
>  /* { dg-require-effective-target vect_simd_clones } */
> -/* { dg-additional-options "-fopenmp-simd" } */
> +/* { dg-additional-options "-fopenmp-simd --param vect-epilogues-nomask=0" } 
> */
>  /* { dg-additional-options "-mavx" { target avx_runtime } } */
>  
>  /* Test that simd inbranch clones work correctly.  */
> @@ -82,8 +82,7 @@ main ()
>  
>  /* Ensure the the in-branch simd clones are used on targets that support 
> them.
> Some targets use another call for the epilogue loops.  */
> -/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 
> "vect" { target { ! aarch64*-*-* } } } } */
> -/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 
> "vect" { target aarch64*-*-* } } } */
> +/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 
> "vect" } } */
>  
>  /* The LTO test produces two dump files and we scan the wrong one.  */
>  /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
> --- gcc/testsuite/gcc.dg/vect/vect-simd-clone-16f.c.jj2023-02-22 
> 15:58:59.661862434 +0100
> +++ gcc/testsuite/gcc.dg/vect/vect-simd-clone-16f.c   2023-03-21 
> 12:22:17.122068835 +0100
> @@ -1,5 +1,5 @@
>  /* { dg-require-effective-target vect_simd_clones } */
> -/* { dg-additional-options "-fopenmp-simd" } */
> +/* { dg-additional-options "-fopenmp-simd --param vect-epilogues-nomask=0" } 
> */
>  /* { dg-additional-options "-mavx" { target avx_runtime } } */
>  
>  #define TYPE __INT64_TYPE__
> --- gcc/testsuite/gcc.dg/vect/vect-simd-clone-17.c.jj 2023-02-22 
> 15:58:59.661862434 +0100
> +++ gcc/testsuite/gcc.dg/vect/vect-simd-clone-17.c2023-03-21 
> 12:23:35.811929497 +0100
> @@ -1,5 +1,5 @@
>  /* { dg-require-effective-target vect_simd_clones } */
> -/* { dg-additional-options "-fopenmp-simd" } */
> +/* { dg-additional-options "-fopenmp-simd --param vect-epilogues-nomask=0" } 
> */
>  /* { dg-additional-options "-mavx" { target avx_runtime } } */
>  
>  /* Test that simd inbranch clones work correctly.  */
> @@ -82,8 +82,7 @@ main ()
>  
>  /* Ensure the the in-branch simd clones are used on targets that support 
> them.
> Some targets use another call for the epilogue loops.  */
> -/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 
> "vect" { target { ! aarch64*-*-* } } } } */
> -/* { dg-final { 

[PATCH] testsuite: Fix up vect-simd-clone1[678]*.c tests [PR108898]

2023-03-21 Thread Jakub Jelinek via Gcc-patches
Hi!

As mentioned in the PR, vect-simd-clone-1[678]{,f}.c tests FAIL on
x86_64-linux with -m64/-march=cascadelake or -m32/-march=cascadelake,
there are 3 matches for the calls rather than expected two.
As suggested by Richi, this patch changes those tests to use
--param vect-epilogues-nomask=0 such that it is more predictable on how
many calls will show up.  In the non-[a-f] suffixed tests, the
scan-tree-dump-times patterns were expecting 2 for non-aarch64 and 3 for
aarch64, which is a puzzle for me, because vect_simd_clones effective
target is apparently never true on aarch64 (just on x86 in some cases and
on amdgcn; perhaps something to change for GCC14, but I guess too late
for stage4).  That said, I have looked at aarch64 dumps and see only 2
calls with --param vect-epilogues-nomask=0 and 3 with --param
vect-epilogues-nomask=1 or without it, so I have tweaked those to always
expect the same thing.  Another thing is some tests uselessly had
-fdump-tree-optimized in dg-options even when they don't scan anything
there.

Tested on x86_64-linux with
make -j32 -k check-gcc RUNTESTFLAGS="vect.exp=gcc.dg/vect/vect-simd-clone-*.c 
--target_board='unix{-m64/-march=x86-64,-m64/-march=cascadelake,-m32/-march=i686,-m32/-march=cascadelake}'"
and aarch64-linux (where all tests are UNSUPPORTED before/after), ok for
trunk?

2023-03-21  Jakub Jelinek  

PR testsuite/108898
* gcc.dg/vect/vect-simd-clone-16.c: Add --param vect-epilogues-nomask=0
to dg-additional-options.  Always expect just 2 foo.simdclone calls.
* gcc.dg/vect/vect-simd-clone-16f.c: Add
--param vect-epilogues-nomask=0 to dg-additional-options.
* gcc.dg/vect/vect-simd-clone-17.c: Likewise.  Always expect just 2
foo.simdclone calls.
* gcc.dg/vect/vect-simd-clone-17d.c: Remove -fdump-tree-optimized from
dg-additional-options.
* gcc.dg/vect/vect-simd-clone-17e.c: Likewise.
* gcc.dg/vect/vect-simd-clone-17f.c: Likewise.  Add
--param vect-epilogues-nomask=0 to dg-additional-options.
* gcc.dg/vect/vect-simd-clone-18.c: Add --param vect-epilogues-nomask=0
to dg-additional-options.  Always expect just 2 foo.simdclone calls.
* gcc.dg/vect/vect-simd-clone-18f.c: Add
--param vect-epilogues-nomask=0 to dg-additional-options.

--- gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c.jj   2023-02-22 
15:58:59.661862434 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-simd-clone-16.c  2023-03-21 
12:21:44.084547190 +0100
@@ -1,5 +1,5 @@
 /* { dg-require-effective-target vect_simd_clones } */
-/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-fopenmp-simd --param vect-epilogues-nomask=0" } */
 /* { dg-additional-options "-mavx" { target avx_runtime } } */
 
 /* Test that simd inbranch clones work correctly.  */
@@ -82,8 +82,7 @@ main ()
 
 /* Ensure the the in-branch simd clones are used on targets that support them.
Some targets use another call for the epilogue loops.  */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" 
{ target { ! aarch64*-*-* } } } } */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 "vect" 
{ target aarch64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" 
} } */
 
 /* The LTO test produces two dump files and we scan the wrong one.  */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
--- gcc/testsuite/gcc.dg/vect/vect-simd-clone-16f.c.jj  2023-02-22 
15:58:59.661862434 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-simd-clone-16f.c 2023-03-21 
12:22:17.122068835 +0100
@@ -1,5 +1,5 @@
 /* { dg-require-effective-target vect_simd_clones } */
-/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-fopenmp-simd --param vect-epilogues-nomask=0" } */
 /* { dg-additional-options "-mavx" { target avx_runtime } } */
 
 #define TYPE __INT64_TYPE__
--- gcc/testsuite/gcc.dg/vect/vect-simd-clone-17.c.jj   2023-02-22 
15:58:59.661862434 +0100
+++ gcc/testsuite/gcc.dg/vect/vect-simd-clone-17.c  2023-03-21 
12:23:35.811929497 +0100
@@ -1,5 +1,5 @@
 /* { dg-require-effective-target vect_simd_clones } */
-/* { dg-additional-options "-fopenmp-simd" } */
+/* { dg-additional-options "-fopenmp-simd --param vect-epilogues-nomask=0" } */
 /* { dg-additional-options "-mavx" { target avx_runtime } } */
 
 /* Test that simd inbranch clones work correctly.  */
@@ -82,8 +82,7 @@ main ()
 
 /* Ensure the the in-branch simd clones are used on targets that support them.
Some targets use another call for the epilogue loops.  */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" 
{ target { ! aarch64*-*-* } } } } */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 "vect" 
{ target aarch64*-*-* } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" 
} } */
 
 /* The LTO test produces two dump files and we scan the