public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: Aldy Hernandez <aldyh@redhat.com>, GCC patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Control all jump threading passes with -fjump-threads.
Date: Tue, 28 Sep 2021 09:41:21 +0200	[thread overview]
Message-ID: <CAFiYyc2cpfamMri35jFcnr_P6c25ZO0f=ckfOLsDANEaSPJ6Vg@mail.gmail.com> (raw)
In-Reply-To: <0c1d857c-6d17-6f91-6aa7-4af1a8391ec8@gmail.com>

On Tue, Sep 28, 2021 at 8:29 AM Jeff Law via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
>
>
> On 9/28/2021 12:17 AM, Aldy Hernandez wrote:
> > On Tue, Sep 28, 2021 at 3:46 AM Jeff Law <jeffreyalaw@gmail.com> wrote:
> >>
> >>
> >> On 9/27/2021 9:00 AM, Aldy Hernandez wrote:
> >>> Last year I mentioned that -fthread-jumps was being ignored by the
> >>> majority of our jump threading passes, and Jeff said he'd be in favor
> >>> of fixing this.
> >>>
> >>> This patch remedies the situation, but it does change existing behavior.
> >>> Currently -fthread-jumps is only enabled for -O2, -O3, and -Os.  This
> >>> means that even if we restricted all jump threading passes with
> >>> -fthread-jumps, DOM jump threading would still seep through since it
> >>> runs at -O1.
> >>>
> >>> I propose this patch, but it does mean that DOM jump threading would
> >>> have to be explicitly enabled with -O1 -fthread-jumps.  An
> >>> alternative would be to also offer a specific -fno-dom-threading, but
> >>> that seems icky.
> >>>
> >>> OK pending tests?
> >>>
> >>> gcc/ChangeLog:
> >>>
> >>>        * tree-ssa-threadbackward.c (pass_thread_jumps::gate): Check
> >>>        flag_thread_jumps.
> >>>        (pass_early_thread_jumps::gate): Same.
> >>>        * tree-ssa-threadedge.c (jump_threader::thread_outgoing_edges):
> >>>        Return if !flag_thread_jumps.
> >>>        * tree-ssa-threadupdate.c
> >>>        (jt_path_registry::register_jump_thread): Assert that
> >>>        flag_thread_jumps is true.
> >> OK.  Clearly this is going to be even better once we disentangle
> >> threading from DOM.
> > Annoyingly, I had to tweak a few more tests, particularly some
> > -Wuninitialized -O1 ones which seem to depend on DOM jump threading to
> > give proper diagnostics.  It seems that every change to jump threading
> > needs tweaks to the Wuninitialized code :-(.
> Well, a lot of jump threading is there to help eliminate false positives
> from Wuninitialized by eliminating paths through the CFG that we can
> prove never execute at runtime.  SO that's not a huge surprise.

I would have suggested to enable -fthread-jumps at -O1 instead
and eventually just add && flag_expensive_optimizations to the
use in cfgcleanup.c to restrict that to -O2+

Richard.

> jeff

  reply	other threads:[~2021-09-28  7:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-27 15:00 Aldy Hernandez
2021-09-28  1:46 ` Jeff Law
2021-09-28  6:17   ` Aldy Hernandez
2021-09-28  6:28     ` Jeff Law
2021-09-28  7:41       ` Richard Biener [this message]
2021-09-28  9:42         ` Aldy Hernandez
2021-09-28 10:54           ` Richard Biener

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='CAFiYyc2cpfamMri35jFcnr_P6c25ZO0f=ckfOLsDANEaSPJ6Vg@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=aldyh@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    /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).