This is the mail archive of the gcc@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: redirect_edge_and_branch questions


Hello,

> > > Perhaps it would make sense to have function that takes list of
> > > incomming edges to given basic block and create empty basic block before
> > > redirecting the selected edges into it.  This operatinon should be
> > > usefull at least for creating loop preheaders.
> > 
> > and its name is "make_forwarder_block" :-)
> > 
> 
> What do I have to do with the parameter 
>    void (*new_bb_cbk) (basic_block))
> 
> ? Its not documented, and I see where it is used in cfg_loop.c calls
> "update_latch" which allocated aux entries, sets a dominator, etc.  What
> am I suppose to do in there? Can I do nothing or is there a minimum I
> must do? 

new_bb_cbk should be a callback that allows you to do whatever extra
processing you want with the newly created block (the fact that it sets
dominator is slightly wrong from design point of view, it should be done
by make_forwarder_block itself).

> It looks like I don't have to even provide that routine since NULL is
> always returned by tree_redirect_edge_branch_and_force().  Is this true?

On trees yes.

Zdenek


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