[gcc r12-567] refactor SSA rewriting timevars

Richard Biener rguenth@gcc.gnu.org
Thu May 6 12:52:11 GMT 2021


https://gcc.gnu.org/g:ee5361a16ddf478113dc5084d08b8c9ba9e4735e

commit r12-567-gee5361a16ddf478113dc5084d08b8c9ba9e4735e
Author: Richard Biener <rguenther@suse.de>
Date:   Thu May 6 11:17:58 2021 +0200

    refactor SSA rewriting timevars
    
    This avoids too deep stacks of timevars during incremental
    SSA rewrite and basically use TV_TREE_INTO_SSA for all into-SSA
    rewrite work and TV_TREE_SSA_INCREMENTAL for update_ssa.
    
    2021-05-06  Richard Biener  <rguenther@suse.de>
    
            * timevar.def (TV_TREE_INSERT_PHI_NODES): Remove.
            (TV_TREE_SSA_REWRITE_BLOCKS): Likewise.
            (TV_TREE_INTO_SSA): New.
            * tree-into-ssa.c (insert_phi_nodes): Do not account separately.
            (rewrite_blocks): Likewise.
            (pass_data_build_ssa): Account to TV_TREE_INTO_SSA.

Diff:
---
 gcc/timevar.def     |  3 +--
 gcc/tree-into-ssa.c | 11 +----------
 2 files changed, 2 insertions(+), 12 deletions(-)

diff --git a/gcc/timevar.def b/gcc/timevar.def
index 63c0b3306de..16d1657436c 100644
--- a/gcc/timevar.def
+++ b/gcc/timevar.def
@@ -162,9 +162,8 @@ DEFTIMEVAR (TV_TREE_EARLY_VRP        , "tree Early VRP")
 DEFTIMEVAR (TV_TREE_COPY_PROP        , "tree copy propagation")
 DEFTIMEVAR (TV_FIND_REFERENCED_VARS  , "tree find ref. vars")
 DEFTIMEVAR (TV_TREE_PTA		     , "tree PTA")
-DEFTIMEVAR (TV_TREE_INSERT_PHI_NODES , "tree PHI insertion")
-DEFTIMEVAR (TV_TREE_SSA_REWRITE_BLOCKS, "tree SSA rewrite")
 DEFTIMEVAR (TV_TREE_SSA_OTHER	     , "tree SSA other")
+DEFTIMEVAR (TV_TREE_INTO_SSA	     , "tree SSA rewrite")
 DEFTIMEVAR (TV_TREE_SSA_INCREMENTAL  , "tree SSA incremental")
 DEFTIMEVAR (TV_TREE_OPS	             , "tree operand scan")
 DEFTIMEVAR (TV_TREE_SSA_DOMINATOR_OPTS   , "dominator optimization")
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index ef990604030..85adb1ad8c7 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -1071,8 +1071,6 @@ insert_phi_nodes (bitmap_head *dfs)
   unsigned i;
   var_info *info;
 
-  timevar_push (TV_TREE_INSERT_PHI_NODES);
-
   /* When the gimplifier introduces SSA names it cannot easily avoid
      situations where abnormal edges added by CFG construction break
      the use-def dominance requirement.  For this case rewrite SSA
@@ -1141,8 +1139,6 @@ insert_phi_nodes (bitmap_head *dfs)
       insert_phi_nodes_for (info->var, idf, false);
       BITMAP_FREE (idf);
     }
-
-  timevar_pop (TV_TREE_INSERT_PHI_NODES);
 }
 
 
@@ -2282,9 +2278,6 @@ rewrite_update_dom_walker::after_dom_children (basic_block bb ATTRIBUTE_UNUSED)
 static void
 rewrite_blocks (basic_block entry, enum rewrite_mode what)
 {
-  /* Rewrite all the basic blocks in the program.  */
-  timevar_push (TV_TREE_SSA_REWRITE_BLOCKS);
-
   block_defs_stack.create (10);
 
   /* Recursively walk the dominator tree rewriting each statement in
@@ -2305,8 +2298,6 @@ rewrite_blocks (basic_block entry, enum rewrite_mode what)
     }
 
   block_defs_stack.release ();
-
-  timevar_pop (TV_TREE_SSA_REWRITE_BLOCKS);
 }
 
 class mark_def_dom_walker : public dom_walker
@@ -2402,7 +2393,7 @@ const pass_data pass_data_build_ssa =
   GIMPLE_PASS, /* type */
   "ssa", /* name */
   OPTGROUP_NONE, /* optinfo_flags */
-  TV_TREE_SSA_OTHER, /* tv_id */
+  TV_TREE_INTO_SSA, /* tv_id */
   PROP_cfg, /* properties_required */
   PROP_ssa, /* properties_provided */
   0, /* properties_destroyed */


More information about the Gcc-cvs mailing list