public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "law 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 (vs. -O2)
Date: Tue, 23 Nov 2021 23:18:11 +0000	[thread overview]
Message-ID: <bug-103388-4-32sCgmixX6@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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |law at gcc dot gnu.org

--- Comment #3 from Jeffrey A. Law <law at gcc dot gnu.org> ---
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.

Anyway, it should probably be assigned to me.  Not sure if I'll get to the
interim approach or not for gcc-12.  I'll have to poke around a bit.

  parent reply	other threads:[~2021-11-23 23:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-23 18:21 [Bug tree-optimization/103388] New: " 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 [this message]
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
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-32sCgmixX6@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).