public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/102059] Incorrect always_inline diagnostic in LTO mode with #pragma GCC target("cpu=power10")
Date: Wed, 05 Jan 2022 03:26:09 +0000	[thread overview]
Message-ID: <bug-102059-4-chcpyc90qU@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102059-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #26 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Kewen Lin <linkw@gcc.gnu.org>:

https://gcc.gnu.org/g:0fc60c183358be2f2003b94226ab49e21c585b13

commit r12-6219-g0fc60c183358be2f2003b94226ab49e21c585b13
Author: Kewen Lin <linkw@linux.ibm.com>
Date:   Tue Jan 4 20:27:18 2022 -0600

    ipa-inline: Add target info into fn summary [PR102059]

    Power ISA 2.07 (Power8) introduces transactional memory
    feature but ISA3.1 (Power10) removes it.  It exposes one
    troublesome issue as PR102059 shows.  Users define some
    function with target pragma cpu=power10 then it calls one
    function with attribute always_inline which inherits
    command line option -mcpu=power8 which enables HTM
    implicitly.  The current isa_flags check doesn't allow this
    inlining due to "target specific option mismatch" and error
    mesasge is emitted.

    Normally, the callee function isn't intended to exploit HTM
    feature, but the default flag setting make it look it has.
    As Richi raised in the PR, we have fp_expressions flag in
    function summary, and allow us to check the function
    actually contains any floating point expressions to avoid
    overkill.  So this patch follows the similar idea but is
    more target specific, for this rs6000 port specific
    requirement on HTM feature check, we would like to check
    rs6000 specific HTM built-in functions and inline assembly,
    it allows targets to do their own customized checks and
    updates.

    It introduces two target hooks need_ipa_fn_target_info and
    update_ipa_fn_target_info.  The former allows target to do
    some previous check and decides to collect target specific
    information for this function or not.  For some special
    case, it can predict the analysis result and set it early
    without any scannings.  The latter allows the
    analyze_function_body to pass gimple stmts down just like
    fp_expressions handlings, target can do its own tricks.
    I put them together as one hook initially with one boolean
    to indicate whether it's initial time, but the code looks a
    bit ugly, to separate them seems to have better readability.

    gcc/ChangeLog:

            PR ipa/102059
            * config/rs6000/rs6000.c (TARGET_NEED_IPA_FN_TARGET_INFO): New
macro.
            (TARGET_UPDATE_IPA_FN_TARGET_INFO): Likewise.
            (rs6000_need_ipa_fn_target_info): New function.
            (rs6000_update_ipa_fn_target_info): Likewise.
            (rs6000_can_inline_p): Adjust for ipa function summary target info.
            * config/rs6000/rs6000.h (RS6000_FN_TARGET_INFO_HTM): New macro.
            * ipa-fnsummary.c (ipa_dump_fn_summary): Adjust for ipa function
            summary target info.
            (analyze_function_body): Adjust for ipa function summary target
info
            and call hook rs6000_need_ipa_fn_target_info and
            rs6000_update_ipa_fn_target_info.
            (ipa_merge_fn_summary_after_inlining): Adjust for ipa function
summary
            target info.
            (inline_read_section): Likewise.
            (ipa_fn_summary_write): Likewise.
            * ipa-fnsummary.h (ipa_fn_summary::target_info): New member.
            * doc/tm.texi: Regenerate.
            * doc/tm.texi.in (TARGET_UPDATE_IPA_FN_TARGET_INFO): Document new
