Patchwork Tighten forwprop1 testing

login
register
mail settings
Submitter Marc Glisse
Date Sept. 14, 2012, 7:30 p.m.
Message ID <alpine.DEB.2.02.1209142123050.8310@stedding.saclay.inria.fr>
Download mbox | patch
Permalink /patch/184019/
State New
Headers show

Comments

Marc Glisse - Sept. 14, 2012, 7:30 p.m.
Hello,

recent patches have let optimizations move from forwprop2 to forwprop1. 
The attached checks that this remains the case. (copyprop1 is the first 
pass after forwprop1 that does a dce-like cleanup)

Only manually tested for now, will check better if it is accepted.

2012-09-15  Marc Glisse  <marc.glisse@inria.fr>

 	* gcc.dg/tree-ssa/forwprop-19.c: Check in forwprop1.
 	* gcc.dg/tree-ssa/forwprop-20.c: Check in forwprop1.
 	* gcc.dg/tree-ssa/forwprop-21.c: Check in copyprop1.
 	* gcc.dg/tree-ssa/forwprop-22.c: Check in copyprop1.
Richard Guenther - Sept. 15, 2012, 4:04 p.m.
On Fri, Sep 14, 2012 at 9:30 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> Hello,
>
> recent patches have let optimizations move from forwprop2 to forwprop1. The
> attached checks that this remains the case. (copyprop1 is the first pass
> after forwprop1 that does a dce-like cleanup)
>
> Only manually tested for now, will check better if it is accepted.

Ok.

Thanks,
Richard.

