Commit 91cde0c3 by Jeff Law Committed by Jeff Law

tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Don't even bother marking…

tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Don't even bother marking bypassed virtuals for out-of-ssa.

        * tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Don't even
        bother marking bypassed virtuals for out-of-ssa.  Instead merge
        bypassed virtuals into vars_to_rename just before into-ssa pass.

From-SVN: r81872
parent e9a75776
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
2004-05-14 Jeff Law <law@redhat.com> 2004-05-14 Jeff Law <law@redhat.com>
* tree-ssa-dom.c (redirect_edges_and_update_ssa_graph): Don't even
bother marking bypassed virtuals for out-of-ssa. Instead merge
bypassed virtuals into vars_to_rename just before into-ssa pass.
* tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Reorganize * tree-ssa-dom.c (simplify_rhs_and_lookup_avail_expr): Reorganize
so that it picks up more opportunities to eliminate ABS expressions so that it picks up more opportunities to eliminate ABS expressions
or turn them into negations. or turn them into negations.
......
...@@ -312,12 +312,14 @@ set_value_for (tree var, tree value, varray_type table) ...@@ -312,12 +312,14 @@ set_value_for (tree var, tree value, varray_type table)
static void static void
redirect_edges_and_update_ssa_graph (varray_type redirection_edges) redirect_edges_and_update_ssa_graph (varray_type redirection_edges)
{ {
basic_block tgt; basic_block tgt, bb;
tree phi;
unsigned int i; unsigned int i;
size_t old_num_referenced_vars = num_referenced_vars; size_t old_num_referenced_vars = num_referenced_vars;
bitmap virtuals_to_rename = BITMAP_XMALLOC ();
/* First note any variables which we are going to have to take /* First note any variables which we are going to have to take
out of SSA form. */ out of SSA form as well as any virtuals which need updating. */
for (i = 0; i < VARRAY_ACTIVE_SIZE (redirection_edges); i += 2) for (i = 0; i < VARRAY_ACTIVE_SIZE (redirection_edges); i += 2)
{ {
block_stmt_iterator bsi; block_stmt_iterator bsi;
...@@ -333,7 +335,11 @@ redirect_edges_and_update_ssa_graph (varray_type redirection_edges) ...@@ -333,7 +335,11 @@ redirect_edges_and_update_ssa_graph (varray_type redirection_edges)
for (phi = phi_nodes (e->dest); phi; phi = TREE_CHAIN (phi)) for (phi = phi_nodes (e->dest); phi; phi = TREE_CHAIN (phi))
{ {
tree result = SSA_NAME_VAR (PHI_RESULT (phi)); tree result = SSA_NAME_VAR (PHI_RESULT (phi));
bitmap_set_bit (vars_to_rename, var_ann (result)->uid);
if (is_gimple_reg (PHI_RESULT (phi)))
bitmap_set_bit (vars_to_rename, var_ann (result)->uid);
else
bitmap_set_bit (virtuals_to_rename, var_ann (result)->uid);
} }
/* Any variables set by statements at the start of the block we /* Any variables set by statements at the start of the block we
...@@ -362,7 +368,7 @@ redirect_edges_and_update_ssa_graph (varray_type redirection_edges) ...@@ -362,7 +368,7 @@ redirect_edges_and_update_ssa_graph (varray_type redirection_edges)
for (j = 0; j < NUM_VDEFS (vdefs); j++) for (j = 0; j < NUM_VDEFS (vdefs); j++)
{ {
tree op = VDEF_RESULT (vdefs, j); tree op = VDEF_RESULT (vdefs, j);
bitmap_set_bit (vars_to_rename, var_ann (op)->uid); bitmap_set_bit (virtuals_to_rename, var_ann (op)->uid);
} }
} }
...@@ -371,20 +377,11 @@ redirect_edges_and_update_ssa_graph (varray_type redirection_edges) ...@@ -371,20 +377,11 @@ redirect_edges_and_update_ssa_graph (varray_type redirection_edges)
for (phi = phi_nodes (tgt); phi; phi = TREE_CHAIN (phi)) for (phi = phi_nodes (tgt); phi; phi = TREE_CHAIN (phi))
{ {
tree result = SSA_NAME_VAR (PHI_RESULT (phi)); tree result = SSA_NAME_VAR (PHI_RESULT (phi));
int j;
bitmap_set_bit (vars_to_rename, var_ann (result)->uid);
for (j = 0; j < PHI_NUM_ARGS (phi); j++) if (is_gimple_reg (PHI_RESULT (phi)))
{ bitmap_set_bit (vars_to_rename, var_ann (result)->uid);
tree arg = PHI_ARG_DEF (phi, j); else
bitmap_set_bit (virtuals_to_rename, var_ann (result)->uid);
if (TREE_CODE (arg) != SSA_NAME)
continue;
arg = SSA_NAME_VAR (arg);
bitmap_set_bit (vars_to_rename, var_ann (arg)->uid);
}
} }
} }
...@@ -497,6 +494,28 @@ redirect_edges_and_update_ssa_graph (varray_type redirection_edges) ...@@ -497,6 +494,28 @@ redirect_edges_and_update_ssa_graph (varray_type redirection_edges)
bitmap_set_bit (vars_to_rename, i); bitmap_set_bit (vars_to_rename, i);
var_ann (referenced_var (i))->out_of_ssa_tag = 0; var_ann (referenced_var (i))->out_of_ssa_tag = 0;
} }
bitmap_a_or_b (vars_to_rename, vars_to_rename, virtuals_to_rename);
/* We must remove any PHIs for virtual variables that we are going to
re-rename. Hopefully we'll be able to simply update these incrementally
soon. */
FOR_EACH_BB (bb)
{
tree next;
for (phi = phi_nodes (bb); phi; phi = next)
{
tree result = PHI_RESULT (phi);
next = TREE_CHAIN (phi);
if (bitmap_bit_p (virtuals_to_rename,
var_ann (SSA_NAME_VAR (result))->uid))
remove_phi_node (phi, NULL, bb);
}
}
BITMAP_XFREE (virtuals_to_rename);
} }
/* Jump threading, redundancy elimination and const/copy propagation. /* Jump threading, redundancy elimination and const/copy propagation.
......
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