graphite-clast-to-gimple.c (translate_clast_user): Rename virtual operands.

2012-08-01  Richard Guenther  <rguenther@suse.de>

	* graphite-clast-to-gimple.c (translate_clast_user): Rename
	virtual operands.
	* sese.c (graphite_copy_stmts_from_block): Do not rename virtual
	operands here.
	* tree-call-cdce.c (tree_call_cdce): Use
	mark_virtual_operands_for_renaming.
	* tree-eh.c (sink_clobbers): Simplify.
	* tree-flow.h (mark_sym_for_renaming): Remove.
	(mark_virtual_operands_for_renaming): New function.
	* tree-if-conv.c (tree_if_conversion): Use
	mark_virtual_operands_for_renaming.
	* tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
	* tree-into-ssa.c (mark_sym_for_renaming): Remove.
	(mark_virtual_operands_for_renaming): New function.
	* tree-loop-distribution.c (tree_loop_distribution): Use
	mark_virtual_operands_for_renaming.
	* tree-ssa-dce.c (mark_virtual_operand_for_renaming): Do not
	update stmts, use mark_virtual_operands_for_renaming.
	* tree-ssa-tail-merge.c (release_last_vdef): Remove.
	(replace_block_by): Adjust.
	(tail_merge_optimize): Use mark_virtual_operands_for_renaming.
	* tree-tailcall.c (tree_optimize_tail_calls_1): Use
	mark_virtual_operands_for_renaming.
	* tree-vect-slp.c (vect_slp_transform_bb): Likewise.
	* tree-vectorizer.c (vectorize_loops): Likewise.

From-SVN: r190034
This commit is contained in:
Richard Guenther 2012-08-01 11:48:56 +00:00 committed by Richard Biener
parent 1371431060
commit 525174a222
15 changed files with 56 additions and 67 deletions

View File

@ -1,3 +1,31 @@
2012-08-01 Richard Guenther <rguenther@suse.de>
* graphite-clast-to-gimple.c (translate_clast_user): Rename
virtual operands.
* sese.c (graphite_copy_stmts_from_block): Do not rename virtual
operands here.
* tree-call-cdce.c (tree_call_cdce): Use
mark_virtual_operands_for_renaming.
* tree-eh.c (sink_clobbers): Simplify.
* tree-flow.h (mark_sym_for_renaming): Remove.
(mark_virtual_operands_for_renaming): New function.
* tree-if-conv.c (tree_if_conversion): Use
mark_virtual_operands_for_renaming.
* tree-inline.c (update_ssa_across_abnormal_edges): Likewise.
* tree-into-ssa.c (mark_sym_for_renaming): Remove.
(mark_virtual_operands_for_renaming): New function.
* tree-loop-distribution.c (tree_loop_distribution): Use
mark_virtual_operands_for_renaming.
* tree-ssa-dce.c (mark_virtual_operand_for_renaming): Do not
update stmts, use mark_virtual_operands_for_renaming.
* tree-ssa-tail-merge.c (release_last_vdef): Remove.
(replace_block_by): Adjust.
(tail_merge_optimize): Use mark_virtual_operands_for_renaming.
* tree-tailcall.c (tree_optimize_tail_calls_1): Use
mark_virtual_operands_for_renaming.
* tree-vect-slp.c (vect_slp_transform_bb): Likewise.
* tree-vectorizer.c (vectorize_loops): Likewise.
2012-08-01 Richard Guenther <rguenther@suse.de>
* tree-flow.h (struct gimple_df): Remove syms_to_rename member,

View File

