summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-24 11:20:29 +0000
committerbonzini <bonzini@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-24 11:20:29 +0000
commit4c5fd53c3bdc9889c269a9ae4056ca81f79def16 (patch)
treee667e14ddbee5b77f8770a36656ac880ea9a62e1 /gcc/tree-ssa-dom.c
parenta71506c69086e7ffddb963ac3100a6bec0f33c27 (diff)
downloadgcc-4c5fd53c3bdc9889c269a9ae4056ca81f79def16.tar.gz
2009-05-24 Paolo Bonzini <bonzini@gnu.org>
* tree-ssa-operands.h (push_stmt_changes, pop_stmt_changes, discard_stmt_changes): Delete. * tree-ssa-operands.c (scb_stack): Delete. (init_ssa_operands): Do not initialize it. (fini_ssa_operands): Do not free it. (push_stmt_changes, pop_stmt_changes, discard_stmt_changes): Delete. * tree-cfg.c (replace_uses_by): Replace pop_stmt_changes with update_stmt, remove the others. Fix comments. * tree-dfa.c (optimize_stack_restore): Likewise. * tree-ssa-forwprop.c (forward_propagate_addr_expr): Likewise. * tree-ssa-loop-ivopts.c (rewrite_use): Likewise. * tree-ssa-dce.c (eliminate_unnecessary_stmts): Likewise. * tree-ssa-ccp.c (optimize_stack_restore, execute_fold_all_builtins): Likewise. * tree-ssa-propagate.c (substitute_and_fold): Likewise. * tree-ssa-dom.c (propagate_rhs_into_lhs): Likewise. (dom_opt_finalize_block): Likewise, adjusting access to stmts_to_rescan. (optimize_stmt): Likewise, adjusting access to stmts_to_rescan. (stmts_to_rescan): Change item type to gimple. (tree_ssa_dominator_optimize): Change type of stmts_to_rescan. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147831 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c43
1 files changed, 14 insertions, 29 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index a041f0e2e27..55a13b9d012 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -134,7 +134,7 @@ static VEC(expr_hash_elt_t,heap) *avail_exprs_stack;
expressions are removed from AVAIL_EXPRS. Else we may change the
hash code for an expression and be unable to find/remove it from
AVAIL_EXPRS. */
-static VEC(gimple_p,heap) *stmts_to_rescan;
+static VEC(gimple,heap) *stmts_to_rescan;
/* Structure for entries in the expression hash table. */
@@ -626,7 +626,7 @@ tree_ssa_dominator_optimize (void)
avail_exprs = htab_create (1024, real_avail_expr_hash, avail_expr_eq, free_expr_hash_elt);
avail_exprs_stack = VEC_alloc (expr_hash_elt_t, heap, 20);
const_and_copies_stack = VEC_alloc (tree, heap, 20);
- stmts_to_rescan = VEC_alloc (gimple_p, heap, 20);
+ stmts_to_rescan = VEC_alloc (gimple, heap, 20);
need_eh_cleanup = BITMAP_ALLOC (NULL);
/* Setup callbacks for the generic dominator tree walker. */
@@ -742,7 +742,7 @@ tree_ssa_dominator_optimize (void)
VEC_free (expr_hash_elt_t, heap, avail_exprs_stack);
VEC_free (tree, heap, const_and_copies_stack);
- VEC_free (gimple_p, heap, stmts_to_rescan);
+ VEC_free (gimple, heap, stmts_to_rescan);
/* Free the value-handle array. */
threadedge_finalize_values ();
@@ -1047,17 +1047,16 @@ dom_opt_finalize_block (struct dom_walk_data *walk_data, basic_block bb)
/* If we queued any statements to rescan in this block, then
go ahead and rescan them now. */
- while (VEC_length (gimple_p, stmts_to_rescan) > 0)
+ while (VEC_length (gimple, stmts_to_rescan) > 0)
{
- gimple *stmt_p = VEC_last (gimple_p, stmts_to_rescan);
- gimple stmt = *stmt_p;
+ gimple stmt = VEC_last (gimple, stmts_to_rescan);
basic_block stmt_bb = gimple_bb (stmt);
if (stmt_bb != bb)
break;
- VEC_pop (gimple_p, stmts_to_rescan);
- pop_stmt_changes (stmt_p);
+ VEC_pop (gimple, stmts_to_rescan);
+ update_stmt (stmt);
}
}
@@ -2130,7 +2129,6 @@ optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
update_stmt_if_modified (stmt);
opt_stats.num_stmts++;
- push_stmt_changes (gsi_stmt_ptr (&si));
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -2253,21 +2251,12 @@ optimize_stmt (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
}
}
+ /* Queue the statement to be re-scanned after all the
+ AVAIL_EXPRS have been processed. The change buffer stack for
+ all the pushed statements will be processed when this queue
+ is emptied. */
if (may_have_exposed_new_symbols)
- {
- /* Queue the statement to be re-scanned after all the
- AVAIL_EXPRS have been processed. The change buffer stack for
- all the pushed statements will be processed when this queue
- is emptied. */
- VEC_safe_push (gimple_p, heap, stmts_to_rescan, gsi_stmt_ptr (&si));
- }
- else
- {
- /* Otherwise, just discard the recently pushed change buffer. If
- not, the STMTS_TO_RESCAN queue will get out of synch with the
- change buffer stack. */
- discard_stmt_changes (gsi_stmt_ptr (&si));
- }
+ VEC_safe_push (gimple, heap, stmts_to_rescan, gsi_stmt (si));
}
/* Search for an existing instance of STMT in the AVAIL_EXPRS table.
@@ -2565,8 +2554,6 @@ propagate_rhs_into_lhs (gimple stmt, tree lhs, tree rhs, bitmap interesting_name
print_gimple_stmt (dump_file, use_stmt, 0, dump_flags);
}
- push_stmt_changes (&use_stmt);
-
/* Propagate the RHS into this use of the LHS. */
FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
propagate_value (use_p, rhs);
@@ -2601,7 +2588,6 @@ propagate_rhs_into_lhs (gimple stmt, tree lhs, tree rhs, bitmap interesting_name
bitmap_set_bit (interesting_names, SSA_NAME_VERSION (result));
}
- discard_stmt_changes (&use_stmt);
continue;
}
@@ -2618,9 +2604,8 @@ propagate_rhs_into_lhs (gimple stmt, tree lhs, tree rhs, bitmap interesting_name
fold_stmt_inplace (use_stmt);
/* Sometimes propagation can expose new operands to the
- renamer. Note this will call update_stmt at the
- appropriate time. */
- pop_stmt_changes (&use_stmt);
+ renamer. */
+ update_stmt (use_stmt);
/* Dump details. */
if (dump_file && (dump_flags & TDF_DETAILS))