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


Hello,

> > > keeping the indices up-to-date.
> > 
> > This in fact is pretty straightforward -- we have only a few functions
> > that modify the edges directly (from what I remember from the time I
> > wrote the patch to implement this, actually only some 3 or 4 functions
> > needed to be changed).
> > 
> > Also it is quite simple to check that nothing goes wrong (the indices
> > can be verified in verify_cfg and failure to keep edges and arguments
> > of phi nodes in sync almost surely leads to failure in verify_ssa,
> > or if you want to be more thorough, you can still have edges recorded
> > in phi arguments with ENABLE_CHECKING).
> > 
> I do not see why you need any explicit connection between the phi data
> structure and the in-edge data structure. 
> 
> I would suggest that you change to the current linked list
> representation of the in-edges to use exactly the same vector
> representation that you use for the phi-function edges.  This way the
> index of the phi function operand becomes the index into the in-edge
> and vica-versa.
> 
> Since it makes no sense to add or delete operands without doing the
> same to the edges, they should stay in sync as long as the phi operands
> are created properly initially.  
> 
> This will centainly be the most space and time efficient, since there
> are no explicit cross connections to maintain or index thru.

you still need to know the index of the edge in the vector, so that you
are able to find argument on an edge in O(1) (which is basically what
we are arguing about here).

Zdenek


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