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 15/n


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  <>

	* 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)
-	    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);
 	    if (!phi_ssa_name_p (tmp))

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