@ -1099,6 +1099,7 @@ translate_clast_user (struct clast_user_stmt *stmt, edge next_e,
new_bb = next_e->src;
mark_bb_with_pbb (pbb, new_bb, bb_pbb_mapping);
mark_virtual_operands_for_renaming (cfun);
update_ssa (TODO_update_ssa);
return next_e;

View File

@ -604,7 +604,6 @@ graphite_copy_stmts_from_block (basic_block bb, basic_block new_bb,
operands. */
copy = gimple_copy (stmt);
gsi_insert_after (&gsi_tgt, copy, GSI_NEW_STMT);
mark_sym_for_renaming (gimple_vop (cfun));
maybe_duplicate_eh_stmt (copy, stmt);
gimple_duplicate_stmt_histograms (cfun, copy, cfun, stmt);

View File

@ -894,7 +894,7 @@ tree_call_cdce (void)
free_dominance_info (CDI_POST_DOMINATORS);
/* As we introduced new control-flow we need to insert PHI-nodes
for the call-clobbers of the remaining call. */
mark_sym_for_renaming (gimple_vop (cfun));
mark_virtual_operands_for_renaming (cfun);
return (TODO_update_ssa | TODO_cleanup_cfg | TODO_ggc_collect
| TODO_remove_unused_locals);
}

View File

@ -3250,22 +3250,18 @@ sink_clobbers (basic_block bb)
for (gsi_prev (&gsi); !gsi_end_p (gsi); gsi_prev (&gsi))
{
gimple stmt = gsi_stmt (gsi);
tree vdef;
if (is_gimple_debug (stmt))
continue;
if (gimple_code (stmt) == GIMPLE_LABEL)
break;
unlink_stmt_vdef (stmt);
gsi_remove (&gsi, false);
vdef = gimple_vdef (stmt);
if (vdef && TREE_CODE (vdef) == SSA_NAME)
{
release_ssa_name (vdef);
vdef = SSA_NAME_VAR (vdef);
mark_sym_for_renaming (vdef);
gimple_set_vdef (stmt, vdef);
gimple_set_vuse (stmt, vdef);
}
/* Trigger the operand scanner to cause renaming for virtual
operands for this statement.
??? Given the simple structure of this code manually
figuring out the reaching definition should not be too hard. */
if (gimple_vuse (stmt))
gimple_set_vuse (stmt, NULL_TREE);
gsi_insert_before (&dgsi, stmt, GSI_SAME_STMT);
}

View File

@ -565,7 +565,7 @@ bool need_ssa_update_p (struct function *);
bool name_registered_for_update_p (tree);
void release_ssa_name_after_update_ssa (tree);
void compute_global_livein (bitmap, bitmap);
void mark_sym_for_renaming (tree);
void mark_virtual_operands_for_renaming (struct function *);
tree get_current_def (tree);
void set_current_def (tree, tree);

View File

@ -1747,7 +1747,7 @@ tree_if_conversion (struct loop *loop)
combine_blocks (loop);
if (flag_tree_loop_if_convert_stores)
mark_sym_for_renaming (gimple_vop (cfun));
mark_virtual_operands_for_renaming (cfun);
changed = true;

View File

@ -1870,7 +1870,7 @@ update_ssa_across_abnormal_edges (basic_block bb, basic_block ret_bb,
if (!is_gimple_reg (PHI_RESULT (phi)))
{
mark_sym_for_renaming (SSA_NAME_VAR (PHI_RESULT (phi)));
mark_virtual_operands_for_renaming (cfun);
continue;
}

View File

@ -2944,17 +2944,13 @@ register_new_name_mapping (tree new_tree, tree old)
}
/* Register symbol SYM to be renamed by update_ssa. */
/* Mark virtual operands of FN for renaming by update_ssa. */
void
mark_sym_for_renaming (tree sym)
mark_virtual_operands_for_renaming (struct function *fn)
{
if (TREE_CODE (sym) == VAR_DECL
&& VAR_DECL_IS_VIRTUAL_OPERAND (sym))
{
cfun->gimple_df->ssa_renaming_needed = 1;
cfun->gimple_df->rename_vops = 1;
}
fn->gimple_df->ssa_renaming_needed = 1;
fn->gimple_df->rename_vops = 1;
}

View File

@ -1515,7 +1515,7 @@ tree_loop_distribution (void)
if (changed)
{
mark_sym_for_renaming (gimple_vop (cfun));
mark_virtual_operands_for_renaming (cfun);
rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa);
}

View File

@ -995,31 +995,32 @@ propagate_necessity (struct edge_list *el)
}
/* Replace all uses of NAME by underlying variable and mark it
for renaming. */
for renaming. This assumes the defining statement of NAME is
going to be removed. */
void
mark_virtual_operand_for_renaming (tree name)
{
tree name_var = SSA_NAME_VAR (name);
bool used = false;
imm_use_iterator iter;
use_operand_p use_p;
gimple stmt;
tree name_var;
name_var = SSA_NAME_VAR (name);
gcc_assert (VAR_DECL_IS_VIRTUAL_OPERAND (name_var));
FOR_EACH_IMM_USE_STMT (stmt, iter, name)
{
FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
SET_USE (use_p, name_var);
update_stmt (stmt);
used = true;
}
if (used)
mark_sym_for_renaming (name_var);
mark_virtual_operands_for_renaming (cfun);
}
/* Replace all uses of result of PHI by underlying variable and mark it
for renaming. */
/* Replace all uses of the virtual PHI result by its underlying variable
and mark it for renaming. This assumes the PHI node is going to be
removed. */
void
mark_virtual_phi_result_for_renaming (gimple phi)

View File

@ -812,37 +812,6 @@ same_succ_flush_bbs (bitmap bbs)
same_succ_flush_bb (BASIC_BLOCK (i));
}
/* Release the last vdef in BB, either normal or phi result. */
static void
release_last_vdef (basic_block bb)
{
gimple_stmt_iterator i;
for (i = gsi_last_bb (bb); !gsi_end_p (i); gsi_prev_nondebug (&i))
{
gimple stmt = gsi_stmt (i);
if (gimple_vdef (stmt) == NULL_TREE)
continue;
mark_virtual_operand_for_renaming (gimple_vdef (stmt));
return;
}
for (i = gsi_start_phis (bb); !gsi_end_p (i); gsi_next (&i))
{
gimple phi = gsi_stmt (i);
tree res = gimple_phi_result (phi);
if (is_gimple_reg (res))
continue;
mark_virtual_phi_result_for_renaming (phi);
return;
}
}
/* For deleted_bb_preds, find bbs with same successors. */
static void
@ -1477,7 +1446,6 @@ replace_block_by (basic_block bb1, basic_block bb2)
bb1->frequency = 0;
/* Do updates that use bb1, before deleting bb1. */
release_last_vdef (bb1);
same_succ_flush_bb (bb1);
delete_basic_block (bb1);
@ -1654,7 +1622,7 @@ tail_merge_optimize (unsigned int todo)
}
todo |= (TODO_verify_ssa | TODO_verify_stmts | TODO_verify_flow);
mark_sym_for_renaming (gimple_vop (cfun));
mark_virtual_operands_for_renaming (cfun);
}
delete_worklist ();

View File

@ -1029,7 +1029,7 @@ tree_optimize_tail_calls_1 (bool opt_tailcalls)
header of the loop created by tail recursion elimination. Do so
by triggering the SSA renamer. */
if (phis_constructed)
mark_sym_for_renaming (gimple_vop (cfun));
mark_virtual_operands_for_renaming (cfun);
if (changed)
return TODO_cleanup_cfg | TODO_update_ssa_only_virtuals;

View File

@ -3149,7 +3149,7 @@ vect_slp_transform_bb (basic_block bb)
}
}
mark_sym_for_renaming (gimple_vop (cfun));
mark_virtual_operands_for_renaming (cfun);
/* The memory tags and pointers in vectorized statements need to
have their SSA forms updated. FIXME, why can't this be delayed
until all the loops have been transformed? */

View File

@ -223,7 +223,7 @@ vectorize_loops (void)
/* ----------- Finalize. ----------- */
mark_sym_for_renaming (gimple_vop (cfun));
mark_virtual_operands_for_renaming (cfun);
for (i = 1; i < vect_loops_num; i++)
{