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 15/n
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 24 Nov 2004 16:44:16 -0500 (EST)
- Subject: [patch] O(1) PHI argument look-up - Part 15/n
Hi,
Attached is part 15 of my O(1) PHI argument look-up patch.
phi_arg_from_edge is the same as e->dest_idx except that it has two
additional gcc_assert's. Note that it does not return -1 any more.
The patch replaces phi_arg_from_edge with e->dest_idx.
verify_phi_args extensively checks PHI nodes. In particular, it
checks for a missing PHI argument. IMHO, we don't need to do the same
check over and over.
By the way, Y is used elsewhere for a different purpose (doh!), so I
don't need to remove that.
Tested on i686-pc-linux-gnu. OK to apply?
Kazu Hirata
2004-11-24 Kazu Hirata <kazu@cs.umass.edu>
* tree-outof-ssa.c (coalesce_abnormal_edges): Use e->dest_idx
instead of calling phi_arg_from_edge.
Index: tree-outof-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-outof-ssa.c,v
retrieving revision 2.34
diff -u -d -p -r2.34 tree-outof-ssa.c
--- tree-outof-ssa.c 24 Nov 2004 19:22:48 -0000 2.34
+++ tree-outof-ssa.c 24 Nov 2004 19:23:13 -0000
@@ -590,10 +590,7 @@ coalesce_abnormal_edges (var_map map, co
if (x == NO_PARTITION)
continue;
- y = phi_arg_from_edge (phi, e);
- gcc_assert (y != -1);
-
- tmp = PHI_ARG_DEF (phi, y);
+ tmp = PHI_ARG_DEF (phi, e->dest_idx);
#ifdef ENABLE_CHECKING
if (!phi_ssa_name_p (tmp))
{