diff mbox series

[rs6000,testsuite] Fix PR87306

Message ID cd0f4895-90a8-5294-8fca-7bf6ac465dbe@linux.vnet.ibm.com
State New
Headers show
Series [rs6000,testsuite] Fix PR87306 | expand

Commit Message

Kewen.Lin Jan. 16, 2019, 9:29 a.m. UTC
Hi,

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87306, it's older POWER 
hardware specific test case issue. On POWER7 and earlier, we implicitly 
set flag -mno-allow-movmisalign which disables vectorization when to 
vectorize the code requires that misaligned loads and stores. For POWER8
and upper, the opposite value is implicitly set(-mallow-movmisalign),
then the vectorization performs as expected.

Similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65484, the proposed 
fix is to make dg-final checks whether vect_hw_misalign support on powerpc,
only further verify the dump pattern when it's on to consitent to the 
behavior.

Tested on trunk for POWER8 LE and POWER7 BE systems.
Is this ok for trunk?

---

 gcc/testsuite/ChangeLog

2019-01-16  Kewen Lin  <linkw@gcc.gnu.org>

	PR target/87306
	* gcc.dg/vect/bb-slp-pow-1.c : Modify to reflect that the loop is not
	vectorized on POWER unless hardware misaligned loads are available.

Comments

Bill Schmidt Jan. 16, 2019, 12:52 p.m. UTC | #1
I can't approve the patch, but I agree this is the right fix.

Bill


On 1/16/19 3:29 AM, Kewen.Lin wrote:
> Hi,
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87306, it's older POWER 
> hardware specific test case issue. On POWER7 and earlier, we implicitly 
> set flag -mno-allow-movmisalign which disables vectorization when to 
> vectorize the code requires that misaligned loads and stores. For POWER8
> and upper, the opposite value is implicitly set(-mallow-movmisalign),
> then the vectorization performs as expected.
>
> Similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65484, the proposed 
> fix is to make dg-final checks whether vect_hw_misalign support on powerpc,
> only further verify the dump pattern when it's on to consitent to the 
> behavior.
>
> Tested on trunk for POWER8 LE and POWER7 BE systems.
> Is this ok for trunk?
>
> ---
>
>  gcc/testsuite/ChangeLog
>
> 2019-01-16  Kewen Lin  <linkw@gcc.gnu.org>
>
> 	PR target/87306
> 	* gcc.dg/vect/bb-slp-pow-1.c : Modify to reflect that the loop is not
> 	vectorized on POWER unless hardware misaligned loads are available.
>
> diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pow-1.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pow-1.c
> index 5a05bd4..6742e12 100644
> --- a/gcc/testsuite/gcc.dg/vect/bb-slp-pow-1.c
> +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pow-1.c
> @@ -25,4 +25,8 @@ main (void)
>    return 0;
>  }
>
> -/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" } } */
> +/* On older powerpc hardware (POWER7 and earlier), the default flag
> +   -mno-allow-movmisalign prevents vectorization.  On POWER8 and later,
> +   when vect_hw_misalign is true, vectorization occurs. */
> +
> +/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" { target {{ ! powerpc*-*-* } || { powerpc*-*-* && vect_hw_misalign }} } } } */
Segher Boessenkool Jan. 16, 2019, 5:15 p.m. UTC | #2
Hi!

On Wed, Jan 16, 2019 at 05:29:30PM +0800, Kewen.Lin wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87306, it's older POWER 
> hardware specific test case issue. On POWER7 and earlier, we implicitly 
> set flag -mno-allow-movmisalign which disables vectorization when to 
> vectorize the code requires that misaligned loads and stores. For POWER8
> and upper, the opposite value is implicitly set(-mallow-movmisalign),
> then the vectorization performs as expected.
> 
> Similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65484, the proposed 
> fix is to make dg-final checks whether vect_hw_misalign support on powerpc,
> only further verify the dump pattern when it's on to consitent to the 
> behavior.

> 2019-01-16  Kewen Lin  <linkw@gcc.gnu.org>
> 
> 	PR target/87306
> 	* gcc.dg/vect/bb-slp-pow-1.c : Modify to reflect that the loop is not

No space before the colon.

> 	vectorized on POWER unless hardware misaligned loads are available.
> 
> diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pow-1.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pow-1.c
> index 5a05bd4..6742e12 100644
> --- a/gcc/testsuite/gcc.dg/vect/bb-slp-pow-1.c
> +++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pow-1.c
> @@ -25,4 +25,8 @@ main (void)
>    return 0;
>  }
> 
> -/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" } } */
> +/* On older powerpc hardware (POWER7 and earlier), the default flag
> +   -mno-allow-movmisalign prevents vectorization.  On POWER8 and later,
> +   when vect_hw_misalign is true, vectorization occurs. */

Two spaces after a full stop.

> +/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" { target {{ ! powerpc*-*-* } || { powerpc*-*-* && vect_hw_misalign }} } } } */

Okay for trunk with those things fixed.  Thanks!


Segher
diff mbox series

Patch

diff --git a/gcc/testsuite/gcc.dg/vect/bb-slp-pow-1.c b/gcc/testsuite/gcc.dg/vect/bb-slp-pow-1.c
index 5a05bd4..6742e12 100644
--- a/gcc/testsuite/gcc.dg/vect/bb-slp-pow-1.c
+++ b/gcc/testsuite/gcc.dg/vect/bb-slp-pow-1.c
@@ -25,4 +25,8 @@  main (void)
   return 0;
 }

-/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" } } */
+/* On older powerpc hardware (POWER7 and earlier), the default flag
+   -mno-allow-movmisalign prevents vectorization.  On POWER8 and later,
+   when vect_hw_misalign is true, vectorization occurs. */
+
+/* { dg-final { scan-tree-dump-times "basic block vectorized" 1 "slp2" { target {{ ! powerpc*-*-* } || { powerpc*-*-* && vect_hw_misalign }} } } } */