public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] test: Fix FAIL of pr97428.c for RVV
@ 2023-11-07  7:44 Juzhe-Zhong
  2023-11-07 10:09 ` Andrew Stubbs
  0 siblings, 1 reply; 12+ messages in thread
From: Juzhe-Zhong @ 2023-11-07  7:44 UTC (permalink / raw)
  To: gcc-patches; +Cc: jeffreyalaw, rguenther, ams, Juzhe-Zhong

This test shows vectorizing stmts using SLP 4 times instead of 2 for RVV.
The reason is RVV has 512 bit vector.
Here is comparison between RVV ans ARM SVE:
https://godbolt.org/z/xc5KE5rPs

But I notice AMDGCN also has 512 bit vector, seems this patch will cause FAIL in GCN ?

Not sure whether GCN is 2 times or 4 times ? 

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/pr97428.c: Fix FAIL for RVV.

---
 gcc/testsuite/gcc.dg/vect/pr97428.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/vect/pr97428.c b/gcc/testsuite/gcc.dg/vect/pr97428.c
index ad6416096aa..352c9bf04a7 100644
--- a/gcc/testsuite/gcc.dg/vect/pr97428.c
+++ b/gcc/testsuite/gcc.dg/vect/pr97428.c
@@ -43,5 +43,6 @@ void foo_i2(dcmlx4_t dst[], const dcmlx_t src[], int n)
 /* { dg-final { scan-tree-dump "Detected interleaving store of size 16" "vect" } } */
 /* We're not able to peel & apply re-aligning to make accesses well-aligned for !vect_hw_misalign,
    but we could by peeling the stores for alignment and applying re-aligning loads.  */
-/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { { ! vect_hw_misalign } || { vect512 } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { xfail { { ! vect_hw_misalign } || { ! vect512 } } } } } */
 /* { dg-final { scan-tree-dump-not "gap of 6 elements" "vect" } } */
-- 
2.36.3


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

* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
  2023-11-07  7:44 [PATCH] test: Fix FAIL of pr97428.c for RVV Juzhe-Zhong
@ 2023-11-07 10:09 ` Andrew Stubbs
  2023-11-07 10:10   ` juzhe.zhong
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Stubbs @ 2023-11-07 10:09 UTC (permalink / raw)
  To: Juzhe-Zhong, gcc-patches; +Cc: jeffreyalaw, rguenther

On 07/11/2023 07:44, Juzhe-Zhong wrote:
> This test shows vectorizing stmts using SLP 4 times instead of 2 for RVV.
> The reason is RVV has 512 bit vector.
> Here is comparison between RVV ans ARM SVE:
> https://godbolt.org/z/xc5KE5rPs
> 
> But I notice AMDGCN also has 512 bit vector, seems this patch will cause FAIL in GCN ?
> 
> Not sure whether GCN is 2 times or 4 times ?

The pattern matches 4 times on GCN.

> gcc/testsuite/ChangeLog:
> 
> 	* gcc.dg/vect/pr97428.c: Fix FAIL for RVV.
> 
> ---
>   gcc/testsuite/gcc.dg/vect/pr97428.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/testsuite/gcc.dg/vect/pr97428.c b/gcc/testsuite/gcc.dg/vect/pr97428.c
> index ad6416096aa..352c9bf04a7 100644
> --- a/gcc/testsuite/gcc.dg/vect/pr97428.c
> +++ b/gcc/testsuite/gcc.dg/vect/pr97428.c
> @@ -43,5 +43,6 @@ void foo_i2(dcmlx4_t dst[], const dcmlx_t src[], int n)
>   /* { dg-final { scan-tree-dump "Detected interleaving store of size 16" "vect" } } */
>   /* We're not able to peel & apply re-aligning to make accesses well-aligned for !vect_hw_misalign,
>      but we could by peeling the stores for alignment and applying re-aligning loads.  */
> -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */
> +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { { ! vect_hw_misalign } || { vect512 } } } } } */
> +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { xfail { { ! vect_hw_misalign } || { ! vect512 } } } } } */
>   /* { dg-final { scan-tree-dump-not "gap of 6 elements" "vect" } } */


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

* Re: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
  2023-11-07 10:09 ` Andrew Stubbs
@ 2023-11-07 10:10   ` juzhe.zhong
  2023-11-07 10:59     ` Andrew Stubbs
  0 siblings, 1 reply; 12+ messages in thread
From: juzhe.zhong @ 2023-11-07 10:10 UTC (permalink / raw)
  To: ams, gcc-patches; +Cc: jeffreyalaw, rguenther

[-- Attachment #1: Type: text/plain, Size: 1976 bytes --]

So, this patch not only fixes RVV FAIL, but also fixes GCN ?




juzhe.zhong@rivai.ai
 
From: Andrew Stubbs
Date: 2023-11-07 18:09
To: Juzhe-Zhong; gcc-patches@gcc.gnu.org
CC: jeffreyalaw@gmail.com; rguenther@suse.de
Subject: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
On 07/11/2023 07:44, Juzhe-Zhong wrote:
> This test shows vectorizing stmts using SLP 4 times instead of 2 for RVV.
> The reason is RVV has 512 bit vector.
> Here is comparison between RVV ans ARM SVE:
> https://godbolt.org/z/xc5KE5rPs
> 
> But I notice AMDGCN also has 512 bit vector, seems this patch will cause FAIL in GCN ?
> 
> Not sure whether GCN is 2 times or 4 times ?
 
The pattern matches 4 times on GCN.
 
> gcc/testsuite/ChangeLog:
> 
> * gcc.dg/vect/pr97428.c: Fix FAIL for RVV.
> 
> ---
>   gcc/testsuite/gcc.dg/vect/pr97428.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/testsuite/gcc.dg/vect/pr97428.c b/gcc/testsuite/gcc.dg/vect/pr97428.c
> index ad6416096aa..352c9bf04a7 100644
> --- a/gcc/testsuite/gcc.dg/vect/pr97428.c
> +++ b/gcc/testsuite/gcc.dg/vect/pr97428.c
> @@ -43,5 +43,6 @@ void foo_i2(dcmlx4_t dst[], const dcmlx_t src[], int n)
>   /* { dg-final { scan-tree-dump "Detected interleaving store of size 16" "vect" } } */
>   /* We're not able to peel & apply re-aligning to make accesses well-aligned for !vect_hw_misalign,
>      but we could by peeling the stores for alignment and applying re-aligning loads.  */
> -/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */
> +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { { ! vect_hw_misalign } || { vect512 } } } } } */
> +/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { xfail { { ! vect_hw_misalign } || { ! vect512 } } } } } */
>   /* { dg-final { scan-tree-dump-not "gap of 6 elements" "vect" } } */
 
 

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

* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
  2023-11-07 10:10   ` juzhe.zhong
@ 2023-11-07 10:59     ` Andrew Stubbs
  2023-11-07 11:05       ` juzhe.zhong
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Stubbs @ 2023-11-07 10:59 UTC (permalink / raw)
  To: juzhe.zhong, gcc-patches; +Cc: jeffreyalaw, rguenther

On 07/11/2023 10:10, juzhe.zhong@rivai.ai wrote:
> So, this patch not only fixes RVV FAIL, but also fixes GCN ?

Before the patch I have:

PASS: gcc.dg/vect/pr97428.c (test for excess errors)
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
load of size 8"
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
store of size 16"
gcc.dg/vect/pr97428.c: pattern found 4 times
XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing 
stmts using SLP" 2
PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"

With the patch I now get:

PASS: gcc.dg/vect/pr97428.c (test for excess errors)
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
load of size 8"
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
store of size 16"
gcc.dg/vect/pr97428.c: pattern found 4 times
XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing 
stmts using SLP" 2
XPASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing 
stmts using SLP" 4
PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"

It's different, but not "fixed".

Andrew

> 
> 
> ------------------------------------------------------------------------
> juzhe.zhong@rivai.ai
> 
>     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>     *Date:* 2023-11-07 18:09
>     *To:* Juzhe-Zhong <mailto:juzhe.zhong@rivai.ai>;
>     gcc-patches@gcc.gnu.org <mailto:gcc-patches@gcc.gnu.org>
>     *CC:* jeffreyalaw@gmail.com <mailto:jeffreyalaw@gmail.com>;
>     rguenther@suse.de <mailto:rguenther@suse.de>
>     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>     On 07/11/2023 07:44, Juzhe-Zhong wrote:
>      > This test shows vectorizing stmts using SLP 4 times instead of 2
>     for RVV.
>      > The reason is RVV has 512 bit vector.
>      > Here is comparison between RVV ans ARM SVE:
>      > https://godbolt.org/z/xc5KE5rPs
>      >
>      > But I notice AMDGCN also has 512 bit vector, seems this patch
>     will cause FAIL in GCN ?
>      >
>      > Not sure whether GCN is 2 times or 4 times ?
>     The pattern matches 4 times on GCN.
>      > gcc/testsuite/ChangeLog:
>      >
>      > * gcc.dg/vect/pr97428.c: Fix FAIL for RVV.
>      >
>      > ---
>      >   gcc/testsuite/gcc.dg/vect/pr97428.c | 3 ++-
>      >   1 file changed, 2 insertions(+), 1 deletion(-)
>      >
>      > diff --git a/gcc/testsuite/gcc.dg/vect/pr97428.c
>     b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      > index ad6416096aa..352c9bf04a7 100644
>      > --- a/gcc/testsuite/gcc.dg/vect/pr97428.c
>      > +++ b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      > @@ -43,5 +43,6 @@ void foo_i2(dcmlx4_t dst[], const dcmlx_t
>     src[], int n)
>      >   /* { dg-final { scan-tree-dump "Detected interleaving store of
>     size 16" "vect" } } */
>      >   /* We're not able to peel & apply re-aligning to make accesses
>     well-aligned for !vect_hw_misalign,
>      >      but we could by peeling the stores for alignment and
>     applying re-aligning loads.  */
>      > -/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>     SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */
>      > +/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>     SLP" 2 "vect" { xfail { { ! vect_hw_misalign } || { vect512 } } } } } */
>      > +/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>     SLP" 4 "vect" { xfail { { ! vect_hw_misalign } || { ! vect512 } } }
>     } } */
>      >   /* { dg-final { scan-tree-dump-not "gap of 6 elements" "vect" }
>     } */
> 


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

* Re: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
  2023-11-07 10:59     ` Andrew Stubbs
