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: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, Kenneth Zadeck <Kenneth dot Zadeck at NaturalBridge dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 05 Oct 2004 16:52:22 -0600
- Subject: Re: PATCH: remove bb_ann_d's num_preds field
- Organization: Red Hat, Inc
- References: <1096478890.2825.1063.camel@localhost.localdomain> <0I4U00AEG18578@mta9.srv.hcvlny.cv.net> <20040930074121.GA3990@atrey.karlin.mff.cuni.cz> <1096571491.2825.1186.camel@localhost.localdomain> <871xgjrn2e.fsf@au.ibm.com>
- Reply-to: law at redhat dot com
On Fri, 2004-10-01 at 00:04, Ben Elliston wrote:
> Jeffrey A Law <law@redhat.com> writes:
>
> > ie, how often is it the case that we're doing something like
> >
> > FOR_EACH_EDGE (e, ei, bb->succs)
> > FOR_EACH_PHI in e->dest
> > find the argument associated with e
> >
> > vs finding a PHI argument for an arbitrary edge.
> >
> > Or something similar. For the first class of uses we ought to be
> > able to get the index via the FOR_EACH_EDGE code by keeping an index
> > in the iterator. In the second case we'd need an index in the edge
> > itself or something similar.
>
> If I'm understanding you correctly, Jeff, then that is already
> available from edge_iterator's index member:
>
> typedef struct {
> unsigned index;
> VEC(edge) *container;
> } edge_iterator;
Nuts. As Zdenek mentioned, we need the index in the pred list
for the block, not the index in the succ list of the parent.
ie, typically in this case we're doing something like
FOR_EACH_SUCCESSOR_OF_BB
FOR_EACH_PHI_IN_THE_SUCCESSOR
find the argument associated with the edge from BB to SUCCESSOR
Jeff