public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [GCC][PATCH][testsuite][mid-end] Fix failing slp test on aarch64 and arm.
@ 2017-09-26 13:12 Tamar Christina
  2017-09-27  9:54 ` Richard Earnshaw (lists)
  0 siblings, 1 reply; 4+ messages in thread
From: Tamar Christina @ 2017-09-26 13:12 UTC (permalink / raw)
  To: gcc-patches
  Cc: nd, james.greenhalgh, Richard.Earnshaw, Marcus.Shawcroft,
	Ramana.Radhakrishnan, nickc, Kyrylo.Tkachov

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

Hi All,

The slp vectorization test currently fails on AArch32 and AArch64
due to it not taking into account that we do have 128 bit vectors in
NEON. This means that two of the loops get vectorized instead of just 1.

So update the conditions to include a check for neon.

Regtested on aarch64-none-elf.

Ok for trunk?

Thanks,
Tamar.

gcc/testsuite/
2017-09-26  Tamar Christina  <tamar.christina@arm.com>

	* gcc.dg/vect/slp-perm-9.c: Add arm_neon_ok checks.

-- 

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

diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
index 4d9c11dcc476a8023b3eaac2ae76cc01bd0db182..816c4b31be80dc6ab77bda838f77357e2157ffb9 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
@@ -54,8 +54,8 @@ int main (int argc, const char* argv[])
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect"  { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target { { {! vect_perm } || {! vect_sizes_32B_16B } } && {! arm_neon_ok} } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect"  { target { { { vect_perm } && { vect_sizes_32B_16B } } || arm_neon_ok } } } } */
 /* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target vect_perm_short } } } */
 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */
 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */


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

* Re: [GCC][PATCH][testsuite][mid-end] Fix failing slp test on aarch64 and arm.
  2017-09-26 13:12 [GCC][PATCH][testsuite][mid-end] Fix failing slp test on aarch64 and arm Tamar Christina
@ 2017-09-27  9:54 ` Richard Earnshaw (lists)
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Earnshaw (lists) @ 2017-09-27  9:54 UTC (permalink / raw)
  To: Tamar Christina, gcc-patches
  Cc: james.greenhalgh, Marcus.Shawcroft, Ramana.Radhakrishnan, nickc,
	Kyrylo.Tkachov

On 26/09/17 14:12, Tamar Christina wrote:
> Hi All,
> 
> The slp vectorization test currently fails on AArch32 and AArch64
> due to it not taking into account that we do have 128 bit vectors in
> NEON. This means that two of the loops get vectorized instead of just 1.
> 
> So update the conditions to include a check for neon.
> 
> Regtested on aarch64-none-elf.
> 
> Ok for trunk?
> 
> Thanks,
> Tamar.
> 
> gcc/testsuite/
> 2017-09-26  Tamar Christina  <tamar.christina@arm.com>
> 
> 	* gcc.dg/vect/slp-perm-9.c: Add arm_neon_ok checks.
> 
> 

It would be better to fix this generically by adding a vect_sizes_16B_8B
rule.

R.

> 8221-diff.patch
> 
> 
> diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
> index 4d9c11dcc476a8023b3eaac2ae76cc01bd0db182..816c4b31be80dc6ab77bda838f77357e2157ffb9 100644
> --- a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
> +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
> @@ -54,8 +54,8 @@ int main (int argc, const char* argv[])
>    return 0;
>  }
>  
> -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */
> -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect"  { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */
> +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target { { {! vect_perm } || {! vect_sizes_32B_16B } } && {! arm_neon_ok} } } } } */
> +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect"  { target { { { vect_perm } && { vect_sizes_32B_16B } } || arm_neon_ok } } } } */
>  /* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target vect_perm_short } } } */
>  /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */
>  /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */
> 

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

* Re: [GCC][PATCH][testsuite][mid-end] Fix failing slp test on aarch64 and arm.
  2017-10-02 13:20 Tamar Christina
@ 2017-10-05 14:44 ` Richard Earnshaw (lists)
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Earnshaw (lists) @ 2017-10-05 14:44 UTC (permalink / raw)
  To: Tamar Christina, gcc-patches
  Cc: nd, law, rguenther, ian, james.greenhalgh, Marcus.Shawcroft,
	Ramana.Radhakrishnan

On 02/10/17 14:20, Tamar Christina wrote:
> Hi All,
> 
> The slp vectorization test currently fails on AArch32 and AArch64
> due to it not taking into account that we do have 128 bit vectors in
> NEON. This means that two of the loops get vectorized instead of just 1.
> 
> So update the conditions to include a check for neon.
> 
> Regtested on aarch64-none-elf.
> 
> Respin of patch https://gcc.gnu.org/ml/gcc-patches/2017-09/msg01805.html
> 
> Ok for trunk?
> 
> Thanks,
> Tamar.
> 
> gcc/testsuite/
> 2017-10-02  Tamar Christina  <tamar.christina@arm.com>
> 
> 	* gcc.dg/vect/slp-perm-9.c: Use vect_sizes_16B_8B.
> 	* lib/target-supports.exp (vect_sizes_16B_8B): New.
> 
> gcc/doc
> 
> 	* sourcebuild.texi (vect_sizes_16B_8B, vect_sizes_32B_16B): New.
> 

OK.

R.

> 
> 8221-diff.patch
> 
> 
> diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
> index 56e1b4eb103ab412b29d6dcd9b556515ebc2ac63..98cebf7b58798abdcaa108daadcd6273667dc785 100644
> --- a/gcc/doc/sourcebuild.texi
> +++ b/gcc/doc/sourcebuild.texi
> @@ -1507,6 +1507,12 @@ Target supports conversion from @code{float} to @code{unsigned int}.
>  
>  @item vect_max_reduc
>  Target supports max reduction for vectors.
> +
> +@item vect_sizes_16B_8B
> +Target supports 16- and 8-bytes vectors.
> +
> +@item vect_sizes_32B_16B
> +Target supports 32- and 16-bytes vectors.
>  @end table
>  
>  @subsubsection Thread Local Storage attributes
> diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
> index 4d9c11dcc476a8023b3eaac2ae76cc01bd0db182..b9b5a3b87ad031a5ab7421efce2c2b0fdf9145f3 100644
> --- a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
> +++ b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
> @@ -54,8 +54,8 @@ int main (int argc, const char* argv[])
>    return 0;
>  }
>  
> -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */
> -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect"  { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */
> +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target { {! vect_perm } || {! vect_sizes_16B_8B } } } } } */
> +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect"  { target { { vect_perm } && { vect_sizes_16B_8B } } } } } */
>  /* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target vect_perm_short } } } */
>  /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */
>  /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */
> diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
> index 57f646ce2df5bcd5619870403242e73f6e91ff77..8ad9b602d277c28a6e34942a564d2ce05da7857f 100644
> --- a/gcc/testsuite/lib/target-supports.exp
> +++ b/gcc/testsuite/lib/target-supports.exp
> @@ -7561,6 +7561,19 @@ proc check_effective_target_vect_sizes_32B_16B { } {
>    }
>  }
>  
> +# Return true if 16- and 8-bytes vectors are available.
> +
> +proc check_effective_target_vect_sizes_16B_8B { } {
> +  if { [check_avx_available]
> +       || [is-effective-target arm_neon]
> +       || [istarget aarch64*-*-*] } {
> +     return 1;
> +  } else {
> +    return 0;
> +  }
> +}
> +
> +
>  # Return true if 128-bits vectors are preferred even if 256-bits vectors
>  # are available.
>  
> 

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

* [GCC][PATCH][testsuite][mid-end] Fix failing slp test on aarch64 and arm.
@ 2017-10-02 13:20 Tamar Christina
  2017-10-05 14:44 ` Richard Earnshaw (lists)
  0 siblings, 1 reply; 4+ messages in thread
From: Tamar Christina @ 2017-10-02 13:20 UTC (permalink / raw)
  To: gcc-patches
  Cc: nd, law, rguenther, ian, james.greenhalgh, Richard.Earnshaw,
	Marcus.Shawcroft, Ramana.Radhakrishnan

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

Hi All,

The slp vectorization test currently fails on AArch32 and AArch64
due to it not taking into account that we do have 128 bit vectors in
NEON. This means that two of the loops get vectorized instead of just 1.

So update the conditions to include a check for neon.

Regtested on aarch64-none-elf.

Respin of patch https://gcc.gnu.org/ml/gcc-patches/2017-09/msg01805.html

Ok for trunk?

Thanks,
Tamar.

gcc/testsuite/
2017-10-02  Tamar Christina  <tamar.christina@arm.com>

	* gcc.dg/vect/slp-perm-9.c: Use vect_sizes_16B_8B.
	* lib/target-supports.exp (vect_sizes_16B_8B): New.

gcc/doc

	* sourcebuild.texi (vect_sizes_16B_8B, vect_sizes_32B_16B): New.

-- 

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

diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index 56e1b4eb103ab412b29d6dcd9b556515ebc2ac63..98cebf7b58798abdcaa108daadcd6273667dc785 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -1507,6 +1507,12 @@ Target supports conversion from @code{float} to @code{unsigned int}.
 
 @item vect_max_reduc
 Target supports max reduction for vectors.
+
+@item vect_sizes_16B_8B
+Target supports 16- and 8-bytes vectors.
+
+@item vect_sizes_32B_16B
+Target supports 32- and 16-bytes vectors.
 @end table
 
 @subsubsection Thread Local Storage attributes
diff --git a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
index 4d9c11dcc476a8023b3eaac2ae76cc01bd0db182..b9b5a3b87ad031a5ab7421efce2c2b0fdf9145f3 100644
--- a/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
+++ b/gcc/testsuite/gcc.dg/vect/slp-perm-9.c
@@ -54,8 +54,8 @@ int main (int argc, const char* argv[])
   return 0;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect"  { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target { {! vect_perm } || {! vect_sizes_16B_8B } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect"  { target { { vect_perm } && { vect_sizes_16B_8B } } } } } */
 /* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target vect_perm_short } } } */
 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */
 /* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 57f646ce2df5bcd5619870403242e73f6e91ff77..8ad9b602d277c28a6e34942a564d2ce05da7857f 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -7561,6 +7561,19 @@ proc check_effective_target_vect_sizes_32B_16B { } {
   }
 }
 
+# Return true if 16- and 8-bytes vectors are available.
+
+proc check_effective_target_vect_sizes_16B_8B { } {
+  if { [check_avx_available]
+       || [is-effective-target arm_neon]
+       || [istarget aarch64*-*-*] } {
+     return 1;
+  } else {
+    return 0;
+  }
+}
+
+
 # Return true if 128-bits vectors are preferred even if 256-bits vectors
 # are available.
 


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

end of thread, other threads:[~2017-10-05 14:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-26 13:12 [GCC][PATCH][testsuite][mid-end] Fix failing slp test on aarch64 and arm Tamar Christina
2017-09-27  9:54 ` Richard Earnshaw (lists)
2017-10-02 13:20 Tamar Christina
2017-10-05 14:44 ` Richard Earnshaw (lists)

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