@ 2023-11-07 11:05       ` juzhe.zhong
  2023-11-07 11:21         ` Andrew Stubbs
  0 siblings, 1 reply; 12+ messages in thread
From: juzhe.zhong @ 2023-11-07 11:05 UTC (permalink / raw)
  To: ams, gcc-patches; +Cc: jeffreyalaw, rguenther

[-- Attachment #1: Type: text/plain, Size: 4162 bytes --]

Could you try this ?

/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { xfail { { ! vect_hw_misalign } || { vect512 } } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { xfail { ! vect512 } } } } */



juzhe.zhong@rivai.ai
 
From: Andrew Stubbs
Date: 2023-11-07 18:59
To: juzhe.zhong@rivai.ai; gcc-patches
CC: jeffreyalaw; rguenther
Subject: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
On 07/11/2023 10:10, juzhe.zhong@rivai.ai wrote:
> So, this patch not only fixes RVV FAIL, but also fixes GCN ?
 
Before the patch I have:
 
PASS: gcc.dg/vect/pr97428.c (test for excess errors)
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
load of size 8"
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
store of size 16"
gcc.dg/vect/pr97428.c: pattern found 4 times
XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing 
stmts using SLP" 2
PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"
 
With the patch I now get:
 
PASS: gcc.dg/vect/pr97428.c (test for excess errors)
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
load of size 8"
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
store of size 16"
gcc.dg/vect/pr97428.c: pattern found 4 times
XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing 
stmts using SLP" 2
XPASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing 
stmts using SLP" 4
PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"
 
It's different, but not "fixed".
 
Andrew
 
> 
> 
> ------------------------------------------------------------------------
> juzhe.zhong@rivai.ai
> 
>     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>     *Date:* 2023-11-07 18:09
>     *To:* Juzhe-Zhong <mailto:juzhe.zhong@rivai.ai>;
>     gcc-patches@gcc.gnu.org <mailto:gcc-patches@gcc.gnu.org>
>     *CC:* jeffreyalaw@gmail.com <mailto:jeffreyalaw@gmail.com>;
>     rguenther@suse.de <mailto:rguenther@suse.de>
>     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>     On 07/11/2023 07:44, Juzhe-Zhong wrote:
>      > This test shows vectorizing stmts using SLP 4 times instead of 2
>     for RVV.
>      > The reason is RVV has 512 bit vector.
>      > Here is comparison between RVV ans ARM SVE:
>      > https://godbolt.org/z/xc5KE5rPs
>      >
>      > But I notice AMDGCN also has 512 bit vector, seems this patch
>     will cause FAIL in GCN ?
>      >
>      > Not sure whether GCN is 2 times or 4 times ?
>     The pattern matches 4 times on GCN.
>      > gcc/testsuite/ChangeLog:
>      >
>      > * gcc.dg/vect/pr97428.c: Fix FAIL for RVV.
>      >
>      > ---
>      >   gcc/testsuite/gcc.dg/vect/pr97428.c | 3 ++-
>      >   1 file changed, 2 insertions(+), 1 deletion(-)
>      >
>      > diff --git a/gcc/testsuite/gcc.dg/vect/pr97428.c
>     b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      > index ad6416096aa..352c9bf04a7 100644
>      > --- a/gcc/testsuite/gcc.dg/vect/pr97428.c
>      > +++ b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      > @@ -43,5 +43,6 @@ void foo_i2(dcmlx4_t dst[], const dcmlx_t
>     src[], int n)
>      >   /* { dg-final { scan-tree-dump "Detected interleaving store of
>     size 16" "vect" } } */
>      >   /* We're not able to peel & apply re-aligning to make accesses
>     well-aligned for !vect_hw_misalign,
>      >      but we could by peeling the stores for alignment and
>     applying re-aligning loads.  */
>      > -/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>     SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */
>      > +/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>     SLP" 2 "vect" { xfail { { ! vect_hw_misalign } || { vect512 } } } } } */
>      > +/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>     SLP" 4 "vect" { xfail { { ! vect_hw_misalign } || { ! vect512 } } }
>     } } */
>      >   /* { dg-final { scan-tree-dump-not "gap of 6 elements" "vect" }
>     } */
> 
 
 

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

* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
  2023-11-07 11:05       ` juzhe.zhong
@ 2023-11-07 11:21         ` Andrew Stubbs
  2023-11-07 11:23           ` juzhe.zhong
       [not found]           ` <202311071923515706180@rivai.ai>
  0 siblings, 2 replies; 12+ messages in thread
From: Andrew Stubbs @ 2023-11-07 11:21 UTC (permalink / raw)
  To: juzhe.zhong, gcc-patches; +Cc: jeffreyalaw, rguenther

On 07/11/2023 11:05, juzhe.zhong@rivai.ai wrote:
> Could you try this ?
> 
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 
> "vect" { xfail { { ! vect_hw_misalign } || { vect512 } } } } } */
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 
> "vect" { xfail { ! vect512 } } } } */

PASS: gcc.dg/vect/pr97428.c (test for excess errors)
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
load of size 8"
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
store of size 16"
gcc.dg/vect/pr97428.c: pattern found 4 times
XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing 
stmts using SLP" 2
PASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing stmts 
using SLP" 4
PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"

The passes are all correct (assuming that 4 matches are a valid number), 
but if you have mutliple patterns with contractictory expectations then 
you probably want to use "target" rather than "xfail" to avoid the noise 
(and invert the conditions, obviously).

Andrew

