public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "aldyh at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/102895] [12 Regression] Dead Code Elimination Regression at -O3 (trunk vs 11.2.0)
Date: Sat, 30 Oct 2021 18:08:07 +0000	[thread overview]
Message-ID: <bug-102895-4-Ng3U80mbuQ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102895-4@http.gcc.gnu.org/bugzilla/>

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

Aldy Hernandez <aldyh at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE
                 CC|                            |law at gcc dot gnu.org,
                   |                            |matz at gcc dot gnu.org

--- Comment #3 from Aldy Hernandez <aldyh at gcc dot gnu.org> ---
This is *almost* a duplicate of PR102981.

Here we have the same scenario: the first iteration of a loop has unreachable
code.  But interestingly, the IL is sufficiently simple that DOM3 (post
loopdone) can see the threading opportunity:

a.c.192t.dom3:  [3] Registering jump thread: (2, 3) incoming edge;  (3, 4)
normal;

but... there's some limitation in the custom block copier the old forward
threader uses:

a.c.192t.dom3:Failure in thread_through_loop_header:   Cancelling jump thread:
(2, 3) incoming edge;  (3, 4) normal;

Again, the backward threader will refuse to thread this, regardless of
loopdone, because it is essentially peeling off the first iteration of a loop. 
This is the main issue we should address, regardless of DOM's limitation.

I'm going to mark this as a duplicate, because I doubt anyone has the
inclination of fixing the old forward threader's copier.

[FWIW, this supersedes the previous comment I made for this PR, as the threader
pipeline has changed in trunk.]

*** This bug has been marked as a duplicate of bug 102981 ***

      parent reply	other threads:[~2021-10-30 18:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22  9:49 [Bug tree-optimization/102895] New: " theodort at inf dot ethz.ch
2021-10-22 10:32 ` [Bug tree-optimization/102895] " rguenth at gcc dot gnu.org
2021-10-22 11:08 ` aldyh at gcc dot gnu.org
2021-10-30 18:08 ` aldyh at gcc dot gnu.org [this message]

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-102895-4-Ng3U80mbuQ@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).