Fix PR40979 and PR47044: after LIM call copy_prop and DCE to clean up.
authorSebastian Pop <sebastian.pop@amd.com>
Wed, 2 Feb 2011 15:52:21 +0000 (15:52 +0000)
committerSebastian Pop <spop@gcc.gnu.org>
Wed, 2 Feb 2011 15:52:21 +0000 (15:52 +0000)
2011-02-02  Sebastian Pop  <sebastian.pop@amd.com>
    Richard Guenther  <rguenther@suse.de>

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 <rguenther@suse.de>
From-SVN: r169531

gcc/ChangeLog
gcc/passes.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/graphite/graphite.exp
gcc/testsuite/gcc.dg/graphite/pr35356-2.c
gcc/testsuite/gfortran.dg/graphite/graphite.exp
gcc/testsuite/gfortran.dg/graphite/vect-pr40979.f90 [new file with mode: 0644]
gcc/tree-ssa-loop.c

index cbe95a0034d36c2201220645c7b2b4df824a7b52..79a140b9b2723d8b07be930c5c8c07e1305bfe03 100644 (file)
@@ -1,3 +1,12 @@
+2011-02-02  Sebastian Pop  <sebastian.pop@amd.com>
+           Richard Guenther  <rguenther@suse.de>
+
+       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  <sebastian.pop@amd.com>
 
        PR tree-optimization/47576
index 90d61e346ecbf2f4b604b2704a62ab0915deb6b5..bf1bd4b6901900116fb7bc2709d602e7d4b2f090 100644 (file)
@@ -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);
index 6b460a10efee93d3ce7b31104a120b8d6817f7bb..c4dd8ac0349f9ece44c0ffe21c2a741f82d3da06 100644 (file)
@@ -1,3 +1,14 @@
+2011-02-02  Sebastian Pop  <sebastian.pop@amd.com>
+           Richard Guenther  <rguenther@suse.de>
+
+       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  <janus@gcc.gnu.org>
 
        PR fortran/47572
index 74e1ed8172d23deb374677ae1a623d910220fd5e..cdf35ebab8a92ef26e1ce7d3213fea67f1ec7dfa 100644 (file)
@@ -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
index e5b0213768c099d707c00c1269c71a9f9b92a4ce..66cfdea5aefecac046b42e24a0041898d8ac28e4 100644 (file)
@@ -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" } } */
index 3d43b55d0c33795fd7bcbfc6614b14a9fe6faffb..73c2aeed42f9fee25bcb7c6f991f535f80daf441 100644 (file)
@@ -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 (file)
index 0000000..21758e9
--- /dev/null
@@ -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" } }
index 656d2b6a8e0027ddcf10a6ee142d9375373da49d..43693eaeae77cff0b8b44dd5a260f29b2e2a5b33 100644 (file)
@@ -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 */
  }
 };