> ------------------------------------------------------------------------
> juzhe.zhong@rivai.ai
> 
>     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>     *Date:* 2023-11-07 18:59
>     *To:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>;
>     gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>     *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>     <mailto:rguenther@suse.de>
>     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>     On 07/11/2023 10:10, juzhe.zhong@rivai.ai wrote:
>      > So, this patch not only fixes RVV FAIL, but also fixes GCN ?
>     Before the patch I have:
>     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving
>     load of size 8"
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving
>     store of size 16"
>     gcc.dg/vect/pr97428.c: pattern found 4 times
>     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing
>     stmts using SLP" 2
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"
>     With the patch I now get:
>     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving
>     load of size 8"
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving
>     store of size 16"
>     gcc.dg/vect/pr97428.c: pattern found 4 times
>     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing
>     stmts using SLP" 2
>     XPASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing
>     stmts using SLP" 4
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"
>     It's different, but not "fixed".
>     Andrew
>      >
>      >
>      >
>     ------------------------------------------------------------------------
>      > juzhe.zhong@rivai.ai
>      >
>      >     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>      >     *Date:* 2023-11-07 18:09
>      >     *To:* Juzhe-Zhong <mailto:juzhe.zhong@rivai.ai>;
>      >     gcc-patches@gcc.gnu.org <mailto:gcc-patches@gcc.gnu.org>
>      >     *CC:* jeffreyalaw@gmail.com <mailto:jeffreyalaw@gmail.com>;
>      >     rguenther@suse.de <mailto:rguenther@suse.de>
>      >     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>      >     On 07/11/2023 07:44, Juzhe-Zhong wrote:
>      >      > This test shows vectorizing stmts using SLP 4 times
>     instead of 2
>      >     for RVV.
>      >      > The reason is RVV has 512 bit vector.
>      >      > Here is comparison between RVV ans ARM SVE:
>      >      > https://godbolt.org/z/xc5KE5rPs
>      >      >
>      >      > But I notice AMDGCN also has 512 bit vector, seems this patch
>      >     will cause FAIL in GCN ?
>      >      >
>      >      > Not sure whether GCN is 2 times or 4 times ?
>      >     The pattern matches 4 times on GCN.
>      >      > gcc/testsuite/ChangeLog:
>      >      >
>      >      > * gcc.dg/vect/pr97428.c: Fix FAIL for RVV.
>      >      >
>      >      > ---
>      >      >   gcc/testsuite/gcc.dg/vect/pr97428.c | 3 ++-
>      >      >   1 file changed, 2 insertions(+), 1 deletion(-)
>      >      >
>      >      > diff --git a/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >     b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >      > index ad6416096aa..352c9bf04a7 100644
>      >      > --- a/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >      > +++ b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >      > @@ -43,5 +43,6 @@ void foo_i2(dcmlx4_t dst[], const dcmlx_t
>      >     src[], int n)
>      >      >   /* { dg-final { scan-tree-dump "Detected interleaving
>     store of
>      >     size 16" "vect" } } */
>      >      >   /* We're not able to peel & apply re-aligning to make
>     accesses
>      >     well-aligned for !vect_hw_misalign,
>      >      >      but we could by peeling the stores for alignment and
>      >     applying re-aligning loads.  */
>      >      > -/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>      >     SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */
>      >      > +/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>      >     SLP" 2 "vect" { xfail { { ! vect_hw_misalign } || { vect512 }
>     } } } } */
>      >      > +/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>      >     SLP" 4 "vect" { xfail { { ! vect_hw_misalign } || { ! vect512
>     } } }
>      >     } } */
>      >      >   /* { dg-final { scan-tree-dump-not "gap of 6 elements"
>     "vect" }
>      >     } */
>      >
> 


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

* Re: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
  2023-11-07 11:21         ` Andrew Stubbs
@ 2023-11-07 11:23           ` juzhe.zhong
       [not found]           ` <202311071923515706180@rivai.ai>
  1 sibling, 0 replies; 12+ messages in thread
From: juzhe.zhong @ 2023-11-07 11:23 UTC (permalink / raw)
  To: ams, gcc-patches; +Cc: jeffreyalaw, rguenther

[-- Attachment #1: Type: text/plain, Size: 6466 bytes --]

Do you mean this ?

/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { { ! vect_hw_misalign } || { vect512 } } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { xfail { ! vect512 } } } } */

Could you try again ? If it works for you, I am gonna send V2 patch to Richi.

Thank you so much for help.


juzhe.zhong@rivai.ai
 
From: Andrew Stubbs
Date: 2023-11-07 19:21
To: juzhe.zhong@rivai.ai; gcc-patches
CC: jeffreyalaw; rguenther
Subject: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
On 07/11/2023 11:05, juzhe.zhong@rivai.ai wrote:
> Could you try this ?
> 
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 
> "vect" { xfail { { ! vect_hw_misalign } || { vect512 } } } } } */
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 
> "vect" { xfail { ! vect512 } } } } */
 
PASS: gcc.dg/vect/pr97428.c (test for excess errors)
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
load of size 8"
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
store of size 16"
gcc.dg/vect/pr97428.c: pattern found 4 times
XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing 
stmts using SLP" 2
PASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing stmts 
using SLP" 4
PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"
 
The passes are all correct (assuming that 4 matches are a valid number), 
but if you have mutliple patterns with contractictory expectations then 
you probably want to use "target" rather than "xfail" to avoid the noise 
(and invert the conditions, obviously).
 
Andrew
 
> ------------------------------------------------------------------------
> juzhe.zhong@rivai.ai
> 
>     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>     *Date:* 2023-11-07 18:59
>     *To:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>;
>     gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>     *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>     <mailto:rguenther@suse.de>
>     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>     On 07/11/2023 10:10, juzhe.zhong@rivai.ai wrote:
>      > So, this patch not only fixes RVV FAIL, but also fixes GCN ?
>     Before the patch I have:
>     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving
>     load of size 8"
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving
>     store of size 16"
>     gcc.dg/vect/pr97428.c: pattern found 4 times
>     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing
>     stmts using SLP" 2
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"
>     With the patch I now get:
>     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving
>     load of size 8"
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving
>     store of size 16"
>     gcc.dg/vect/pr97428.c: pattern found 4 times
>     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing
>     stmts using SLP" 2
>     XPASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing
>     stmts using SLP" 4
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"
>     It's different, but not "fixed".
>     Andrew
>      >
>      >
>      >
>     ------------------------------------------------------------------------
>      > juzhe.zhong@rivai.ai
>      >
>      >     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>      >     *Date:* 2023-11-07 18:09
>      >     *To:* Juzhe-Zhong <mailto:juzhe.zhong@rivai.ai>;
>      >     gcc-patches@gcc.gnu.org <mailto:gcc-patches@gcc.gnu.org>
>      >     *CC:* jeffreyalaw@gmail.com <mailto:jeffreyalaw@gmail.com>;
>      >     rguenther@suse.de <mailto:rguenther@suse.de>
>      >     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>      >     On 07/11/2023 07:44, Juzhe-Zhong wrote:
>      >      > This test shows vectorizing stmts using SLP 4 times
>     instead of 2
>      >     for RVV.
>      >      > The reason is RVV has 512 bit vector.
>      >      > Here is comparison between RVV ans ARM SVE:
>      >      > https://godbolt.org/z/xc5KE5rPs
>      >      >
>      >      > But I notice AMDGCN also has 512 bit vector, seems this patch
>      >     will cause FAIL in GCN ?
>      >      >
>      >      > Not sure whether GCN is 2 times or 4 times ?
>      >     The pattern matches 4 times on GCN.
>      >      > gcc/testsuite/ChangeLog:
>      >      >
>      >      > * gcc.dg/vect/pr97428.c: Fix FAIL for RVV.
>      >      >
>      >      > ---
>      >      >   gcc/testsuite/gcc.dg/vect/pr97428.c | 3 ++-
>      >      >   1 file changed, 2 insertions(+), 1 deletion(-)
>      >      >
>      >      > diff --git a/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >     b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >      > index ad6416096aa..352c9bf04a7 100644
>      >      > --- a/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >      > +++ b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >      > @@ -43,5 +43,6 @@ void foo_i2(dcmlx4_t dst[], const dcmlx_t
>      >     src[], int n)
>      >      >   /* { dg-final { scan-tree-dump "Detected interleaving
>     store of
>      >     size 16" "vect" } } */
>      >      >   /* We're not able to peel & apply re-aligning to make
>     accesses
>      >     well-aligned for !vect_hw_misalign,
>      >      >      but we could by peeling the stores for alignment and
>      >     applying re-aligning loads.  */
>      >      > -/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>      >     SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */
>      >      > +/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>      >     SLP" 2 "vect" { xfail { { ! vect_hw_misalign } || { vect512 }
>     } } } } */
>      >      > +/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>      >     SLP" 4 "vect" { xfail { { ! vect_hw_misalign } || { ! vect512
>     } } }
>      >     } } */
>      >      >   /* { dg-final { scan-tree-dump-not "gap of 6 elements"
>     "vect" }
>      >     } */
>      >
> 
 
 

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

* Re: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
       [not found]           ` <202311071923515706180@rivai.ai>
@ 2023-11-07 11:24             ` juzhe.zhong
  2023-11-07 11:44               ` Andrew Stubbs
  0 siblings, 1 reply; 12+ messages in thread
From: juzhe.zhong @ 2023-11-07 11:24 UTC (permalink / raw)
  To: ams, gcc-patches; +Cc: jeffreyalaw, rguenther

[-- Attachment #1: Type: text/plain, Size: 6949 bytes --]

Oh. Sorry maybe it's better like this:

/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { { ! vect_hw_misalign } || { vect512 } } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { target { ! vect512 } } } } */



juzhe.zhong@rivai.ai
 
From: juzhe.zhong@rivai.ai
Date: 2023-11-07 19:23
To: ams; gcc-patches
CC: jeffreyalaw; rguenther
Subject: Re: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
Do you mean this ?

