public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "yinyuefengyi at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/108351] [13 Regression] Dead Code Elimination Regression at -O3 since r13-4240-gfeeb0d68f1c708
Date: Wed, 15 Feb 2023 09:09:37 +0000	[thread overview]
Message-ID: <bug-108351-4-ah6bFEyv7K@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108351-4@http.gcc.gnu.org/bugzilla/>

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

Xionghu Luo (luoxhu at gcc dot gnu.org) <yinyuefengyi at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yinyuefengyi at gmail dot com

--- Comment #3 from Xionghu Luo (luoxhu at gcc dot gnu.org) <yinyuefengyi at gmail dot com> ---
(In reply to Andrew Pinski from comment #2)
> I noticed that with the C++ front-end early inline inlines f into main but
> with the C front-end it does not ...

C++ generates different call instructions with C front-end:

<   D.3747 = f (7, 7);
<   D.3748 = f (9, 7);
---
>   f (7, 7);
>   f (9, 7);


then an extra return_cost cost is added to C++ front-end:

<   D.3747 = f (7, 7);
<               freq:1.00 size:  4 time: 13
<   D.3748 = f (9, 7);
<               freq:1.00 size:  4 time: 13
---
>   f (7, 7);
>               freq:1.00 size:  3 time: 12
>   f (9, 7);
>               freq:1.00 size:  3 time: 12


early inline pass inlines the two calls with C front-end but fails to inline
them with C++ front-end due to "growth 8 exceeds --param early-inlining-insns 
divided by number of calls". 

gcc/ipa-inline.cc:747    growth * (n + 1) > early_inlining_insns

gcc/opts.cc:687    { OPT_LEVELS_3_PLUS, OPT__param_early_inlining_insns_, NULL,
14 },


Tried revert the commit r13-4240-gfeeb0d68f1c708, the two calls still exits,
need also revert the commit r13-4686-g095a13eda2caf6.
(r13-4686 mentioned IPA-SRA detects whether parameters could be removed,
obviously it doesn't work well now if constants are not propagated before
IPA-SRA, it seems that the IPA-SRA only remove locally_unused parameters but
'm' is not locally used and the constants from caller are not visible in
IPA-SRA?)

  parent reply	other threads:[~2023-02-15  9:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 11:46 [Bug tree-optimization/108351] New: Dead Code Elimination Regression at -O3 (trunk vs. 12.2.0) yann at ywg dot ch
2023-01-10 12:10 ` [Bug tree-optimization/108351] [13 Regression] " rguenth at gcc dot gnu.org
2023-01-10 14:41 ` [Bug tree-optimization/108351] [13 Regression] Dead Code Elimination Regression at -O3 since r13-4240-gfeeb0d68f1c708 marxin at gcc dot gnu.org
2023-01-10 22:48 ` pinskia at gcc dot gnu.org
2023-02-15  9:09 ` yinyuefengyi at gmail dot com [this message]
2023-02-15  9:15 ` yinyuefengyi at gmail dot com
2023-02-17 12:52 ` jamborm at gcc dot gnu.org
2023-04-08 14:38 ` law at gcc dot gnu.org
2023-04-26  6:57 ` [Bug tree-optimization/108351] [13/14 " rguenth at gcc dot gnu.org
2023-07-27  9:25 ` rguenth at gcc dot gnu.org
2023-11-24 12:43 ` sjames at gcc dot gnu.org
2023-11-24 14:56 ` yann at ywg dot ch
2023-11-24 15:47 ` jamborm 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-108351-4-ah6bFEyv7K@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).