This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: remove bb_ann_d's num_preds field
- From: Jeffrey A Law <law at redhat dot com>
- To: Ben Elliston <bje at au1 dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 29 Sep 2004 11:28:10 -0600
- Subject: Re: PATCH: remove bb_ann_d's num_preds field
- Organization: Red Hat, Inc
- References: <87sm915gfd.fsf@au.ibm.com>
- Reply-to: law at redhat dot com
On Wed, 2004-09-29 at 07:54, Ben Elliston wrote:
> As Jeff Law suggested, this patch removes the num_preds field from the
> bb_ann_d structure, saving one integer (about a 16% saving) per
> annotation instance.
>
> Tested with a bootstrap and regression testsuite run. Okay for
> mainline?
>
> Ben
>
> 2004-09-29 Ben Elliston <bje@au.ibm.com>
>
> * tree-flow.h (struct bb_ann_d): Remove num_preds member.
> * tree-into-ssa.c (rewrite_into_ssa): Don't set it.
> (rewrite_ssa_into_ssa): Likewise.
> * tree-phinodes.c (create_phi_node): Access the number of
> predecessor edges using EDGE_COUNT() and not num_preds.
Cool.
Probably the next thing to figure out is how to map between
incoming edges and phi node elements.
One possibility would be to record the index of each edge in its
pred/succ vectors. So given an edge E, we can get the PHI arguments
associated with that edge from PHI_ARG_DEF (phi, E->pred_index). At
first glance I tend to lean this direction, though I don't
particularly like the idea of enlarging the edge structure and
keeping the indices up-to-date.
Another would be to keep edges in the array in some well defined
order and use a binary search instead of a linear search.
Hopefully others have already thought through this problem enough to
provide better and more concrete suggestions.
jeff