> 2012-09-15  Marc Glisse  <marc.glisse@inria.fr>
>
>         * gcc.dg/tree-ssa/forwprop-19.c: Check in forwprop1.
>         * gcc.dg/tree-ssa/forwprop-20.c: Check in forwprop1.
>         * gcc.dg/tree-ssa/forwprop-21.c: Check in copyprop1.
>         * gcc.dg/tree-ssa/forwprop-22.c: Check in copyprop1.
>
> --
> Marc Glisse
> Index: testsuite/gcc.dg/tree-ssa/forwprop-19.c
> ===================================================================
> --- testsuite/gcc.dg/tree-ssa/forwprop-19.c     (revision 191308)
> +++ testsuite/gcc.dg/tree-ssa/forwprop-19.c     (working copy)
> @@ -1,15 +1,15 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O -fdump-tree-forwprop2" } */
> +/* { dg-options "-O -fdump-tree-forwprop1" } */
>
>  typedef int vec __attribute__((vector_size (4 * sizeof (int))));
>  void f (vec *x1, vec *x2)
>  {
>    vec m = { 1, 2, 3, 0 };
>    vec n = { 3, 0, 1, 2 };
>    vec y = __builtin_shuffle (*x1, *x2, n);
>    vec z = __builtin_shuffle (y, m);
>    *x1 = z;
>  }
>
> -/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "forwprop2" } } */
> -/* { dg-final { cleanup-tree-dump "forwprop2" } } */
> +/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "forwprop1" } } */
> +/* { dg-final { cleanup-tree-dump "forwprop1" } } */
> Index: testsuite/gcc.dg/tree-ssa/forwprop-20.c
> ===================================================================
> --- testsuite/gcc.dg/tree-ssa/forwprop-20.c     (revision 191308)
> +++ testsuite/gcc.dg/tree-ssa/forwprop-20.c     (working copy)
> @@ -1,13 +1,13 @@
>  /* { dg-do compile } */
>  /* { dg-require-effective-target double64 } */
> -/* { dg-options "-O2 -fdump-tree-optimized" }  */
> +/* { dg-options "-O -fdump-tree-forwprop1" }  */
>
>  #include <stdint.h>
>
>  /* All of these optimizations happen for unsupported vector modes as a
>     consequence of the lowering pass. We need to test with a vector mode
>     that is supported by default on at least some architectures, or make
>     the test target specific so we can pass a flag like -mavx.  */
>
>  typedef double vecf __attribute__ ((vector_size (2 * sizeof (double))));
>  typedef int64_t veci __attribute__ ((vector_size (2 * sizeof (int64_t))));
> @@ -59,12 +59,12 @@ void k (vecf* r)
>  }
>
>  void l (double d, vecf* r)
>  {
>    vecf x = { -d, 5 };
>    vecf y = {  d, 4 };
>    veci m = {  2, 0 };
>    *r = __builtin_shuffle (x, y, m); // { d, -d }
>  }
>
> -/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "optimized" } } */
> -/* { dg-final { cleanup-tree-dump "optimized" } } */
> +/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "forwprop1" } } */
> +/* { dg-final { cleanup-tree-dump "forwprop1" } } */
> Index: testsuite/gcc.dg/tree-ssa/forwprop-21.c
> ===================================================================
> --- testsuite/gcc.dg/tree-ssa/forwprop-21.c     (revision 191308)
> +++ testsuite/gcc.dg/tree-ssa/forwprop-21.c     (working copy)
> @@ -1,13 +1,16 @@
>  /* { dg-do compile } */
> -/* { dg-options "-O -fdump-tree-optimized" } */
> +/* { dg-options "-O -fdump-tree-copyprop1" } */
>  typedef int v4si __attribute__ ((vector_size (4 * sizeof(int))));
>
>  int
>  test (v4si *x, v4si *y)
>  {
>    v4si m = { 2, 3, 6, 5 };
>    v4si z = __builtin_shuffle (*x, *y, m);
>    return z[2];
>  }
> -/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "optimized" } } */
> -/* { dg-final { cleanup-tree-dump "optimized" } } */
> +
> +/* Optimization in forwprop1, cleanup in copyprop1.  */
> +
> +/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "copyprop1" } } */
> +/* { dg-final { cleanup-tree-dump "copyprop1" } } */
> Index: testsuite/gcc.dg/tree-ssa/forwprop-22.c
> ===================================================================
> --- testsuite/gcc.dg/tree-ssa/forwprop-22.c     (revision 191308)
> +++ testsuite/gcc.dg/tree-ssa/forwprop-22.c     (working copy)
> @@ -1,18 +1,20 @@
>  /* { dg-do compile } */
>  /* { dg-require-effective-target vect_double } */
>  /* { dg-require-effective-target vect_perm } */
> -/* { dg-options "-O -fdump-tree-optimized" } */
> +/* { dg-options "-O -fdump-tree-copyprop1" } */
>
>  typedef double vec __attribute__((vector_size (2 * sizeof (double))));
>  void f (vec *px, vec *y, vec *z)
>  {
>    vec x = *px;
>    vec t1 = { x[1], x[0] };
>    vec t2 = { x[0], x[1] };
>    *y = t1;
>    *z = t2;
>  }
>
> -/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "optimized" } } */
> -/* { dg-final { scan-tree-dump-not "BIT_FIELD_REF" "optimized" } } */
> -/* { dg-final { cleanup-tree-dump "optimized" } } */
> +/* Optimization in forwprop1, cleanup in copyprop1.  */
> +
> +/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "copyprop1" } } */
> +/* { dg-final { scan-tree-dump-not "BIT_FIELD_REF" "copyprop1" } } */
> +/* { dg-final { cleanup-tree-dump "copyprop1" } } */
>

Patch

Index: testsuite/gcc.dg/tree-ssa/forwprop-19.c

===================================================================
--- testsuite/gcc.dg/tree-ssa/forwprop-19.c	(revision 191308)

+++ testsuite/gcc.dg/tree-ssa/forwprop-19.c	(working copy)

@@ -1,15 +1,15 @@ 

 /* { dg-do compile } */
-/* { dg-options "-O -fdump-tree-forwprop2" } */

+/* { dg-options "-O -fdump-tree-forwprop1" } */

 
 typedef int vec __attribute__((vector_size (4 * sizeof (int))));
 void f (vec *x1, vec *x2)
 {
   vec m = { 1, 2, 3, 0 };
   vec n = { 3, 0, 1, 2 };
   vec y = __builtin_shuffle (*x1, *x2, n);
   vec z = __builtin_shuffle (y, m);
   *x1 = z;
 }
 
-/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "forwprop2" } } */

-/* { dg-final { cleanup-tree-dump "forwprop2" } } */

+/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "forwprop1" } } */

+/* { dg-final { cleanup-tree-dump "forwprop1" } } */

