From ba4d2b2f28479db60842a014a93613da093fd150 Mon Sep 17 00:00:00 2001 From: amacleod Date: Wed, 2 Oct 2013 17:57:54 +0000 Subject: * 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 --- gcc/tree-into-ssa.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'gcc/tree-into-ssa.c') 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. */ -- cgit v1.2.1