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: [PATCH] Improve inlining heuristics via estimate_num_insns


On Thu, 24 Feb 2005 23:54:08 +0100, Richard Guenther
<rguenth@tat.physik.uni-tuebingen.de> wrote:
> Hi!
> 
> This patch improves inlining heuristics by tweaking estimate_num_insns
> to return numbers that
>    1. are more close to those of gcc 3.4
>    2. do not penaltize abstraction.  I.e. the size estimate results in
>         inline int foo(int x) { return x*x; }
>         int bar(int x) { return foo(x); }
>       having the same sizes (actually 1) if foo is inlined in bar.
> 
> See http://gcc.gnu.org/ml/gcc/2005-02/msg00981.html for more comparisons
> with gcc 3.4 and unpatched gcc 4.0.

I made another exmeriment, compiling current mainine with 3.4, 4.0 and
4.0 patched
and compare all the sizes from the cgraph dump file.  The result
(sorted after 3.4 size)
can be viewed at
http://www.tat.physik.uni-tuebingen.de/~rguenth/gcc/size.png
The red line is the size estimate of 3.4, the green dots are the size
estimates of 4.0
and the blue dots are the new size estimate with the patch.  The new one is less
noisy and more close to the 3.4 behavior.  Also the overall size
estimate for mostly
C sources is slightly below that of 3.4.

Richard.


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