hook.
            (TARGET_NEED_IPA_FN_TARGET_INFO): Likewise.
            * target.def (update_ipa_fn_target_info): New hook.
            (need_ipa_fn_target_info): Likewise.
            * targhooks.c (default_need_ipa_fn_target_info): New function.
            (default_update_ipa_fn_target_info): Likewise.
            * targhooks.h (default_update_ipa_fn_target_info): New declare.
            (default_need_ipa_fn_target_info): Likewise.

    gcc/testsuite/ChangeLog:

            PR ipa/102059
            * gcc.dg/lto/pr102059-1_0.c: New test.
            * gcc.dg/lto/pr102059-1_1.c: New test.
            * gcc.dg/lto/pr102059-1_2.c: New test.
            * gcc.dg/lto/pr102059-2_0.c: New test.
            * gcc.dg/lto/pr102059-2_1.c: New test.
            * gcc.dg/lto/pr102059-2_2.c: New test.
            * gcc.target/powerpc/pr102059-1.c: New test.
            * gcc.target/powerpc/pr102059-2.c: New test.
            * gcc.target/powerpc/pr102059-3.c: New test.

  parent reply	other threads:[~2022-01-05  3:26 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  9:42 [Bug lto/102059] New: " fw at gcc dot gnu.org
2021-08-25  9:49 ` [Bug ipa/102059] " rguenth at gcc dot gnu.org
2021-08-25  9:54 ` marxin at gcc dot gnu.org
2021-08-25 11:49 ` chip.kerchner at ibm dot com
2021-08-25 13:25 ` marxin at gcc dot gnu.org
2021-08-25 13:30 ` marxin at gcc dot gnu.org
2021-08-25 13:34 ` marxin at gcc dot gnu.org
2021-08-25 13:44 ` marxin at gcc dot gnu.org
2021-08-25 15:34 ` linkw at gcc dot gnu.org
2021-08-26  6:26 ` linkw at gcc dot gnu.org
2021-08-26  8:20 ` rguenth at gcc dot gnu.org
2021-08-26  8:24 ` rguenth at gcc dot gnu.org
2021-08-26  8:34 ` fw at gcc dot gnu.org
2021-08-26  8:45 ` linkw at gcc dot gnu.org
2021-08-26  8:56 ` linkw at gcc dot gnu.org
2021-08-26  9:02 ` linkw at gcc dot gnu.org
2021-08-26  9:04 ` marxin at gcc dot gnu.org
2021-08-26  9:29 ` linkw at gcc dot gnu.org
2021-08-26  9:34 ` linkw at gcc dot gnu.org
2021-08-26 18:46 ` meissner at gcc dot gnu.org
2021-09-01  7:10 ` linkw at gcc dot gnu.org
2021-09-14 14:09 ` chip.kerchner at ibm dot com
2021-09-14 14:11 ` chip.kerchner at ibm dot com
2021-09-15  9:57 ` linkw at gcc dot gnu.org
2021-09-15 12:19 ` chip.kerchner at ibm dot com
2021-11-26  2:07 ` linkw at gcc dot gnu.org
2022-01-05  3:26 ` cvs-commit at gcc dot gnu.org [this message]
2022-02-04 18:55 ` pc at gcc dot gnu.org
2022-02-04 19:33 ` dan at danny dot cz
2022-02-04 20:15 ` bergner at gcc dot gnu.org
2022-02-05  2:50 ` linkw at gcc dot gnu.org
2022-02-08 21:53 ` meissner at gcc dot gnu.org
2022-02-09  2:33 ` linkw at gcc dot gnu.org
2022-02-09  3:20 ` linkw at gcc dot gnu.org
2022-02-09  7:21 ` rguenth at gcc dot gnu.org
2022-02-09  7:35 ` linkw at gcc dot gnu.org
2022-03-15  6:38 ` linkw at gcc dot gnu.org
2022-05-05 18:14 ` bergner at gcc dot gnu.org
2022-05-06 16:41 ` cvs-commit at gcc dot gnu.org
2022-05-06 19:03 ` cvs-commit at gcc dot gnu.org
2022-05-06 21:45 ` cvs-commit at gcc dot gnu.org
2022-05-19 21:20 ` cvs-commit at gcc dot gnu.org
2022-05-19 21:25 ` bergner at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-102059-4-chcpyc90qU@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).