From 62869a1ca1ddb89e9cb5c808bfe678979e4090f0 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 18 Oct 2016 07:49:32 +0000 Subject: [PATCH] tree-ssa-propagate.h (substitute_and_fold): Adjust prototype. 2016-10-18 Richard Biener * tree-ssa-propagate.h (substitute_and_fold): Adjust prototype. * tree-ssa-propagate.c (ssa_prop_fini): Remove final BB_VISITED clearing. (substitute_and_fold_dom_walker): Adjust constructor. (substitute_and_fold_dom_walker::before_dom_children): Remove do_dce flag and handling (always true). (substitute_and_fold): Likewise. * tree-vrp.c (vrp_finalize): Adjust. (execute_early_vrp): Remove final BB_VISITED clearing. * tree-ssa-ccp.c (ccp_finalize): Adjust. * tree-ssa-copy.c (fini_copy_prop): Likewise. * ira.c (ira): Call clear_bb_flags. From-SVN: r241296 --- gcc/ChangeLog | 15 +++++++++++++++ gcc/ira.c | 2 ++ gcc/tree-ssa-ccp.c | 3 +-- gcc/tree-ssa-copy.c | 2 +- gcc/tree-ssa-propagate.c | 20 ++++++-------------- gcc/tree-ssa-propagate.h | 3 +-- gcc/tree-vrp.c | 5 +---- 7 files changed, 27 insertions(+), 23 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2c10faf83e4..77fef062355 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2016-10-18 Richard Biener + + * tree-ssa-propagate.h (substitute_and_fold): Adjust prototype. + * tree-ssa-propagate.c (ssa_prop_fini): Remove final BB_VISITED + clearing. + (substitute_and_fold_dom_walker): Adjust constructor. + (substitute_and_fold_dom_walker::before_dom_children): Remove + do_dce flag and handling (always true). + (substitute_and_fold): Likewise. + * tree-vrp.c (vrp_finalize): Adjust. + (execute_early_vrp): Remove final BB_VISITED clearing. + * tree-ssa-ccp.c (ccp_finalize): Adjust. + * tree-ssa-copy.c (fini_copy_prop): Likewise. + * ira.c (ira): Call clear_bb_flags. + 2016-10-18 Richard Biener * genmatch.c (dt_operand::gen_gimple_expr): Use get_name to diff --git a/gcc/ira.c b/gcc/ira.c index 94cfe2a04a1..cd640fce589 100644 --- a/gcc/ira.c +++ b/gcc/ira.c @@ -5065,6 +5065,8 @@ ira (FILE *f) bool saved_flag_caller_saves = flag_caller_saves; enum ira_region saved_flag_ira_region = flag_ira_region; + clear_bb_flags (); + /* Perform target specific PIC register initialization. */ targetm.init_pic_reg (); diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 61754d8d758..167598f6eec 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -953,8 +953,7 @@ ccp_finalize (bool nonzero_p) } /* Perform substitutions based on the known constant values. */ - something_changed = substitute_and_fold (get_constant_value, - ccp_fold_stmt, true); + something_changed = substitute_and_fold (get_constant_value, ccp_fold_stmt); free (const_val); const_val = NULL; diff --git a/gcc/tree-ssa-copy.c b/gcc/tree-ssa-copy.c index fcf4fa9464a..abc62053571 100644 --- a/gcc/tree-ssa-copy.c +++ b/gcc/tree-ssa-copy.c @@ -550,7 +550,7 @@ fini_copy_prop (void) } } - bool changed = substitute_and_fold (get_value, NULL, true); + bool changed = substitute_and_fold (get_value, NULL); if (changed) { free_numbers_of_iterations_estimates (cfun); diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c index 0f940cc56b5..fbe7e13f84e 100644 --- a/gcc/tree-ssa-propagate.c +++ b/gcc/tree-ssa-propagate.c @@ -479,9 +479,6 @@ ssa_prop_fini (void) free (cfg_order_to_bb); BITMAP_FREE (ssa_edge_worklist); uid_to_stmt.release (); - basic_block bb; - FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (cfun), NULL, next_bb) - bb->flags &= ~BB_VISITED; } @@ -972,10 +969,9 @@ class substitute_and_fold_dom_walker : public dom_walker public: substitute_and_fold_dom_walker (cdi_direction direction, ssa_prop_get_value_fn get_value_fn_, - ssa_prop_fold_stmt_fn fold_fn_, - bool do_dce_) + ssa_prop_fold_stmt_fn fold_fn_) : dom_walker (direction), get_value_fn (get_value_fn_), - fold_fn (fold_fn_), do_dce (do_dce_), something_changed (false) + fold_fn (fold_fn_), something_changed (false) { stmts_to_remove.create (0); stmts_to_fixup.create (0); @@ -993,7 +989,6 @@ public: ssa_prop_get_value_fn get_value_fn; ssa_prop_fold_stmt_fn fold_fn; - bool do_dce; bool something_changed; vec stmts_to_remove; vec stmts_to_fixup; @@ -1012,8 +1007,7 @@ substitute_and_fold_dom_walker::before_dom_children (basic_block bb) tree res = gimple_phi_result (phi); if (virtual_operand_p (res)) continue; - if (do_dce - && res && TREE_CODE (res) == SSA_NAME) + if (res && TREE_CODE (res) == SSA_NAME) { tree sprime = get_value_fn (res); if (sprime @@ -1039,8 +1033,7 @@ substitute_and_fold_dom_walker::before_dom_children (basic_block bb) /* No point propagating into a stmt we have a value for we can propagate into all uses. Mark it for removal instead. */ tree lhs = gimple_get_lhs (stmt); - if (do_dce - && lhs && TREE_CODE (lhs) == SSA_NAME) + if (lhs && TREE_CODE (lhs) == SSA_NAME) { tree sprime = get_value_fn (lhs); if (sprime @@ -1180,8 +1173,7 @@ substitute_and_fold_dom_walker::before_dom_children (basic_block bb) bool substitute_and_fold (ssa_prop_get_value_fn get_value_fn, - ssa_prop_fold_stmt_fn fold_fn, - bool do_dce) + ssa_prop_fold_stmt_fn fold_fn) { gcc_assert (get_value_fn); @@ -1192,7 +1184,7 @@ substitute_and_fold (ssa_prop_get_value_fn get_value_fn, calculate_dominance_info (CDI_DOMINATORS); substitute_and_fold_dom_walker walker(CDI_DOMINATORS, - get_value_fn, fold_fn, do_dce); + get_value_fn, fold_fn); walker.walk (ENTRY_BLOCK_PTR_FOR_FN (cfun)); /* We cannot remove stmts during the BB walk, especially not release diff --git a/gcc/tree-ssa-propagate.h b/gcc/tree-ssa-propagate.h index 1a969765f09..2729bc7dff9 100644 --- a/gcc/tree-ssa-propagate.h +++ b/gcc/tree-ssa-propagate.h @@ -75,8 +75,7 @@ extern bool update_gimple_call (gimple_stmt_iterator *, tree, int, ...); extern bool update_call_from_tree (gimple_stmt_iterator *, tree); extern void ssa_propagate (ssa_prop_visit_stmt_fn, ssa_prop_visit_phi_fn); extern bool stmt_makes_single_store (gimple *); -extern bool substitute_and_fold (ssa_prop_get_value_fn, ssa_prop_fold_stmt_fn, - bool); +extern bool substitute_and_fold (ssa_prop_get_value_fn, ssa_prop_fold_stmt_fn); extern bool may_propagate_copy (tree, tree); extern bool may_propagate_copy_into_stmt (gimple *, tree); extern bool may_propagate_copy_into_asm (tree); diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index eb3eebd44d5..31f4f25cced 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -10622,8 +10622,7 @@ vrp_finalize (bool warn_array_bounds_p) vr_value[i]->max); } - substitute_and_fold (op_with_constant_singleton_value_range, - vrp_fold_stmt, true); + substitute_and_fold (op_with_constant_singleton_value_range, vrp_fold_stmt); if (warn_array_bounds && warn_array_bounds_p) check_all_array_refs (); @@ -10954,8 +10953,6 @@ execute_early_vrp () vrp_free_lattice (); scev_finalize (); loop_optimizer_finalize (); - FOR_EACH_BB_FN (bb, cfun) - bb->flags &= ~BB_VISITED; return 0; } -- 2.30.2