Commit 39c58b3a by Richard Guenther Committed by Richard Biener

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
parent 974f90ba
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> 2012-07-30 Oleg Endo <olegendo@gcc.gnu.org>
PR target/39423 PR target/39423
......
...@@ -979,6 +979,9 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl, ...@@ -979,6 +979,9 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl,
push_cfun (fn); push_cfun (fn);
init_tree_ssa (fn); init_tree_ssa (fn);
/* We input IL in SSA form. */
cfun->gimple_df->in_ssa_p = true;
/* Use the function's decl state. */ /* Use the function's decl state. */
decl_state = lto_get_function_in_decl_state (file_data, fn_decl); decl_state = lto_get_function_in_decl_state (file_data, fn_decl);
gcc_assert (decl_state); gcc_assert (decl_state);
...@@ -1015,9 +1018,6 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl, ...@@ -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 */ /* Restore decl state */
file_data->current_decl_state = file_data->global_decl_state; file_data->current_decl_state = file_data->global_decl_state;
......
...@@ -23,6 +23,6 @@ int main() ...@@ -23,6 +23,6 @@ int main()
/* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */ /* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */
/* { dg-final { scan-ipa-dump "foo.arg1 = &b" "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-tree-dump "fre2" } } */
/* { dg-final { cleanup-ipa-dump "pta" } } */ /* { dg-final { cleanup-ipa-dump "pta" } } */
...@@ -28,6 +28,6 @@ int main() ...@@ -28,6 +28,6 @@ int main()
/* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */ /* { dg-final { scan-ipa-dump "foo.arg0 = &a" "pta" } } */
/* { dg-final { scan-ipa-dump "foo.arg1 = &b" "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-tree-dump "fre2" } } */
/* { dg-final { cleanup-ipa-dump "pta" } } */ /* { dg-final { cleanup-ipa-dump "pta" } } */
...@@ -16,5 +16,5 @@ int f() ...@@ -16,5 +16,5 @@ int f()
return lala.x[0]; 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" } } */ /* { dg-final { cleanup-tree-dump "tmmark" } } */
...@@ -675,7 +675,7 @@ mark_def_sites (basic_block bb, gimple stmt, bitmap kills) ...@@ -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 /* 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. */ 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); tree sym = USE_FROM_PTR (use_p);
gcc_assert (DECL_P (sym)); gcc_assert (DECL_P (sym));
...@@ -686,7 +686,7 @@ mark_def_sites (basic_block bb, gimple stmt, bitmap kills) ...@@ -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 /* Now process the defs. Mark BB as the definition block and add
each def to the set of killed symbols. */ 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)); gcc_assert (DECL_P (def));
set_def_block (def, bb, false); set_def_block (def, bb, false);
...@@ -1336,7 +1336,7 @@ rewrite_stmt (gimple_stmt_iterator si) ...@@ -1336,7 +1336,7 @@ rewrite_stmt (gimple_stmt_iterator si)
if (is_gimple_debug (stmt)) if (is_gimple_debug (stmt))
rewrite_debug_stmt_uses (stmt); rewrite_debug_stmt_uses (stmt);
else 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); tree var = USE_FROM_PTR (use_p);
gcc_assert (DECL_P (var)); gcc_assert (DECL_P (var));
...@@ -1346,7 +1346,7 @@ rewrite_stmt (gimple_stmt_iterator si) ...@@ -1346,7 +1346,7 @@ rewrite_stmt (gimple_stmt_iterator si)
/* Step 2. Register the statement's DEF operands. */ /* Step 2. Register the statement's DEF operands. */
if (register_defs_p (stmt)) 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 var = DEF_FROM_PTR (def_p);
tree name = make_ssa_name (var, stmt); tree name = make_ssa_name (var, stmt);
...@@ -1404,7 +1404,6 @@ static void ...@@ -1404,7 +1404,6 @@ static void
rewrite_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED, rewrite_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
basic_block bb) basic_block bb)
{ {
gimple phi;
gimple_stmt_iterator gsi; gimple_stmt_iterator gsi;
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
...@@ -1418,11 +1417,7 @@ rewrite_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED, ...@@ -1418,11 +1417,7 @@ rewrite_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
node introduces a new version for the associated variable. */ node introduces a new version for the associated variable. */
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
{ {
tree result; tree result = gimple_phi_result (gsi_stmt (gsi));
phi = gsi_stmt (gsi);
result = gimple_phi_result (phi);
gcc_assert (is_gimple_reg (result));
register_new_def (result, SSA_NAME_VAR (result)); register_new_def (result, SSA_NAME_VAR (result));
} }
...@@ -2437,8 +2432,7 @@ struct gimple_opt_pass pass_build_ssa = ...@@ -2437,8 +2432,7 @@ struct gimple_opt_pass pass_build_ssa =
PROP_ssa, /* properties_provided */ PROP_ssa, /* properties_provided */
0, /* properties_destroyed */ 0, /* properties_destroyed */
0, /* todo_flags_start */ 0, /* todo_flags_start */
TODO_update_ssa_only_virtuals TODO_verify_ssa
| TODO_verify_ssa
| TODO_remove_unused_locals /* todo_flags_finish */ | TODO_remove_unused_locals /* todo_flags_finish */
} }
}; };
...@@ -2889,7 +2883,8 @@ register_new_name_mapping (tree new_tree, tree old) ...@@ -2889,7 +2883,8 @@ register_new_name_mapping (tree new_tree, tree old)
void void
mark_sym_for_renaming (tree sym) 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));
} }
......
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