This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR40979: after LIM call copy_prop and DCE to clean up.


On Tue, Feb 01, 2011 at 02:50:16PM -0600, Sebastian Pop wrote:
> Hi,
> 
> This patch fixes the 60% regression on induct.f90 when graphite is
> enabled.  This enables the vectorization of all the loops that were
> vectorizable without graphite.
> 
> I am regstraping this on amd64-linux.  Ok for trunk?

Sebastian,
   You might want to look at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47048#c1
to see if the remaining failures left in vect.exp (reduced from 129 to now 24
with your patch) present any clues as to where the remaining problems in
-fgraphite-identity's vectorization might lie?
               Jack
> 
> Thanks,
> Sebastian
> 
> 2011-02-01  Sebastian Pop  <sebastian.pop@amd.com>
> 	    Richard Guenther  <rguenther@suse.de>
> 
> 	PR tree-optimization/40979
> 	* passes.c (init_optimization_passes): After LIM call copy_prop
> 	and DCE to clean up.
> 	* tree-ssa-loop.c (pass_graphite_transforms): Add
> 	TODO_update_address_taken and TODO_dump_func.
> 
> 	* gcc.dg/graphite/graphite.exp (DEFAULT_VECTCFLAGS): Add -ffast-math.
> 	* gcc.dg/graphite/pr35356-2.c: Adjust pattern.
> 	* gfortran.dg/graphite/graphite.exp: Run vect_files conditionally to
> 	check_vect_support_and_set_flags.
> 	* gfortran.dg/graphite/vect-pr40979.f90: New.
> ---
>  gcc/ChangeLog                                      |    9 +++++++
>  gcc/passes.c                                       |    2 +-
>  gcc/testsuite/ChangeLog                            |   10 +++++++
>  gcc/testsuite/gcc.dg/graphite/graphite.exp         |    2 +-
>  gcc/testsuite/gcc.dg/graphite/pr35356-2.c          |    4 +-
>  gcc/testsuite/gfortran.dg/graphite/graphite.exp    |    6 ++++-
>  .../gfortran.dg/graphite/vect-pr40979.f90          |   26 ++++++++++++++++++++
>  gcc/tree-ssa-loop.c                                |    3 +-
>  8 files changed, 56 insertions(+), 6 deletions(-)
>  create mode 100644 gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90
> 
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index 626d8f7..286cf26 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,4 +1,13 @@
>  2011-02-01  Sebastian Pop  <sebastian.pop@amd.com>
> +	    Richard Guenther  <rguenther@suse.de>
> +
> +	PR tree-optimization/40979
> +	* passes.c (init_optimization_passes): After LIM call copy_prop
> +	and DCE to clean up.
> +	* tree-ssa-loop.c (pass_graphite_transforms): Add
> +	TODO_update_address_taken and TODO_dump_func.
> +
> +2011-02-01  Sebastian Pop  <sebastian.pop@amd.com>
>  
>  	PR tree-optimization/47576
>  	PR tree-optimization/47555
> diff --git a/gcc/passes.c b/gcc/passes.c
> index 90d61e3..bf1bd4b 100644
> --- a/gcc/passes.c
> +++ b/gcc/passes.c
> @@ -892,9 +892,9 @@ init_optimization_passes (void)
>  	    {
>  	      struct opt_pass **p = &pass_graphite.pass.sub;
>  	      NEXT_PASS (pass_graphite_transforms);
> +	      NEXT_PASS (pass_lim);
>  	      NEXT_PASS (pass_copy_prop);
>  	      NEXT_PASS (pass_dce_loop);
> -	      NEXT_PASS (pass_lim);
>  	    }
>  	  NEXT_PASS (pass_iv_canon);
>  	  NEXT_PASS (pass_if_conversion);
> diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
> index 26b7e3e..8a07015 100644
> --- a/gcc/testsuite/ChangeLog
> +++ b/gcc/testsuite/ChangeLog
> @@ -1,3 +1,13 @@
> +2011-02-01  Sebastian Pop  <sebastian.pop@amd.com>
> +	    Richard Guenther  <rguenther@suse.de>
> +
> +	PR tree-optimization/40979
> +	* gcc.dg/graphite/graphite.exp (DEFAULT_VECTCFLAGS): Add -ffast-math.
> +	* gcc.dg/graphite/pr35356-2.c: Adjust pattern.
> +	* gfortran.dg/graphite/graphite.exp: Run vect_files conditionally to
> +	check_vect_support_and_set_flags.
> +	* gfortran.dg/graphite/vect-pr40979.f90: New.
> +
>  2011-02-01  Richard Guenther  <rguenther@suse.de>
>  
>  	PR tree-optimization/47559
> diff --git a/gcc/testsuite/gcc.dg/graphite/graphite.exp b/gcc/testsuite/gcc.dg/graphite/graphite.exp
> index 74e1ed8..cdf35eb 100644
> --- a/gcc/testsuite/gcc.dg/graphite/graphite.exp
> +++ b/gcc/testsuite/gcc.dg/graphite/graphite.exp
> @@ -58,7 +58,7 @@ dg-runtest $block_files       "" "-O2 -floop-block -fno-loop-strip-mine -fno-loo
>  
>  # Vectorizer tests, to be run or compiled, depending on target capabilities.
>  global DEFAULT_VECTCFLAGS
> -set DEFAULT_VECTCFLAGS "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details"
> +set DEFAULT_VECTCFLAGS "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details -ffast-math"
>  
>  if [check_vect_support_and_set_flags] {
>      dg-runtest $vect_files        "" $DEFAULT_VECTCFLAGS
> diff --git a/gcc/testsuite/gcc.dg/graphite/pr35356-2.c b/gcc/testsuite/gcc.dg/graphite/pr35356-2.c
> index e5b0213..66cfdea 100644
> --- a/gcc/testsuite/gcc.dg/graphite/pr35356-2.c
> +++ b/gcc/testsuite/gcc.dg/graphite/pr35356-2.c
> @@ -39,6 +39,6 @@ foo (int bar, int n, int k)
>  */
>  
>  
> -/* { dg-final { scan-tree-dump-times "MIN_EXPR" 2 "graphite" } } */
> -/* { dg-final { scan-tree-dump-times "MAX_EXPR" 2 "graphite" } } */
> +/* { dg-final { scan-tree-dump-times "MIN_EXPR" 4 "graphite" } } */
> +/* { dg-final { scan-tree-dump-times "MAX_EXPR" 4 "graphite" } } */
>  /* { dg-final { cleanup-tree-dump "graphite" } } */
> diff --git a/gcc/testsuite/gfortran.dg/graphite/graphite.exp b/gcc/testsuite/gfortran.dg/graphite/graphite.exp
> index 3d43b55..73c2aee 100644
> --- a/gcc/testsuite/gfortran.dg/graphite/graphite.exp
> +++ b/gcc/testsuite/gfortran.dg/graphite/graphite.exp
> @@ -51,7 +51,11 @@ gfortran-dg-runtest $scop_files        "-O2 -fgraphite -fdump-tree-graphite-all"
>  gfortran-dg-runtest $id_files          "-O2 -fgraphite-identity -ffast-math"
>  gfortran-dg-runtest $interchange_files "-O2 -floop-interchange -fno-loop-block -fno-loop-strip-mine -ffast-math -fdump-tree-graphite-all"
>  gfortran-dg-runtest $block_files       "-O2 -floop-block -fno-loop-strip-mine -fno-loop-interchange -ffast-math -fdump-tree-graphite-all"
> -gfortran-dg-runtest $vect_files        "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details"
> +
> +# Vectorizer tests, to be run or compiled, depending on target capabilities.
> +if [check_vect_support_and_set_flags] {
> +    gfortran-dg-runtest $vect_files "-O2 -fgraphite-identity -ftree-vectorize -fno-vect-cost-model -fdump-tree-vect-details -ffast-math"
> +}
>  
>  # Tests to be run.
>  set dg-do-what-default run
> diff --git a/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90 b/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90
> new file mode 100644
> index 0000000..21758e9
> --- /dev/null
> +++ b/gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90
> @@ -0,0 +1,26 @@
> +! { dg-do compile }
> +! { dg-require-effective-target vect_int }
> +
> +module mqc_m
> +integer, parameter, private :: longreal = selected_real_kind(15,90)
> +contains
> +      subroutine mutual_ind_quad_cir_coil (m, l12)
> +      real (kind = longreal), dimension(9), save :: w2gauss, w1gauss
> +      real (kind = longreal) :: l12_lower, num, l12
> +      real (kind = longreal), dimension(3) :: current, coil
> +      w2gauss(1) = 16.0_longreal/81.0_longreal
> +      w1gauss(5) = 0.3302393550_longreal
> +      do i = 1, 2*m
> +          do j = 1, 9
> +              do k = 1, 9
> +                  num = w1gauss(j) * w2gauss(k) * dot_product(coil,current)
> +                  l12_lower = l12_lower + num
> +              end do
> +          end do
> +      end do
> +      l12 = l12_lower
> +      end subroutine mutual_ind_quad_cir_coil
> +end module mqc_m
> +
> +! { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } }
> +! { dg-final { cleanup-tree-dump "vect" } }
> diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
> index 656d2b6..462b172 100644
> --- a/gcc/tree-ssa-loop.c
> +++ b/gcc/tree-ssa-loop.c
> @@ -309,7 +309,8 @@ struct gimple_opt_pass pass_graphite_transforms =
>    0,					/* properties_provided */
>    0,					/* properties_destroyed */
>    0,					/* todo_flags_start */
> -  0					/* todo_flags_finish */
> +  TODO_update_address_taken
> +  | TODO_dump_func                     /* todo_flags_finish */
>   }
>  };
>  
> -- 
> 1.7.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]