Commit 4430da7f by Kazu Hirata Committed by Kazu Hirata

tree-phinodes.c (remove_phi_node): Clean up by factoring out calls to…

tree-phinodes.c (remove_phi_node): Clean up by factoring out calls to release_ssa_name and release_phi_node.

	* tree-phinodes.c (remove_phi_node): Clean up by factoring out
	calls to release_ssa_name and release_phi_node.

From-SVN: r95835
parent 8fb790fd
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
* cfgexpand.c (construct_exit_block): Use EDGE_PRED instead of * cfgexpand.c (construct_exit_block): Use EDGE_PRED instead of
EDGE_I. EDGE_I.
* tree-phinodes.c (remove_phi_node): Clean up by factoring out
calls to release_ssa_name and release_phi_node.
2005-03-03 Roger Sayle <roger@eyesopen.com> 2005-03-03 Roger Sayle <roger@eyesopen.com>
Andrew Pinski <pinskia@physics.uc.edu> Andrew Pinski <pinskia@physics.uc.edu>
......
...@@ -404,36 +404,27 @@ remove_phi_args (edge e) ...@@ -404,36 +404,27 @@ remove_phi_args (edge e)
void void
remove_phi_node (tree phi, tree prev, basic_block bb) remove_phi_node (tree phi, tree prev, basic_block bb)
{ {
if (prev) tree *loc;
{
/* 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 if (prev)
SSA_NAME node so that it can be reused. */
release_ssa_name (PHI_RESULT (phi));
release_phi_node (phi);
}
else if (phi == phi_nodes (bb))
{ {
/* Update the list head if removing the first element. */ loc = &PHI_CHAIN (prev);
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. */
release_ssa_name (PHI_RESULT (phi));
release_phi_node (phi);
} }
else else
{ {
/* Traverse the list looking for the node to remove. */ for (loc = &(bb_ann (bb)->phi_nodes);
tree prev, t; *loc != phi;
prev = NULL_TREE; loc = &PHI_CHAIN (*loc))
for (t = phi_nodes (bb); t && t != phi; t = PHI_CHAIN (t)) ;
prev = t;
if (t)
remove_phi_node (t, prev, bb);
} }
/* Remove PHI from the chain. */
*loc = PHI_CHAIN (phi);
/* If we are deleting the PHI node, then we should release the
SSA_NAME node so that it can be reused. */
release_ssa_name (PHI_RESULT (phi));
release_phi_node (phi);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment