aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-08-01 11:48:56 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-08-01 11:48:56 +0000
commit525174a22213a316c4fb668d839a128ce03c6414 (patch)
treee525938828010ae0d2bba879beb2a05b69f70760
parent137143106086c762d05037b4d420c1eaf8fe6fbc (diff)
downloadgcc-525174a22213a316c4fb668d839a128ce03c6414.zip
gcc-525174a22213a316c4fb668d839a128ce03c6414.tar.gz
gcc-525174a22213a316c4fb668d839a128ce03c6414.tar.bz2
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
-rw-r--r--gcc/ChangeLog28
-rw-r--r--gcc/graphite-clast-to-gimple.c1
-rw-r--r--gcc/sese.c1
-rw-r--r--gcc/tree-call-cdce.c2
-rw-r--r--gcc/tree-eh.c16
-rw-r--r--gcc/tree-flow.h2
-rw-r--r--gcc/tree-if-conv.c2
-rw-r--r--gcc/tree-inline.c2
-rw-r--r--gcc/tree-into-ssa.c12
-rw-r--r--gcc/tree-loop-distribution.c2
-rw-r--r--gcc/tree-ssa-dce.c15
-rw-r--r--gcc/tree-ssa-tail-merge.c34
-rw-r--r--gcc/tree-tailcall.c2
-rw-r--r--gcc/tree-vect-slp.c2
-rw-r--r--gcc/tree-vectorizer.c2
15 files changed, 56 insertions, 67 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1d7faf0..6faadd9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,33 @@
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,
add ssa_renaming_needed and rename_vops flags.
(SYMS_TO_RENAME): Remove.
diff --git a/gcc/graphite-clast-to-gimple.c b/gcc/graphite-clast-to-gimple.c
index 103a639..42f96c7 100644
--- a/gcc/graphite-clast-to-gimple.c
+++ b/gcc/graphite-clast-to-gimple.c
@@ -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;
diff --git a/gcc/sese.c b/gcc/sese.c
index 03b9f3d..acae527 100644
--- a/gcc/sese.c
+++ b/gcc/sese.c
@@ -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);
diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c
index 3ad241c..06abda5 100644
--- a/gcc/tree-call-cdce.c
+++ b/gcc/tree-call-cdce.c
@@ -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);
}
diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c
index a5dce62..bd9294d 100644
--- a/gcc/tree-eh.c
+++ b/gcc/tree-eh.c
@@ -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);
}
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 553f22e..04cd2a7 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -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);
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 89747b3..e8a65ea 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -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;
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 4088e75..7a9b7e0 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -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;
}
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 0971d01..995a3a7 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -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;
}
diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c
index 18df9fb..394a38c 100644
--- a/gcc/tree-loop-distribution.c
+++ b/gcc/tree-loop-distribution.c
@@ -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);
}
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 4d1b620..c1db16b 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -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)
diff --git a/gcc/tree-ssa-tail-merge.c b/gcc/tree-ssa-tail-merge.c
index 3912ed5..ab37336 100644
--- a/gcc/tree-ssa-tail-merge.c
+++ b/gcc/tree-ssa-tail-merge.c
@@ -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 ();
diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c
index ec77c5f..5de5837 100644
--- a/gcc/tree-tailcall.c
+++ b/gcc/tree-tailcall.c
@@ -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;
diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c
index 79a7e3a..782172f 100644
--- a/gcc/tree-vect-slp.c
+++ b/gcc/tree-vect-slp.c
@@ -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? */
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 89a481e..6944d13 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -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++)
{