summaryrefslogtreecommitdiff
path: root/gcc/tree-into-ssa.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-into-ssa.c')
-rw-r--r--gcc/tree-into-ssa.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/tree-into-ssa.c b/gcc/tree-into-ssa.c
index 2f5ac69251e..5a04ee7924f 100644
--- a/gcc/tree-into-ssa.c
+++ b/gcc/tree-into-ssa.c
@@ -2869,6 +2869,46 @@ mark_virtual_operands_for_renaming (struct function *fn)
fn->gimple_df->rename_vops = 1;
}
+/* Replace all uses of NAME by underlying variable and mark it
+ 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;
+
+ 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);
+ used = true;
+ }
+ if (used)
+ mark_virtual_operands_for_renaming (cfun);
+}
+
+/* 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)
+{
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Marking result for renaming : ");
+ print_gimple_stmt (dump_file, phi, 0, TDF_SLIM);
+ fprintf (dump_file, "\n");
+ }
+
+ mark_virtual_operand_for_renaming (gimple_phi_result (phi));
+}
/* Return true if there is any work to be done by update_ssa
for function FN. */