This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Inliner badness metric tweak
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 30 Mar 2015 11:25:50 +0200
- Subject: Re: Inliner badness metric tweak
- Authentication-results: sourceware.org; auth=none
- References: <20150330014542 dot GC10552 at kam dot mff dot cuni dot cz>
On Mon, Mar 30, 2015 at 3:45 AM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> this patch makes inline metric to be
> estimate_speedup
> ---------------------------- (over)
> edge_growth^2*overall_growth
>
> This is intended to make stronger push on inliner to preffer functions with
> smaller growth and do not take overall growth (that is expected unit growth
> after inlining all calls to a give function) so seriously.
>
> This solve code size regression for tramp3d and also improve DLV. I tested it
> on firefox with resonable results and on subset of SPEC that caused inliner
> issues in past.
>
> Lacking access to SUSE's periodic testers, I intend to commit it today and
> watch them for possible regressions.
>
> Bootstrapped/regtested x86_64-linux.
>
> PR ipa/65076
> * ipa-inline.c (edge_badness): Base denominator on callee's
> grwoth squared.
>
> Index: ipa-inline.c
> ===================================================================
> --- ipa-inline.c (revision 221757)
> +++ ipa-inline.c (working copy)
> @@ -1099,7 +1099,7 @@ edge_badness (struct cgraph_edge *edge,
> numerator = numerator >> 11;
> denominator = growth;
> if (callee_info->growth > 0)
> - denominator *= callee_info->growth;
> + denominator *= callee_info->growth * callee_info->growth;
For sure a comment explaining this would be good ...
> badness = - numerator / denominator;
>