tree-ssa-propagate.h (substitute_and_fold): Adjust prototype.

2016-10-18  Richard Biener  <rguenther@suse.de>

	* 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
This commit is contained in:
Richard Biener 2016-10-18 07:49:32 +00:00 committed by Richard Biener
parent 699acd5b64
commit 62869a1ca1
7 changed files with 27 additions and 23 deletions

View File

@ -1,3 +1,18 @@
2016-10-18 Richard Biener <rguenther@suse.de>
* 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 <rguenther@suse.de>
* genmatch.c (dt_operand::gen_gimple_expr): Use get_name to

View File

@ -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 ();

View File

@ -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;

View File

@ -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);

View File

@ -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<gimple *> stmts_to_remove;
vec<gimple *> 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

View File

@ -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);

View File

@ -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;
}