This is the mail archive of the 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: [PATCH] New code size estimate

On Mon, 28 Feb 2005, Richard Guenther wrote:

> On Mon, 28 Feb 2005, Steven Bosscher wrote:
> > Ref:
> >
> > > 	* 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 Guenther <richard dot guenther at uni-tuebingen dot de>

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