Commit b2c24c1b by Kazu Hirata Committed by Kazu Hirata

tree-phinodes.c (remove_all_phi_nodes_for): Speed up using a pointer to the last…

tree-phinodes.c (remove_all_phi_nodes_for): Speed up using a pointer to the last PHI node in the new PHI chain.

	* tree-phinodes.c (remove_all_phi_nodes_for): Speed up using a
	pointer to the last PHI node in the new PHI chain.

From-SVN: r90173
parent b741fa00
2004-11-06 Kazu Hirata <kazu@cs.umass.edu>
* tree-phinodes.c (remove_all_phi_nodes_for): Speed up using a
pointer to the last PHI node in the new PHI chain.
2004-11-06 Kaz Kojima <kkojima@gcc.gnu.org> 2004-11-06 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.c (prepare_move_operands): Emit a use of r12 * config/sh/sh.c (prepare_move_operands): Emit a use of r12
......
...@@ -449,10 +449,10 @@ remove_all_phi_nodes_for (bitmap vars) ...@@ -449,10 +449,10 @@ remove_all_phi_nodes_for (bitmap vars)
FOR_EACH_BB (bb) FOR_EACH_BB (bb)
{ {
/* Build a new PHI list for BB without variables in VARS. */ /* Build a new PHI list for BB without variables in VARS. */
tree phi, new_phi_list, last_phi, next; tree phi, new_phi_list, next;
tree *lastp = &new_phi_list;
last_phi = new_phi_list = NULL_TREE; for (phi = phi_nodes (bb); phi; phi = next)
for (phi = phi_nodes (bb), next = NULL; phi; phi = next)
{ {
tree var = SSA_NAME_VAR (PHI_RESULT (phi)); tree var = SSA_NAME_VAR (PHI_RESULT (phi));
...@@ -465,13 +465,8 @@ remove_all_phi_nodes_for (bitmap vars) ...@@ -465,13 +465,8 @@ remove_all_phi_nodes_for (bitmap vars)
Note that fact in PHI_REWRITTEN. */ Note that fact in PHI_REWRITTEN. */
PHI_REWRITTEN (phi) = 1; PHI_REWRITTEN (phi) = 1;
if (new_phi_list == NULL_TREE) *lastp = phi;
new_phi_list = last_phi = phi; lastp = &PHI_CHAIN (phi);
else
{
PHI_CHAIN (last_phi) = phi;
last_phi = phi;
}
} }
else else
{ {
...@@ -483,8 +478,7 @@ remove_all_phi_nodes_for (bitmap vars) ...@@ -483,8 +478,7 @@ remove_all_phi_nodes_for (bitmap vars)
} }
/* Make sure the last node in the new list has no successors. */ /* Make sure the last node in the new list has no successors. */
if (last_phi) *lastp = NULL;
PHI_CHAIN (last_phi) = NULL_TREE;
bb_ann (bb)->phi_nodes = new_phi_list; bb_ann (bb)->phi_nodes = new_phi_list;
#if defined ENABLE_CHECKING #if defined ENABLE_CHECKING
......
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