[Bug ipa/97445] Some fonctions marked static inline in Linux kernel are not inlined

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 21 18:01:33 GMT 2020


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

--- Comment #50 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:caaa218f912ccf932fdb79243ded68bb462bbe63

commit r11-4192-gcaaa218f912ccf932fdb79243ded68bb462bbe63
Author: Jan Hubicka <jh@suse.cz>
Date:   Wed Oct 21 20:00:22 2020 +0200

    Inline functions with builtin_constant_p more agressively.

    This patch implements heuristics that increases inline limits (by the hints
    mechanism) for inline functions that use builtin_constant_p on parameter.
Those
    are very likely intended to be always inlined and simplify after inlining.

    The PR is about a function that we used to inline with
     --param inline-insns-single=200 but with new default of 70 for -O2 we no
longer
    do so.  Hints are currently configured to bump the bound up twice, so we
    get limit of 140 that is still not enough to inline the particular testcase
    but it should help in general.  I can implement a stronger bump if that
seems
    useful (maybe it is). The example is bit operation written as a decision
chain
    with 64 conditions.
    This blows up the limit on number of conditions we track per funtion (which
is
    30) and thus the size/time estimates are not working that well.

    gcc/ChangeLog:

            PR ipa/97445
            * ipa-fnsummary.c (ipa_dump_hints): Add
INLINE_HINT_builtin_constant_p.
            (ipa_fn_summary::~ipa_fn_summary): Free builtin_constant_p_parms.
            (ipa_fn_summary_t::duplicate): Duplicate builtin_constant_p_parms.
            (ipa_dump_fn_summary): Dump builtin_constant_p_parms.
            (add_builtin_constant_p_parm): New function
            (set_cond_stmt_execution_predicate): Update
builtin_constant_p_parms.
            (ipa_call_context::estimate_size_and_time): Set
            INLINE_HINT_builtin_constant_p..
            (ipa_merge_fn_summary_after_inlining): Merge
builtin_constant_p_parms.
            (inline_read_section): Read builtin_constant_p_parms.
            (ipa_fn_summary_write): Write builtin_constant_p_parms.
            * ipa-fnsummary.h (enum ipa_hints_vals): Add
            INLINE_HINT_builtin_constant_p.
            * ipa-inline.c (want_inline_small_function_p): Use
            INLINE_HINT_builtin_constant_p.
            (edge_badness): Use INLINE_HINT_builtin_constant_p.

    gcc/testsuite/ChangeLog:

            PR ipa/97445
            * gcc.dg/ipa/inlinehint-5.c: New test.


More information about the Gcc-bugs mailing list