This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] O(1) PHI argument look-up - Part 19/n
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 29 Nov 2004 00:38:14 -0500 (EST)
- Subject: [patch] O(1) PHI argument look-up - Part 19/n
Hi,
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 <kazu@cs.umass.edu>
* tree-ssa.c (ssa_redirect_edge): Use PHI_CHAIN in the "for"
loop.
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. */
edge
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)
continue;