summaryrefslogtreecommitdiff
path: root/gcc/tree-into-ssa.c
diff options
context:
space:
mode:
authoramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-02 17:57:54 +0000
committeramacleod <amacleod@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-02 17:57:54 +0000
commitba4d2b2f28479db60842a014a93613da093fd150 (patch)
tree4e565c339cd910e920e36af879ee13b02dd89c3d /gcc/tree-into-ssa.c
parent11f8ac85df3620e926f8eb0d132fa3a71a9b433a (diff)
downloadgcc-ba4d2b2f28479db60842a014a93613da093fd150.tar.gz
* tree-flow.h: Remove some prototypes.
* tree-ssa-dce.c (mark_virtual_operand_for_renaming, mark_virtual_phi_result_for_renaming): Move to tree-into-ssa.c. * tree-into-ssa.c (mark_virtual_operand_for_renaming, mark_virtual_phi_result_for_renaming): Relocate here. * tree-into-ssa.h: Add prototypes. * tree-ssa-phiopt.c: (tree_ssa_phiopt_worker) Use single_pred_before_succ_order. (blocks_in_phiopt_order): Rename and move to cfganal.c. (nonfreeing_call_p) Move to gimple.c. * cfganal.c (single_pred_before_succ_order): Move and renamed from tree-ssa-phiopt.c. * basic-block.h (single_pred_before_succ_order): Add prototype. * gimple.c (nonfreeing_call_p): Relocate here. * gimple.h: Add prototype. * tree-ssa-ifcombine.c: Include tree-ssa-phiopt.h. * tree-ssa-dom.h: New file. Relocate prototypes here. * tree-ssa.h: Include tree-ssa-dom.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203122 138bc75d-0d04-0410-961f-82ee72b054a4
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. */