summaryrefslogtreecommitdiff
path: root/gcc/tree-phinodes.c
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-06 15:14:11 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-06 15:14:11 +0000
commita5ae639c0e638198ad21e81ca1eee676b67875ba (patch)
tree6838e695ad282ca52b22e7f2649ebf6c69aeecde /gcc/tree-phinodes.c
parent9e4e504cb48e7160229828d934083321026f1578 (diff)
downloadgcc-a5ae639c0e638198ad21e81ca1eee676b67875ba.tar.gz
* tree-phinodes.c (remove_all_phi_nodes_for): Speed up using a
pointer to the last PHI node in the new PHI chain. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90173 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-phinodes.c')
-rw-r--r--gcc/tree-phinodes.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/gcc/tree-phinodes.c b/gcc/tree-phinodes.c
index 2e190e58179..0d621b53339 100644
--- a/gcc/tree-phinodes.c
+++ b/gcc/tree-phinodes.c
@@ -449,10 +449,10 @@ remove_all_phi_nodes_for (bitmap vars)
FOR_EACH_BB (bb)
{
/* 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), next = NULL; phi; phi = next)
+ for (phi = phi_nodes (bb); phi; phi = next)
{
tree var = SSA_NAME_VAR (PHI_RESULT (phi));
@@ -465,13 +465,8 @@ remove_all_phi_nodes_for (bitmap vars)
Note that fact in PHI_REWRITTEN. */
PHI_REWRITTEN (phi) = 1;
- if (new_phi_list == NULL_TREE)
- new_phi_list = last_phi = phi;
- else
- {
- PHI_CHAIN (last_phi) = phi;
- last_phi = phi;
- }
+ *lastp = phi;
+ lastp = &PHI_CHAIN (phi);
}
else
{
@@ -483,8 +478,7 @@ remove_all_phi_nodes_for (bitmap vars)
}
/* Make sure the last node in the new list has no successors. */
- if (last_phi)
- PHI_CHAIN (last_phi) = NULL_TREE;
+ *lastp = NULL;
bb_ann (bb)->phi_nodes = new_phi_list;
#if defined ENABLE_CHECKING