tree-cfg.c, [...]: Replace TREE_CHAIN with PHI_CHAIN where appropriate.
* tree-cfg.c, tree-if-conv.c, tree-into-ssa.c, tree-scalar-evolution.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-ssa.c, tree-vectorizer.c: Replace TREE_CHAIN with PHI_CHAIN where appropriate. From-SVN: r90262
This commit is contained in:
parent
1590235e1e
commit
bb29d95124
@ -1,3 +1,11 @@
|
||||
2004-11-08 Kazu Hirata <kazu@cs.umass.edu>
|
||||
|
||||
* tree-cfg.c, tree-if-conv.c, tree-into-ssa.c,
|
||||
tree-scalar-evolution.c, tree-ssa-loop-im.c,
|
||||
tree-ssa-loop-ivopts.c, tree-ssa-loop-manip.c, tree-ssa.c,
|
||||
tree-vectorizer.c: Replace TREE_CHAIN with PHI_CHAIN where
|
||||
appropriate.
|
||||
|
||||
2004-11-08 Ben Elliston <bje@au.ibm.com>
|
||||
|
||||
* cgraph.h (cgraph_calls_p): Remove.
|
||||
|
@ -4279,7 +4279,7 @@ tree_duplicate_bb (basic_block bb)
|
||||
/* First copy the phi nodes. We do not copy phi node arguments here,
|
||||
since the edges are not ready yet. Keep the chain of phi nodes in
|
||||
the same order, so that we can add them later. */
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
mark_for_rewrite (PHI_RESULT (phi));
|
||||
create_phi_node (PHI_RESULT (phi), new_bb);
|
||||
@ -4501,7 +4501,7 @@ rewrite_to_new_ssa_names_bb (basic_block bb, htab_t map)
|
||||
if (e->flags & EDGE_ABNORMAL)
|
||||
break;
|
||||
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
rewrite_to_new_ssa_names_def (PHI_RESULT_PTR (phi), phi, map);
|
||||
if (e)
|
||||
@ -4546,7 +4546,7 @@ rewrite_to_new_ssa_names_bb (basic_block bb, htab_t map)
|
||||
}
|
||||
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
for (phi = phi_nodes (e->dest); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
rewrite_to_new_ssa_names_use
|
||||
(PHI_ARG_DEF_PTR_FROM_EDGE (phi, e), map);
|
||||
|
@ -591,7 +591,7 @@ if_convertable_loop_p (struct loop *loop, bool for_vectorizer ATTRIBUTE_UNUSED)
|
||||
/* ??? Check data dependency for vectorizer. */
|
||||
|
||||
/* What about phi nodes ? */
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
if (!if_convertable_phi_p (loop, bb, phi))
|
||||
return false;
|
||||
|
||||
|
@ -298,7 +298,7 @@ ssa_mark_def_sites_initialize_block (struct dom_walk_data *walk_data,
|
||||
|
||||
sbitmap_zero (kills);
|
||||
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
def = PHI_RESULT (phi);
|
||||
def_uid = SSA_NAME_VERSION (def);
|
||||
@ -328,7 +328,7 @@ ssa_mark_phi_uses (struct dom_walk_data *walk_data, basic_block bb)
|
||||
if (e->dest == EXIT_BLOCK_PTR)
|
||||
continue;
|
||||
|
||||
for (phi = phi_nodes (e->dest); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
use = PHI_ARG_DEF_FROM_EDGE (phi, e);
|
||||
if (TREE_CODE (use) != SSA_NAME)
|
||||
@ -748,7 +748,7 @@ ssa_rewrite_initialize_block (struct dom_walk_data *walk_data, basic_block bb)
|
||||
/* Step 1. Register new definitions for every PHI node in the block.
|
||||
Conceptually, all the PHI nodes are executed in parallel and each PHI
|
||||
node introduces a new version for the associated variable. */
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
tree result = PHI_RESULT (phi);
|
||||
|
||||
@ -783,7 +783,7 @@ rewrite_add_phi_arguments (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
|
||||
{
|
||||
tree phi;
|
||||
|
||||
for (phi = phi_nodes (e->dest); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
tree currdef;
|
||||
|
||||
@ -818,7 +818,7 @@ rewrite_virtual_phi_arguments (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
|
||||
if (e->dest == EXIT_BLOCK_PTR)
|
||||
continue;
|
||||
|
||||
for (phi = phi_nodes (e->dest); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
tree result = PHI_RESULT (phi);
|
||||
op = PHI_ARG_DEF_PTR_FROM_EDGE (phi, e);
|
||||
@ -852,7 +852,7 @@ ssa_rewrite_phi_arguments (struct dom_walk_data *walk_data, basic_block bb)
|
||||
if (e->dest == EXIT_BLOCK_PTR)
|
||||
continue;
|
||||
|
||||
for (phi = phi_nodes (e->dest); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
op = PHI_ARG_DEF_PTR_FROM_EDGE (phi, e);
|
||||
if (TREE_CODE (USE_FROM_PTR (op)) != SSA_NAME)
|
||||
|
@ -2374,7 +2374,7 @@ analyze_scalar_evolution_for_all_loop_phi_nodes (varray_type exit_conditions)
|
||||
loop = loop_containing_stmt (VARRAY_TREE (exit_conditions, i));
|
||||
bb = loop->header;
|
||||
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
if (is_gimple_reg (PHI_RESULT (phi)))
|
||||
{
|
||||
chrec = instantiate_parameters
|
||||
|
@ -1239,7 +1239,7 @@ determine_lsm_loop (struct loop *loop)
|
||||
return;
|
||||
}
|
||||
|
||||
for (phi = phi_nodes (loop->header); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
|
||||
determine_lsm_reg (loop, exits, n_exits, PHI_RESULT (phi));
|
||||
|
||||
free (exits);
|
||||
|
@ -805,7 +805,7 @@ find_bivs (struct ivopts_data *data)
|
||||
bool found = false;
|
||||
struct loop *loop = data->current_loop;
|
||||
|
||||
for (phi = phi_nodes (loop->header); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (PHI_RESULT (phi)))
|
||||
continue;
|
||||
@ -848,7 +848,7 @@ mark_bivs (struct ivopts_data *data)
|
||||
struct loop *loop = data->current_loop;
|
||||
basic_block incr_bb;
|
||||
|
||||
for (phi = phi_nodes (loop->header); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
iv = get_iv (data, PHI_RESULT (phi));
|
||||
if (!iv)
|
||||
@ -1510,7 +1510,7 @@ find_interesting_uses_outside (struct ivopts_data *data, edge exit)
|
||||
{
|
||||
tree phi, def;
|
||||
|
||||
for (phi = phi_nodes (exit->dest); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (exit->dest); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
def = PHI_ARG_DEF_FROM_EDGE (phi, exit);
|
||||
find_interesting_uses_outer (data, def);
|
||||
@ -1543,7 +1543,7 @@ find_interesting_uses (struct ivopts_data *data)
|
||||
&& !flow_bb_inside_loop_p (data->current_loop, e->dest))
|
||||
find_interesting_uses_outside (data, e);
|
||||
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
find_interesting_uses_stmt (data, phi);
|
||||
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
|
||||
find_interesting_uses_stmt (data, bsi_stmt (bsi));
|
||||
@ -3415,7 +3415,7 @@ determine_set_costs (struct ivopts_data *data)
|
||||
}
|
||||
|
||||
n = 0;
|
||||
for (phi = phi_nodes (loop->header); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
op = PHI_RESULT (phi);
|
||||
|
||||
@ -4169,7 +4169,7 @@ protect_loop_closed_ssa_form_use (edge exit, use_operand_p op_p)
|
||||
return;
|
||||
|
||||
/* Try finding a phi node that copies the value out of the loop. */
|
||||
for (phi = phi_nodes (exit->dest); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (exit->dest); phi; phi = PHI_CHAIN (phi))
|
||||
if (PHI_ARG_DEF_FROM_EDGE (phi, exit) == use)
|
||||
break;
|
||||
|
||||
@ -4303,7 +4303,7 @@ rewrite_use_outer (struct ivopts_data *data,
|
||||
if (stmts && name_info (data, tgt)->preserve_biv)
|
||||
return;
|
||||
|
||||
for (phi = phi_nodes (exit->dest); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (exit->dest); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
use_operand_p use_p = PHI_ARG_DEF_PTR_FROM_EDGE (phi, exit);
|
||||
|
||||
|
@ -272,7 +272,7 @@ find_uses_to_rename (bitmap *use_blocks)
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
{
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
for (i = 0; i < (unsigned) PHI_NUM_ARGS (phi); i++)
|
||||
find_uses_to_rename_use (PHI_ARG_EDGE (phi, i)->src,
|
||||
PHI_ARG_DEF (phi, i), use_blocks);
|
||||
@ -383,7 +383,7 @@ verify_loop_closed_ssa (void)
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
{
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
for (i = 0; i < (unsigned) PHI_NUM_ARGS (phi); i++)
|
||||
check_loop_closed_ssa_use (PHI_ARG_EDGE (phi, i)->src,
|
||||
PHI_ARG_DEF (phi, i));
|
||||
@ -404,7 +404,7 @@ split_loop_exit_edge (edge exit)
|
||||
tree phi, new_phi, new_name, name;
|
||||
use_operand_p op_p;
|
||||
|
||||
for (phi = phi_nodes (dest); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
op_p = PHI_ARG_DEF_PTR_FROM_EDGE (phi, EDGE_SUCC (bb, 0));
|
||||
|
||||
@ -567,7 +567,7 @@ set_phi_def_stmts (basic_block bb)
|
||||
{
|
||||
tree phi;
|
||||
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
SSA_NAME_DEF_STMT (PHI_RESULT (phi)) = phi;
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,7 @@ flush_pending_stmts (edge e)
|
||||
|
||||
for (phi = phi_nodes (e->dest), arg = PENDING_STMT (e);
|
||||
phi;
|
||||
phi = TREE_CHAIN (phi), arg = TREE_CHAIN (arg))
|
||||
phi = PHI_CHAIN (phi), arg = TREE_CHAIN (arg))
|
||||
{
|
||||
tree def = TREE_VALUE (arg);
|
||||
add_phi_arg (&phi, def, e);
|
||||
@ -1281,7 +1281,7 @@ kill_redundant_phi_nodes (void)
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
{
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
var = PHI_RESULT (phi);
|
||||
check_phi_redundancy (phi, eq_to);
|
||||
|
@ -353,7 +353,7 @@ rename_variables_in_bb (basic_block bb)
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
rename_def_op (PHI_RESULT_PTR (phi), phi);
|
||||
|
||||
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
|
||||
@ -390,7 +390,7 @@ rename_variables_in_bb (basic_block bb)
|
||||
}
|
||||
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
for (phi = phi_nodes (e->dest); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
|
||||
rename_use_op (PHI_ARG_DEF_PTR_FROM_EDGE (phi, e));
|
||||
}
|
||||
|
||||
@ -449,8 +449,8 @@ copy_phi_nodes (struct loop *loop, struct loop *new_loop,
|
||||
for (phi = phi_nodes (loop->header),
|
||||
new_phi = phi_nodes (new_loop->header);
|
||||
phi;
|
||||
phi = TREE_CHAIN (phi),
|
||||
new_phi = TREE_CHAIN (new_phi))
|
||||
phi = PHI_CHAIN (phi),
|
||||
new_phi = PHI_CHAIN (new_phi))
|
||||
{
|
||||
new_e = loop_preheader_edge (new_loop);
|
||||
def = PHI_ARG_DEF_FROM_EDGE (phi, e);
|
||||
@ -557,7 +557,7 @@ update_phi_nodes_for_guard (edge guard_true_edge, struct loop * loop)
|
||||
{
|
||||
tree phi, phi1;
|
||||
|
||||
for (phi = phi_nodes (loop->header); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
tree new_phi;
|
||||
tree phi_arg;
|
||||
@ -695,7 +695,7 @@ tree_duplicate_loop_to_edge_cfg (struct loop *loop, struct loops *loops,
|
||||
|
||||
/* Duplicating phi args at exit bbs as coming
|
||||
also from exit of duplicated loop. */
|
||||
for (phi = phi_nodes (exit_dest); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (exit_dest); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
phi_arg = PHI_ARG_DEF_FROM_EDGE (phi, loop->exit_edges[0]);
|
||||
if (phi_arg)
|
||||
@ -736,7 +736,7 @@ tree_duplicate_loop_to_edge_cfg (struct loop *loop, struct loops *loops,
|
||||
|
||||
/* We have to add phi args to the loop->header here as coming
|
||||
from new_exit_e edge. */
|
||||
for (phi = phi_nodes (loop->header); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
phi_arg = PHI_ARG_DEF_FROM_EDGE (phi, entry_e);
|
||||
if (phi_arg)
|
||||
@ -2913,7 +2913,7 @@ vect_update_ivs_after_vectorizer (struct loop *loop, tree niters)
|
||||
|
||||
loop->exit_edges[0] = EDGE_PRED (new_bb, 0);
|
||||
|
||||
for (phi = phi_nodes (loop->header); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (loop->header); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
tree access_fn = NULL;
|
||||
tree evolution_part;
|
||||
@ -3731,7 +3731,7 @@ vect_analyze_scalar_cycles (loop_vec_info loop_vinfo)
|
||||
if (vect_debug_details (NULL))
|
||||
fprintf (dump_file, "\n<<vect_analyze_scalar_cycles>>\n");
|
||||
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
tree access_fn = NULL;
|
||||
|
||||
@ -5351,7 +5351,7 @@ vect_analyze_loop_with_symbolic_num_of_iters (tree niters,
|
||||
|
||||
/* Analyze phi functions of the loop header. */
|
||||
|
||||
for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
|
||||
for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
|
||||
{
|
||||
tree access_fn = NULL;
|
||||
tree evolution_part;
|
||||
|
Loading…
Reference in New Issue
Block a user