tree-into-ssa.c (mark_def_sites): Also process virtual operands.

2012-07-30  Richard Guenther  <rguenther@suse.de>

	* tree-into-ssa.c (mark_def_sites): Also process virtual operands.
	(rewrite_stmt): Likewise.
	(rewrite_enter_block): Likewise.
	(pass_build_ssa): Do not update virtual SSA form during TODO.
	(mark_symbol_for_renaming): Do nothing if we are not in SSA form.
	* lto-streamer-in.c (lto_read_body): Set in_ssa_p earlier.

	* gcc.dg/ipa/ipa-pta-3.c: Adjust.
	* gcc.dg/ipa/ipa-pta-4.c: Likewise.
	* gcc.dg/tm/memopt-3.c: Likewise.

From-SVN: r189969
This commit is contained in:
Richard Guenther 2012-07-30 11:18:15 +00:00 committed by Richard Biener
parent 974f90baf2
commit 39c58b3afa
6 changed files with 23 additions and 19 deletions

View File

@ -1,3 +1,12 @@
2012-07-30 Richard Guenther <rguenther@suse.de>
* tree-into-ssa.c (mark_def_sites): Also process virtual operands.
(rewrite_stmt): Likewise.
(rewrite_enter_block): Likewise.
(pass_build_ssa): Do not update virtual SSA form during TODO.
(mark_symbol_for_renaming): Do nothing if we are not in SSA form.
* lto-streamer-in.c (lto_read_body): Set in_ssa_p earlier.
2012-07-30 Oleg Endo <olegendo@gcc.gnu.org>
PR target/39423

View File

@ -979,6 +979,9 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl,
push_cfun (fn);
init_tree_ssa (fn);
/* We input IL in SSA form. */
cfun->gimple_df->in_ssa_p = true;
/* Use the function's decl state. */
decl_state = lto_get_function_in_decl_state (file_data, fn_decl);
gcc_assert (decl_state);
@ -1015,9 +1018,6 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl,
}
}
/* We should now be in SSA. */
cfun->gimple_df->in_ssa_p = true;
/* Restore decl state */
file_data->current_decl_state = file_data->global_decl_state;

View File

@ -23,6 +23,6 @@ int main()
/* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */
/* { dg-final { scan-ipa-dump "foo.arg1 = &b" "pta" } } */
/* { dg-final { scan-tree-dump "Replaced \\\*p_1\\\(D\\\) with 1" "fre2" } } */
/* { dg-final { scan-tree-dump "Replaced \\\*p_2\\\(D\\\) with 1" "fre2" } } */
/* { dg-final { cleanup-tree-dump "fre2" } } */
/* { dg-final { cleanup-ipa-dump "pta" } } */

View File

@ -28,6 +28,6 @@ int main()
/* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */
/* { dg-final { scan-ipa-dump "foo.arg1 = &b" "pta" } } */
/* { dg-final { scan-tree-dump "Replaced \\\*p_1\\\(D\\\) with 1" "fre2" } } */
/* { dg-final { scan-tree-dump "Replaced \\\*p_2\\\(D\\\) with 1" "fre2" } } */
/* { dg-final { cleanup-tree-dump "fre2" } } */
/* { dg-final { cleanup-ipa-dump "pta" } } */

View File

@ -16,5 +16,5 @@ int f()
return lala.x[0];
}
/* { dg-final { scan-tree-dump-times "logging: lala.x\\\[i_1\\\]" 1 "tmmark" } } */
/* { dg-final { scan-tree-dump-times "logging: lala.x\\\[i_4\\\]" 1 "tmmark" } } */
/* { dg-final { cleanup-tree-dump "tmmark" } } */

View File

@ -675,7 +675,7 @@ mark_def_sites (basic_block bb, gimple stmt, bitmap kills)
/* If a variable is used before being set, then the variable is live
across a block boundary, so mark it live-on-entry to BB. */
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
{
tree sym = USE_FROM_PTR (use_p);
gcc_assert (DECL_P (sym));
@ -686,7 +686,7 @@ mark_def_sites (basic_block bb, gimple stmt, bitmap kills)
/* Now process the defs. Mark BB as the definition block and add
each def to the set of killed symbols. */
FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_DEF)
FOR_EACH_SSA_TREE_OPERAND (def, stmt, iter, SSA_OP_ALL_DEFS)
{
gcc_assert (DECL_P (def));
set_def_block (def, bb, false);
@ -1336,7 +1336,7 @@ rewrite_stmt (gimple_stmt_iterator si)
if (is_gimple_debug (stmt))
rewrite_debug_stmt_uses (stmt);
else
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_USE)
FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES)
{
tree var = USE_FROM_PTR (use_p);
gcc_assert (DECL_P (var));
@ -1346,7 +1346,7 @@ rewrite_stmt (gimple_stmt_iterator si)
/* Step 2. Register the statement's DEF operands. */
if (register_defs_p (stmt))
FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_DEF)
FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, iter, SSA_OP_ALL_DEFS)
{
tree var = DEF_FROM_PTR (def_p);
tree name = make_ssa_name (var, stmt);
@ -1404,7 +1404,6 @@ static void
rewrite_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
basic_block bb)
{
gimple phi;
gimple_stmt_iterator gsi;
if (dump_file && (dump_flags & TDF_DETAILS))
@ -1418,11 +1417,7 @@ rewrite_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
node introduces a new version for the associated variable. */
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{
tree result;
phi = gsi_stmt (gsi);
result = gimple_phi_result (phi);
gcc_assert (is_gimple_reg (result));
tree result = gimple_phi_result (gsi_stmt (gsi));
register_new_def (result, SSA_NAME_VAR (result));
}
@ -2437,8 +2432,7 @@ struct gimple_opt_pass pass_build_ssa =
PROP_ssa, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
TODO_update_ssa_only_virtuals
| TODO_verify_ssa
TODO_verify_ssa
| TODO_remove_unused_locals /* todo_flags_finish */
}
};
@ -2889,7 +2883,8 @@ register_new_name_mapping (tree new_tree, tree old)
void
mark_sym_for_renaming (tree sym)
{
bitmap_set_bit (SYMS_TO_RENAME (cfun), DECL_UID (sym));
if (cfun->gimple_df->in_ssa_p)
bitmap_set_bit (SYMS_TO_RENAME (cfun), DECL_UID (sym));
}