This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] New code size estimate
- From: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- To: Steven Bosscher <stevenb at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 28 Feb 2005 15:55:49 +0100 (CET)
- Subject: Re: [PATCH] New code size estimate
On Mon, 28 Feb 2005, Richard Guenther wrote:
> On Mon, 28 Feb 2005, Steven Bosscher wrote:
>
> > Ref: http://gcc.gnu.org/ml/gcc-patches/2005-02/msg01796.html
> >
> > > * tree-inline.c (estimate_num_insns_1): Ignore stores to decls with
> > > ignored flag set.
> >
> > Someone still has to explain why this makes sense. All large
> > expressions will now suddenly look really small, if I understand
> > this change correctly. For example, say you have,
[...]
> free, as is the use of constants. That could be changed to
> only make uses of DECL_IGNORED variables free - i.e. account
> for a variable load at least once. Note that we still walk
I experimented with this, but with this we loose the property
that the following functions have the same size after inlining:
inline int foo(int x) { return x; }
int bar(int x) { return foo(x); }
which is such a nice and sensible property.
I guess doing better than the patch posted is only possible by
re-counting after inlining and at least some trivial optimization
passes like CCP, DCE and FRE.
Richard.
--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/