[RFC] Early inlining pass

Jan Hubicka jh@suse.cz
Wed Jun 1 11:55:00 GMT 2005


> On 6/1/05, Jan Hubicka <jh@suse.cz> wrote:
> 
> > + /* Rebuild call edges from current function after a passes not aware
> > +    of cgraph updating.  */
> > + static void
> > + rebuild_cgraph_edges (void)
> > + {
> > +   basic_block bb;
> > +   struct cgraph_node *node = cgraph_node (current_function_decl);
> > +   block_stmt_iterator bsi;
> > +
> > +   while (node->callees)
> > +     cgraph_remove_edge (node->callees);
> 
> cgraph_node_remove_callees (node);
Fixed in my copy of patch.
> 
> 
> > Index: ipa-inline.c
> > ===================================================================
> > RCS file: /cvs/gcc/gcc/gcc/ipa-inline.c,v
> > retrieving revision 2.7
> > diff -c -3 -p -r2.7 ipa-inline.c
> > *** ipa-inline.c        29 May 2005 19:38:32 -0000      2.7
> > --- ipa-inline.c        31 May 2005 22:57:39 -0000
> > *************** Software Foundation, 59 Temple Place - S
> > *** 79,84 ****
> > --- 79,85 ----
> >   #include "intl.h"
> >   #include "tree-pass.h"
> >   #include "coverage.h"
> > + #include "ggc.h"
> > 
> >   /* Statistics we collect about inlining algorithm.  */
> >   static int ncalls_inlined;
> > *************** cgraph_decide_inlining (void)
> > *** 876,885 ****
> >   /* Decide on the inlining.  We do so in the topological order to avoid
> >      expenses on updating data structures.  */
> > 
> > ! void
> > ! cgraph_decide_inlining_incrementally (struct cgraph_node *node)
> >   {
> >     struct cgraph_edge *e;
> > 
> >     /* First of all look for always inline functions.  */
> >     for (e = node->callees; e; e = e->next_callee)
> > --- 877,887 ----
> >   /* Decide on the inlining.  We do so in the topological order to avoid
> >      expenses on updating data structures.  */
> > 
> > ! bool
> > ! cgraph_decide_inlining_incrementally (struct cgraph_node *node, bool early)
> 
> Instead of adding an extra parameter, for clarity just split the
> function into two?

I would preffer to not have all the logic in function duplicated...

Honza
> 
> Richard.



More information about the Gcc-patches mailing list