public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH]middle-end testsuite: fix failing complex add testcases PR103000
@ 2021-11-01  9:54 Tamar Christina
  2021-11-01 13:39 ` Jeff Law
  2021-11-02 13:29 ` Richard Biener
  0 siblings, 2 replies; 3+ messages in thread
From: Tamar Christina @ 2021-11-01  9:54 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd, rguenther

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

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.

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


-- 

[-- Attachment #2: rb14998.patch --]
[-- Type: text/x-diff, Size: 3723 bytes --]

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


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

* Re: [PATCH]middle-end testsuite: fix failing complex add testcases PR103000
  2021-11-01  9:54 [PATCH]middle-end testsuite: fix failing complex add testcases PR103000 Tamar Christina
@ 2021-11-01 13:39 ` Jeff Law
  2021-11-02 13:29 ` Richard Biener
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Law @ 2021-11-01 13:39 UTC (permalink / raw)
  To: Tamar Christina, gcc-patches; +Cc: nd, rguenther



On 11/1/2021 3:54 AM, Tamar Christina via Gcc-patches 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.
>
> 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.
OK
jeff


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

* Re: [PATCH]middle-end testsuite: fix failing complex add testcases PR103000
  2021-11-01  9:54 [PATCH]middle-end testsuite: fix failing complex add testcases PR103000 Tamar Christina
  2021-11-01 13:39 ` Jeff Law
@ 2021-11-02 13:29 ` Richard Biener
  1 sibling, 0 replies; 3+ messages in thread
From: Richard Biener @ 2021-11-02 13:29 UTC (permalink / raw)
  To: Tamar Christina; +Cc: gcc-patches, nd

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 <rguenther@suse.de>
SUSE Software Solutions Germany GmbH, Maxfeldstrasse 5, 90409 Nuernberg,
Germany; GF: Ivo Totev; HRB 36809 (AG Nuernberg)

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

end of thread, other threads:[~2021-11-02 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-01  9:54 [PATCH]middle-end testsuite: fix failing complex add testcases PR103000 Tamar Christina
2021-11-01 13:39 ` Jeff Law
2021-11-02 13:29 ` Richard Biener

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