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: [RFA] new code size estimation for inlining


> > + /* Used by estimate_num_insns.  Estimate number of instructions seen
> > +    by given statement.  */
> > + static tree
> > + c_estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
> > + {
> > +   int *count = data;
> > +   tree x = *tp;
> > + 
> > +   if (TYPE_P (x) || DECL_P (x))
> > +     {
> > +       *walk_subtrees = 0;
> > +       return NULL;
> > +     }
> ---- 8< ----
> 
> Hmm...
> This skipping of types and decls is something we could probably do in
> other places to speed up tree walks a bit.  Or maybe even add a flag to
> walk_tree to ignore types/decls???

Hmm, perhaps.  The types are quite complex nodes.  In this case it is
correctness issue tought.  complexity of types used does not matter :)
> 
> 
> > diff -Nrc3p gcc.orig/langhooks.h gcc/langhooks.h
> > *** gcc.orig/langhooks.h	Mon Jun 30 22:49:23 2003
> > --- gcc/langhooks.h	Mon Jun 30 23:14:36 2003
> > *************** struct lang_hooks_for_tree_inlining
> > *** 56,61 ****
> > --- 56,62 ----
> >     union tree_node *(*convert_parm_for_inlining) PARAMS ((union tree_node *,
> >   							 union tree_node *,
> >   							 union tree_node *));
> > +   int (*estimate_num_insns) PARAMS ((union tree_node *));
> >   };
> >   
> >   struct lang_hooks_for_callgraph
> 
> Please use "tree" instead of "tree_node *" here.  I still have a
> patch[1] waiting for approval to remove all those pointless uses of
> "tree_node", "rtx_dev *" and "rtvec_dev *", don't add new ones please. 
> It is totally unnecessary since the introduction of coretypes.h (and in
> fact "rtx" and "tree" are already used in other places in langhooks.h,
> so apparently it even works ;-)
OK, I can change all of them afterwards too.

Honza
> 
> Gr.
> Steven
> 
> 
> [1] http://gcc.gnu.org/ml/gcc-patches/2003-06/msg02320.html
> 


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