test: Fix XPASS of bb-slp-43.c for RVV

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

Checks

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

Commit Message

juzhe.zhong@rivai.ai Nov. 6, 2023, 10:35 p.m. UTC
  RVV is variable length vector but also has 256 bit VLS mode vector.
This test is vectorized as:

f:
        vsetivli        zero,8,e32,m2,ta,ma
        vle32.v v2,0(a0)
        vmv.v.i v4,1
        vle16.v v1,0(a1)
        vmseq.vv        v0,v2,v4
        vsetvli zero,zero,e16,m1,ta,ma
        vmseq.vi        v1,v1,2
        vsetvli zero,zero,e32,m2,ta,ma
        vmv.v.i v2,0
        vmand.mm        v0,v0,v1
        vmerge.vvm      v2,v2,v4,v0
        vse32.v v2,0(a0)
        ret

Use 256 bit vector, so remove XFAIL for 256 bits vector.

gcc/testsuite/ChangeLog:

	* gcc.dg/vect/bb-slp-43.c: Fix XPASS for RVV.

---
 gcc/testsuite/gcc.dg/vect/bb-slp-43.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jeff Law Nov. 7, 2023, 3:23 a.m. UTC | #1
On 11/6/23 15:35, Juzhe-Zhong wrote:
> RVV is variable length vector but also has 256 bit VLS mode vector.
> This test is vectorized as:
> 
> f:
>          vsetivli        zero,8,e32,m2,ta,ma
>          vle32.v v2,0(a0)
>          vmv.v.i v4,1
>          vle16.v v1,0(a1)
>          vmseq.vv        v0,v2,v4
>          vsetvli zero,zero,e16,m1,ta,ma
>          vmseq.vi        v1,v1,2
>          vsetvli zero,zero,e32,m2,ta,ma
>          vmv.v.i v2,0
>          vmand.mm        v0,v0,v1
>          vmerge.vvm      v2,v2,v4,v0
>          vse32.v v2,0(a0)
>          ret
> 
> Use 256 bit vector, so remove XFAIL for 256 bits vector.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.dg/vect/bb-slp-43.c: Fix XPASS for RVV.
So will this create a FAIL if someone runs the testsuite with the 
autovec preference set to scalable?  Or are the fallbacks to VLS still 
available when we prefer scalable vectors?

jeff
  
juzhe.zhong@rivai.ai Nov. 7, 2023, 3:30 a.m. UTC | #2
>> So will this create a FAIL if someone runs the testsuite with the
>> autovec preference set to scalable?
No, it won't. Since it is always -fno-vect-cost-model.
When a scalable vector doesn't have 256bit vector,  it always XFAIL, for example, ARM SVE.

>> Or are the fallbacks to VLS still
>> available when we prefer scalable vectors?
Yes. since it is -fno-vect-cost-model.


juzhe.zhong@rivai.ai
 
From: Jeff Law
Date: 2023-11-07 11:23
To: Juzhe-Zhong; gcc-patches
CC: rguenther
Subject: Re: [PATCH] test: Fix XPASS of bb-slp-43.c for RVV
 
 
On 11/6/23 15:35, Juzhe-Zhong wrote:
> RVV is variable length vector but also has 256 bit VLS mode vector.
> This test is vectorized as:
> 
> f:
>          vsetivli        zero,8,e32,m2,ta,ma
>          vle32.v v2,0(a0)
>          vmv.v.i v4,1
>          vle16.v v1,0(a1)
>          vmseq.vv        v0,v2,v4
>          vsetvli zero,zero,e16,m1,ta,ma
>          vmseq.vi        v1,v1,2
>          vsetvli zero,zero,e32,m2,ta,ma
>          vmv.v.i v2,0
>          vmand.mm        v0,v0,v1
>          vmerge.vvm      v2,v2,v4,v0
>          vse32.v v2,0(a0)
>          ret
> 
> Use 256 bit vector, so remove XFAIL for 256 bits vector.
> 
> gcc/testsuite/ChangeLog:
> 
> * gcc.dg/vect/bb-slp-43.c: Fix XPASS for RVV.
So will this create a FAIL if someone runs the testsuite with the 
autovec preference set to scalable?  Or are the fallbacks to VLS still 
available when we prefer scalable vectors?
 
jeff
  
Jeff Law Nov. 7, 2023, 3:49 a.m. UTC | #3
On 11/6/23 20:30, juzhe.zhong@rivai.ai wrote:
>  >> So will this create a FAIL if someone runs the testsuite with the
>>> autovec preference set to scalable?
> No, it won't. Since it is always -fno-vect-cost-model.
> When a scalable vector doesn't have 256bit vector,  it always XFAIL, for 
> example, ARM SVE.
> 
>>> Or are the fallbacks to VLS still
>>> available when we prefer scalable vectors?
> Yes. since it is -fno-vect-cost-model.
OK.  Thanks for clarifying.  This is fine for the trunk.
jeff
  
juzhe.zhong@rivai.ai Nov. 7, 2023, 7:20 a.m. UTC | #4
Thanks Jeff. Just finish bootstrap +regression passed.
Committed.



juzhe.zhong@rivai.ai
 
From: Jeff Law
Date: 2023-11-07 11:49
To: juzhe.zhong@rivai.ai; gcc-patches
CC: rguenther
Subject: Re: [PATCH] test: Fix XPASS of bb-slp-43.c for RVV
 
 
On 11/6/23 20:30, juzhe.zhong@rivai.ai wrote:
>  >> So will this create a FAIL if someone runs the testsuite with the
>>> autovec preference set to scalable?
> No, it won't. Since it is always -fno-vect-cost-model.
> When a scalable vector doesn't have 256bit vector,  it always XFAIL, for 
> example, ARM SVE.
> 
>>> Or are the fallbacks to VLS still
>>> available when we prefer scalable vectors?
> Yes. since it is -fno-vect-cost-model.
OK.  Thanks for clarifying.  This is fine for the trunk.
jeff
  

Patch

diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-43.c b/gcc/testsuite/gcc.dg/vect/bb-slp-43.c
index a65d9513c4d..dad2d24262d 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-43.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-43.c
@@ -14,4 +14,4 @@  f (int *restrict x, short *restrict y)
 }
 
 /* { dg-final { scan-tree-dump-not "mixed mask and nonmask" "slp2" } } */
-/* { dg-final { scan-tree-dump-not "vector operands from scalars" "slp2" { target { { vect_int && vect_bool_cmp } && { vect_unpack && vect_hw_misalign } } xfail vect_variable_length } } } */
+/* { dg-final { scan-tree-dump-not "vector operands from scalars" "slp2" { target { { vect_int && vect_bool_cmp } && { vect_unpack && vect_hw_misalign } } xfail { vect_variable_length && { ! vect256 } } } } } */