From 9dac82c4dac4a4e47756c5a16067672339804cf0 Mon Sep 17 00:00:00 2001 From: Sebastian Pop Date: Wed, 2 Feb 2011 15:52:21 +0000 Subject: [PATCH] Fix PR40979 and PR47044: after LIM call copy_prop and DCE to clean up. 2011-02-02 Sebastian Pop Richard Guenther PR tree-optimization/40979 PR bootstrap/47044 * passes.c (init_optimization_passes): After LIM call copy_prop and DCE to clean up. * tree-ssa-loop.c (pass_graphite_transforms): Add 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. Co-Authored-By: Richard Guenther From-SVN: r169531 --- gcc/ChangeLog | 9 +++++++ gcc/passes.c | 2 +- gcc/testsuite/ChangeLog | 11 ++++++++ gcc/testsuite/gcc.dg/graphite/graphite.exp | 2 +- gcc/testsuite/gcc.dg/graphite/pr35356-2.c | 4 +-- .../gfortran.dg/graphite/graphite.exp | 6 ++++- .../gfortran.dg/graphite/vect-pr40979.f90 | 26 +++++++++++++++++++ gcc/tree-ssa-loop.c | 2 +- 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 cbe95a0034d..79a140b9b27 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2011-02-02 Sebastian Pop + Richard Guenther + + PR tree-optimization/40979 + PR bootstrap/47044 + * passes.c (init_optimization_passes): After LIM call copy_prop + and DCE to clean up. + * tree-ssa-loop.c (pass_graphite_transforms): Add TODO_dump_func. + 2011-02-02 Sebastian Pop PR tree-optimization/47576 diff --git a/gcc/passes.c b/gcc/passes.c index 90d61e346ec..bf1bd4b6901 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 6b460a10efe..c4dd8ac0349 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2011-02-02 Sebastian Pop + Richard Guenther + + PR tree-optimization/40979 + PR bootstrap/47044 + * 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-02 Janus Weil PR fortran/47572 diff --git a/gcc/testsuite/gcc.dg/graphite/graphite.exp b/gcc/testsuite/gcc.dg/graphite/graphite.exp index 74e1ed8172d..cdf35ebab8a 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 e5b0213768c..66cfdea5aef 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 3d43b55d0c3..73c2aeed42f 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 00000000000..21758e91fd5 --- /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 656d2b6a8e0..43693eaeae7 100644 --- a/gcc/tree-ssa-loop.c +++ b/gcc/tree-ssa-loop.c @@ -309,7 +309,7 @@ struct gimple_opt_pass pass_graphite_transforms = 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ - 0 /* todo_flags_finish */ + TODO_dump_func /* todo_flags_finish */ } };