public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/103388] [12 Regression] missed optimization for dead code elimination at -O3 (trunk vs 11.2.0)
Date: Tue, 18 Jan 2022 14:24:42 +0000	[thread overview]
Message-ID: <bug-103388-4-KSrSdFoM4O@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103388-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2021-11-23 00:00:00         |2022-1-18
             Status|NEW                         |ASSIGNED

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Re-confirmed.(In reply to Jeffrey A. Law from comment #3)
> So to fix this right we'd need to duplicate some of the logic in
> tree-ssa-threadupdate.c.  Conceptually for block B where one or more
> predecessors thread to target T, you make a single copy B', and redirect
> *all* the relevant predecessors to B'.
> 
> In addition to allowing more aggressive threading, it would also reduce
> codesize since currently we'll end up with multiple copies of B'.  We have
> optimizers that are supposed to clean that up, but I've never seen them do a
> particularly good job.
> 
> This isn't likely to land in gcc-12.
> 
> An interim approach might be to go ahead and register the thread and only
> reject it for size later if we're going to end up with multiple copies. 
> After all this is a cost analysis question and we don't know until all the
> paths are registered if it's profitable or not.

So I think at least this should be possible, no?  Also why do we need to
do extra limitation?  We should end up accounting for B's size N times
without the optimization so the costing is still accurate, no?

So IMHO the scaling factors do not make much sense to me, they were introduced
to fix PR68398.

We need --param fsm-scale-path-stmts=1 to get the desired threading done.

  parent reply	other threads:[~2022-01-18 14:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 18:21 [Bug tree-optimization/103388] New: [12 Regression] missed optimization for dead code elimination at -O3 (vs. -O2) theodort at inf dot ethz.ch
2021-11-23 19:19 ` [Bug tree-optimization/103388] " aldyh at gcc dot gnu.org
2021-11-23 19:31 ` aldyh at gcc dot gnu.org
2021-11-23 23:18 ` law at gcc dot gnu.org
2021-11-24  8:50 ` [Bug tree-optimization/103388] [12 Regression] missed optimization for dead code elimination at -O3 (trunk vs 11.2.0) rguenth at gcc dot gnu.org
2022-01-18 14:24 ` rguenth at gcc dot gnu.org [this message]
2022-01-18 15:28 ` law at gcc dot gnu.org
2022-05-06  8:31 ` [Bug tree-optimization/103388] [12/13 " jakub at gcc dot gnu.org
2022-07-26 13:09 ` rguenth at gcc dot gnu.org
2023-05-08 12:23 ` [Bug tree-optimization/103388] [12/13/14 " rguenth 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-103388-4-KSrSdFoM4O@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).