Index: testsuite/gcc.dg/tree-ssa/forwprop-20.c

===================================================================
--- testsuite/gcc.dg/tree-ssa/forwprop-20.c	(revision 191308)

+++ testsuite/gcc.dg/tree-ssa/forwprop-20.c	(working copy)

@@ -1,13 +1,13 @@ 

 /* { dg-do compile } */
 /* { dg-require-effective-target double64 } */
-/* { dg-options "-O2 -fdump-tree-optimized" }  */

+/* { dg-options "-O -fdump-tree-forwprop1" }  */

 
 #include <stdint.h>
 
 /* All of these optimizations happen for unsupported vector modes as a
    consequence of the lowering pass. We need to test with a vector mode
    that is supported by default on at least some architectures, or make
    the test target specific so we can pass a flag like -mavx.  */
 
 typedef double vecf __attribute__ ((vector_size (2 * sizeof (double))));
 typedef int64_t veci __attribute__ ((vector_size (2 * sizeof (int64_t))));
@@ -59,12 +59,12 @@  void k (vecf* r)

 }
 
 void l (double d, vecf* r)
 {
   vecf x = { -d, 5 };
   vecf y = {  d, 4 };
   veci m = {  2, 0 };
   *r = __builtin_shuffle (x, y, m); // { d, -d }
 }
 
-/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "optimized" } } */

-/* { dg-final { cleanup-tree-dump "optimized" } } */

+/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "forwprop1" } } */

+/* { dg-final { cleanup-tree-dump "forwprop1" } } */

Index: testsuite/gcc.dg/tree-ssa/forwprop-21.c

===================================================================
--- testsuite/gcc.dg/tree-ssa/forwprop-21.c	(revision 191308)

+++ testsuite/gcc.dg/tree-ssa/forwprop-21.c	(working copy)

@@ -1,13 +1,16 @@ 

 /* { dg-do compile } */
-/* { dg-options "-O -fdump-tree-optimized" } */

+/* { dg-options "-O -fdump-tree-copyprop1" } */

 typedef int v4si __attribute__ ((vector_size (4 * sizeof(int))));
 
 int
 test (v4si *x, v4si *y)
 {
   v4si m = { 2, 3, 6, 5 };
   v4si z = __builtin_shuffle (*x, *y, m);
   return z[2];
 }
-/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "optimized" } } */

-/* { dg-final { cleanup-tree-dump "optimized" } } */

+

+/* Optimization in forwprop1, cleanup in copyprop1.  */

+

+/* { dg-final { scan-tree-dump-not "VEC_PERM_EXPR" "copyprop1" } } */

+/* { dg-final { cleanup-tree-dump "copyprop1" } } */

Index: testsuite/gcc.dg/tree-ssa/forwprop-22.c

===================================================================
--- testsuite/gcc.dg/tree-ssa/forwprop-22.c	(revision 191308)

+++ testsuite/gcc.dg/tree-ssa/forwprop-22.c	(working copy)

@@ -1,18 +1,20 @@ 

 /* { dg-do compile } */
 /* { dg-require-effective-target vect_double } */
 /* { dg-require-effective-target vect_perm } */
-/* { dg-options "-O -fdump-tree-optimized" } */

+/* { dg-options "-O -fdump-tree-copyprop1" } */

 
 typedef double vec __attribute__((vector_size (2 * sizeof (double))));
 void f (vec *px, vec *y, vec *z)
 {
   vec x = *px;
   vec t1 = { x[1], x[0] };
   vec t2 = { x[0], x[1] };
   *y = t1;
   *z = t2;
 }
 
-/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "optimized" } } */

-/* { dg-final { scan-tree-dump-not "BIT_FIELD_REF" "optimized" } } */

-/* { dg-final { cleanup-tree-dump "optimized" } } */

+/* Optimization in forwprop1, cleanup in copyprop1.  */

+

+/* { dg-final { scan-tree-dump-times "VEC_PERM_EXPR" 1 "copyprop1" } } */

+/* { dg-final { scan-tree-dump-not "BIT_FIELD_REF" "copyprop1" } } */

+/* { dg-final { cleanup-tree-dump "copyprop1" } } */