/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { { ! vect_hw_misalign } || { vect512 } } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { xfail { ! vect512 } } } } */

Could you try again ? If it works for you, I am gonna send V2 patch to Richi.

Thank you so much for help.


juzhe.zhong@rivai.ai
 
From: Andrew Stubbs
Date: 2023-11-07 19:21
To: juzhe.zhong@rivai.ai; gcc-patches
CC: jeffreyalaw; rguenther
Subject: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
On 07/11/2023 11:05, juzhe.zhong@rivai.ai wrote:
> Could you try this ?
> 
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 
> "vect" { xfail { { ! vect_hw_misalign } || { vect512 } } } } } */
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 
> "vect" { xfail { ! vect512 } } } } */
 
PASS: gcc.dg/vect/pr97428.c (test for excess errors)
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
load of size 8"
PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving 
store of size 16"
gcc.dg/vect/pr97428.c: pattern found 4 times
XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing 
stmts using SLP" 2
PASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing stmts 
using SLP" 4
PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"
 
The passes are all correct (assuming that 4 matches are a valid number), 
but if you have mutliple patterns with contractictory expectations then 
you probably want to use "target" rather than "xfail" to avoid the noise 
(and invert the conditions, obviously).
 
Andrew
 
> ------------------------------------------------------------------------
> juzhe.zhong@rivai.ai
> 
>     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>     *Date:* 2023-11-07 18:59
>     *To:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>;
>     gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>     *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>     <mailto:rguenther@suse.de>
>     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>     On 07/11/2023 10:10, juzhe.zhong@rivai.ai wrote:
>      > So, this patch not only fixes RVV FAIL, but also fixes GCN ?
>     Before the patch I have:
>     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving
>     load of size 8"
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving
>     store of size 16"
>     gcc.dg/vect/pr97428.c: pattern found 4 times
>     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing
>     stmts using SLP" 2
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"
>     With the patch I now get:
>     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving
>     load of size 8"
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected interleaving
>     store of size 16"
>     gcc.dg/vect/pr97428.c: pattern found 4 times
>     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing
>     stmts using SLP" 2
>     XPASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing
>     stmts using SLP" 4
>     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6 elements"
>     It's different, but not "fixed".
>     Andrew
>      >
>      >
>      >
>     ------------------------------------------------------------------------
>      > juzhe.zhong@rivai.ai
>      >
>      >     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>      >     *Date:* 2023-11-07 18:09
>      >     *To:* Juzhe-Zhong <mailto:juzhe.zhong@rivai.ai>;
>      >     gcc-patches@gcc.gnu.org <mailto:gcc-patches@gcc.gnu.org>
>      >     *CC:* jeffreyalaw@gmail.com <mailto:jeffreyalaw@gmail.com>;
>      >     rguenther@suse.de <mailto:rguenther@suse.de>
>      >     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>      >     On 07/11/2023 07:44, Juzhe-Zhong wrote:
>      >      > This test shows vectorizing stmts using SLP 4 times
>     instead of 2
>      >     for RVV.
>      >      > The reason is RVV has 512 bit vector.
>      >      > Here is comparison between RVV ans ARM SVE:
>      >      > https://godbolt.org/z/xc5KE5rPs
>      >      >
>      >      > But I notice AMDGCN also has 512 bit vector, seems this patch
>      >     will cause FAIL in GCN ?
>      >      >
>      >      > Not sure whether GCN is 2 times or 4 times ?
>      >     The pattern matches 4 times on GCN.
>      >      > gcc/testsuite/ChangeLog:
>      >      >
>      >      > * gcc.dg/vect/pr97428.c: Fix FAIL for RVV.
>      >      >
>      >      > ---
>      >      >   gcc/testsuite/gcc.dg/vect/pr97428.c | 3 ++-
>      >      >   1 file changed, 2 insertions(+), 1 deletion(-)
>      >      >
>      >      > diff --git a/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >     b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >      > index ad6416096aa..352c9bf04a7 100644
>      >      > --- a/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >      > +++ b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >      > @@ -43,5 +43,6 @@ void foo_i2(dcmlx4_t dst[], const dcmlx_t
>      >     src[], int n)
>      >      >   /* { dg-final { scan-tree-dump "Detected interleaving
>     store of
>      >     size 16" "vect" } } */
>      >      >   /* We're not able to peel & apply re-aligning to make
>     accesses
>      >     well-aligned for !vect_hw_misalign,
>      >      >      but we could by peeling the stores for alignment and
>      >     applying re-aligning loads.  */
>      >      > -/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>      >     SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */
>      >      > +/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>      >     SLP" 2 "vect" { xfail { { ! vect_hw_misalign } || { vect512 }
>     } } } } */
>      >      > +/* { dg-final { scan-tree-dump-times "vectorizing stmts using
>      >     SLP" 4 "vect" { xfail { { ! vect_hw_misalign } || { ! vect512
>     } } }
>      >     } } */
>      >      >   /* { dg-final { scan-tree-dump-not "gap of 6 elements"
>     "vect" }
>      >     } */
>      >
> 
 
 

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

* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
  2023-11-07 11:24             ` juzhe.zhong
@ 2023-11-07 11:44               ` Andrew Stubbs
  2023-11-07 12:03                 ` juzhe.zhong
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Stubbs @ 2023-11-07 11:44 UTC (permalink / raw)
  To: juzhe.zhong, gcc-patches; +Cc: jeffreyalaw, rguenther

On 07/11/2023 11:24, juzhe.zhong@rivai.ai wrote:
> Oh. Sorry maybe it's better like this:
> 
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 
> "vect" { target { { ! vect_hw_misalign } || { vect512 } } } } } */
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 
> "vect" { target{ ! vect512 } } } } */

The conditions are backwards; this expects vect512 machines to match 
twice. Also I think there's a space missing.

Andrew

> 
> ------------------------------------------------------------------------
> juzhe.zhong@rivai.ai
> 
>     *From:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>
>     *Date:* 2023-11-07 19:23
>     *To:* ams <mailto:ams@codesourcery.com>; gcc-patches
>     <mailto:gcc-patches@gcc.gnu.org>
>     *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>     <mailto:rguenther@suse.de>
>     *Subject:* Re: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>     Do you mean this ?
> 
>     /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2
>     "vect" { target { { ! vect_hw_misalign } || { vect512 } } } } } */
>     /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4
>     "vect" { xfail { ! vect512 } } } } */
> 
>     Could you try again ? If it works for you, I am gonna send V2 patch
>     to Richi.
> 
>     Thank you so much for help.
>     ------------------------------------------------------------------------
>     juzhe.zhong@rivai.ai
> 
>         *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>         *Date:* 2023-11-07 19:21
>         *To:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>;
>         gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>         *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>         <mailto:rguenther@suse.de>
>         *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>         On 07/11/2023 11:05, juzhe.zhong@rivai.ai wrote:
>          > Could you try this ?
>          >
>          > /* { dg-final { scan-tree-dump-times "vectorizing stmts using
>         SLP" 2
>          > "vect" { xfail { { ! vect_hw_misalign } || { vect512 } } } } } */
>          > /* { dg-final { scan-tree-dump-times "vectorizing stmts using
>         SLP" 4
>          > "vect" { xfail { ! vect512 } } } } */
>         PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>         PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>         interleaving
>         load of size 8"
>         PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>         interleaving
>         store of size 16"
>         gcc.dg/vect/pr97428.c: pattern found 4 times
>         XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing
>         stmts using SLP" 2
>         PASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>         "vectorizing stmts
>         using SLP" 4
>         PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6
>         elements"
>         The passes are all correct (assuming that 4 matches are a valid
>         number),
>         but if you have mutliple patterns with contractictory
>         expectations then
>         you probably want to use "target" rather than "xfail" to avoid
>         the noise
>         (and invert the conditions, obviously).
>         Andrew
>          >
>         ------------------------------------------------------------------------
>          > juzhe.zhong@rivai.ai
>          >
>          >     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>          >     *Date:* 2023-11-07 18:59
>          >     *To:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>;
>          >     gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>          >     *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>          >     <mailto:rguenther@suse.de>
>          >     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>          >     On 07/11/2023 10:10, juzhe.zhong@rivai.ai wrote:
>          >      > So, this patch not only fixes RVV FAIL, but also fixes
>         GCN ?
>          >     Before the patch I have:
>          >     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>         interleaving
>          >     load of size 8"
>          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>         interleaving
>          >     store of size 16"
>          >     gcc.dg/vect/pr97428.c: pattern found 4 times
>          >     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>         "vectorizing
>          >     stmts using SLP" 2
>          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap
>         of 6 elements"
>          >     With the patch I now get:
>          >     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>         interleaving
>          >     load of size 8"
>          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>         interleaving
>          >     store of size 16"
>          >     gcc.dg/vect/pr97428.c: pattern found 4 times
>          >     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>         "vectorizing
>          >     stmts using SLP" 2
>          >     XPASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>         "vectorizing
>          >     stmts using SLP" 4
>          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap
>         of 6 elements"
>          >     It's different, but not "fixed".
>          >     Andrew
>          >      >
>          >      >
>          >      >
>          >    
>         ------------------------------------------------------------------------
>          >      > juzhe.zhong@rivai.ai
>          >      >
>          >      >     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>          >      >     *Date:* 2023-11-07 18:09
>          >      >     *To:* Juzhe-Zhong <mailto:juzhe.zhong@rivai.ai>;
>          >      >     gcc-patches@gcc.gnu.org
>         <mailto:gcc-patches@gcc.gnu.org>
>          >      >     *CC:* jeffreyalaw@gmail.com
>         <mailto:jeffreyalaw@gmail.com>;
>          >      >     rguenther@suse.de <mailto:rguenther@suse.de>
>          >      >     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c
>         for RVV
>          >      >     On 07/11/2023 07:44, Juzhe-Zhong wrote:
>          >      >      > This test shows vectorizing stmts using SLP 4 times
>          >     instead of 2
>          >      >     for RVV.
>          >      >      > The reason is RVV has 512 bit vector.
>          >      >      > Here is comparison between RVV ans ARM SVE:
>          >      >      > https://godbolt.org/z/xc5KE5rPs
>          >      >      >
>          >      >      > But I notice AMDGCN also has 512 bit vector,
>         seems this patch
>          >      >     will cause FAIL in GCN ?
>          >      >      >
>          >      >      > Not sure whether GCN is 2 times or 4 times ?
>          >      >     The pattern matches 4 times on GCN.
>          >      >      > gcc/testsuite/ChangeLog:
>          >      >      >
>          >      >      > * gcc.dg/vect/pr97428.c: Fix FAIL for RVV.
>          >      >      >
>          >      >      > ---
>          >      >      >   gcc/testsuite/gcc.dg/vect/pr97428.c | 3 ++-
>          >      >      >   1 file changed, 2 insertions(+), 1 deletion(-)
>          >      >      >
>          >      >      > diff --git a/gcc/testsuite/gcc.dg/vect/pr97428.c
>          >      >     b/gcc/testsuite/gcc.dg/vect/pr97428.c
>          >      >      > index ad6416096aa..352c9bf04a7 100644
>          >      >      > --- a/gcc/testsuite/gcc.dg/vect/pr97428.c
>          >      >      > +++ b/gcc/testsuite/gcc.dg/vect/pr97428.c
>          >      >      > @@ -43,5 +43,6 @@ void foo_i2(dcmlx4_t dst[],
>         const dcmlx_t
>          >      >     src[], int n)
>          >      >      >   /* { dg-final { scan-tree-dump "Detected
>         interleaving
>          >     store of
>          >      >     size 16" "vect" } } */
>          >      >      >   /* We're not able to peel & apply re-aligning
>         to make
>          >     accesses
>          >      >     well-aligned for !vect_hw_misalign,
>          >      >      >      but we could by peeling the stores for
>         alignment and
>          >      >     applying re-aligning loads.  */
>          >      >      > -/* { dg-final { scan-tree-dump-times
>         "vectorizing stmts using
>          >      >     SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */
>          >      >      > +/* { dg-final { scan-tree-dump-times
>         "vectorizing stmts using
>          >      >     SLP" 2 "vect" { xfail { { ! vect_hw_misalign } ||
>         { vect512 }
>          >     } } } } */
>          >      >      > +/* { dg-final { scan-tree-dump-times
>         "vectorizing stmts using
>          >      >     SLP" 4 "vect" { xfail { { ! vect_hw_misalign } ||
>         { ! vect512
>          >     } } }
>          >      >     } } */
>          >      >      >   /* { dg-final { scan-tree-dump-not "gap of 6
>         elements"
>          >     "vect" }
>          >      >     } */
>          >      >
>          >
> 


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

* Re: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
  2023-11-07 11:44               ` Andrew Stubbs
@ 2023-11-07 12:03                 ` juzhe.zhong
  2023-11-07 12:05                   ` Andrew Stubbs
  0 siblings, 1 reply; 12+ messages in thread
From: juzhe.zhong @ 2023-11-07 12:03 UTC (permalink / raw)
  To: ams, gcc-patches; +Cc: jeffreyalaw, rguenther

[-- Attachment #1: Type: text/plain, Size: 10018 bytes --]

Sorry I made a mistake here.

Does it work for you ?

/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" { target { { vect_hw_misalign } && { ! vect512 } } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 "vect" { target { vect512 } } } } */

Tested on RVV is OK.


juzhe.zhong@rivai.ai
 
From: Andrew Stubbs
Date: 2023-11-07 19:44
To: juzhe.zhong@rivai.ai; gcc-patches
CC: jeffreyalaw; rguenther
Subject: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
On 07/11/2023 11:24, juzhe.zhong@rivai.ai wrote:
> Oh. Sorry maybe it's better like this:
> 
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 
> "vect" { target { { ! vect_hw_misalign } || { vect512 } } } } } */
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 
> "vect" { target{ ! vect512 } } } } */
 
The conditions are backwards; this expects vect512 machines to match 
twice. Also I think there's a space missing.
 
Andrew
 
