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: Andrew MacLeod <amacleod at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: Ben Elliston <bje at au1 dot ibm dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 29 Sep 2004 13:41:05 -0400
- Subject: Re: PATCH: remove bb_ann_d's num_preds field
- References: <87sm915gfd.fsf@au.ibm.com> <1096478890.2825.1063.camel@localhost.localdomain>
On Wed, 2004-09-29 at 13:28, Jeffrey A Law wrote:
> On Wed, 2004-09-29 at 07:54, Ben Elliston wrote:
> 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.
For the immediate_uses stuff, I need to attach more use info to the PHI
arguments. In doing so, we could also put each phi argument into a
linked list hung off the edge. Given an edge, you could find all phi
arguments associated with it. Given a phi argument, you could either
traverse the list to the edge node, or alternatively keep a pointer to
the edge. More memory of course.
The list off the edge has some very nice properties for removing edges
or PHI nodes, but I havent gone down this path to actually implement it
yet. It might not be so pleasant for other endevours.
Andrew