@@ -176,6 +176,7 @@ DEFTIMEVAR (TV_TREE_SPLIT_EDGES , "tree split crit edges")
DEFTIMEVAR (TV_TREE_REASSOC , "tree reassociation")
DEFTIMEVAR (TV_TREE_PRE , "tree PRE")
DEFTIMEVAR (TV_TREE_FRE , "tree FRE")
+DEFTIMEVAR (TV_TREE_RPO_VN , "tree RPO VN")
DEFTIMEVAR (TV_TREE_SINK , "tree code sinking")
DEFTIMEVAR (TV_TREE_PHIOPT , "tree linearize phis")
DEFTIMEVAR (TV_TREE_BACKPROP , "tree backward propagate")
@@ -7290,14 +7290,14 @@ eliminate_with_rpo_vn (bitmap inserted_exprs)
return walker.eliminate_cleanup ();
}
-unsigned
-do_rpo_vn (function *fn, edge entry, bitmap exit_bbs,
- bool iterate, bool eliminate, vn_lookup_kind kind);
+static unsigned
+do_rpo_vn_1 (function *fn, edge entry, bitmap exit_bbs,
+ bool iterate, bool eliminate, vn_lookup_kind kind);
void
run_rpo_vn (vn_lookup_kind kind)
{
- do_rpo_vn (cfun, NULL, NULL, true, false, kind);
+ do_rpo_vn_1 (cfun, NULL, NULL, true, false, kind);
/* ??? Prune requirement of these. */
constant_to_value_id = new hash_table<vn_constant_hasher> (23);
@@ -7995,9 +7995,9 @@ do_unwind (unwind_state *to, rpo_elim &avail)
executed and iterate. If ELIMINATE is true then perform
elimination, otherwise leave that to the caller. */
-unsigned
-do_rpo_vn (function *fn, edge entry, bitmap exit_bbs,
- bool iterate, bool eliminate, vn_lookup_kind kind)
+static unsigned
+do_rpo_vn_1 (function *fn, edge entry, bitmap exit_bbs,
+ bool iterate, bool eliminate, vn_lookup_kind kind)
{
unsigned todo = 0;
default_vn_walk_kind = kind;
@@ -8415,12 +8415,18 @@ do_rpo_vn (function *fn, edge entry, bitmap exit_bbs,
/* Region-based entry for RPO VN. Performs value-numbering and elimination
on the SEME region specified by ENTRY and EXIT_BBS. If ENTRY is not
the only edge into the region at ENTRY->dest PHI nodes in ENTRY->dest
- are not considered. */
+ are not considered.
+ If ITERATE is true then treat backedges optimistically as not
+ executed and iterate. If ELIMINATE is true then perform
+ elimination, otherwise leave that to the caller.
+ KIND specifies the amount of work done for handling memory operations. */
unsigned
-do_rpo_vn (function *fn, edge entry, bitmap exit_bbs)
+do_rpo_vn (function *fn, edge entry, bitmap exit_bbs,
+ bool iterate, bool eliminate, vn_lookup_kind kind)
{
- unsigned todo = do_rpo_vn (fn, entry, exit_bbs, false, true, VN_WALKREWRITE);
+ auto_timevar tv (TV_TREE_RPO_VN);
+ unsigned todo = do_rpo_vn_1 (fn, entry, exit_bbs, iterate, eliminate, kind);
free_rpo_vn ();
return todo;
}
@@ -8476,7 +8482,7 @@ pass_fre::execute (function *fun)
if (iterate_p)
loop_optimizer_init (AVOID_CFG_MODIFICATIONS);
- todo = do_rpo_vn (fun, NULL, NULL, iterate_p, true, VN_WALKREWRITE);
+ todo = do_rpo_vn_1 (fun, NULL, NULL, iterate_p, true, VN_WALKREWRITE);
free_rpo_vn ();
if (iterate_p)
@@ -295,8 +295,12 @@ value_id_constant_p (unsigned int v)
tree fully_constant_vn_reference_p (vn_reference_t);
tree vn_nary_simplify (vn_nary_op_t);
-unsigned do_rpo_vn (function *, edge, bitmap, bool, bool, vn_lookup_kind);
-unsigned do_rpo_vn (function *, edge, bitmap);
+unsigned do_rpo_vn (function *, edge, bitmap,
+ /* iterate */ bool = false,
+ /* eliminate */ bool = true,
+ vn_lookup_kind = VN_WALKREWRITE);
+
+/* Private interface for PRE. */
void run_rpo_vn (vn_lookup_kind);
unsigned eliminate_with_rpo_vn (bitmap);
void free_rpo_vn (void);
@@ -1466,10 +1466,7 @@ execute_early_warn_uninitialized (struct function *fun)
elimination to compute edge reachability. Don't bother when
we only warn for unconditionally executed code though. */
if (!optimize)
- {
- do_rpo_vn (fun, NULL, NULL, false, false, VN_NOWALK);
- free_rpo_vn ();
- }
+ do_rpo_vn (fun, NULL, NULL, false, false, VN_NOWALK);
else
set_all_edges_as_executable (fun);