public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix vect-simd-clone testcase dump scanning
@ 2023-04-14  9:42 Richard Biener
  2023-04-14  9:50 ` Jakub Jelinek
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Biener @ 2023-04-14  9:42 UTC (permalink / raw)
  To: gcc-patches

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(-)

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" } { "" } } */
-- 
2.35.3

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fix vect-simd-clone testcase dump scanning
  2023-04-14  9:42 [PATCH] Fix vect-simd-clone testcase dump scanning Richard Biener
@ 2023-04-14  9:50 ` Jakub Jelinek
  2023-04-14 10:15   ` Richard Biener
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Jelinek @ 2023-04-14  9:50 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fix vect-simd-clone testcase dump scanning
  2023-04-14  9:50 ` Jakub Jelinek
@ 2023-04-14 10:15   ` Richard Biener
  2023-04-14 10:25     ` Jakub Jelinek
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Biener @ 2023-04-14 10:15 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fix vect-simd-clone testcase dump scanning
  2023-04-14 10:15   ` Richard Biener
@ 2023-04-14 10:25     ` Jakub Jelinek
  2023-04-14 10:59       ` Andre Vieira (lists)
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Jelinek @ 2023-04-14 10:25 UTC (permalink / raw)
  To: Richard Biener; +Cc: gcc-patches

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fix vect-simd-clone testcase dump scanning
  2023-04-14 10:25     ` Jakub Jelinek
@ 2023-04-14 10:59       ` Andre Vieira (lists)
  2023-04-14 11:00         ` Jakub Jelinek
  0 siblings, 1 reply; 7+ messages in thread
From: Andre Vieira (lists) @ 2023-04-14 10:59 UTC (permalink / raw)
  To: Jakub Jelinek, Richard Biener; +Cc: gcc-patches

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
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fix vect-simd-clone testcase dump scanning
  2023-04-14 10:59       ` Andre Vieira (lists)
@ 2023-04-14 11:00         ` Jakub Jelinek
  2023-04-14 13:38           ` Andre Vieira (lists)
  0 siblings, 1 reply; 7+ messages in thread
From: Jakub Jelinek @ 2023-04-14 11:00 UTC (permalink / raw)
  To: Andre Vieira (lists); +Cc: Richard Biener, gcc-patches

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Fix vect-simd-clone testcase dump scanning
  2023-04-14 11:00         ` Jakub Jelinek
@ 2023-04-14 13:38           ` Andre Vieira (lists)
  0 siblings, 0 replies; 7+ messages in thread
From: Andre Vieira (lists) @ 2023-04-14 13:38 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Richard Biener, gcc-patches

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
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-04-14 13:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-14  9:42 [PATCH] Fix vect-simd-clone testcase dump scanning Richard Biener
2023-04-14  9:50 ` Jakub Jelinek
2023-04-14 10:15   ` Richard Biener
2023-04-14 10:25     ` Jakub Jelinek
2023-04-14 10:59       ` Andre Vieira (lists)
2023-04-14 11:00         ` Jakub Jelinek
2023-04-14 13:38           ` Andre Vieira (lists)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).