This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFA] new code size estimation for inlining
- From: Jan Hubicka <jh at suse dot cz>
- To: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- Cc: Jan Hubicka <jh at suse dot cz>, pfeifer at dbai dot tuwien dot ac dot at,rth at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: Wed, 2 Jul 2003 13:10:21 +0200
- Subject: Re: [RFA] new code size estimation for inlining
- References: <20030630205631.GD10852@kam.mff.cuni.cz> <1057104363.21407.19.camel@steven.lr-s.tudelft.nl>
> > + /* 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
>