OSDN Git Service

Measure time spent in DD analysis and in code gen.
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Aug 2009 14:18:17 +0000 (14:18 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Aug 2009 14:18:17 +0000 (14:18 +0000)
2009-08-05  Sebastian Pop  <sebastian.pop@amd.com>

* graphite-clast-to-gimple.c (gloog): Add time to TV_GRAPHITE_CODE_GEN.
* graphite-dependences.c (graphite_legal_transform): Add time to
TV_GRAPHITE_DATA_DEPS.
(dependency_between_pbbs_p): Same.
* timevar.def (TV_GRAPHITE_DATA_DEPS, TV_GRAPHITE_CODE_GEN): New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150683 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ChangeLog.graphite
gcc/common.opt
gcc/graphite-clast-to-gimple.c
gcc/graphite-dependences.c
gcc/timevar.def
gcc/tree-parloops.c

index 335436f..6b72bfd 100644 (file)
@@ -1,3 +1,11 @@
+2009-08-12  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * graphite-clast-to-gimple.c (gloog): Add time to TV_GRAPHITE_CODE_GEN.
+       * graphite-dependences.c (graphite_legal_transform): Add time to
+       TV_GRAPHITE_DATA_DEPS.
+       (dependency_between_pbbs_p): Same.
+       * timevar.def (TV_GRAPHITE_DATA_DEPS, TV_GRAPHITE_CODE_GEN): New.
+
 2009-08-12  Andrey Belevantsev  <abel@ispras.ru>
 
        PR rtl-optimization/41033
index ff6e748..3762a0b 100644 (file)
@@ -1,3 +1,15 @@
+2009-08-05  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * graphite-clast-to-gimple.c (gloog): Add time to TV_GRAPHITE_CODE_GEN.
+       * graphite-dependences.c (graphite_legal_transform): Add time to
+       TV_GRAPHITE_DATA_DEPS.
+       (dependency_between_pbbs_p): Same.
+       * timevar.def (TV_GRAPHITE_DATA_DEPS, TV_GRAPHITE_CODE_GEN): New.
+
+2009-08-03  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * Merge from mainline (r149952:150372).
+
 2009-07-28  Sebastian Pop  <sebastian.pop@amd.com>
 
        * ChangeLog.graphite: Fix indenting, white spaces and 80 columns.
index d8507d1..133bc52 100644 (file)
@@ -571,12 +571,10 @@ fgraphite
 Common Report Var(flag_graphite)
 Enable in and out of Graphite representation
 
-; This option is not documented as it does not perform any useful optimization.
 fgraphite-identity
 Common Report Var(flag_graphite_identity) Optimization
 Enable Graphite Identity transformation
 
-; This option is not documented as it will be removed
 floop-parallelize-all
 Common Report Var(flag_loop_parallelize_all) Optimization
 Mark all loops as parallel
index bf540a2..5da15e0 100644 (file)
@@ -1160,7 +1160,11 @@ gloog (scop_p scop, htab_t bb_pbb_mapping)
   sese region = SCOP_REGION (scop);
   ifsese if_region = NULL;
   htab_t rename_map, newivs_index;
-  cloog_prog_clast pc = scop_to_clast (scop);
+  cloog_prog_clast pc;
+
+  timevar_push (TV_GRAPHITE_CODE_GEN);
+
+  pc = scop_to_clast (scop);
 
   if (dump_file && (dump_flags & TDF_DETAILS))
     {
@@ -1206,6 +1210,8 @@ gloog (scop_p scop, htab_t bb_pbb_mapping)
   VEC_free (tree, heap, newivs);
   cloog_clast_free (pc.stmt);
   cloog_program_free (pc.prog);
+  timevar_pop (TV_GRAPHITE_CODE_GEN);
+
   return true;
 }
 
index 3cd41ed..ed2f92e 100644 (file)
@@ -556,11 +556,17 @@ graphite_legal_transform (scop_p scop)
   int i, j;
   poly_bb_p pbb1, pbb2;
 
+  timevar_push (TV_GRAPHITE_DATA_DEPS);
+
   for (i = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), i, pbb1); i++)
     for (j = 0; VEC_iterate (poly_bb_p, SCOP_BBS (scop), j, pbb2); j++)
       if (!graphite_legal_transform_bb (pbb1, pbb2))
