On Mon, 1 Nov 2021, Tamar Christina wrote:

> Hi All,
> 
> Some targets have overriden the default unroll factor and so do not have 
> enough
> data to succeed for SLP vectorization if loop vect is turned off.
> 
> To fix this just always unroll in these testcases.

Another option is to place

#pragma GCC unroll N

before the loop you need to have unrolled N times.

> Bootstrapped Regtested on aarch64-none-linux-gnu, x86_64-pc-linux-gnu
> and no issues.
> 
> Ok for master?
> 
> Thanks,
> Tamar
> 
> gcc/testsuite/ChangeLog:
> 
>       PR testsuite/103000
>       * gcc.dg/vect/complex/fast-math-bb-slp-complex-add-double.c:
>       Force unroll.
>       * gcc.dg/vect/complex/fast-math-bb-slp-complex-add-float.c: likewise
>       * gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-float.c:
>       Likewise
>       * gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-half-float.c:
>       Likewise.
> 
> --- inline copy of patch -- 
> diff --git 
> a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-double.c 
> b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-double.c
> index 
> 4445119fc9d2c7dafe6abb5f7fb741c7794144a2..23f179a55dcf77c7cfa8f55f748c9973b5e9c646
>  100644
> --- a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-double.c
> +++ b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-double.c
> @@ -1,6 +1,7 @@
>  /* { dg-do compile } */
> +/* { dg-require-effective-target vect_double } */
>  /* { dg-add-options arm_v8_3a_complex_neon } */
> -/* { dg-additional-options "-fno-tree-loop-vectorize" } */
> +/* { dg-additional-options "-fno-tree-loop-vectorize -funroll-loops" } */
>  /* { dg-add-options arm_v8_1m_mve_fp } */
>  
>  #define TYPE double
> diff --git 
> a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-float.c 
> b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-float.c
> index 
> ff53719d1a895a7161ebcc6fba4903fc3de9095f..cc7715160981274605b4ab21e7db33fdb373e04d
>  100644
> --- a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-float.c
> +++ b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-float.c
> @@ -1,6 +1,7 @@
>  /* { dg-do compile } */
> +/* { dg-require-effective-target vect_float } */
>  /* { dg-add-options arm_v8_3a_complex_neon } */
> -/* { dg-additional-options "-fno-tree-loop-vectorize" } */
> +/* { dg-additional-options "-fno-tree-loop-vectorize -funroll-loops" } */
>  /* { dg-add-options arm_v8_1m_mve_fp } */
>  
>  #define TYPE float
> diff --git 
> a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-float.c
>  
> b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-float.c
> index 
> 8bc7117565e79a0e93a22d2b28a32e9c5ddfe4d3..fb6a1676fb4b7a766088dcec42a3a2465c3e11f9
>  100644
> --- 
> a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-float.c
> +++ 
> b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-float.c
> @@ -1,6 +1,7 @@
>  /* { dg-do compile } */
> +/* { dg-require-effective-target vect_float } */
>  /* { dg-add-options arm_v8_3a_complex_neon } */
> -/* { dg-additional-options "-fno-tree-loop-vectorize" } */
> +/* { dg-additional-options "-fno-tree-loop-vectorize -funroll-loops" } */
>  /* { dg-add-options arm_v8_1m_mve_fp } */
>  
>  #define TYPE float
> diff --git 
> a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-half-float.c
>  
> b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-half-float.c
> index 
> 80e0f5d5412318d05883813a81dc4a2d9a62f234..4bb106a3d520c6ab2a322cc463f6a7f5c5238f95
>  100644
> --- 
> a/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-half-float.c
> +++ 
> b/gcc/testsuite/gcc.dg/vect/complex/fast-math-bb-slp-complex-add-pattern-half-float.c
> @@ -1,6 +1,7 @@
>  /* { dg-do compile } */
> +/* { dg-require-effective-target vect_complex_add_half } */
>  /* { dg-add-options arm_v8_3a_fp16_complex_neon } */
> -/* { dg-additional-options "-fno-tree-loop-vectorize" } */
> +/* { dg-additional-options "-fno-tree-loop-vectorize -funroll-loops" } */
>  /* { dg-add-options arm_v8_1m_mve_fp } */
>  
>  #define TYPE _Float16
> @@ -8,6 +9,6 @@
>  #include "complex-add-pattern-template.c"
>  
>  /* { dg-final { scan-tree-dump-times "stmt.*COMPLEX_ADD_ROT90" 1 "slp1" { 
> target { vect_complex_add_half } } } } */
> -/* { dg-final { scan-tree-dump-times "stmt.*COMPLEX_ADD_ROT270" 1 "slp1" { 
> target { vect_complex_add_byte } && ! target { arm*-*-* } } } } */
> +/* { dg-final { scan-tree-dump-times "stmt.*COMPLEX_ADD_ROT270" 1 "slp1" { 
> target { vect_complex_add_half } && ! target { arm*-*-* } } } } */
>  /* { dg-final { scan-tree-dump "Found COMPLEX_ADD_ROT270" "slp1" { xfail 
> *-*-* } } } */
>  /* { dg-final { scan-tree-dump "Found COMPLEX_ADD_ROT90" "slp1" } } */
> 
> 
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Ivo Totev; HRB 36809 (AG Nuernberg)

Reply via email to