This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improve inlining heuristics via estimate_num_insns
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 25 Feb 2005 15:39:32 +0100
- Subject: Re: [PATCH] Improve inlining heuristics via estimate_num_insns
- References: <421E5B10.2050805@tat.physik.uni-tuebingen.de>
- Reply-to: Richard Guenther <richard dot guenther at gmail dot com>
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.