From c90b053beae374f5c5790b3105e472bb57d858f7 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 12 Jun 2006 13:52:51 +0000 Subject: [PATCH] tree-flow.h: Remove the prototype for compute_phi_arg_on_exit. * tree-flow.h: Remove the prototype for compute_phi_arg_on_exit. * tree-ssa-loop-ivopts.c (protect_loop_closed_ssa_form_use, protect_loop_closed_ssa_form, compute_phi_arg_on_exit): Remove. From-SVN: r114569 --- gcc/ChangeLog | 8 ++++ gcc/tree-flow.h | 1 - gcc/tree-ssa-loop-ivopts.c | 106 --------------------------------------------- 3 files changed, 8 insertions(+), 107 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4569635..c4b463e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2006-06-12 Kazu Hirata + + * tree-flow.h: Remove the prototype for + compute_phi_arg_on_exit. + * tree-ssa-loop-ivopts.c (protect_loop_closed_ssa_form_use, + protect_loop_closed_ssa_form, compute_phi_arg_on_exit): + Remove. + 2006-06-12 Mark Shinwell * builtins.c (expand_builtin_return_addr): Only use diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h index abb585a..4e69368 100644 --- a/gcc/tree-flow.h +++ b/gcc/tree-flow.h @@ -827,7 +827,6 @@ bool for_each_index (tree *, bool (*) (tree, tree *, void *), void *); void create_iv (tree, tree, tree, struct loop *, block_stmt_iterator *, bool, tree *, tree *); void split_loop_exit_edge (edge); -void compute_phi_arg_on_exit (edge, tree, tree); unsigned force_expr_to_var_cost (tree); basic_block bsi_insert_on_edge_immediate_loop (edge, tree); void standard_iv_increment_position (struct loop *, block_stmt_iterator *, diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 2bb2f06..0f98604 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -5463,112 +5463,6 @@ rewrite_use_compare (struct ivopts_data *data, *op_p = op; } -/* Ensure that operand *OP_P may be used at the end of EXIT without - violating loop closed ssa form. */ - -static void -protect_loop_closed_ssa_form_use (edge exit, use_operand_p op_p) -{ - basic_block def_bb; - struct loop *def_loop; - tree phi, use; - - use = USE_FROM_PTR (op_p); - if (TREE_CODE (use) != SSA_NAME) - return; - - def_bb = bb_for_stmt (SSA_NAME_DEF_STMT (use)); - if (!def_bb) - return; - - def_loop = def_bb->loop_father; - if (flow_bb_inside_loop_p (def_loop, exit->dest)) - return; - - /* Try finding a phi node that copies the value out of the loop. */ - for (phi = phi_nodes (exit->dest); phi; phi = PHI_CHAIN (phi)) - if (PHI_ARG_DEF_FROM_EDGE (phi, exit) == use) - break; - - if (!phi) - { - /* Create such a phi node. */ - tree new_name = duplicate_ssa_name (use, NULL); - - phi = create_phi_node (new_name, exit->dest); - SSA_NAME_DEF_STMT (new_name) = phi; - add_phi_arg (phi, use, exit); - } - - SET_USE (op_p, PHI_RESULT (phi)); -} - -/* Ensure that operands of STMT may be used at the end of EXIT without - violating loop closed ssa form. */ - -static void -protect_loop_closed_ssa_form (edge exit, tree stmt) -{ - ssa_op_iter iter; - use_operand_p use_p; - - FOR_EACH_SSA_USE_OPERAND (use_p, stmt, iter, SSA_OP_ALL_USES) - protect_loop_closed_ssa_form_use (exit, use_p); -} - -/* STMTS compute a value of a phi argument OP on EXIT of a loop. Arrange things - so that they are emitted on the correct place, and so that the loop closed - ssa form is preserved. */ - -void -compute_phi_arg_on_exit (edge exit, tree stmts, tree op) -{ - tree_stmt_iterator tsi; - block_stmt_iterator bsi; - tree phi, stmt, def, next; - - if (!single_pred_p (exit->dest)) - split_loop_exit_edge (exit); - - /* Ensure there is label in exit->dest, so that we can - insert after it. */ - tree_block_label (exit->dest); - bsi = bsi_after_labels (exit->dest); - - if (TREE_CODE (stmts) == STATEMENT_LIST) - { - for (tsi = tsi_start (stmts); !tsi_end_p (tsi); tsi_next (&tsi)) - { - tree stmt = tsi_stmt (tsi); - bsi_insert_before (&bsi, stmt, BSI_SAME_STMT); - protect_loop_closed_ssa_form (exit, stmt); - } - } - else - { - bsi_insert_before (&bsi, stmts, BSI_SAME_STMT); - protect_loop_closed_ssa_form (exit, stmts); - } - - if (!op) - return; - - for (phi = phi_nodes (exit->dest); phi; phi = next) - { - next = PHI_CHAIN (phi); - - if (PHI_ARG_DEF_FROM_EDGE (phi, exit) == op) - { - def = PHI_RESULT (phi); - remove_statement (phi, false); - stmt = build2 (MODIFY_EXPR, TREE_TYPE (op), - def, op); - SSA_NAME_DEF_STMT (def) = stmt; - bsi_insert_before (&bsi, stmt, BSI_SAME_STMT); - } - } -} - /* Rewrites USE using candidate CAND. */ static void -- 2.7.4