Fix vect-simd-clone testcase dump scanning

Message ID 20230414094255.F02F313498@imap2.suse-dmz.suse.de
State Repeat Merge
Headers
Series Fix vect-simd-clone testcase dump scanning |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Richard Biener April 14, 2023, 9:42 a.m. UTC
  This replaces i686*-*-* && { ! lp64 } with the appropriate
{ i?86-*-* x86_64-*-* } && { ! lp64 } for the testcases and
also amends the e variants checking last variant for avx.
I've used avx in the dump scanning, not avx_runtime, since
the dumps get produced when one would not execute but only
compile them.  The f varaints lack AVX checking, I didn't
rectify this with this patch.  Likewise -mx32 testing shows
that ! lp64 is maybe not correct. 

Tested on x86_64-unknown-linux-gnu with 
{,-m32,-march=cascadelake,-m32/-march=cascadelake}

Pushed.

	* gcc.dg/vect/vect-simd-clone-16e.c: Fix x86 lp64 checking
	and add missing avx guard.
	* gcc.dg/vect/vect-simd-clone-17e.c: Likewise.
	* gcc.dg/vect/vect-simd-clone-18e.c: Likewise.
	* gcc.dg/vect/vect-simd-clone-16f.c: Fix x86 lp64 checking.
	* gcc.dg/vect/vect-simd-clone-17f.c: Likewise.
	* gcc.dg/vect/vect-simd-clone-18f.c: Likewise.
---
 gcc/testsuite/gcc.dg/vect/vect-simd-clone-16e.c | 6 +++---
 gcc/testsuite/gcc.dg/vect/vect-simd-clone-16f.c | 4 ++--
 gcc/testsuite/gcc.dg/vect/vect-simd-clone-17e.c | 6 +++---
 gcc/testsuite/gcc.dg/vect/vect-simd-clone-17f.c | 4 ++--
 gcc/testsuite/gcc.dg/vect/vect-simd-clone-18e.c | 6 +++---
 gcc/testsuite/gcc.dg/vect/vect-simd-clone-18f.c | 4 ++--
 6 files changed, 15 insertions(+), 15 deletions(-)
  

Comments

Jakub Jelinek April 14, 2023, 9:50 a.m. UTC | #1
On Fri, Apr 14, 2023 at 11:42:55AM +0200, Richard Biener via Gcc-patches wrote:
> This replaces i686*-*-* && { ! lp64 } with the appropriate
> { i?86-*-* x86_64-*-* } && { ! lp64 } for the testcases and
> also amends the e variants checking last variant for avx.
> I've used avx in the dump scanning, not avx_runtime, since
> the dumps get produced when one would not execute but only
> compile them.  The f varaints lack AVX checking, I didn't

avx_runtime was actually intentional.  The thing is that the testcase
has
/* { dg-additional-options "-mavx" { target avx_runtime } } */
So, if avx_runtime, we know we are compiled with -mavx.  If not, we don't
really know, it could be with -mavx because user configured gcc to default
to -mavx through some --with-arch=, or because it was tested with
--target_board=unix/-mavx etc.
If we wanted to make sure it is exact, we could do
/* { dg-additional-options "-mno-avx" { target i?86-*-* x86_64-*-* } } */
/* { dg-additional-options "-mavx" { target avx_runtime } } */
and then avx_runtime can be actually trusted.

	Jakub
  
Richard Biener April 14, 2023, 10:15 a.m. UTC | #2
On Fri, 14 Apr 2023, Jakub Jelinek wrote:

> On Fri, Apr 14, 2023 at 11:42:55AM +0200, Richard Biener via Gcc-patches wrote:
> > This replaces i686*-*-* && { ! lp64 } with the appropriate
> > { i?86-*-* x86_64-*-* } && { ! lp64 } for the testcases and
> > also amends the e variants checking last variant for avx.
> > I've used avx in the dump scanning, not avx_runtime, since
> > the dumps get produced when one would not execute but only
> > compile them.  The f varaints lack AVX checking, I didn't
> 
> avx_runtime was actually intentional.  The thing is that the testcase
> has
> /* { dg-additional-options "-mavx" { target avx_runtime } } */
> So, if avx_runtime, we know we are compiled with -mavx.  If not, we don't
> really know, it could be with -mavx because user configured gcc to default
> to -mavx through some --with-arch=, or because it was tested with
> --target_board=unix/-mavx etc.
> If we wanted to make sure it is exact, we could do
> /* { dg-additional-options "-mno-avx" { target i?86-*-* x86_64-*-* } } */
> /* { dg-additional-options "-mavx" { target avx_runtime } } */
> and then avx_runtime can be actually trusted.

