[PATCH, rs6000, testsuite] Fix PR87306

Bill Schmidt wschmidt@linux.ibm.com
Wed Jan 16 12:52:00 GMT 2019


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



More information about the Gcc-patches mailing list