mirror of git://gcc.gnu.org/git/gcc.git
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
This commit is contained in:
parent
af7acf2ed6
commit
c90b053bea
|
@ -1,3 +1,11 @@
|
||||||
|
2006-06-12 Kazu Hirata <kazu@codesourcery.com>
|
||||||
|
|
||||||
|
* 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 <shinwell@codesourcery.com>
|
2006-06-12 Mark Shinwell <shinwell@codesourcery.com>
|
||||||
|
|
||||||
* builtins.c (expand_builtin_return_addr): Only use
|
* builtins.c (expand_builtin_return_addr): Only use
|
||||||
|
|
|
@ -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,
|
void create_iv (tree, tree, tree, struct loop *, block_stmt_iterator *, bool,
|
||||||
tree *, tree *);
|
tree *, tree *);
|
||||||
void split_loop_exit_edge (edge);
|
void split_loop_exit_edge (edge);
|
||||||
void compute_phi_arg_on_exit (edge, tree, tree);
|
|
||||||
unsigned force_expr_to_var_cost (tree);
|
unsigned force_expr_to_var_cost (tree);
|
||||||
basic_block bsi_insert_on_edge_immediate_loop (edge, tree);
|
basic_block bsi_insert_on_edge_immediate_loop (edge, tree);
|
||||||
void standard_iv_increment_position (struct loop *, block_stmt_iterator *,
|
void standard_iv_increment_position (struct loop *, block_stmt_iterator *,
|
||||||
|
|
|
@ -5463,112 +5463,6 @@ rewrite_use_compare (struct ivopts_data *data,
|
||||||
*op_p = op;
|
*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. */
|
/* Rewrites USE using candidate CAND. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue