This is the mail archive of the gcc-patches@gcc.gnu.org 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]

Re: PATCH: remove bb_ann_d's num_preds field


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



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