> 
> ------------------------------------------------------------------------
> juzhe.zhong@rivai.ai
> 
>     *From:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>
>     *Date:* 2023-11-07 19:23
>     *To:* ams <mailto:ams@codesourcery.com>; gcc-patches
>     <mailto:gcc-patches@gcc.gnu.org>
>     *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>     <mailto:rguenther@suse.de>
>     *Subject:* Re: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>     Do you mean this ?
> 
>     /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2
>     "vect" { target { { ! vect_hw_misalign } || { vect512 } } } } } */
>     /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4
>     "vect" { xfail { ! vect512 } } } } */
> 
>     Could you try again ? If it works for you, I am gonna send V2 patch
>     to Richi.
> 
>     Thank you so much for help.
>     ------------------------------------------------------------------------
>     juzhe.zhong@rivai.ai
> 
>         *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>         *Date:* 2023-11-07 19:21
>         *To:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>;
>         gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>         *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>         <mailto:rguenther@suse.de>
>         *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>         On 07/11/2023 11:05, juzhe.zhong@rivai.ai wrote:
>          > Could you try this ?
>          >
>          > /* { dg-final { scan-tree-dump-times "vectorizing stmts using
>         SLP" 2
>          > "vect" { xfail { { ! vect_hw_misalign } || { vect512 } } } } } */
>          > /* { dg-final { scan-tree-dump-times "vectorizing stmts using
>         SLP" 4
>          > "vect" { xfail { ! vect512 } } } } */
>         PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>         PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>         interleaving
>         load of size 8"
>         PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>         interleaving
>         store of size 16"
>         gcc.dg/vect/pr97428.c: pattern found 4 times
>         XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect "vectorizing
>         stmts using SLP" 2
>         PASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>         "vectorizing stmts
>         using SLP" 4
>         PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6
>         elements"
>         The passes are all correct (assuming that 4 matches are a valid
>         number),
>         but if you have mutliple patterns with contractictory
>         expectations then
>         you probably want to use "target" rather than "xfail" to avoid
>         the noise
>         (and invert the conditions, obviously).
>         Andrew
>          >
>         ------------------------------------------------------------------------
>          > juzhe.zhong@rivai.ai
>          >
>          >     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>          >     *Date:* 2023-11-07 18:59
>          >     *To:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>;
>          >     gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>          >     *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>          >     <mailto:rguenther@suse.de>
>          >     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>          >     On 07/11/2023 10:10, juzhe.zhong@rivai.ai wrote:
>          >      > So, this patch not only fixes RVV FAIL, but also fixes
>         GCN ?
>          >     Before the patch I have:
>          >     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>         interleaving
>          >     load of size 8"
>          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>         interleaving
>          >     store of size 16"
>          >     gcc.dg/vect/pr97428.c: pattern found 4 times
>          >     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>         "vectorizing
>          >     stmts using SLP" 2
>          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap
>         of 6 elements"
>          >     With the patch I now get:
>          >     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>         interleaving
>          >     load of size 8"
>          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>         interleaving
>          >     store of size 16"
>          >     gcc.dg/vect/pr97428.c: pattern found 4 times
>          >     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>         "vectorizing
>          >     stmts using SLP" 2
>          >     XPASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>         "vectorizing
>          >     stmts using SLP" 4
>          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap
>         of 6 elements"
>          >     It's different, but not "fixed".
>          >     Andrew
>          >      >
>          >      >
>          >      >
>          >    
>         ------------------------------------------------------------------------
>          >      > juzhe.zhong@rivai.ai
>          >      >
>          >      >     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>          >      >     *Date:* 2023-11-07 18:09
>          >      >     *To:* Juzhe-Zhong <mailto:juzhe.zhong@rivai.ai>;
>          >      >     gcc-patches@gcc.gnu.org
>         <mailto:gcc-patches@gcc.gnu.org>
>          >      >     *CC:* jeffreyalaw@gmail.com
>         <mailto:jeffreyalaw@gmail.com>;
>          >      >     rguenther@suse.de <mailto:rguenther@suse.de>
>          >      >     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c
>         for RVV
>          >      >     On 07/11/2023 07:44, Juzhe-Zhong wrote:
>          >      >      > This test shows vectorizing stmts using SLP 4 times
>          >     instead of 2
>          >      >     for RVV.
>          >      >      > The reason is RVV has 512 bit vector.
>          >      >      > Here is comparison between RVV ans ARM SVE:
>          >      >      > https://godbolt.org/z/xc5KE5rPs
>          >      >      >
>          >      >      > But I notice AMDGCN also has 512 bit vector,
>         seems this patch
>          >      >     will cause FAIL in GCN ?
>          >      >      >
>          >      >      > Not sure whether GCN is 2 times or 4 times ?
>          >      >     The pattern matches 4 times on GCN.
>          >      >      > gcc/testsuite/ChangeLog:
>          >      >      >
>          >      >      > * gcc.dg/vect/pr97428.c: Fix FAIL for RVV.
>          >      >      >
>          >      >      > ---
>          >      >      >   gcc/testsuite/gcc.dg/vect/pr97428.c | 3 ++-
>          >      >      >   1 file changed, 2 insertions(+), 1 deletion(-)
>          >      >      >
>          >      >      > diff --git a/gcc/testsuite/gcc.dg/vect/pr97428.c
>          >      >     b/gcc/testsuite/gcc.dg/vect/pr97428.c
>          >      >      > index ad6416096aa..352c9bf04a7 100644
>          >      >      > --- a/gcc/testsuite/gcc.dg/vect/pr97428.c
>          >      >      > +++ b/gcc/testsuite/gcc.dg/vect/pr97428.c
>          >      >      > @@ -43,5 +43,6 @@ void foo_i2(dcmlx4_t dst[],
>         const dcmlx_t
>          >      >     src[], int n)
>          >      >      >   /* { dg-final { scan-tree-dump "Detected
>         interleaving
>          >     store of
>          >      >     size 16" "vect" } } */
>          >      >      >   /* We're not able to peel & apply re-aligning
>         to make
>          >     accesses
>          >      >     well-aligned for !vect_hw_misalign,
>          >      >      >      but we could by peeling the stores for
>         alignment and
>          >      >     applying re-aligning loads.  */
>          >      >      > -/* { dg-final { scan-tree-dump-times
>         "vectorizing stmts using
>          >      >     SLP" 2 "vect" { xfail { ! vect_hw_misalign } } } } */
>          >      >      > +/* { dg-final { scan-tree-dump-times
>         "vectorizing stmts using
>          >      >     SLP" 2 "vect" { xfail { { ! vect_hw_misalign } ||
>         { vect512 }
>          >     } } } } */
>          >      >      > +/* { dg-final { scan-tree-dump-times
>         "vectorizing stmts using
>          >      >     SLP" 4 "vect" { xfail { { ! vect_hw_misalign } ||
>         { ! vect512
>          >     } } }
>          >      >     } } */
>          >      >      >   /* { dg-final { scan-tree-dump-not "gap of 6
>         elements"
>          >     "vect" }
>          >      >     } */
>          >      >
>          >
> 
 
 

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

* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
  2023-11-07 12:03                 ` juzhe.zhong
@ 2023-11-07 12:05                   ` Andrew Stubbs
  2023-11-07 12:07                     ` juzhe.zhong
  0 siblings, 1 reply; 12+ messages in thread
From: Andrew Stubbs @ 2023-11-07 12:05 UTC (permalink / raw)
  To: juzhe.zhong, gcc-patches; +Cc: jeffreyalaw, rguenther

On 07/11/2023 12:03, juzhe.zhong@rivai.ai wrote:
> Sorry I made a mistake here.
> 
> Does it work for you ?
> 
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 
> "vect" { target { { vect_hw_misalign } && { ! vect512 } } } } } */
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 
> "vect" { target { vect512 } } } } */
> 
> Tested on RVV is OK.

5 PASS on amdgcn also.

Andrew

> ------------------------------------------------------------------------
> juzhe.zhong@rivai.ai
> 
>     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>     *Date:* 2023-11-07 19:44
>     *To:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>;
>     gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>     *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>     <mailto:rguenther@suse.de>
>     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>     On 07/11/2023 11:24, juzhe.zhong@rivai.ai wrote:
>      > Oh. Sorry maybe it's better like this:
>      >
>      > /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2
>      > "vect" { target { { ! vect_hw_misalign } || { vect512 } } } } } */
>      > /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4
>      > "vect" { target{ ! vect512 } } } } */
>     The conditions are backwards; this expects vect512 machines to match
>     twice. Also I think there's a space missing.
>     Andrew
>      >
>      >
>     ------------------------------------------------------------------------
>      > juzhe.zhong@rivai.ai
>      >
>      >     *From:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>
>      >     *Date:* 2023-11-07 19:23
>      >     *To:* ams <mailto:ams@codesourcery.com>; gcc-patches
>      >     <mailto:gcc-patches@gcc.gnu.org>
>      >     *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>      >     <mailto:rguenther@suse.de>
>      >     *Subject:* Re: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>      >     Do you mean this ?
>      >
>      >     /* { dg-final { scan-tree-dump-times "vectorizing stmts using
>     SLP" 2
>      >     "vect" { target { { ! vect_hw_misalign } || { vect512 } } } }
>     } */
>      >     /* { dg-final { scan-tree-dump-times "vectorizing stmts using
>     SLP" 4
>      >     "vect" { xfail { ! vect512 } } } } */
>      >
>      >     Could you try again ? If it works for you, I am gonna send V2
>     patch
>      >     to Richi.
>      >
>      >     Thank you so much for help.
>      >    
>     ------------------------------------------------------------------------
>      >     juzhe.zhong@rivai.ai
>      >
>      >         *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>      >         *Date:* 2023-11-07 19:21
>      >         *To:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>;
>      >         gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>      >         *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>      >         <mailto:rguenther@suse.de>
>      >         *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>      >         On 07/11/2023 11:05, juzhe.zhong@rivai.ai wrote:
>      >          > Could you try this ?
>      >          >
>      >          > /* { dg-final { scan-tree-dump-times "vectorizing
>     stmts using
>      >         SLP" 2
>      >          > "vect" { xfail { { ! vect_hw_misalign } || { vect512 }
>     } } } } */
>      >          > /* { dg-final { scan-tree-dump-times "vectorizing
>     stmts using
>      >         SLP" 4
>      >          > "vect" { xfail { ! vect512 } } } } */
>      >         PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>      >         PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>      >         interleaving
>      >         load of size 8"
>      >         PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>      >         interleaving
>      >         store of size 16"
>      >         gcc.dg/vect/pr97428.c: pattern found 4 times
>      >         XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>     "vectorizing
>      >         stmts using SLP" 2
>      >         PASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>      >         "vectorizing stmts
>      >         using SLP" 4
>      >         PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6
>      >         elements"
>      >         The passes are all correct (assuming that 4 matches are a
>     valid
>      >         number),
>      >         but if you have mutliple patterns with contractictory
>      >         expectations then
>      >         you probably want to use "target" rather than "xfail" to
>     avoid
>      >         the noise
>      >         (and invert the conditions, obviously).
>      >         Andrew
>      >          >
>      >        
>     ------------------------------------------------------------------------
>      >          > juzhe.zhong@rivai.ai
>      >          >
>      >          >     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>      >          >     *Date:* 2023-11-07 18:59
>      >          >     *To:* juzhe.zhong@rivai.ai
>     <mailto:juzhe.zhong@rivai.ai>;
>      >          >     gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>      >          >     *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>;
>     rguenther
>      >          >     <mailto:rguenther@suse.de>
>      >          >     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c
>     for RVV
>      >          >     On 07/11/2023 10:10, juzhe.zhong@rivai.ai wrote:
>      >          >      > So, this patch not only fixes RVV FAIL, but
>     also fixes
>      >         GCN ?
>      >          >     Before the patch I have:
>      >          >     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>      >          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect
>     "Detected
>      >         interleaving
>      >          >     load of size 8"
>      >          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect
>     "Detected
>      >         interleaving
>      >          >     store of size 16"
>      >          >     gcc.dg/vect/pr97428.c: pattern found 4 times
>      >          >     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>      >         "vectorizing
>      >          >     stmts using SLP" 2
>      >          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not
>     vect "gap
>      >         of 6 elements"
>      >          >     With the patch I now get:
>      >          >     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>      >          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect
>     "Detected
>      >         interleaving
>      >          >     load of size 8"
>      >          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect
>     "Detected
>      >         interleaving
>      >          >     store of size 16"
>      >          >     gcc.dg/vect/pr97428.c: pattern found 4 times
>      >          >     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>      >         "vectorizing
>      >          >     stmts using SLP" 2
>      >          >     XPASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>      >         "vectorizing
>      >          >     stmts using SLP" 4
>      >          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not
>     vect "gap
>      >         of 6 elements"
>      >          >     It's different, but not "fixed".
>      >          >     Andrew
>      >          >      >
>      >          >      >
>      >          >      >
>      >          >
>      >        
>     ------------------------------------------------------------------------
>      >          >      > juzhe.zhong@rivai.ai
>      >          >      >
>      >          >      >     *From:* Andrew Stubbs
>     <mailto:ams@codesourcery.com>
>      >          >      >     *Date:* 2023-11-07 18:09
>      >          >      >     *To:* Juzhe-Zhong
>     <mailto:juzhe.zhong@rivai.ai>;
>      >          >      >     gcc-patches@gcc.gnu.org
>      >         <mailto:gcc-patches@gcc.gnu.org>
>      >          >      >     *CC:* jeffreyalaw@gmail.com
>      >         <mailto:jeffreyalaw@gmail.com>;
>      >          >      >     rguenther@suse.de <mailto:rguenther@suse.de>
>      >          >      >     *Subject:* Re: [PATCH] test: Fix FAIL of
>     pr97428.c
>      >         for RVV
>      >          >      >     On 07/11/2023 07:44, Juzhe-Zhong wrote:
>      >          >      >      > This test shows vectorizing stmts using
>     SLP 4 times
>      >          >     instead of 2
>      >          >      >     for RVV.
>      >          >      >      > The reason is RVV has 512 bit vector.
>      >          >      >      > Here is comparison between RVV ans ARM SVE:
>      >          >      >      > https://godbolt.org/z/xc5KE5rPs
>      >          >      >      >
>      >          >      >      > But I notice AMDGCN also has 512 bit vector,
>      >         seems this patch
>      >          >      >     will cause FAIL in GCN ?
>      >          >      >      >
>      >          >      >      > Not sure whether GCN is 2 times or 4 times ?
>      >          >      >     The pattern matches 4 times on GCN.
>      >          >      >      > gcc/testsuite/ChangeLog:
>      >          >      >      >
>      >          >      >      > * gcc.dg/vect/pr97428.c: Fix FAIL for RVV.
>      >          >      >      >
>      >          >      >      > ---
>      >          >      >      >   gcc/testsuite/gcc.dg/vect/pr97428.c |
>     3 ++-
>      >          >      >      >   1 file changed, 2 insertions(+), 1
>     deletion(-)
>      >          >      >      >
>      >          >      >      > diff --git
>     a/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >          >      >     b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >          >      >      > index ad6416096aa..352c9bf04a7 100644
>      >          >      >      > --- a/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >          >      >      > +++ b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >          >      >      > @@ -43,5 +43,6 @@ void foo_i2(dcmlx4_t
>     dst[],
>      >         const dcmlx_t
>      >          >      >     src[], int n)
>      >          >      >      >   /* { dg-final { scan-tree-dump "Detected
>      >         interleaving
>      >          >     store of
>      >          >      >     size 16" "vect" } } */
>      >          >      >      >   /* We're not able to peel & apply
>     re-aligning
>      >         to make
>      >          >     accesses
>      >          >      >     well-aligned for !vect_hw_misalign,
>      >          >      >      >      but we could by peeling the stores for
>      >         alignment and
>      >          >      >     applying re-aligning loads.  */
>      >          >      >      > -/* { dg-final { scan-tree-dump-times
>      >         "vectorizing stmts using
>      >          >      >     SLP" 2 "vect" { xfail { ! vect_hw_misalign
>     } } } } */
>      >          >      >      > +/* { dg-final { scan-tree-dump-times
>      >         "vectorizing stmts using
>      >          >      >     SLP" 2 "vect" { xfail { { !
>     vect_hw_misalign } ||
>      >         { vect512 }
>      >          >     } } } } */
>      >          >      >      > +/* { dg-final { scan-tree-dump-times
>      >         "vectorizing stmts using
>      >          >      >     SLP" 4 "vect" { xfail { { !
>     vect_hw_misalign } ||
>      >         { ! vect512
>      >          >     } } }
>      >          >      >     } } */
>      >          >      >      >   /* { dg-final { scan-tree-dump-not
>     "gap of 6
>      >         elements"
>      >          >     "vect" }
>      >          >      >     } */
>      >          >      >
>      >          >
>      >
> 


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

* Re: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
  2023-11-07 12:05                   ` Andrew Stubbs
@ 2023-11-07 12:07                     ` juzhe.zhong
  0 siblings, 0 replies; 12+ messages in thread
From: juzhe.zhong @ 2023-11-07 12:07 UTC (permalink / raw)
  To: ams, gcc-patches; +Cc: jeffreyalaw, rguenther

[-- Attachment #1: Type: text/plain, Size: 12303 bytes --]

Thanks a lot ! I will send V2 for Richi to review.




juzhe.zhong@rivai.ai
 
From: Andrew Stubbs
Date: 2023-11-07 20:05
To: juzhe.zhong@rivai.ai; gcc-patches
CC: jeffreyalaw; rguenther
Subject: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
On 07/11/2023 12:03, juzhe.zhong@rivai.ai wrote:
> Sorry I made a mistake here.
> 
> Does it work for you ?
> 
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 
> "vect" { target { { vect_hw_misalign } && { ! vect512 } } } } } */
> /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4 
> "vect" { target { vect512 } } } } */
> 
> Tested on RVV is OK.
 
5 PASS on amdgcn also.
 
Andrew
 
> ------------------------------------------------------------------------
> juzhe.zhong@rivai.ai
> 
>     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>     *Date:* 2023-11-07 19:44
>     *To:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>;
>     gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>     *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>     <mailto:rguenther@suse.de>
>     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>     On 07/11/2023 11:24, juzhe.zhong@rivai.ai wrote:
>      > Oh. Sorry maybe it's better like this:
>      >
>      > /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2
>      > "vect" { target { { ! vect_hw_misalign } || { vect512 } } } } } */
>      > /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 4
>      > "vect" { target{ ! vect512 } } } } */
>     The conditions are backwards; this expects vect512 machines to match
>     twice. Also I think there's a space missing.
>     Andrew
>      >
>      >
>     ------------------------------------------------------------------------
>      > juzhe.zhong@rivai.ai
>      >
>      >     *From:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>
>      >     *Date:* 2023-11-07 19:23
>      >     *To:* ams <mailto:ams@codesourcery.com>; gcc-patches
>      >     <mailto:gcc-patches@gcc.gnu.org>
>      >     *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>      >     <mailto:rguenther@suse.de>
>      >     *Subject:* Re: Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>      >     Do you mean this ?
>      >
>      >     /* { dg-final { scan-tree-dump-times "vectorizing stmts using
>     SLP" 2
>      >     "vect" { target { { ! vect_hw_misalign } || { vect512 } } } }
>     } */
>      >     /* { dg-final { scan-tree-dump-times "vectorizing stmts using
>     SLP" 4
>      >     "vect" { xfail { ! vect512 } } } } */
>      >
>      >     Could you try again ? If it works for you, I am gonna send V2
>     patch
>      >     to Richi.
>      >
>      >     Thank you so much for help.
>      >    
>     ------------------------------------------------------------------------
>      >     juzhe.zhong@rivai.ai
>      >
>      >         *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>      >         *Date:* 2023-11-07 19:21
>      >         *To:* juzhe.zhong@rivai.ai <mailto:juzhe.zhong@rivai.ai>;
>      >         gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>      >         *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>; rguenther
>      >         <mailto:rguenther@suse.de>
>      >         *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c for RVV
>      >         On 07/11/2023 11:05, juzhe.zhong@rivai.ai wrote:
>      >          > Could you try this ?
>      >          >
>      >          > /* { dg-final { scan-tree-dump-times "vectorizing
>     stmts using
>      >         SLP" 2
>      >          > "vect" { xfail { { ! vect_hw_misalign } || { vect512 }
>     } } } } */
>      >          > /* { dg-final { scan-tree-dump-times "vectorizing
>     stmts using
>      >         SLP" 4
>      >          > "vect" { xfail { ! vect512 } } } } */
>      >         PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>      >         PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>      >         interleaving
>      >         load of size 8"
>      >         PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect "Detected
>      >         interleaving
>      >         store of size 16"
>      >         gcc.dg/vect/pr97428.c: pattern found 4 times
>      >         XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>     "vectorizing
>      >         stmts using SLP" 2
>      >         PASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>      >         "vectorizing stmts
>      >         using SLP" 4
>      >         PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not vect "gap of 6
>      >         elements"
>      >         The passes are all correct (assuming that 4 matches are a
>     valid
>      >         number),
>      >         but if you have mutliple patterns with contractictory
>      >         expectations then
>      >         you probably want to use "target" rather than "xfail" to
>     avoid
>      >         the noise
>      >         (and invert the conditions, obviously).
>      >         Andrew
>      >          >
>      >        
>     ------------------------------------------------------------------------
>      >          > juzhe.zhong@rivai.ai
>      >          >
>      >          >     *From:* Andrew Stubbs <mailto:ams@codesourcery.com>
>      >          >     *Date:* 2023-11-07 18:59
>      >          >     *To:* juzhe.zhong@rivai.ai
>     <mailto:juzhe.zhong@rivai.ai>;
>      >          >     gcc-patches <mailto:gcc-patches@gcc.gnu.org>
>      >          >     *CC:* jeffreyalaw <mailto:jeffreyalaw@gmail.com>;
>     rguenther
>      >          >     <mailto:rguenther@suse.de>
>      >          >     *Subject:* Re: [PATCH] test: Fix FAIL of pr97428.c
>     for RVV
>      >          >     On 07/11/2023 10:10, juzhe.zhong@rivai.ai wrote:
>      >          >      > So, this patch not only fixes RVV FAIL, but
>     also fixes
>      >         GCN ?
>      >          >     Before the patch I have:
>      >          >     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>      >          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect
>     "Detected
>      >         interleaving
>      >          >     load of size 8"
>      >          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect
>     "Detected
>      >         interleaving
>      >          >     store of size 16"
>      >          >     gcc.dg/vect/pr97428.c: pattern found 4 times
>      >          >     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>      >         "vectorizing
>      >          >     stmts using SLP" 2
>      >          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not
>     vect "gap
>      >         of 6 elements"
>      >          >     With the patch I now get:
>      >          >     PASS: gcc.dg/vect/pr97428.c (test for excess errors)
>      >          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect
>     "Detected
>      >         interleaving
>      >          >     load of size 8"
>      >          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump vect
>     "Detected
>      >         interleaving
>      >          >     store of size 16"
>      >          >     gcc.dg/vect/pr97428.c: pattern found 4 times
>      >          >     XFAIL: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>      >         "vectorizing
>      >          >     stmts using SLP" 2
>      >          >     XPASS: gcc.dg/vect/pr97428.c scan-tree-dump-times vect
>      >         "vectorizing
>      >          >     stmts using SLP" 4
>      >          >     PASS: gcc.dg/vect/pr97428.c scan-tree-dump-not
>     vect "gap
>      >         of 6 elements"
>      >          >     It's different, but not "fixed".
>      >          >     Andrew
>      >          >      >
>      >          >      >
>      >          >      >
>      >          >
>      >        
>     ------------------------------------------------------------------------
>      >          >      > juzhe.zhong@rivai.ai
>      >          >      >
>      >          >      >     *From:* Andrew Stubbs
>     <mailto:ams@codesourcery.com>
>      >          >      >     *Date:* 2023-11-07 18:09
>      >          >      >     *To:* Juzhe-Zhong
>     <mailto:juzhe.zhong@rivai.ai>;
>      >          >      >     gcc-patches@gcc.gnu.org
>      >         <mailto:gcc-patches@gcc.gnu.org>
>      >          >      >     *CC:* jeffreyalaw@gmail.com
>      >         <mailto:jeffreyalaw@gmail.com>;
>      >          >      >     rguenther@suse.de <mailto:rguenther@suse.de>
>      >          >      >     *Subject:* Re: [PATCH] test: Fix FAIL of
>     pr97428.c
>      >         for RVV
>      >          >      >     On 07/11/2023 07:44, Juzhe-Zhong wrote:
>      >          >      >      > This test shows vectorizing stmts using
>     SLP 4 times
>      >          >     instead of 2
>      >          >      >     for RVV.
>      >          >      >      > The reason is RVV has 512 bit vector.
>      >          >      >      > Here is comparison between RVV ans ARM SVE:
>      >          >      >      > https://godbolt.org/z/xc5KE5rPs
>      >          >      >      >
>      >          >      >      > But I notice AMDGCN also has 512 bit vector,
>      >         seems this patch
>      >          >      >     will cause FAIL in GCN ?
>      >          >      >      >
>      >          >      >      > Not sure whether GCN is 2 times or 4 times ?
>      >          >      >     The pattern matches 4 times on GCN.
>      >          >      >      > gcc/testsuite/ChangeLog:
>      >          >      >      >
>      >          >      >      > * gcc.dg/vect/pr97428.c: Fix FAIL for RVV.
>      >          >      >      >
>      >          >      >      > ---
>      >          >      >      >   gcc/testsuite/gcc.dg/vect/pr97428.c |
>     3 ++-
>      >          >      >      >   1 file changed, 2 insertions(+), 1
>     deletion(-)
>      >          >      >      >
>      >          >      >      > diff --git
>     a/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >          >      >     b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >          >      >      > index ad6416096aa..352c9bf04a7 100644
>      >          >      >      > --- a/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >          >      >      > +++ b/gcc/testsuite/gcc.dg/vect/pr97428.c
>      >          >      >      > @@ -43,5 +43,6 @@ void foo_i2(dcmlx4_t
>     dst[],
>      >         const dcmlx_t
>      >          >      >     src[], int n)
>      >          >      >      >   /* { dg-final { scan-tree-dump "Detected
>      >         interleaving
>      >          >     store of
>      >          >      >     size 16" "vect" } } */
>      >          >      >      >   /* We're not able to peel & apply
>     re-aligning
>      >         to make
>      >          >     accesses
>      >          >      >     well-aligned for !vect_hw_misalign,
>      >          >      >      >      but we could by peeling the stores for
>      >         alignment and
>      >          >      >     applying re-aligning loads.  */
>      >          >      >      > -/* { dg-final { scan-tree-dump-times
>      >         "vectorizing stmts using
>      >          >      >     SLP" 2 "vect" { xfail { ! vect_hw_misalign
>     } } } } */
>      >          >      >      > +/* { dg-final { scan-tree-dump-times
>      >         "vectorizing stmts using
>      >          >      >     SLP" 2 "vect" { xfail { { !
>     vect_hw_misalign } ||
>      >         { vect512 }
>      >          >     } } } } */
>      >          >      >      > +/* { dg-final { scan-tree-dump-times
>      >         "vectorizing stmts using
>      >          >      >     SLP" 4 "vect" { xfail { { !
>     vect_hw_misalign } ||
>      >         { ! vect512
>      >          >     } } }
>      >          >      >     } } */
>      >          >      >      >   /* { dg-final { scan-tree-dump-not
>     "gap of 6
>      >         elements"
>      >          >     "vect" }
>      >          >      >     } */
>      >          >      >
>      >          >
>      >
> 
 
 

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

end of thread, other threads:[~2023-11-07 12:07 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-07  7:44 [PATCH] test: Fix FAIL of pr97428.c for RVV Juzhe-Zhong
2023-11-07 10:09 ` Andrew Stubbs
2023-11-07 10:10   ` juzhe.zhong
2023-11-07 10:59     ` Andrew Stubbs
2023-11-07 11:05       ` juzhe.zhong
2023-11-07 11:21         ` Andrew Stubbs
2023-11-07 11:23           ` juzhe.zhong
     [not found]           ` <202311071923515706180@rivai.ai>
2023-11-07 11:24             ` juzhe.zhong
2023-11-07 11:44               ` Andrew Stubbs
2023-11-07 12:03                 ` juzhe.zhong
2023-11-07 12:05                   ` Andrew Stubbs
2023-11-07 12:07                     ` juzhe.zhong

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