[rs6000] Fix PR85080

Message ID a339b4a7-45b9-b958-d2c9-642bbe0d825e@linux.ibm.com
State New
Headers show
Series
  • [rs6000] Fix PR85080
Related show

Commit Message

Bill Schmidt April 16, 2018, 2:41 a.m.
Hi,

PR85080 identifies a test case that started failing last year when
an improvement was made to the vectorizer.  The failure turns out to
be appropriate.  The test used to not expect the loop in the first
function to be vectorized, because the cost of potentially unaligned
loads made this unprofitable.  However, with Power8 and later hardware,
this is no longer the case.  This patch adjusts the test to only check
its results for targets that have inefficient unaligned loads.

Tested on powerpc64le-linux-gnu (POWER8) and powerpc64-linux-gnu
(POWER7).  Is this okay for trunk?

Thanks,
Bill


[gcc/testsuite]

2018-04-16  Bill Schmidt  <wschmidt@linux.ibm.com>

	PR target/85080
	* gcc.dg/vect/costmodel/ppc/costmodel-pr37194.c: Skip dump checks
	if the target supports efficient unaligned storage accesses.

Comments

Segher Boessenkool April 16, 2018, 3:46 p.m. | #1
Hi Bill,

On Sun, Apr 15, 2018 at 09:41:04PM -0500, Bill Schmidt wrote:
> PR85080 identifies a test case that started failing last year when
> an improvement was made to the vectorizer.  The failure turns out to
> be appropriate.  The test used to not expect the loop in the first
> function to be vectorized, because the cost of potentially unaligned
> loads made this unprofitable.  However, with Power8 and later hardware,
> this is no longer the case.  This patch adjusts the test to only check
> its results for targets that have inefficient unaligned loads.

> --- gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-pr37194.c	(revision 259389)
> +++ gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-pr37194.c	(working copy)
> @@ -22,6 +22,6 @@ ggSpectrum_Set20(float * data, float d)
>        data[i] = d;
>  }
>  
> -/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
> -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
> +/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target { ! vect_hw_misalign } } } } */
> +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! vect_hw_misalign } } } } */

Alternatively you could skip the whole test if vect_hw_misalign.

But this is fine.  Okay for trunk (and backports if needed/wanted).
Thanks!


Segher

Patch

Index: gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-pr37194.c
===================================================================
--- gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-pr37194.c	(revision 259389)
+++ gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-pr37194.c	(working copy)
@@ -22,6 +22,6 @@  ggSpectrum_Set20(float * data, float d)
       data[i] = d;
 }
 
-/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { scan-tree-dump-times "vectorization not profitable" 1 "vect" { target { ! vect_hw_misalign } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { ! vect_hw_misalign } } } } */