Commit 706ca88e by Diego Novillo Committed by Diego Novillo

tree-pass.h (TODO_update_smt_usage): Remove.


	* tree-pass.h (TODO_update_smt_usage): Remove.
	Update all users.
	* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Remove
	argument SOME.
	Update all users.

From-SVN: r122787
parent 751d9855
2007-03-09 Diego Novillo <dnovillo@redhat.com>
* tree-pass.h (TODO_update_smt_usage): Remove.
Update all users.
* tree-ssa-forwprop.c (forward_propagate_addr_expr_1): Remove
argument SOME.
Update all users.
2007-03-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca> 2007-03-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa.c (attr_length_call): Revise condition for long pc-relative branch. * pa.c (attr_length_call): Revise condition for long pc-relative branch.
......
...@@ -1533,10 +1533,10 @@ struct tree_opt_pass pass_lower_complex = ...@@ -1533,10 +1533,10 @@ struct tree_opt_pass pass_lower_complex =
0, /* properties_provided */ 0, /* properties_provided */
0, /* properties_destroyed */ 0, /* properties_destroyed */
0, /* todo_flags_start */ 0, /* todo_flags_start */
TODO_dump_func | TODO_ggc_collect TODO_dump_func
| TODO_update_smt_usage | TODO_ggc_collect
| TODO_update_ssa | TODO_update_ssa
| TODO_verify_stmts, /* todo_flags_finish */ | TODO_verify_stmts, /* todo_flags_finish */
0 /* letter */ 0 /* letter */
}; };
......
...@@ -215,10 +215,6 @@ struct dump_file_info ...@@ -215,10 +215,6 @@ struct dump_file_info
for the passes that are handed to register_dump_files. */ for the passes that are handed to register_dump_files. */
#define TODO_set_props (1 << 15) #define TODO_set_props (1 << 15)
/* Set by passes that may make SMT's that were previously never used
in statements, used. */
#define TODO_update_smt_usage (1 << 16)
#define TODO_update_ssa_any \ #define TODO_update_ssa_any \
(TODO_update_ssa \ (TODO_update_ssa \
| TODO_update_ssa_no_phi \ | TODO_update_ssa_no_phi \
......
...@@ -1612,9 +1612,6 @@ decide_instantiations (void) ...@@ -1612,9 +1612,6 @@ decide_instantiations (void)
} }
bitmap_clear (&done_head); bitmap_clear (&done_head);
if (!bitmap_empty_p (sra_candidates))
todoflags |= TODO_update_smt_usage;
mark_set_for_renaming (sra_candidates); mark_set_for_renaming (sra_candidates);
if (dump_file) if (dump_file)
...@@ -1700,7 +1697,6 @@ generate_one_element_ref (struct sra_elt *elt, tree base) ...@@ -1700,7 +1697,6 @@ generate_one_element_ref (struct sra_elt *elt, tree base)
} }
case ARRAY_TYPE: case ARRAY_TYPE:
todoflags |= TODO_update_smt_usage;
if (TREE_CODE (elt->element) == RANGE_EXPR) if (TREE_CODE (elt->element) == RANGE_EXPR)
return build4 (ARRAY_RANGE_REF, elt->type, base, return build4 (ARRAY_RANGE_REF, elt->type, base,
TREE_OPERAND (elt->element, 0), NULL, NULL); TREE_OPERAND (elt->element, 0), NULL, NULL);
......
...@@ -1411,8 +1411,7 @@ execute_ssa_ccp (bool store_ccp) ...@@ -1411,8 +1411,7 @@ execute_ssa_ccp (bool store_ccp)
ccp_initialize (); ccp_initialize ();
ssa_propagate (ccp_visit_stmt, ccp_visit_phi_node); ssa_propagate (ccp_visit_stmt, ccp_visit_phi_node);
if (ccp_finalize ()) if (ccp_finalize ())
return (TODO_cleanup_cfg | TODO_update_ssa | TODO_update_smt_usage return (TODO_cleanup_cfg | TODO_update_ssa | TODO_remove_unused_locals);
| TODO_remove_unused_locals);
else else
return 0; return 0;
} }
......
...@@ -389,8 +389,7 @@ struct tree_opt_pass pass_dominator = ...@@ -389,8 +389,7 @@ struct tree_opt_pass pass_dominator =
TODO_dump_func TODO_dump_func
| TODO_update_ssa | TODO_update_ssa
| TODO_cleanup_cfg | TODO_cleanup_cfg
| TODO_verify_ssa | TODO_verify_ssa, /* todo_flags_finish */
| TODO_update_smt_usage, /* todo_flags_finish */
0 /* letter */ 0 /* letter */
}; };
...@@ -2551,9 +2550,11 @@ struct tree_opt_pass pass_phi_only_cprop = ...@@ -2551,9 +2550,11 @@ struct tree_opt_pass pass_phi_only_cprop =
0, /* properties_provided */ 0, /* properties_provided */
0, /* properties_destroyed */ 0, /* properties_destroyed */
0, /* todo_flags_start */ 0, /* todo_flags_start */
TODO_cleanup_cfg | TODO_dump_func TODO_cleanup_cfg
| TODO_ggc_collect | TODO_verify_ssa | TODO_dump_func
| TODO_verify_stmts | TODO_update_smt_usage | TODO_ggc_collect
| TODO_update_ssa, /* todo_flags_finish */ | TODO_verify_ssa
| TODO_verify_stmts
| TODO_update_ssa, /* todo_flags_finish */
0 /* letter */ 0 /* letter */
}; };
...@@ -668,14 +668,11 @@ forward_propagate_addr_into_variable_array_index (tree offset, tree lhs, ...@@ -668,14 +668,11 @@ forward_propagate_addr_into_variable_array_index (tree offset, tree lhs,
Often this will allow for removal of an ADDR_EXPR and INDIRECT_REF Often this will allow for removal of an ADDR_EXPR and INDIRECT_REF
node or for recovery of array indexing from pointer arithmetic. node or for recovery of array indexing from pointer arithmetic.
CHANGED is an optional pointer to a boolean variable set to true if
either the LHS or RHS was changed in the USE_STMT.
Return true if the propagation was successful (the propagation can Return true if the propagation was successful (the propagation can
be not totally successful, yet things may have been changed). */ be not totally successful, yet things may have been changed). */
static bool static bool
forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed) forward_propagate_addr_expr_1 (tree stmt, tree use_stmt)
{ {
tree name = GIMPLE_STMT_OPERAND (stmt, 0); tree name = GIMPLE_STMT_OPERAND (stmt, 0);
tree lhs, rhs, array_ref; tree lhs, rhs, array_ref;
...@@ -695,8 +692,6 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed) ...@@ -695,8 +692,6 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
TREE_OPERAND (lhs, 0) = unshare_expr (GIMPLE_STMT_OPERAND (stmt, 1)); TREE_OPERAND (lhs, 0) = unshare_expr (GIMPLE_STMT_OPERAND (stmt, 1));
fold_stmt_inplace (use_stmt); fold_stmt_inplace (use_stmt);
tidy_after_forward_propagate_addr (use_stmt); tidy_after_forward_propagate_addr (use_stmt);
if (changed)
*changed = true;
} }
/* Trivial case. The use statement could be a trivial copy. We /* Trivial case. The use statement could be a trivial copy. We
...@@ -712,8 +707,6 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed) ...@@ -712,8 +707,6 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
GIMPLE_STMT_OPERAND (use_stmt, 1) GIMPLE_STMT_OPERAND (use_stmt, 1)
= unshare_expr (GIMPLE_STMT_OPERAND (stmt, 1)); = unshare_expr (GIMPLE_STMT_OPERAND (stmt, 1));
tidy_after_forward_propagate_addr (use_stmt); tidy_after_forward_propagate_addr (use_stmt);
if (changed)
*changed = true;
return true; return true;
} }
...@@ -734,8 +727,6 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed) ...@@ -734,8 +727,6 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
TREE_OPERAND (rhs, 0) = unshare_expr (GIMPLE_STMT_OPERAND (stmt, 1)); TREE_OPERAND (rhs, 0) = unshare_expr (GIMPLE_STMT_OPERAND (stmt, 1));
fold_stmt_inplace (use_stmt); fold_stmt_inplace (use_stmt);
tidy_after_forward_propagate_addr (use_stmt); tidy_after_forward_propagate_addr (use_stmt);
if (changed)
*changed = true;
return true; return true;
} }
...@@ -768,8 +759,6 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed) ...@@ -768,8 +759,6 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
if (fold_stmt_inplace (use_stmt)) if (fold_stmt_inplace (use_stmt))
{ {
tidy_after_forward_propagate_addr (use_stmt); tidy_after_forward_propagate_addr (use_stmt);
if (changed)
*changed = true;
return true; return true;
} }
else else
...@@ -795,8 +784,6 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed) ...@@ -795,8 +784,6 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
res = forward_propagate_addr_into_variable_array_index (offset_stmt, lhs, res = forward_propagate_addr_into_variable_array_index (offset_stmt, lhs,
stmt, use_stmt); stmt, use_stmt);
if (res && changed)
*changed = true;
return res; return res;
} }
...@@ -812,16 +799,12 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed) ...@@ -812,16 +799,12 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
tree offset_stmt = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0)); tree offset_stmt = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0));
res = forward_propagate_addr_into_variable_array_index (offset_stmt, lhs, res = forward_propagate_addr_into_variable_array_index (offset_stmt, lhs,
stmt, use_stmt); stmt, use_stmt);
if (res && changed)
*changed = true;
return res; return res;
} }
return false; return false;
} }
/* STMT is a statement of the form SSA_NAME = ADDR_EXPR <whatever>. /* STMT is a statement of the form SSA_NAME = ADDR_EXPR <whatever>.
SOME is a pointer to a boolean value indicating whether we
propagated the address expression anywhere.
Try to forward propagate the ADDR_EXPR into all uses of the SSA_NAME. Try to forward propagate the ADDR_EXPR into all uses of the SSA_NAME.
Often this will allow for removal of an ADDR_EXPR and INDIRECT_REF Often this will allow for removal of an ADDR_EXPR and INDIRECT_REF
...@@ -829,7 +812,7 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed) ...@@ -829,7 +812,7 @@ forward_propagate_addr_expr_1 (tree stmt, tree use_stmt, bool *changed)
Returns true, if all uses have been propagated into. */ Returns true, if all uses have been propagated into. */
static bool static bool
forward_propagate_addr_expr (tree stmt, bool *some) forward_propagate_addr_expr (tree stmt)
{ {
int stmt_loop_depth = bb_for_stmt (stmt)->loop_depth; int stmt_loop_depth = bb_for_stmt (stmt)->loop_depth;
tree name = GIMPLE_STMT_OPERAND (stmt, 0); tree name = GIMPLE_STMT_OPERAND (stmt, 0);
...@@ -860,8 +843,7 @@ forward_propagate_addr_expr (tree stmt, bool *some) ...@@ -860,8 +843,7 @@ forward_propagate_addr_expr (tree stmt, bool *some)
push_stmt_changes (&use_stmt); push_stmt_changes (&use_stmt);
result = forward_propagate_addr_expr_1 (stmt, use_stmt, some); result = forward_propagate_addr_expr_1 (stmt, use_stmt);
*some |= result;
all &= result; all &= result;
pop_stmt_changes (&use_stmt); pop_stmt_changes (&use_stmt);
...@@ -999,8 +981,7 @@ tree_ssa_forward_propagate_single_use_vars (void) ...@@ -999,8 +981,7 @@ tree_ssa_forward_propagate_single_use_vars (void)
if (TREE_CODE (rhs) == ADDR_EXPR) if (TREE_CODE (rhs) == ADDR_EXPR)
{ {
bool some = false; if (forward_propagate_addr_expr (stmt))
if (forward_propagate_addr_expr (stmt, &some))
{ {
release_defs (stmt); release_defs (stmt);
todoflags |= TODO_remove_unused_locals; todoflags |= TODO_remove_unused_locals;
...@@ -1008,8 +989,6 @@ tree_ssa_forward_propagate_single_use_vars (void) ...@@ -1008,8 +989,6 @@ tree_ssa_forward_propagate_single_use_vars (void)
} }
else else
bsi_next (&bsi); bsi_next (&bsi);
if (some)
todoflags |= TODO_update_smt_usage;
} }
else if ((TREE_CODE (rhs) == BIT_NOT_EXPR else if ((TREE_CODE (rhs) == BIT_NOT_EXPR
|| TREE_CODE (rhs) == NEGATE_EXPR) || TREE_CODE (rhs) == NEGATE_EXPR)
......
...@@ -5758,7 +5758,6 @@ struct tree_opt_pass pass_vrp = ...@@ -5758,7 +5758,6 @@ struct tree_opt_pass pass_vrp =
| TODO_ggc_collect | TODO_ggc_collect
| TODO_verify_ssa | TODO_verify_ssa
| TODO_dump_func | TODO_dump_func
| TODO_update_ssa | TODO_update_ssa, /* todo_flags_finish */
| TODO_update_smt_usage, /* todo_flags_finish */
0 /* letter */ 0 /* letter */
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment