* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190034
138bc75d-0d04-0410-961f-
82ee72b054a4
+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,
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;
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);
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);
}
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);
}
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);
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;
if (!is_gimple_reg (PHI_RESULT (phi)))
{
- mark_sym_for_renaming (SSA_NAME_VAR (PHI_RESULT (phi)));
+ mark_virtual_operands_for_renaming (cfun);
continue;
}
}
-/* 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;
}
if (changed)
{
- mark_sym_for_renaming (gimple_vop (cfun));
+ mark_virtual_operands_for_renaming (cfun);
rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa);
}
}
/* 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)
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
bb1->frequency = 0;
/* Do updates that use bb1, before deleting bb1. */
- release_last_vdef (bb1);
same_succ_flush_bb (bb1);
delete_basic_block (bb1);
}
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 ();
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;
}
}
- 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? */
/* ----------- Finalize. ----------- */
- mark_sym_for_renaming (gimple_vop (cfun));
+ mark_virtual_operands_for_renaming (cfun);
for (i = 1; i < vect_loops_num; i++)
{