test: Fix FAIL of bb-slp-cond-1.c for RVV

Message ID 20231106230343.3273494-1-juzhe.zhong@rivai.ai
State Accepted
Headers
Series test: Fix FAIL of bb-slp-cond-1.c for RVV |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

juzhe.zhong@rivai.ai Nov. 6, 2023, 11:03 p.m. UTC
  This patch fixes:
FAIL: gcc.dg/vect/bb-slp-cond-1.c -flto -ffat-lto-objects  scan-tree-dump-times vect "loop vectorized" 1
FAIL: gcc.dg/vect/bb-slp-cond-1.c scan-tree-dump-times vect "loop vectorized" 1

For RVV, "loop vectorized" appears 2 times instead of 1. Because:
optimized: loop vectorized using 16 byte vectors
optimized: loop vectorized using 8 byte vectors

As long as targets have both 64bit and 128bit vectors, it will occur 2 times.
2 targets are same situation, one is AMDGCN, the other is RVV.

Replace it target amdgcn with vect64 && vect128 to make test more general and easy maintain.

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/bb-slp-cond-1.c: Fix FAIL.

---
 gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Jeff Law Nov. 7, 2023, 3:25 a.m. UTC | #1
On 11/6/23 16:03, Juzhe-Zhong wrote:
> This patch fixes:
> FAIL: gcc.dg/vect/bb-slp-cond-1.c -flto -ffat-lto-objects  scan-tree-dump-times vect "loop vectorized" 1
> FAIL: gcc.dg/vect/bb-slp-cond-1.c scan-tree-dump-times vect "loop vectorized" 1
> 
> For RVV, "loop vectorized" appears 2 times instead of 1. Because:
> optimized: loop vectorized using 16 byte vectors
> optimized: loop vectorized using 8 byte vectors
> 
> As long as targets have both 64bit and 128bit vectors, it will occur 2 times.
> 2 targets are same situation, one is AMDGCN, the other is RVV.
> 
> Replace it target amdgcn with vect64 && vect128 to make test more general and easy maintain.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.dg/vect/bb-slp-cond-1.c: Fix FAIL.
OK.
jeff
  
Li, Pan2 Nov. 7, 2023, 3:32 a.m. UTC | #2
Committed, thanks Jeff.

Pan

-----Original Message-----
From: Jeff Law <jeffreyalaw@gmail.com> 
Sent: Tuesday, November 7, 2023 11:25 AM
To: Juzhe-Zhong <juzhe.zhong@rivai.ai>; gcc-patches@gcc.gnu.org
Cc: rguenther@suse.de
Subject: Re: [PATCH] test: Fix FAIL of bb-slp-cond-1.c for RVV



On 11/6/23 16:03, Juzhe-Zhong wrote:
> This patch fixes:
> FAIL: gcc.dg/vect/bb-slp-cond-1.c -flto -ffat-lto-objects  scan-tree-dump-times vect "loop vectorized" 1
> FAIL: gcc.dg/vect/bb-slp-cond-1.c scan-tree-dump-times vect "loop vectorized" 1
> 
> For RVV, "loop vectorized" appears 2 times instead of 1. Because:
> optimized: loop vectorized using 16 byte vectors
> optimized: loop vectorized using 8 byte vectors
> 
> As long as targets have both 64bit and 128bit vectors, it will occur 2 times.
> 2 targets are same situation, one is AMDGCN, the other is RVV.
> 
> Replace it target amdgcn with vect64 && vect128 to make test more general and easy maintain.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.dg/vect/bb-slp-cond-1.c: Fix FAIL.
OK.
jeff
  
Richard Biener Nov. 7, 2023, 1:43 p.m. UTC | #3
On Tue, 7 Nov 2023, Juzhe-Zhong wrote:

> This patch fixes:
> FAIL: gcc.dg/vect/bb-slp-cond-1.c -flto -ffat-lto-objects  scan-tree-dump-times vect "loop vectorized" 1
> FAIL: gcc.dg/vect/bb-slp-cond-1.c scan-tree-dump-times vect "loop vectorized" 1
> 
> For RVV, "loop vectorized" appears 2 times instead of 1. Because:
> optimized: loop vectorized using 16 byte vectors
> optimized: loop vectorized using 8 byte vectors
> 
> As long as targets have both 64bit and 128bit vectors, it will occur 2 times.
> 2 targets are same situation, one is AMDGCN, the other is RVV.
> 
> Replace it target amdgcn with vect64 && vect128 to make test more general and easy maintain.

I think we usually add --param vect-epilogues-nomask=0 instead to avoid
epilogue vectorization.  I wonder why the test is called bb-slp-*
though ...

> gcc/testsuite/ChangeLog:
> 
> 	* gcc.dg/vect/bb-slp-cond-1.c: Fix FAIL.
> 
> ---
>  gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c b/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c
> index c8024429e9c..7efb91725df 100644
> --- a/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c
> +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c
> @@ -47,6 +47,6 @@ int main ()
>  }
>  
>  /* { dg-final { scan-tree-dump {(no need for alias check [^\n]* when VF is 1|no alias between [^\n]* when [^\n]* is outside \(-16, 16\))} "vect" { target vect_element_align } } } */
> -/* { dg-final { scan-tree-dump-times "loop vectorized" 1 "vect" { target { vect_element_align && { ! amdgcn-*-* } } } } } */
> -/* { dg-final { scan-tree-dump-times "loop vectorized" 2 "vect" { target amdgcn-*-* } } } */
> +/* { dg-final { scan-tree-dump-times "loop vectorized" 1 "vect" { target { vect_element_align && { ! { vect64 && vect128 } } } } } } */
> +/* { dg-final { scan-tree-dump-times "loop vectorized" 2 "vect" { target { vect64 && vect128 } } } } */
>  
>
  

Patch

diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c b/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c
index c8024429e9c..7efb91725df 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-cond-1.c
@@ -47,6 +47,6 @@  int main ()
 }
 
 /* { dg-final { scan-tree-dump {(no need for alias check [^\n]* when VF is 1|no alias between [^\n]* when [^\n]* is outside \(-16, 16\))} "vect" { target vect_element_align } } } */
-/* { dg-final { scan-tree-dump-times "loop vectorized" 1 "vect" { target { vect_element_align && { ! amdgcn-*-* } } } } } */
-/* { dg-final { scan-tree-dump-times "loop vectorized" 2 "vect" { target amdgcn-*-* } } } */
+/* { dg-final { scan-tree-dump-times "loop vectorized" 1 "vect" { target { vect_element_align && { ! { vect64 && vect128 } } } } } } */
+/* { dg-final { scan-tree-dump-times "loop vectorized" 2 "vect" { target { vect64 && vect128 } } } } */