This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] CFG hooks for rtl/tree specificities
> On Tue, Apr 01, 2003 at 05:46:07PM +0200, Jan Hubicka wrote:
> >
> > This looks nice.
> > It would be interesting to think about what operations do we really need
> > - for instance split_edge should be probably implementable already via
> > the primitive operations (basic block creation, edge redirection). Our
>
> Yes, the split_edge function is trivially implemented at the tree level:
>
> basic_block
> tree_split_edge (edge_in)
> edge edge_in;
> {
> basic_block new_bb, dest;
>
> /* Abnormal edges cannot be split. */
> if (edge_in->flags & EDGE_ABNORMAL)
> abort ();
>
> dest = edge_in->dest;
> new_bb = create_bb ();
> redirect_edge_succ (edge_in, new_bb);
> make_edge (new_bb, dest, EDGE_FALLTHRU);
> return new_bb;
> }
>
> except "create_bb" all the other functions are CFG generic, making the split_edge
> a good candidate for the CFG API. At RTL level the split_edge function deals
> with insns at this moment.
Yes, the generic implementation would have to deal with idea of
linearized RTL chain (so know what to do about fallthru edges and so
on). Lets leave it hooked for now.
Honza
>
> > current API is not 100% ready for that so we will probably need cleanup
> > on the way.
> >
> > I would be happy about switching to the hooks first and leaving it to me
> > to cleanup the APIs if you preffer.
> >
> Yes, thanks.
>
> Sebastian