This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] O(1) PHI argument look-up - Part 19/n


Attached is part 19 of my O(1) PHI argument look-up patch.

We no longer call remove PHI arguments or PHI nodes in the "for" loop
shown in the patch.  In fact, the "for" loop is a "read-only"
operation to the chain of PHI nodes, so we don't have to evaluate
PHI_CHAIN at the beginning of loop.

Tested on i686-pc-linux-gnu.  OK to apply?

Kazu Hirata

2004-11-28  Kazu Hirata  <>

	* tree-ssa.c (ssa_redirect_edge): Use PHI_CHAIN in the "for"

Index: tree-ssa.c
RCS file: /cvs/gcc/gcc/gcc/tree-ssa.c,v
retrieving revision 2.68
diff -u -d -p -r2.68 tree-ssa.c
--- tree-ssa.c	27 Nov 2004 17:26:16 -0000	2.68
+++ tree-ssa.c	27 Nov 2004 17:46:35 -0000
@@ -53,16 +53,14 @@ Boston, MA 02111-1307, USA.  */
 ssa_redirect_edge (edge e, basic_block dest)
-  tree phi, next;
+  tree phi;
   tree list = NULL, *last = &list;
   tree src, dst, node;
   int i;
   /* Remove the appropriate PHI arguments in E's destination block.  */
-  for (phi = phi_nodes (e->dest); phi; phi = next)
+  for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
-      next = PHI_CHAIN (phi);
       i = phi_arg_from_edge (phi, e);
       if (PHI_ARG_DEF (phi, i) == NULL_TREE)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]