Patchwork [testsuite,powerpc] fix slp-perm-{5,6}.c regression (PR testsuite/44538)

login
register
mail settings
Submitter Mikael Pettersson
Date June 16, 2010, 10:33 a.m.
Message ID <19480.43134.61768.905494@pilspetsen.it.uu.se>
Download mbox | patch
Permalink /patch/55869/
State New
Headers show

Comments

Mikael Pettersson - June 16, 2010, 10:33 a.m.
This fixes a powerpc testsuite regression on trunk and 4.5.
The fix for PR43949 improved VRP, causing initialization loops
in two vectorization test cases (gcc.dg/vect/slp-perm-{5,6}.c)
to also be vectorized.  The scan-tree-dump-times check then sees
too many "vectorized 1 loops" messages, and fails.

Fixed by placing asm (""); markers in the initialization loops,
as suggested by Richard Guenther in the PR entry.

Tested on powerpc-linux where it eliminated the new FAILs for
gcc.dg/vect/slp-perm-{5,6}.c.  There was no change in testsuite
results on x86_64-linux; the patch does have the same effect on
x86_64 with regard to the number of vectorized loops, but x86_64
is not a vect_perm target so the number of vectorized loops is
not actually checked there.

Ok for trunk and 4.5? (I don't have svn write access.)

/Mikael

gcc/testsuite/

2010-06-16  Mikael Pettersson  <mikpe@it.uu.se>

	PR testsuite/44538
	* gcc.dg/vect/slp-perm-5.c (main): Prevent
	initialization loop from being vectorized.
	* gcc.dg/vect/slp-perm-6.c (main): Likewise.
Richard Guenther - June 16, 2010, 11:01 a.m.
On Wed, Jun 16, 2010 at 12:33 PM, Mikael Pettersson <mikpe@it.uu.se> wrote:
> This fixes a powerpc testsuite regression on trunk and 4.5.
> The fix for PR43949 improved VRP, causing initialization loops
> in two vectorization test cases (gcc.dg/vect/slp-perm-{5,6}.c)
> to also be vectorized.  The scan-tree-dump-times check then sees
> too many "vectorized 1 loops" messages, and fails.
>
> Fixed by placing asm (""); markers in the initialization loops,
> as suggested by Richard Guenther in the PR entry.
>
> Tested on powerpc-linux where it eliminated the new FAILs for
> gcc.dg/vect/slp-perm-{5,6}.c.  There was no change in testsuite
> results on x86_64-linux; the patch does have the same effect on
> x86_64 with regard to the number of vectorized loops, but x86_64
> is not a vect_perm target so the number of vectorized loops is
> not actually checked there.
>
> Ok for trunk and 4.5? (I don't have svn write access.)

Ok with the if () removed (which was supposed to prevent
vectorization).  I'll take care of that change and the commit.

Thanks,
Richard.

> /Mikael
>
> gcc/testsuite/
>
> 2010-06-16  Mikael Pettersson  <mikpe@it.uu.se>
>
>        PR testsuite/44538
>        * gcc.dg/vect/slp-perm-5.c (main): Prevent
>        initialization loop from being vectorized.
>        * gcc.dg/vect/slp-perm-6.c (main): Likewise.
>
> --- gcc-4.6-20100612/gcc/testsuite/gcc.dg/vect/slp-perm-5.c.~1~ 2008-09-04 12:41:50.000000000 +0200
> +++ gcc-4.6-20100612/gcc/testsuite/gcc.dg/vect/slp-perm-5.c     2010-06-15 22:08:10.000000000 +0200
> @@ -63,6 +63,7 @@ int main (int argc, const char* argv[])
>       output2[i] = 0;
>       if (input[i] > 256)
>         abort ();
> +      __asm__ volatile ("");
>     }
>
>   foo (input, output, input2, output2);
> --- gcc-4.6-20100612/gcc/testsuite/gcc.dg/vect/slp-perm-6.c.~1~ 2008-09-04 12:41:50.000000000 +0200
> +++ gcc-4.6-20100612/gcc/testsuite/gcc.dg/vect/slp-perm-6.c     2010-06-15 22:08:10.000000000 +0200
> @@ -62,6 +62,7 @@ int main (int argc, const char* argv[])
>       output2[i] = 0;
>       if (input[i] > 256)
>         abort ();
> +      __asm__ volatile ("");
>     }
>
>   foo (input, output, input2, output2);
>

Patch

--- gcc-4.6-20100612/gcc/testsuite/gcc.dg/vect/slp-perm-5.c.~1~	2008-09-04 12:41:50.000000000 +0200
+++ gcc-4.6-20100612/gcc/testsuite/gcc.dg/vect/slp-perm-5.c	2010-06-15 22:08:10.000000000 +0200
@@ -63,6 +63,7 @@  int main (int argc, const char* argv[])
       output2[i] = 0;
       if (input[i] > 256)
         abort ();
+      __asm__ volatile ("");
     }
 
   foo (input, output, input2, output2);
--- gcc-4.6-20100612/gcc/testsuite/gcc.dg/vect/slp-perm-6.c.~1~	2008-09-04 12:41:50.000000000 +0200
+++ gcc-4.6-20100612/gcc/testsuite/gcc.dg/vect/slp-perm-6.c	2010-06-15 22:08:10.000000000 +0200
@@ -62,6 +62,7 @@  int main (int argc, const char* argv[])
       output2[i] = 0;
       if (input[i] > 256)
         abort ();
+      __asm__ volatile ("");
     }
 
   foo (input, output, input2, output2);