This is the mail archive of the gcc-patches@gcc.gnu.org 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 16/n


Hi,

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

phi_arg_from_edge no longer returns -1.  The patch replaces
phi_arg_from_edge with e->dest_idx.  Note that this is safe because
remove_phi_arg_num removes a PHI argument, which always exist.  It's
just that a "missing PHI argument" is faked by putting NULL_TREE in
the corresponding slot.

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

Kazu Hirata

2004-11-25  Kazu Hirata  <kazu@cs.umass.edu>

	* tree-phinodes.c (remove_phi_args): Replace phi_arg_from_edge
	with e->dest_idx.

Index: tree-phinodes.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-phinodes.c,v
retrieving revision 2.26
diff -u -d -p -r2.26 tree-phinodes.c
--- tree-phinodes.c	23 Nov 2004 17:45:42 -0000	2.26
+++ tree-phinodes.c	23 Nov 2004 18:40:39 -0000
@@ -395,11 +395,7 @@ remove_phi_args (edge e)
   tree phi;
 
   for (phi = phi_nodes (e->dest); phi; phi = PHI_CHAIN (phi))
-    {
-      int index = phi_arg_from_edge (phi, e);
-      if (index >= 0)
-	remove_phi_arg_num (phi, index);
-    }
+    remove_phi_arg_num (phi, e->dest_idx);
 }
 
 /* Remove PHI node PHI from basic block BB.  If PREV is non-NULL, it is


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