diff mbox series

refactor SSA rewriting timevars

Message ID nycvar.YFH.7.76.2105061451370.9719@elmra.sevgm.obk
State New
Headers show
Series refactor SSA rewriting timevars | expand

Commit Message

Richard Biener May 6, 2021, 12:51 p.m. UTC
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.

Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed.

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.
---
 gcc/timevar.def     |  3 +--
 gcc/tree-into-ssa.c | 11 +----------
 2 files changed, 2 insertions(+), 12 deletions(-)
diff mbox series

Patch

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 */