Chain PHI nodes via separate a chain field
Steven Bosscher
stevenb@suse.de
Wed Jun 16 21:17:00 GMT 2004
On Wednesday 16 June 2004 21:09, Richard Henderson wrote:
> On Wed, Jun 16, 2004 at 08:57:01PM +0200, Steven Bosscher wrote:
> > Okeydokey. OK with that change?
>
> Show me the actual patch you want to apply.
Bien sur, voila!
A large collection of one-liners basically.
Gr.
Steven
* tree.h (PHI_CHAIN): New.
* (tree-cfg.c, tree-dfa.c, tree-flow-inline.h, tree-into-ssa.c,
tree-outof-ssa.c, tree-phinodes.c, tree-pretty-print.c,
tree-ssa-alias.c, tree-ssa-ccp.c, tree-ssa-dom.c, tree-ssa-dse.c,
tree-ssa-live.c, tree-ssa-loop.c, tree-ssa-phiopt.c, tree-ssa-pre.c,
tree-ssa.c, tree-tailcall.c): Use PHI_CHAIN instead of TREE_CHAIN
when traversing a list of PHI_NODEs.
? cgraphanal.c
? ipa-side-effects.c
? tree-ssa-gvn.c
Index: tree-cfg.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-cfg.c,v
retrieving revision 2.11
diff -c -3 -p -r2.11 tree-cfg.c
*** tree-cfg.c 16 Jun 2004 17:17:14 -0000 2.11
--- tree-cfg.c 16 Jun 2004 19:16:29 -0000
*************** remove_phi_nodes_and_edges_for_unreachab
*** 1768,1774 ****
phi = phi_nodes (bb);
while (phi)
{
! tree next = TREE_CHAIN (phi);
remove_phi_node (phi, NULL_TREE, bb);
phi = next;
}
--- 1768,1774 ----
phi = phi_nodes (bb);
while (phi)
{
! tree next = PHI_CHAIN (phi);
remove_phi_node (phi, NULL_TREE, bb);
phi = next;
}
*************** phi_alternatives_equal (basic_block dest
*** 2113,2119 ****
tree phi, val1, val2;
int n1, n2;
! for (phi = phi_nodes (dest); phi; phi = TREE_CHAIN (phi))
{
n1 = phi_arg_from_edge (phi, e1);
n2 = phi_arg_from_edge (phi, e2);
--- 2113,2119 ----
tree phi, val1, val2;
int n1, n2;
! for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
{
n1 = phi_arg_from_edge (phi, e1);
n2 = phi_arg_from_edge (phi, e2);
*************** tree_split_edge (edge edge_in)
*** 3100,3106 ****
/* Find all the PHI arguments on the original edge, and change them to
the new edge. Do it before redirection, so that the argument does not
get removed. */
! for (phi = phi_nodes (dest); phi; phi = TREE_CHAIN (phi))
{
num_elem = PHI_NUM_ARGS (phi);
for (i = 0; i < num_elem; i++)
--- 3100,3106 ----
/* Find all the PHI arguments on the original edge, and change them to
the new edge. Do it before redirection, so that the argument does not
get removed. */
! for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
{
num_elem = PHI_NUM_ARGS (phi);
for (i = 0; i < num_elem; i++)
*************** verify_stmts (void)
*** 3386,3392 ****
tree phi;
int i;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
int phi_num_args = PHI_NUM_ARGS (phi);
--- 3386,3392 ----
tree phi;
int i;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
int phi_num_args = PHI_NUM_ARGS (phi);
*************** tree_make_forwarder_block (edge fallthru
*** 3733,3739 ****
{
edge e;
basic_block dummy, bb;
! tree phi, new_phi, var;
dummy = fallthru->src;
bb = fallthru->dest;
--- 3733,3739 ----
{
edge e;
basic_block dummy, bb;
! tree phi, new_phi, var, prev, next;
dummy = fallthru->src;
bb = fallthru->dest;
*************** tree_make_forwarder_block (edge fallthru
*** 3743,3749 ****
/* If we redirected a branch we must create new phi nodes at the
start of BB. */
! for (phi = phi_nodes (dummy); phi; phi = TREE_CHAIN (phi))
{
var = PHI_RESULT (phi);
new_phi = create_phi_node (var, bb);
--- 3743,3749 ----
/* If we redirected a branch we must create new phi nodes at the
start of BB. */
! for (phi = phi_nodes (dummy); phi; phi = PHI_CHAIN (phi))
{
var = PHI_RESULT (phi);
new_phi = create_phi_node (var, bb);
*************** tree_make_forwarder_block (edge fallthru
*** 3752,3759 ****
add_phi_arg (&new_phi, PHI_RESULT (phi), fallthru);
}
! /* Ensure that the PHI node chains are in the same order. */
! set_phi_nodes (bb, nreverse (phi_nodes (bb)));
/* Add the arguments we have stored on edges. */
for (e = bb->pred; e; e = e->pred_next)
--- 3752,3766 ----
add_phi_arg (&new_phi, PHI_RESULT (phi), fallthru);
}
! /* Ensure that the PHI node chain is in the same order. */
! prev = NULL;
! for (phi = phi_nodes (bb); phi; phi = next)
! {
! next = PHI_CHAIN (phi);
! PHI_CHAIN (phi) = prev;
! prev = phi;
! }
! set_phi_nodes (bb, prev);
/* Add the arguments we have stored on edges. */
for (e = bb->pred; e; e = e->pred_next)
*************** tree_make_forwarder_block (edge fallthru
*** 3763,3769 ****
for (phi = phi_nodes (bb), var = PENDING_STMT (e);
phi;
! phi = TREE_CHAIN (phi), var = TREE_CHAIN (var))
add_phi_arg (&phi, TREE_VALUE (var), e);
PENDING_STMT (e) = NULL;
--- 3770,3776 ----
for (phi = phi_nodes (bb), var = PENDING_STMT (e);
phi;
! phi = PHI_CHAIN (phi), var = TREE_CHAIN (var))
add_phi_arg (&phi, TREE_VALUE (var), e);
PENDING_STMT (e) = NULL;
*************** thread_jumps (void)
*** 3944,3950 ****
/* Update PHI nodes. We know that the new argument should
have the same value as the argument associated with LAST.
Otherwise we would have changed our target block above. */
! for (phi = phi_nodes (dest); phi; phi = TREE_CHAIN (phi))
{
arg = phi_arg_from_edge (phi, last);
if (arg < 0)
--- 3951,3957 ----
/* Update PHI nodes. We know that the new argument should
have the same value as the argument associated with LAST.
Otherwise we would have changed our target block above. */
! for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
{
arg = phi_arg_from_edge (phi, last);
if (arg < 0)
Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-dfa.c,v
retrieving revision 2.9
diff -c -3 -p -r2.9 tree-dfa.c
*** tree-dfa.c 15 Jun 2004 18:37:32 -0000 2.9
--- tree-dfa.c 16 Jun 2004 19:16:29 -0000
*************** compute_immediate_uses (int flags, bool
*** 181,187 ****
{
tree phi;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
compute_immediate_uses_for_phi (phi, calc_for);
for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
--- 181,187 ----
{
tree phi;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
compute_immediate_uses_for_phi (phi, calc_for);
for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
*************** free_df (void)
*** 227,233 ****
{
tree phi;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
free_df_for_stmt (phi);
for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
--- 227,233 ----
{
tree phi;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
free_df_for_stmt (phi);
for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
*************** dump_immediate_uses (FILE *file)
*** 636,642 ****
{
tree phi;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
dump_immediate_uses_for (file, phi);
for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
--- 636,642 ----
{
tree phi;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
dump_immediate_uses_for (file, phi);
for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
*************** collect_dfa_stats (struct dfa_stats_d *d
*** 818,824 ****
FOR_EACH_BB (bb)
{
tree phi;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
dfa_stats_p->num_phis++;
dfa_stats_p->num_phi_args += PHI_NUM_ARGS (phi);
--- 818,824 ----
FOR_EACH_BB (bb)
{
tree phi;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
dfa_stats_p->num_phis++;
dfa_stats_p->num_phi_args += PHI_NUM_ARGS (phi);
Index: tree-flow-inline.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-flow-inline.h,v
retrieving revision 2.7
diff -c -3 -p -r2.7 tree-flow-inline.h
*** tree-flow-inline.h 15 Jun 2004 18:51:43 -0000 2.7
--- tree-flow-inline.h 16 Jun 2004 19:16:29 -0000
*************** set_phi_nodes (basic_block bb, tree l)
*** 427,433 ****
tree phi;
bb_ann (bb)->phi_nodes = l;
! for (phi = l; phi; phi = TREE_CHAIN (phi))
set_bb_for_stmt (phi, bb);
}
--- 427,433 ----
tree phi;
bb_ann (bb)->phi_nodes = l;
! for (phi = l; phi; phi = PHI_CHAIN (phi))
set_bb_for_stmt (phi, bb);
}
Index: tree-into-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-into-ssa.c,v
retrieving revision 2.9
diff -c -3 -p -r2.9 tree-into-ssa.c
*** tree-into-ssa.c 10 Jun 2004 21:41:06 -0000 2.9
--- tree-into-ssa.c 16 Jun 2004 19:16:30 -0000
*************** rewrite_initialize_block (struct dom_wal
*** 514,520 ****
/* 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))
{
tree result = PHI_RESULT (phi);
--- 514,520 ----
/* 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 = PHI_CHAIN (phi))
{
tree result = PHI_RESULT (phi);
*************** rewrite_add_phi_arguments (struct dom_wa
*** 538,544 ****
{
tree phi;
! for (phi = phi_nodes (e->dest); phi; phi = TREE_CHAIN (phi))
{
tree currdef;
--- 538,544 ----
{
tree phi;
! for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
{
tree currdef;
Index: tree-outof-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-outof-ssa.c,v
retrieving revision 2.6
diff -c -3 -p -r2.6 tree-outof-ssa.c
*** tree-outof-ssa.c 10 Jun 2004 22:37:05 -0000 2.6
--- tree-outof-ssa.c 16 Jun 2004 19:16:30 -0000
*************** eliminate_build (elim_graph g, basic_blo
*** 343,349 ****
clear_elim_graph (g);
! for (phi = phi_nodes (B); phi; phi = TREE_CHAIN (phi))
{
T0 = var_to_partition_to_var (g->map, PHI_RESULT (phi));
--- 343,349 ----
clear_elim_graph (g);
! for (phi = phi_nodes (B); phi; phi = PHI_CHAIN (phi))
{
T0 = var_to_partition_to_var (g->map, PHI_RESULT (phi));
*************** coalesce_abnormal_edges (var_map map, co
*** 588,594 ****
FOR_EACH_BB (bb)
for (e = bb->succ; e; e = e->succ_next)
if (e->dest != EXIT_BLOCK_PTR && e->flags & EDGE_ABNORMAL)
! for (phi = phi_nodes (e->dest); phi; phi = TREE_CHAIN (phi))
{
/* Visit each PHI on the destination side of this abnormal
edge, and attempt to coalesce the argument with the result. */
--- 588,594 ----
FOR_EACH_BB (bb)
for (e = bb->succ; e; e = e->succ_next)
if (e->dest != EXIT_BLOCK_PTR && e->flags & EDGE_ABNORMAL)
! for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
{
/* Visit each PHI on the destination side of this abnormal
edge, and attempt to coalesce the argument with the result. */
*************** coalesce_ssa_name (var_map map, int flag
*** 698,704 ****
/* Add all potential copies via PHI arguments to the list. */
FOR_EACH_BB (bb)
{
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
tree res = PHI_RESULT (phi);
int p = var_to_partition (map, res);
--- 698,704 ----
/* Add all potential copies via PHI arguments to the list. */
FOR_EACH_BB (bb)
{
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
tree res = PHI_RESULT (phi);
int p = var_to_partition (map, res);
*************** eliminate_virtual_phis (void)
*** 970,976 ****
{
for (phi = phi_nodes (bb); phi; phi = next)
{
! next = TREE_CHAIN (phi);
if (!is_gimple_reg (SSA_NAME_VAR (PHI_RESULT (phi))))
{
#ifdef ENABLE_CHECKING
--- 970,976 ----
{
for (phi = phi_nodes (bb); phi; phi = next)
{
! next = PHI_CHAIN (phi);
if (!is_gimple_reg (SSA_NAME_VAR (PHI_RESULT (phi))))
{
#ifdef ENABLE_CHECKING
*************** coalesce_vars (var_map map, tree_live_in
*** 1031,1037 ****
{
tree phi, arg;
int p;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
p = var_to_partition (map, PHI_RESULT (phi));
--- 1031,1037 ----
{
tree phi, arg;
int p;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
p = var_to_partition (map, PHI_RESULT (phi));
*************** rewrite_trees (var_map map, tree *values
*** 1794,1800 ****
{
tree phi;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
tree T0 = var_to_partition_to_var (map, PHI_RESULT (phi));
--- 1794,1800 ----
{
tree phi;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
tree T0 = var_to_partition_to_var (map, PHI_RESULT (phi));
*************** remove_ssa_form (FILE *dump, var_map map
*** 1987,1993 ****
{
for (phi = phi_nodes (bb); phi; phi = next)
{
! next = TREE_CHAIN (phi);
if ((flags & SSANORM_REMOVE_ALL_PHIS)
|| var_to_partition (map, PHI_RESULT (phi)) != NO_PARTITION)
remove_phi_node (phi, NULL_TREE, bb);
--- 1987,1993 ----
{
for (phi = phi_nodes (bb); phi; phi = next)
{
! next = PHI_CHAIN (phi);
if ((flags & SSANORM_REMOVE_ALL_PHIS)
|| var_to_partition (map, PHI_RESULT (phi)) != NO_PARTITION)
remove_phi_node (phi, NULL_TREE, bb);
*************** rewrite_vars_out_of_ssa (bitmap vars)
*** 2029,2035 ****
to manually take variables out of SSA form here. */
FOR_EACH_BB (bb)
{
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
tree result = SSA_NAME_VAR (PHI_RESULT (phi));
--- 2029,2035 ----
to manually take variables out of SSA form here. */
FOR_EACH_BB (bb)
{
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
tree result = SSA_NAME_VAR (PHI_RESULT (phi));
Index: tree-phinodes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-phinodes.c,v
retrieving revision 2.3
diff -c -3 -p -r2.3 tree-phinodes.c
*** tree-phinodes.c 30 May 2004 18:32:30 -0000 2.3
--- tree-phinodes.c 16 Jun 2004 19:16:30 -0000
*************** make_phi_node (tree var, int len)
*** 183,189 ****
{
free_phinode_count--;
phi = free_phinodes[bucket];
! free_phinodes[bucket] = TREE_CHAIN (free_phinodes[bucket]);
#ifdef GATHER_STATISTICS
phi_nodes_reused++;
#endif
--- 183,189 ----
{
free_phinode_count--;
phi = free_phinodes[bucket];
! free_phinodes[bucket] = PHI_CHAIN (free_phinodes[bucket]);
#ifdef GATHER_STATISTICS
phi_nodes_reused++;
#endif
*************** release_phi_node (tree phi)
*** 220,226 ****
bucket = len > NUM_BUCKETS - 1 ? NUM_BUCKETS - 1 : len;
bucket -= 2;
! TREE_CHAIN (phi) = free_phinodes[bucket];
free_phinodes[bucket] = phi;
free_phinode_count++;
}
--- 220,226 ----
bucket = len > NUM_BUCKETS - 1 ? NUM_BUCKETS - 1 : len;
bucket -= 2;
! PHI_CHAIN (phi) = free_phinodes[bucket];
free_phinodes[bucket] = phi;
free_phinode_count++;
}
*************** resize_phi_node (tree *phi, int len)
*** 256,262 ****
{
free_phinode_count--;
new_phi = free_phinodes[bucket];
! free_phinodes[bucket] = TREE_CHAIN (free_phinodes[bucket]);
#ifdef GATHER_STATISTICS
phi_nodes_reused++;
#endif
--- 256,262 ----
{
free_phinode_count--;
new_phi = free_phinodes[bucket];
! free_phinodes[bucket] = PHI_CHAIN (free_phinodes[bucket]);
#ifdef GATHER_STATISTICS
phi_nodes_reused++;
#endif
*************** create_phi_node (tree var, basic_block b
*** 300,306 ****
PHI_REWRITTEN (phi) = 0;
/* Add the new PHI node to the list of PHI nodes for block BB. */
! TREE_CHAIN (phi) = phi_nodes (bb);
bb_ann (bb)->phi_nodes = phi;
/* Associate BB to the PHI node. */
--- 300,306 ----
PHI_REWRITTEN (phi) = 0;
/* Add the new PHI node to the list of PHI nodes for block BB. */
! PHI_CHAIN (phi) = phi_nodes (bb);
bb_ann (bb)->phi_nodes = phi;
/* Associate BB to the PHI node. */
*************** add_phi_arg (tree *phi, tree def, edge e
*** 345,358 ****
tree p;
for (p = phi_nodes (e->dest);
! p && TREE_CHAIN (p) != old_phi;
! p = TREE_CHAIN (p))
;
if (!p)
abort ();
! TREE_CHAIN (p) = *phi;
}
}
}
--- 345,358 ----
tree p;
for (p = phi_nodes (e->dest);
! p && PHI_CHAIN (p) != old_phi;
! p = PHI_CHAIN (p))
;
if (!p)
abort ();
! PHI_CHAIN (p) = *phi;
}
}
}
*************** remove_phi_node (tree phi, tree prev, ba
*** 434,440 ****
if (prev)
{
/* Rewire the list if we are given a PREV pointer. */
! TREE_CHAIN (prev) = TREE_CHAIN (phi);
/* If we are deleting the PHI node, then we should release the
SSA_NAME node so that it can be reused. */
--- 434,440 ----
if (prev)
{
/* Rewire the list if we are given a PREV pointer. */
! PHI_CHAIN (prev) = PHI_CHAIN (phi);
/* If we are deleting the PHI node, then we should release the
SSA_NAME node so that it can be reused. */
*************** remove_phi_node (tree phi, tree prev, ba
*** 444,450 ****
else if (phi == phi_nodes (bb))
{
/* Update the list head if removing the first element. */
! bb_ann (bb)->phi_nodes = TREE_CHAIN (phi);
/* If we are deleting the PHI node, then we should release the
SSA_NAME node so that it can be reused. */
--- 444,450 ----
else if (phi == phi_nodes (bb))
{
/* Update the list head if removing the first element. */
! bb_ann (bb)->phi_nodes = PHI_CHAIN (phi);
/* If we are deleting the PHI node, then we should release the
SSA_NAME node so that it can be reused. */
*************** remove_phi_node (tree phi, tree prev, ba
*** 456,462 ****
/* Traverse the list looking for the node to remove. */
tree prev, t;
prev = NULL_TREE;
! for (t = phi_nodes (bb); t && t != phi; t = TREE_CHAIN (t))
prev = t;
if (t)
remove_phi_node (t, prev, bb);
--- 456,462 ----
/* Traverse the list looking for the node to remove. */
tree prev, t;
prev = NULL_TREE;
! for (t = phi_nodes (bb); t && t != phi; t = PHI_CHAIN (t))
prev = t;
if (t)
remove_phi_node (t, prev, bb);
*************** remove_all_phi_nodes_for (bitmap vars)
*** 481,487 ****
{
tree var = SSA_NAME_VAR (PHI_RESULT (phi));
! next = TREE_CHAIN (phi);
/* Only add PHI nodes for variables not in VARS. */
if (!bitmap_bit_p (vars, var_ann (var)->uid))
{
--- 481,487 ----
{
tree var = SSA_NAME_VAR (PHI_RESULT (phi));
! next = PHI_CHAIN (phi);
/* Only add PHI nodes for variables not in VARS. */
if (!bitmap_bit_p (vars, var_ann (var)->uid))
{
*************** remove_all_phi_nodes_for (bitmap vars)
*** 494,500 ****
new_phi_list = last_phi = phi;
else
{
! TREE_CHAIN (last_phi) = phi;
last_phi = phi;
}
}
--- 494,500 ----
new_phi_list = last_phi = phi;
else
{
! PHI_CHAIN (last_phi) = phi;
last_phi = phi;
}
}
*************** remove_all_phi_nodes_for (bitmap vars)
*** 509,519 ****
/* Make sure the last node in the new list has no successors. */
if (last_phi)
! TREE_CHAIN (last_phi) = NULL_TREE;
bb_ann (bb)->phi_nodes = new_phi_list;
#if defined ENABLE_CHECKING
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
tree var = SSA_NAME_VAR (PHI_RESULT (phi));
if (bitmap_bit_p (vars, var_ann (var)->uid))
--- 509,519 ----
/* Make sure the last node in the new list has no successors. */
if (last_phi)
! PHI_CHAIN (last_phi) = NULL_TREE;
bb_ann (bb)->phi_nodes = new_phi_list;
#if defined ENABLE_CHECKING
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
tree var = SSA_NAME_VAR (PHI_RESULT (phi));
if (bitmap_bit_p (vars, var_ann (var)->uid))
Index: tree-pretty-print.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-pretty-print.c,v
retrieving revision 2.8
diff -c -3 -p -r2.8 tree-pretty-print.c
*** tree-pretty-print.c 16 Jun 2004 01:21:26 -0000 2.8
--- tree-pretty-print.c 16 Jun 2004 19:16:31 -0000
*************** dump_phi_nodes (pretty_printer *buffer,
*** 2123,2129 ****
if (!phi)
return;
! for (; phi; phi = TREE_CHAIN (phi))
{
if (is_gimple_reg (PHI_RESULT (phi)) || (flags & TDF_VOPS))
{
--- 2123,2129 ----
if (!phi)
return;
! for (; phi; phi = PHI_CHAIN (phi))
{
if (is_gimple_reg (PHI_RESULT (phi)) || (flags & TDF_VOPS))
{
Index: tree-ssa-alias.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-alias.c,v
retrieving revision 2.7
diff -c -3 -p -r2.7 tree-ssa-alias.c
*** tree-ssa-alias.c 10 Jun 2004 21:41:06 -0000 2.7
--- tree-ssa-alias.c 16 Jun 2004 19:16:32 -0000
*************** dump_points_to_info (FILE *file)
*** 2094,2100 ****
{
tree phi;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
tree ptr = PHI_RESULT (phi);
if (POINTER_TYPE_P (TREE_TYPE (ptr)))
--- 2094,2100 ----
{
tree phi;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
tree ptr = PHI_RESULT (phi);
if (POINTER_TYPE_P (TREE_TYPE (ptr)))
Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-ccp.c,v
retrieving revision 2.8
diff -c -3 -p -r2.8 tree-ssa-ccp.c
*** tree-ssa-ccp.c 10 Jun 2004 22:37:05 -0000 2.8
--- tree-ssa-ccp.c 16 Jun 2004 19:16:34 -0000
*************** simulate_block (basic_block block)
*** 289,295 ****
/* Always simulate PHI nodes, even if we have simulated this block
before. */
! for (phi = phi_nodes (block); phi; phi = TREE_CHAIN (phi))
visit_phi_node (phi);
/* If this is the first time we've simulated this block, then we
--- 289,295 ----
/* Always simulate PHI nodes, even if we have simulated this block
before. */
! for (phi = phi_nodes (block); phi; phi = PHI_CHAIN (phi))
visit_phi_node (phi);
/* If this is the first time we've simulated this block, then we
*************** substitute_and_fold (void)
*** 382,388 ****
tree phi;
/* Propagate our known constants into PHI nodes. */
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
int i;
--- 382,388 ----
tree phi;
/* Propagate our known constants into PHI nodes. */
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
int i;
*************** initialize (void)
*** 1184,1190 ****
{
tree phi, var;
int x;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
value *val;
val = get_value (PHI_RESULT (phi));
--- 1184,1190 ----
{
tree phi, var;
int x;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
value *val;
val = get_value (PHI_RESULT (phi));
Index: tree-ssa-copy.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-copy.c,v
retrieving revision 2.5
diff -c -3 -p -r2.5 tree-ssa-copy.c
*** tree-ssa-copy.c 15 Jun 2004 11:49:50 -0000 2.5
--- tree-ssa-copy.c 16 Jun 2004 19:16:34 -0000
*************** cprop_into_successor_phis (basic_block b
*** 313,319 ****
the entries. */
phi_num_args = PHI_NUM_ARGS (phi);
hint = phi_num_args;
! for ( ; phi; phi = TREE_CHAIN (phi))
{
int i;
tree new;
--- 313,319 ----
the entries. */
phi_num_args = PHI_NUM_ARGS (phi);
hint = phi_num_args;
! for ( ; phi; phi = PHI_CHAIN (phi))
{
int i;
tree new;
Index: tree-ssa-copyrename.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-copyrename.c,v
retrieving revision 2.4
diff -c -3 -p -r2.4 tree-ssa-copyrename.c
*** tree-ssa-copyrename.c 10 Jun 2004 22:37:05 -0000 2.4
--- tree-ssa-copyrename.c 16 Jun 2004 19:16:34 -0000
*************** rename_ssa_copies (void)
*** 320,326 ****
FOR_EACH_BB (bb)
{
/* Treat PHI nodes as copies between the result and each argument. */
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
int i;
tree res = PHI_RESULT (phi);
--- 320,326 ----
FOR_EACH_BB (bb)
{
/* Treat PHI nodes as copies between the result and each argument. */
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
int i;
tree res = PHI_RESULT (phi);
Index: tree-ssa-dce.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dce.c,v
retrieving revision 2.6
diff -c -3 -p -r2.6 tree-ssa-dce.c
*** tree-ssa-dce.c 12 Jun 2004 00:18:32 -0000 2.6
--- tree-ssa-dce.c 16 Jun 2004 19:16:35 -0000
*************** find_obviously_necessary_stmts (struct e
*** 432,438 ****
tree phi;
/* Check any PHI nodes in the block. */
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
NECESSARY (phi) = 0;
--- 432,438 ----
tree phi;
/* Check any PHI nodes in the block. */
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
NECESSARY (phi) = 0;
*************** remove_dead_phis (basic_block bb)
*** 664,670 ****
if (! NECESSARY (phi))
{
! tree next = TREE_CHAIN (phi);
if (dump_file && (dump_flags & TDF_DETAILS))
{
--- 664,670 ----
if (! NECESSARY (phi))
{
! tree next = PHI_CHAIN (phi);
if (dump_file && (dump_flags & TDF_DETAILS))
{
*************** remove_dead_phis (basic_block bb)
*** 680,686 ****
else
{
prev = phi;
! phi = TREE_CHAIN (phi);
}
}
}
--- 680,686 ----
else
{
prev = phi;
! phi = PHI_CHAIN (phi);
}
}
}
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dom.c,v
retrieving revision 2.11
diff -c -3 -p -r2.11 tree-ssa-dom.c
*** tree-ssa-dom.c 16 Jun 2004 13:39:49 -0000 2.11
--- tree-ssa-dom.c 16 Jun 2004 19:16:35 -0000
*************** redirect_edges_and_update_ssa_graph (var
*** 331,337 ****
/* All variables referenced in PHI nodes we bypass must be
renamed. */
! for (phi = phi_nodes (e->dest); phi; phi = TREE_CHAIN (phi))
{
tree result = SSA_NAME_VAR (PHI_RESULT (phi));
--- 331,337 ----
/* All variables referenced in PHI nodes we bypass must be
renamed. */
! for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
{
tree result = SSA_NAME_VAR (PHI_RESULT (phi));
*************** redirect_edges_and_update_ssa_graph (var
*** 381,387 ****
/* Finally, any variables in PHI nodes at our final destination
must also be taken our of SSA form. */
! for (phi = phi_nodes (tgt); phi; phi = TREE_CHAIN (phi))
{
tree result = SSA_NAME_VAR (PHI_RESULT (phi));
--- 381,387 ----
/* Finally, any variables in PHI nodes at our final destination
must also be taken our of SSA form. */
! for (phi = phi_nodes (tgt); phi; phi = PHI_CHAIN (phi))
{
tree result = SSA_NAME_VAR (PHI_RESULT (phi));
*************** redirect_edges_and_update_ssa_graph (var
*** 515,521 ****
{
tree result = PHI_RESULT (phi);
! next = TREE_CHAIN (phi);
if (bitmap_bit_p (virtuals_to_rename,
var_ann (SSA_NAME_VAR (result))->uid))
--- 515,521 ----
{
tree result = PHI_RESULT (phi);
! next = PHI_CHAIN (phi);
if (bitmap_bit_p (virtuals_to_rename,
var_ann (SSA_NAME_VAR (result))->uid))
*************** thread_across_edge (struct dom_walk_data
*** 698,704 ****
tree phi;
/* Each PHI creates a temporary equivalence, record them. */
! for (phi = phi_nodes (e->dest); phi; phi = TREE_CHAIN (phi))
{
tree src = PHI_ARG_DEF (phi, phi_arg_from_edge (phi, e));
tree dst = PHI_RESULT (phi);
--- 698,704 ----
tree phi;
/* Each PHI creates a temporary equivalence, record them. */
! for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
{
tree src = PHI_ARG_DEF (phi, phi_arg_from_edge (phi, e));
tree dst = PHI_RESULT (phi);
*************** record_equivalences_from_phis (struct do
*** 1334,1340 ****
= VARRAY_TOP_GENERIC_PTR (walk_data->block_data_stack);
tree phi;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
tree lhs = PHI_RESULT (phi);
tree rhs = NULL;
--- 1334,1340 ----
= VARRAY_TOP_GENERIC_PTR (walk_data->block_data_stack);
tree phi;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
tree lhs = PHI_RESULT (phi);
tree rhs = NULL;
Index: tree-ssa-dse.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dse.c,v
retrieving revision 2.2
diff -c -3 -p -r2.2 tree-ssa-dse.c
*** tree-ssa-dse.c 10 Jun 2004 21:41:07 -0000 2.2
--- tree-ssa-dse.c 16 Jun 2004 19:16:35 -0000
*************** dse_record_phis (struct dom_walk_data *w
*** 333,339 ****
struct dse_global_data *dse_gd = walk_data->global_data;
tree phi;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
if (need_imm_uses_for (PHI_RESULT (phi)))
record_voperand_set (dse_gd->stores,
&bd->stores,
--- 333,339 ----
struct dse_global_data *dse_gd = walk_data->global_data;
tree phi;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
if (need_imm_uses_for (PHI_RESULT (phi)))
record_voperand_set (dse_gd->stores,
&bd->stores,
*************** tree_ssa_dse (void)
*** 373,379 ****
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
stmt_ann (bsi_stmt (bsi))->uid = uid++;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
stmt_ann (phi)->uid = uid++;
}
--- 373,379 ----
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
stmt_ann (bsi_stmt (bsi))->uid = uid++;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
stmt_ann (phi)->uid = uid++;
}
Index: tree-ssa-live.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-live.c,v
retrieving revision 2.8
diff -c -3 -p -r2.8 tree-ssa-live.c
*** tree-ssa-live.c 10 Jun 2004 22:37:05 -0000 2.8
--- tree-ssa-live.c 16 Jun 2004 19:16:36 -0000
*************** create_ssa_var_map (int flags)
*** 329,335 ****
FOR_EACH_BB (bb)
{
tree phi, arg;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
int i;
register_ssa_partition (map, PHI_RESULT (phi), false);
--- 329,335 ----
FOR_EACH_BB (bb)
{
tree phi, arg;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
int i;
register_ssa_partition (map, PHI_RESULT (phi), false);
*************** calculate_live_on_entry (var_map map)
*** 578,584 ****
{
bitmap_clear (saw_def);
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
for (i = 0; i < PHI_NUM_ARGS (phi); i++)
{
--- 578,584 ----
{
bitmap_clear (saw_def);
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
for (i = 0; i < PHI_NUM_ARGS (phi); i++)
{
*************** calculate_live_on_entry (var_map map)
*** 603,609 ****
The a_3 referred to in b_3's PHI node is the one incoming on the
edge, *not* the PHI node just seen. */
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
var = PHI_RESULT (phi);
set_if_valid (map, saw_def, var);
--- 603,609 ----
The a_3 referred to in b_3's PHI node is the one incoming on the
edge, *not* the PHI node just seen. */
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
var = PHI_RESULT (phi);
set_if_valid (map, saw_def, var);
*************** calculate_live_on_entry (var_map map)
*** 701,707 ****
int z, ok = 0;
for (phi = phi_nodes (e->dest);
phi && !ok;
! phi = TREE_CHAIN (phi))
{
for (z = 0; z < PHI_NUM_ARGS (phi); z++)
if (var == PHI_ARG_DEF (phi, z))
--- 701,707 ----
int z, ok = 0;
for (phi = phi_nodes (e->dest);
phi && !ok;
! phi = PHI_CHAIN (phi))
{
for (z = 0; z < PHI_NUM_ARGS (phi); z++)
if (var == PHI_ARG_DEF (phi, z))
*************** calculate_live_on_exit (tree_live_info_p
*** 751,757 ****
/* Set all the live-on-exit bits for uses in PHIs. */
FOR_EACH_BB (bb)
{
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
for (i = 0; i < PHI_NUM_ARGS (phi); i++)
{
t = PHI_ARG_DEF (phi, i);
--- 751,757 ----
/* Set all the live-on-exit bits for uses in PHIs. */
FOR_EACH_BB (bb)
{
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
for (i = 0; i < PHI_NUM_ARGS (phi); i++)
{
t = PHI_ARG_DEF (phi, i);
*************** build_tree_conflict_graph (tree_live_inf
*** 1418,1424 ****
going to be translated out of SSA form we must record a conflict
between the result of the PHI and any variables with are live.
Otherwise the out-of-ssa translation may create incorrect code. */
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
tree result = PHI_RESULT (phi);
int p = var_to_partition (map, result);
--- 1418,1424 ----
going to be translated out of SSA form we must record a conflict
between the result of the PHI and any variables with are live.
Otherwise the out-of-ssa translation may create incorrect code. */
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
tree result = PHI_RESULT (phi);
int p = var_to_partition (map, result);
*************** register_ssa_partitions_for_vars (bitmap
*** 1837,1843 ****
{
tree result = SSA_NAME_VAR (PHI_RESULT (phi));
! next = TREE_CHAIN (phi);
if (bitmap_bit_p (vars, var_ann (result)->uid))
{
if (! is_gimple_reg (result))
--- 1837,1843 ----
{
tree result = SSA_NAME_VAR (PHI_RESULT (phi));
! next = PHI_CHAIN (phi);
if (bitmap_bit_p (vars, var_ann (result)->uid))
{
if (! is_gimple_reg (result))
Index: tree-ssa-loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop.c,v
retrieving revision 2.3
diff -c -3 -p -r2.3 tree-ssa-loop.c
*** tree-ssa-loop.c 10 Jun 2004 21:41:07 -0000 2.3
--- tree-ssa-loop.c 16 Jun 2004 19:16:36 -0000
*************** mark_defs_for_rewrite (basic_block bb)
*** 109,115 ****
v_must_def_optype v_must_defs;
unsigned i;
! for (stmt = phi_nodes (bb); stmt; stmt = TREE_CHAIN (stmt))
{
var = SSA_NAME_VAR (PHI_RESULT (stmt));
bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
--- 109,115 ----
v_must_def_optype v_must_defs;
unsigned i;
! for (stmt = phi_nodes (bb); stmt; stmt = PHI_CHAIN (stmt))
{
var = SSA_NAME_VAR (PHI_RESULT (stmt));
bitmap_set_bit (vars_to_rename, var_ann (var)->uid);
*************** duplicate_blocks (varray_type bbs_to_dup
*** 223,229 ****
for (e1 = new_header->succ; e1->dest != e->dest; e1 = e1->succ_next)
continue;
! for (phi = phi_nodes (e->dest); phi; phi = TREE_CHAIN (phi))
{
tree def = phi_element_for_edge (phi, e)->def;
add_phi_arg (&phi, def, e1);
--- 223,229 ----
for (e1 = new_header->succ; e1->dest != e->dest; e1 = e1->succ_next)
continue;
! for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
{
tree def = phi_element_for_edge (phi, e)->def;
add_phi_arg (&phi, def, e1);
Index: tree-ssa-phiopt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-phiopt.c,v
retrieving revision 2.7
diff -c -3 -p -r2.7 tree-ssa-phiopt.c
*** tree-ssa-phiopt.c 19 May 2004 18:31:35 -0000 2.7
--- tree-ssa-phiopt.c 16 Jun 2004 19:16:36 -0000
*************** tree_ssa_phiopt (void)
*** 121,127 ****
/* We're searching for blocks with one PHI node which has two
arguments. */
phi = phi_nodes (bb);
! if (phi && TREE_CHAIN (phi) == NULL
&& PHI_NUM_ARGS (phi) == 2)
{
arg0 = PHI_ARG_DEF (phi, 0);
--- 121,127 ----
/* We're searching for blocks with one PHI node which has two
arguments. */
phi = phi_nodes (bb);
! if (phi && PHI_CHAIN (phi) == NULL
&& PHI_NUM_ARGS (phi) == 2)
{
arg0 = PHI_ARG_DEF (phi, 0);
Index: tree-ssa-pre.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-pre.c,v
retrieving revision 2.9
diff -c -3 -p -r2.9 tree-ssa-pre.c
*** tree-ssa-pre.c 14 Jun 2004 01:27:57 -0000 2.9
--- tree-ssa-pre.c 16 Jun 2004 19:16:37 -0000
*************** compute_avail (basic_block block)
*** 1606,1612 ****
dom = get_immediate_dominator (CDI_DOMINATORS, block);
if (dom)
set_copy (AVAIL_OUT (block), AVAIL_OUT (dom));
! for (phi = phi_nodes (block); phi; phi = TREE_CHAIN (phi))
{
/* Ignore virtual PHIs until we can do PRE on expressions
with virtual operands. */
--- 1606,1612 ----
dom = get_immediate_dominator (CDI_DOMINATORS, block);
if (dom)
set_copy (AVAIL_OUT (block), AVAIL_OUT (dom));
! for (phi = phi_nodes (block); phi; phi = PHI_CHAIN (phi))
{
/* Ignore virtual PHIs until we can do PRE on expressions
with virtual operands. */
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa.c,v
retrieving revision 2.8
diff -c -3 -p -r2.8 tree-ssa.c
*** tree-ssa.c 14 Jun 2004 20:41:39 -0000 2.8
--- tree-ssa.c 16 Jun 2004 19:16:37 -0000
*************** ssa_remove_edge (edge e)
*** 58,64 ****
/* Remove the appropriate PHI arguments in E's destination block. */
for (phi = phi_nodes (e->dest); phi; phi = next)
{
! next = TREE_CHAIN (phi);
remove_phi_arg (phi, e->src);
}
--- 58,64 ----
/* Remove the appropriate PHI arguments in E's destination block. */
for (phi = phi_nodes (e->dest); phi; phi = next)
{
! next = PHI_CHAIN (phi);
remove_phi_arg (phi, e->src);
}
*************** ssa_redirect_edge (edge e, basic_block d
*** 80,86 ****
/* Remove the appropriate PHI arguments in E's destination block. */
for (phi = phi_nodes (e->dest); phi; phi = next)
{
! next = TREE_CHAIN (phi);
i = phi_arg_from_edge (phi, e);
if (i < 0)
--- 80,86 ----
/* Remove the appropriate PHI arguments in E's destination block. */
for (phi = phi_nodes (e->dest); phi; phi = next)
{
! next = PHI_CHAIN (phi);
i = phi_arg_from_edge (phi, e);
if (i < 0)
*************** verify_ssa (void)
*** 305,311 ****
tree phi;
block_stmt_iterator bsi;
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
err |= verify_def (bb, definition_block, PHI_RESULT (phi), phi);
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
--- 305,311 ----
tree phi;
block_stmt_iterator bsi;
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
err |= verify_def (bb, definition_block, PHI_RESULT (phi), phi);
for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
*************** verify_ssa (void)
*** 389,395 ****
}
/* Verify the arguments for every PHI node in the block. */
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
err |= verify_phi_args (phi, bb, definition_block);
/* Now verify all the uses and vuses in every statement of the block.
--- 389,395 ----
}
/* Verify the arguments for every PHI node in the block. */
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
err |= verify_phi_args (phi, bb, definition_block);
/* Now verify all the uses and vuses in every statement of the block.
*************** kill_redundant_phi_nodes (void)
*** 881,887 ****
FOR_EACH_BB (bb)
{
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
{
var = PHI_RESULT (phi);
--- 881,887 ----
FOR_EACH_BB (bb)
{
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
{
var = PHI_RESULT (phi);
*************** execute_late_warn_uninitialized (void)
*** 1077,1083 ****
execute_early_warn_uninitialized ();
FOR_EACH_BB (bb)
! for (phi = phi_nodes (bb); phi; phi = TREE_CHAIN (phi))
warn_uninitialized_phi (phi);
}
--- 1077,1083 ----
execute_early_warn_uninitialized ();
FOR_EACH_BB (bb)
! for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
warn_uninitialized_phi (phi);
}
Index: tree-tailcall.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-tailcall.c,v
retrieving revision 2.8
diff -c -3 -p -r2.8 tree-tailcall.c
*** tree-tailcall.c 10 Jun 2004 21:41:07 -0000 2.8
--- tree-tailcall.c 16 Jun 2004 19:16:37 -0000
*************** propagate_through_phis (tree var, edge e
*** 339,345 ****
basic_block dest = e->dest;
tree phi;
! for (phi = phi_nodes (dest); phi; phi = TREE_CHAIN (phi))
if (phi_element_for_edge (phi, e)->def == var)
return PHI_RESULT (phi);
--- 339,345 ----
basic_block dest = e->dest;
tree phi;
! for (phi = phi_nodes (dest); phi; phi = PHI_CHAIN (phi))
if (phi_element_for_edge (phi, e)->def == var)
return PHI_RESULT (phi);
*************** adjust_accumulator_values (block_stmt_it
*** 558,564 ****
if (a_acc)
{
! for (phi = phi_nodes (back->dest); phi; phi = TREE_CHAIN (phi))
if (PHI_RESULT (phi) == a_acc)
break;
--- 558,564 ----
if (a_acc)
{
! for (phi = phi_nodes (back->dest); phi; phi = PHI_CHAIN (phi))
if (PHI_RESULT (phi) == a_acc)
break;
*************** adjust_accumulator_values (block_stmt_it
*** 567,573 ****
if (m_acc)
{
! for (phi = phi_nodes (back->dest); phi; phi = TREE_CHAIN (phi))
if (PHI_RESULT (phi) == m_acc)
break;
--- 567,573 ----
if (m_acc)
{
! for (phi = phi_nodes (back->dest); phi; phi = PHI_CHAIN (phi))
if (PHI_RESULT (phi) == m_acc)
break;
*************** eliminate_tail_call (struct tailcall *t)
*** 684,690 ****
args = TREE_CHAIN (args))
{
! for (phi = phi_nodes (first); phi; phi = TREE_CHAIN (phi))
if (param == SSA_NAME_VAR (PHI_RESULT (phi)))
break;
--- 684,690 ----
args = TREE_CHAIN (args))
{
! for (phi = phi_nodes (first); phi; phi = PHI_CHAIN (phi))
if (param == SSA_NAME_VAR (PHI_RESULT (phi)))
break;
*************** eliminate_tail_call (struct tailcall *t)
*** 701,707 ****
for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
{
param = SSA_NAME_VAR (V_MAY_DEF_RESULT (v_may_defs, i));
! for (phi = phi_nodes (first); phi; phi = TREE_CHAIN (phi))
if (param == SSA_NAME_VAR (PHI_RESULT (phi)))
break;
--- 701,707 ----
for (i = 0; i < NUM_V_MAY_DEFS (v_may_defs); i++)
{
param = SSA_NAME_VAR (V_MAY_DEF_RESULT (v_may_defs, i));
! for (phi = phi_nodes (first); phi; phi = PHI_CHAIN (phi))
if (param == SSA_NAME_VAR (PHI_RESULT (phi)))
break;
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.515
diff -c -3 -p -r1.515 tree.h
*** tree.h 16 Jun 2004 05:09:40 -0000 1.515
--- tree.h 16 Jun 2004 19:19:13 -0000
*************** struct tree_ssa_name GTY(())
*** 1208,1213 ****
--- 1208,1218 ----
/* In a PHI_NODE node. */
#define PHI_RESULT(NODE) PHI_NODE_CHECK (NODE)->phi.result
+ /* PHI_NODEs for each basic block are chained together in a single linked
+ list. The head of the list is linked from the block annotation, and
+ the link to the next PHI is in PHI_CHAIN. */
+ #define PHI_CHAIN(NODE) TREE_CHAIN (PHI_NODE_CHECK (NODE))
+
/* Nonzero if the PHI node was rewritten by a previous pass through the
SSA renamer. */
#define PHI_REWRITTEN(NODE) PHI_NODE_CHECK (NODE)->phi.rewritten
More information about the Gcc-patches
mailing list