This is the mail archive of the
mailing list for the GCC project.
Re: [patch] tree-phinodes.c: Speed up remove_phi_arg_num.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: law at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 02 Nov 2004 08:19:48 -0500 (EST)
- Subject: Re: [patch] tree-phinodes.c: Speed up remove_phi_arg_num.
- References: <firstname.lastname@example.org><email@example.com>
> > * tree-phinodes.c (remove_phi_arg_num): Do not zero the
> > element that's being removed.
> OK. I would recommend a short comment indicating why it is safe to
> not clear the various structure elements.
Here is the final patch I committed.
2004-11-02 Kazu Hirata <firstname.lastname@example.org>
* tree-phinodes.c (remove_phi_arg_num): Do not zero the
element that's being removed.
RCS file: /cvs/gcc/gcc/gcc/tree-phinodes.c,v
retrieving revision 2.15
diff -u -d -p -r2.15 tree-phinodes.c
--- tree-phinodes.c 30 Oct 2004 00:13:52 -0000 2.15
+++ tree-phinodes.c 2 Nov 2004 02:48:32 -0000
@@ -396,10 +396,10 @@ remove_phi_arg_num (tree phi, int i)
PHI_ARG_NONZERO (phi, i) = PHI_ARG_NONZERO (phi, num_elem - 1);
- /* Shrink the vector and return. */
- SET_PHI_ARG_DEF (phi, num_elem - 1, NULL_TREE);
- PHI_ARG_EDGE (phi, num_elem - 1) = NULL;
- PHI_ARG_NONZERO (phi, num_elem - 1) = false;
+ /* Shrink the vector and return. Note that we do not have to clear
+ PHI_ARG_DEF, PHI_ARG_EDGE, or PHI_ARG_NONZERO because the garbage
+ collector will not look at those elements beyond the first
+ PHI_NUM_ARGS elements of the array. */