-       return false;
+       {
+         timevar_pop (TV_GRAPHITE_DATA_DEPS);
+         return false;
+       }
 
+  timevar_pop (TV_GRAPHITE_DATA_DEPS);
   return true;
 }
 
@@ -681,11 +687,17 @@ dependency_between_pbbs_p (poly_bb_p pbb1, poly_bb_p pbb2, int level)
   int i, j;
   poly_dr_p pdr1, pdr2;
 
+  timevar_push (TV_GRAPHITE_DATA_DEPS);
+
   for (i = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb1), i, pdr1); i++)
     for (j = 0; VEC_iterate (poly_dr_p, PBB_DRS (pbb2), j, pdr2); j++)
       if (graphite_carried_dependence_level_k (pdr1, pdr2, level))
-       return true;
+       {
+         timevar_pop (TV_GRAPHITE_DATA_DEPS);
+         return true;
+       }
 
+  timevar_pop (TV_GRAPHITE_DATA_DEPS);
   return false;
 }
 
index 938447f..0e704cb 100644 (file)
@@ -122,7 +122,9 @@ DEFTIMEVAR (TV_COMPLETE_UNROLL       , "complete unrolling")
 DEFTIMEVAR (TV_TREE_PARALLELIZE_LOOPS, "tree parallelize loops")
 DEFTIMEVAR (TV_TREE_VECTORIZATION    , "tree vectorization")
 DEFTIMEVAR (TV_TREE_SLP_VECTORIZATION, "tree slp vectorization")
-DEFTIMEVAR (TV_GRAPHITE_TRANSFORMS   , "GRAPHITE loop transforms")
+DEFTIMEVAR (TV_GRAPHITE_TRANSFORMS   , "Graphite loop transforms")
+DEFTIMEVAR (TV_GRAPHITE_DATA_DEPS    , "Graphite data dep analysis")
+DEFTIMEVAR (TV_GRAPHITE_CODE_GEN     , "Graphite code generation")
 DEFTIMEVAR (TV_TREE_LINEAR_TRANSFORM , "tree loop linear")
 DEFTIMEVAR (TV_TREE_LOOP_DISTRIBUTION, "tree loop distribution")
 DEFTIMEVAR (TV_CHECK_DATA_DEPS       , "tree check data dependences")
index 9acf0ff..9b9ac75 100644 (file)
@@ -1801,6 +1801,11 @@ parallelize_loops (void)
     {
       htab_empty (reduction_list);
 
+      /* If we use autopar in graphite pass, we use it's marked dependency
+      checking results.  */
+      if (flag_loop_parallelize_all && !loop->can_be_parallel)
+       continue;
+
       /* FIXME: Only consider innermost loops with just one exit.  */
       if (loop->inner || !single_dom_exit (loop))
        continue;
@@ -1811,19 +1816,22 @@ parallelize_loops (void)
          /* FIXME: the check for vector phi nodes could be removed.  */
          || loop_has_vector_phi_nodes (loop))
        continue;
-     
-        if (/* Do not bother with loops in cold areas.  */
-           optimize_loop_nest_for_size_p (loop)
-           /* Or loops that roll too little.  */
-           || expected_loop_iterations (loop) <= n_threads)
+
+      /* FIXME: Bypass this check as graphite doesn't update the
+      count and frequency correctly now.  */
+      if (!flag_loop_parallelize_all
+         && (expected_loop_iterations (loop) <= n_threads
+             /* Do not bother with loops in cold areas.  */
+             || optimize_loop_nest_for_size_p (loop)))
        continue;
+
       if (!try_get_loop_niter (loop, &niter_desc))
        continue;
 
       if (!try_create_reduction_list (loop, reduction_list))
        continue;
 
-      if (!loop_parallel_p (loop))
+      if (!flag_loop_parallelize_all && !loop_parallel_p (loop))
        continue;
 
       changed = true;