public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Aldy Hernandez <aldyh@redhat.com>, GCC patches <gcc-patches@gcc.gnu.org>
Cc: Andrew MacLeod <amacleod@redhat.com>, Martin Sebor <msebor@redhat.com>
Subject: Re: [PATCH] Try to resolve paths in threader without looking further back.
Date: Wed, 20 Oct 2021 14:19:18 -0600	[thread overview]
Message-ID: <be9d89d8-5081-1c89-ed49-3628ea078ef1@gmail.com> (raw)
In-Reply-To: <20211020102816.656714-1-aldyh@redhat.com>



On 10/20/2021 4:28 AM, Aldy Hernandez wrote:
> Sometimes we can solve a candidate path without having to recurse
> further back.  This can mostly happen in fully resolving mode, because
> we can ask the ranger what the range on entry to the path is, but
> there's no reason this can't always apply.  This one-liner removes
> the fully-resolving restriction.
>
> I'm tickled pink to see how many things we now get quite early
> in the compilation.  I actually had to disable jump threading entirely
> for a few tests because the early threader was catching things
> disturbingly early.  Also, as Richi predicted, I saw a lot of pre-VRP
> cleanups happening.
>
> I was going to commit this as obvious, but I think the test changes
> merit discussion.
>
> We've been playing games with gcc.dg/tree-ssa/ssa-thread-11.c for quite
> some time.  Every time a threading pass gets smarter, we push the
> check further down the pipeline.  We've officially run out of dumb
> threading passes to disable ;-).  In the last year we've gone up from a
> handful of threads, to 34 threads with the current combination of
> options.  I doubt this is testing anything useful any more, so I've
> removed it.
>
> Similarly for gcc.dg/tree-ssa/ssa-dom-thread-4.c.  We used to thread 3
> jump threads, but they were disallowed because of loop rotation.  Then
> we started catching more jump threads in VRP2 threading so we tested
> there.  With this patch though, we triple the number of threads found
> from 11 to 31.  I believe this test has outlived its usefulness, and
> I've removed it.  Note that even though we have these outrageous
> possibilities for this test, the block copier ultimately chops them
> down (23 survive though).
>
> Likewise for ssa-dom-thread-7.c.  The number of threads in this test has
> been growing consistently over the years.  There's no way to test
> what is possible, especially because improvements in one threader open
> up possibilities for another.  With this patch we're up to 41 registered
> jump threads and they're spread over 4 passes.  There's no way to get the
> amount right, and this test has become a source of useless busywork.
So we want to keep some form of ssa-dom-thread-7.  That' s the canonical 
testcase for the case for the FSM optimization.

What we need to verify is that we thread jumps across the backedge of 
the loop through the switch statement to a particular case (thus 
bypassing the indirect jump for the switch statement).  How to do that 
in a way that's easier to manage?  I have no clue.  I guess a gimple-fe 
based test might help.

Jeff




  parent reply	other threads:[~2021-10-20 20:19 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 10:28 Aldy Hernandez
2021-10-20 14:35 ` Martin Sebor
2021-10-20 15:15   ` Aldy Hernandez
2021-10-20 20:01     ` Jeff Law
2021-10-21  7:17       ` Aldy Hernandez
2021-10-21 14:50         ` Martin Sebor
2021-10-22 11:22           ` Aldy Hernandez
2021-10-22 14:27             ` Martin Sebor
2021-10-22 15:18               ` Aldy Hernandez
2021-10-22 15:59                 ` Martin Sebor
2021-10-23  8:31                   ` Aldy Hernandez
2021-10-21 17:59         ` Jeff Law
2021-10-21  7:22       ` Richard Biener
2021-10-20 20:19 ` Jeff Law [this message]
2021-10-21 10:15   ` Aldy Hernandez
2021-10-22  3:34     ` Jeff Law
2021-10-22  3:53       ` Aldy Hernandez
2021-10-24 16:57         ` Jeff Law
2021-10-24 17:55           ` Bernhard Reutner-Fischer
2021-10-24 18:21           ` Richard Biener
2021-10-24 18:25           ` Aldy Hernandez
2021-10-25  6:47             ` Aldy Hernandez
2021-10-25 18:42             ` Jeff Law
2021-10-25 18:49               ` Aldy Hernandez
2021-10-25 18:58                 ` Jeff Law
2021-10-25 16:58 ` Andrew MacLeod
2021-10-25 17:01   ` Aldy Hernandez
2021-10-25 17:02   ` Jeff Law

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=be9d89d8-5081-1c89-ed49-3628ea078ef1@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=aldyh@redhat.com \
    --cc=amacleod@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=msebor@redhat.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).