public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/103454] New: -finline-functions-called-once is both compile-time and runtime loss at average for spec2006, spec2017 and tramp3d
@ 2021-11-28  8:25 hubicka at gcc dot gnu.org
  2021-11-29  8:50 ` [Bug middle-end/103454] " marxin at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-11-28  8:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103454

            Bug ID: 103454
           Summary: -finline-functions-called-once is both compile-time
                    and runtime loss at average for spec2006, spec2017 and
                    tramp3d
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org
  Target Milestone: ---

Looking into exchange2 performance I run benchmarks with
-fno-inline-functions-called-once.  It seems we do have important regressions
here.

The following compares default flags (base) and run with additional
-fno-inline-functions-called-once
https://lnt.opensuse.org/db_default/v4/CPP/latest_runs_report?younger_in_days=14&older_in_days=0&all_changes=on&min_percentage_change=0.01&revisions=c53447034965e4191a8738f045a3c7d1552d5f59%2C67b183fac7b08067fdd3c09abd3efd2691083395&include_user_branches=on

https://lnt.opensuse.org/db_default/v4/SPEC/latest_runs_report?younger_in_days=14&older_in_days=0&all_changes=on&min_percentage_change=0.01&revisions=c53447034965e4191a8738f045a3c7d1552d5f59%2C67b183fac7b08067fdd3c09abd3efd2691083395&include_user_branches=on

Large differences are

default flags wins
 - fatigue2 with both -O2 and -Ofast inlining 40%

-fno-inline-functions-called-once wins:
 - tramp3d with -Ofast. 31%
 - exchange2 with -Ofast 11-21%
 - specfp2006 total build time 41% (mostly wrf that builds 71% faster)
 - specint2005 total about 1.5-3%
 - specfp2017 total 64% (again mostly wrf)
 - specint2017 total 2.5-3.5%

Once more tests are run I can make better summary.  It is couple releases since
I benchmarked -fno-inline-functions-called-once so I am not quite sure how long
we have the problem.

For exchange2 the problem is inlining different clones of digits2 into each
other. Each clone of digits2 has 9 nested loop and calls the other clone from
innermost one.  I guess we may want to have loop depth limit on inlining once
and also have its own specific large-functions-insns and growth (in particular,
I think the growth wants to be smaller, like say 10% instead of letting
function grow twice).

It also shows however that we have problems in middle-end both in scalability
and code quality on large CFGs which are probably quite important (and anoying)
to track down.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug middle-end/103454] -finline-functions-called-once is both compile-time and runtime loss at average for spec2006, spec2017 and tramp3d
  2021-11-28  8:25 [Bug middle-end/103454] New: -finline-functions-called-once is both compile-time and runtime loss at average for spec2006, spec2017 and tramp3d hubicka at gcc dot gnu.org
@ 2021-11-29  8:50 ` marxin at gcc dot gnu.org
  2021-12-09 20:03 ` cvs-commit at gcc dot gnu.org
  2021-12-10 11:48 ` hubicka at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-11-29  8:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103454

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-11-29
     Ever confirmed|0                           |1
                 CC|                            |marxin at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug middle-end/103454] -finline-functions-called-once is both compile-time and runtime loss at average for spec2006, spec2017 and tramp3d
  2021-11-28  8:25 [Bug middle-end/103454] New: -finline-functions-called-once is both compile-time and runtime loss at average for spec2006, spec2017 and tramp3d hubicka at gcc dot gnu.org
  2021-11-29  8:50 ` [Bug middle-end/103454] " marxin at gcc dot gnu.org
@ 2021-12-09 20:03 ` cvs-commit at gcc dot gnu.org
  2021-12-10 11:48 ` hubicka at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-12-09 20:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103454

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jan Hubicka <hubicka@gcc.gnu.org>:

https://gcc.gnu.org/g:f157c5362b4844f7676cae2aba81a4cf75bd68d5

commit r12-5872-gf157c5362b4844f7676cae2aba81a4cf75bd68d5
Author: Jan Hubicka <jh@suse.cz>
Date:   Thu Dec 9 21:02:17 2021 +0100

    Limit inlining functions called once

    as dicussed in PR ipa/103454 there are several benchmarks that regresses
    for -finline-functions-called once. Runtmes:
     - tramp3d with -Ofast. 31%
     - exchange2 with -Ofast 11-21%
     - roms O2 9%-10%
     - tonto 2.5-3.5% with LTO
    Build times:
     - specfp2006 41% (mostly wrf that builds 71% faster)
     - specint2006 1.5-3%
     - specfp2017 64% (again mostly wrf)
     - specint2017 2.5-3.5%

    This patch adds two params to tweak the behaviour:
     1) max-inline-functions-called-once-loop-depth limiting the loop depth
        (this is useful primarily for exchange where the inlined function is in
         loop depth 9)
     2) max-inline-functions-called-once-insns
        We already have large-function-insns/growth parameters, but these are
        limiting also inlining small functions, so reducing them will regress
        very large functions that are hot.

        Because inlining functions called once is meant just as a cleanup pass
        I think it makes sense to have separate limit for it.
    gcc/ChangeLog:

    2021-12-09  Jan Hubicka  <hubicka@ucw.cz>

            * doc/invoke.texi (max-inline-functions-called-once-loop-depth,
            max-inline-functions-called-once-insns): New parameters.
            * ipa-inline.c (check_callers): Handle
            param_inline_functions_called_once_loop_depth and
            param_inline_functions_called_once_insns.
            (edge_badness): Fix linebreaks.
            * params.opt (param=max-inline-functions-called-once-loop-depth,
            param=max-inline-functions-called-once-insn): New params.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug middle-end/103454] -finline-functions-called-once is both compile-time and runtime loss at average for spec2006, spec2017 and tramp3d
  2021-11-28  8:25 [Bug middle-end/103454] New: -finline-functions-called-once is both compile-time and runtime loss at average for spec2006, spec2017 and tramp3d hubicka at gcc dot gnu.org
  2021-11-29  8:50 ` [Bug middle-end/103454] " marxin at gcc dot gnu.org
  2021-12-09 20:03 ` cvs-commit at gcc dot gnu.org
@ 2021-12-10 11:48 ` hubicka at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: hubicka at gcc dot gnu.org @ 2021-12-10 11:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103454

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |103585

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
With g:r12-5872-gf157c5362b4844f7676cae2aba81a4cf75bd68d5 exchange runtime and
wrf build time problems are solved.
The parameter is pushed up by fatigue2 benchmarks, I opened separate PR103585
for this


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103585
[Bug 103585] fatigue2 requires inlining of peridida to work well

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-10 11:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-28  8:25 [Bug middle-end/103454] New: -finline-functions-called-once is both compile-time and runtime loss at average for spec2006, spec2017 and tramp3d hubicka at gcc dot gnu.org
2021-11-29  8:50 ` [Bug middle-end/103454] " marxin at gcc dot gnu.org
2021-12-09 20:03 ` cvs-commit at gcc dot gnu.org
2021-12-10 11:48 ` hubicka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).