Oops.  Indeed target_avx checks whether it can compile sth with
-O2 -mavx rather than verifying avx is present.  I've seen scan
failures with -m32/-march=cascadelake on a zen2 host.  I'm not exactly
sure why.

I'll revert the avx_runtime changes and let somebody else deal
with the remaining issues in these tests.

Richard.
  
Jakub Jelinek April 14, 2023, 10:25 a.m. UTC | #3
On Fri, Apr 14, 2023 at 10:15:06AM +0000, Richard Biener wrote:
> Oops.  Indeed target_avx checks whether it can compile sth with
> -O2 -mavx rather than verifying avx is present.  I've seen scan
> failures with -m32/-march=cascadelake on a zen2 host.  I'm not exactly
> sure why.

That is strange.  Sure, -march=cascadelake implies -mavx (-mavx512f even),
but it would surprise me if on such a host avx_runtime wasn't true.
But we've been there before, I think cascadelake turns on the vector
epilogues.
In r13-6784 I've added --param vect-epilogues-nomask=0 to some testcases
that were affected at that point, but perhaps something is affected since
then.  Will have a look.

	Jakub
  
Andre Vieira (lists) April 14, 2023, 10:59 a.m. UTC | #4
On the other thread I commented that inbranch simdclones are failing for 
AVX512F because it sets the mask_mode, for which inbranch hasn't been 
implemented, and so it is rejected.

On 14/04/2023 11:25, Jakub Jelinek via Gcc-patches wrote:
> On Fri, Apr 14, 2023 at 10:15:06AM +0000, Richard Biener wrote:
>> Oops.  Indeed target_avx checks whether it can compile sth with
>> -O2 -mavx rather than verifying avx is present.  I've seen scan
>> failures with -m32/-march=cascadelake on a zen2 host.  I'm not exactly
>> sure why.
> 
> That is strange.  Sure, -march=cascadelake implies -mavx (-mavx512f even),
> but it would surprise me if on such a host avx_runtime wasn't true.
> But we've been there before, I think cascadelake turns on the vector
> epilogues.
> In r13-6784 I've added --param vect-epilogues-nomask=0 to some testcases
> that were affected at that point, but perhaps something is affected since
> then.  Will have a look.
> 
> 	Jakub
>
  
Jakub Jelinek April 14, 2023, 11 a.m. UTC | #5
On Fri, Apr 14, 2023 at 11:59:02AM +0100, Andre Vieira (lists) wrote:
> On the other thread I commented that inbranch simdclones are failing for
> AVX512F because it sets the mask_mode, for which inbranch hasn't been
> implemented, and so it is rejected.

But then we can as well use -mno-avx512f in dg-additional-options of the
test and have another test copy if needed that checks -mavx512f.

	Jakub
  
Andre Vieira (lists) April 14, 2023, 1:38 p.m. UTC | #6
SGTM

On 14/04/2023 12:00, Jakub Jelinek wrote:
> On Fri, Apr 14, 2023 at 11:59:02AM +0100, Andre Vieira (lists) wrote:
>> On the other thread I commented that inbranch simdclones are failing for
>> AVX512F because it sets the mask_mode, for which inbranch hasn't been
>> implemented, and so it is rejected.
> 
> But then we can as well use -mno-avx512f in dg-additional-options of the
> test and have another test copy if needed that checks -mavx512f.
> 
> 	Jakub
>
  

Patch

diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16e.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16e.c
index c8b482bf2e7..9d3392924b3 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16e.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16e.c
@@ -8,9 +8,9 @@ 
 /* Ensure the the in-branch simd clones are used on targets that support them.
    Some targets use another call for the epilogue loops.
    Some targets use pairs of vectors and do twice the calls.  */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { { ! avx_runtime } && { ! { i686*-*-* && { ! lp64 } } } } } } } */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 "vect" { target { avx_runtime && { ! { i686*-*-* && { ! lp64 } } } } } } } */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { i686*-*-* && { ! lp64 } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { { ! avx } && { ! { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 "vect" { target { avx && { ! { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { { ! avx } && { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } } */
 
 /* The LTO test produces two dump files and we scan the wrong one.  */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16f.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16f.c
index 171bbbb38bb..1e2b6056db1 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16f.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-16f.c
@@ -7,8 +7,8 @@ 
 
 /* Ensure the the in-branch simd clones are used on targets that support them.
    Some targets use pairs of vectors and do twice the calls.  */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { ! { i686*-*-* && { ! lp64 } } } } } } */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { i686*-*-* && { ! lp64 } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { ! { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { { i?86*-*-* x86_64-*-* } && { ! lp64 } } } } } */
 
 /* The LTO test produces two dump files and we scan the wrong one.  */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17e.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17e.c
index 3b4da3d1a5f..769727e6db1 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17e.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17e.c
@@ -8,9 +8,9 @@ 
 /* Ensure the the in-branch simd clones are used on targets that support them.
    Some targets use another call for the epilogue loops.
    Some targets use pairs of vectors and do twice the calls.  */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { { ! avx_runtime } && { ! { i686*-*-* && { ! lp64 } } } } } } } */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 "vect" { target { avx_runtime && { ! { i686*-*-* && { ! lp64 } } } } } } } */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { i686*-*-* && { ! lp64 } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { { ! avx } && { ! { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 "vect" { target { avx && { ! { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { { ! avx } && { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } } */
 
 /* The LTO test produces two dump files and we scan the wrong one.  */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17f.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17f.c
index 9e4b9546818..c1dc420d2ca 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17f.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-17f.c
@@ -7,8 +7,8 @@ 
 
 /* Ensure the the in-branch simd clones are used on targets that support them.
    Some targets use pairs of vectors and do twice the calls.  */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { ! { i686*-*-* && { ! lp64 } } } } } } */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { i686*-*-* && { ! lp64 } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { ! { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { { i?86*-*-* x86_64-*-* } && { ! lp64 } } } } } */
 
 /* The LTO test produces two dump files and we scan the wrong one.  */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-18e.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-18e.c
index 9d20e52cb9a..caa3d70763f 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-18e.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-18e.c
@@ -8,9 +8,9 @@ 
 /* Ensure the the in-branch simd clones are used on targets that support them.
    Some targets use another call for the epilogue loops.
    Some targets use pairs of vectors and do twice the calls.  */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { { ! avx_runtime } && { ! { i686*-*-* && { ! lp64 } } } } } } } */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 "vect" { target { avx_runtime && { ! { i686*-*-* && { ! lp64 } } } } } } } */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { i686*-*-* && { ! lp64 } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { { ! avx } && { ! { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 3 "vect" { target { avx && { ! { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { { ! avx } && { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } } */
 
 /* The LTO test produces two dump files and we scan the wrong one.  */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-18f.c b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-18f.c
index 5907e87de13..df630c2a40b 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-simd-clone-18f.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-simd-clone-18f.c
@@ -7,8 +7,8 @@ 
 
 /* Ensure the the in-branch simd clones are used on targets that support them.
    Some targets use pairs of vectors and do twice the calls.  */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { ! { i686*-*-* && { ! lp64 } } } } } } */
-/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { i686*-*-* && { ! lp64 } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 2 "vect" { target { ! { { i?86-*-* x86_64-*-* } && { ! lp64 } } } } } } */
+/* { dg-final { scan-tree-dump-times {[\n\r] [^\n]* = foo\.simdclone} 4 "vect" { target { { i?86*-*-* x86_64-*-* } && { ! lp64 } } } } } */
 
 /* The LTO test produces two dump files and we scan the wrong one.  */
 /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */