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] Remove VRP threader passes in exchange for better threading pre-VRP.
Date: Fri, 29 Oct 2021 09:29:53 +0200	[thread overview]
Message-ID: <CAFiYyc0z8UcPBav+ff3oV+_J00USCfhPRnaMxpVFEgPp=qhXBw@mail.gmail.com> (raw)
In-Reply-To: <ccef5fc9-e8d8-50f3-f29c-3b2d97d341d1@gmail.com>

On Thu, Oct 28, 2021 at 8:34 PM Jeff Law via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
>
>
> On 10/28/2021 9:24 AM, Aldy Hernandez wrote:
> > This patch upgrades the pre-VRP threading passes to fully resolving
> > backward threaders, and removes the post-VRP threading passes altogether.
> > With it, we reduce the number of threaders in our pipeline from 9 to 7.
> >
> > This will leave DOM as the only forward threader client.  When the ranger
> > can handle floats, we should be able to upgrade the pre-DOM threaders to
> > fully resolving threaders and kill the embedded DOM threader.
> >
> > The final numbers are:
> >
> >       prev: # threads in backward + vrp-threaders = 92624
> >       now:  # threads in backward threaders = 94275
> >       Gain: +1.78%
> >
> >       prev: # total threads: 189495
> >       now:  # total threads: 193714
> >       Gain: +2.22%
> >
> >       The numbers are not as great as my initial proposal, but I've
> >       recently pushed all the work that got us to this point ;-).
> >
> > And... the total compilation improves by 1.32%!
> >
> > There's a regression on uninit-pred-7_a.c that I've yet to look at.  I
> > want to make sure it's not a missing thread.  If it is, I'll create a PR
> > and own it.
> >
> > Also, the tree-ssa/phi_on_compare-*.c tests have all regressed.  This
> > seems to be some special case the forward threader handles that the
> > backward threader does not (edge_forwards_cmp_to_conditional_jump*).
> > I haven't dug deep to see if this is solveable within our
> > infrastructure, but a cursory look shows that even though the VRP
> > threader threads this, the *.optimized dump ends with more conditional
> > jumps than without the optimization.  I'd like to punt on this for
> > now, because DOM actually catches this through its lone use of the
> > forward threader (I've adjusted the tests).  However, we will need to
> > address this sooner or later, if indeed it's still improving the final
> > assembly.
> >
> > Even though we have been incrementally stressing all the pieces of this
> > intricate puzzle, I do expect fall out.  My plan from here until stage1
> > ends is to stop new development in the threader(s), and focus on bug
> > fixing and improving the developer's debugging experience.
> >
> > OK pending another round of tests on x86-64 and ppc64le Linux?
> >
> > gcc/ChangeLog:
> >
> >       * passes.def: Replace the pass_thread_jumps before VRP* with
> >       pass_thread_jumps_full.  Remove all pass_vrp_threader instances.
> >
> > libgomp/ChangeLog:
> >
> >       * testsuite/libgomp.graphite/force-parallel-4.c: Adjust for threading changes.
> >       * testsuite/libgomp.graphite/force-parallel-8.c: Same.
> >
> > gcc/testsuite/ChangeLog:
> >
> >       * gcc.dg/loop-unswitch-2.c: Adjust for threading changes.
> >       * gcc.dg/old-style-asm-1.c: Same.
> >       * gcc.dg/tree-ssa/phi_on_compare-1.c: Same.
> >       * gcc.dg/tree-ssa/phi_on_compare-2.c: Same.
> >       * gcc.dg/tree-ssa/phi_on_compare-3.c: Same.
> >       * gcc.dg/tree-ssa/phi_on_compare-4.c: Same.
> >       * gcc.dg/tree-ssa/pr20701.c: Same.
> >       * gcc.dg/tree-ssa/pr21001.c: Same.
> >       * gcc.dg/tree-ssa/pr21294.c: Same.
> >       * gcc.dg/tree-ssa/pr21417.c: Same.
> >       * gcc.dg/tree-ssa/pr21559.c: Same.
> >       * gcc.dg/tree-ssa/pr21563.c: Same.
> >       * gcc.dg/tree-ssa/pr49039.c: Same.
> >       * gcc.dg/tree-ssa/pr59597.c: Same.
> >       * gcc.dg/tree-ssa/pr61839_1.c: Same.
> >       * gcc.dg/tree-ssa/pr61839_3.c: Same.
> >       * gcc.dg/tree-ssa/pr66752-3.c: Same.
> >       * gcc.dg/tree-ssa/pr68198.c: Same.
> >       * gcc.dg/tree-ssa/pr77445-2.c: Same.
> >       * gcc.dg/tree-ssa/pr77445.c: Same.
> >       * gcc.dg/tree-ssa/ranger-threader-1.c: Same.
> >       * gcc.dg/tree-ssa/ranger-threader-2.c: Same.
> >       * gcc.dg/tree-ssa/ranger-threader-4.c: Same.
> >       * gcc.dg/tree-ssa/ssa-dom-thread-1.c: Same.
> >       * gcc.dg/tree-ssa/ssa-dom-thread-11.c: Same.
> >       * gcc.dg/tree-ssa/ssa-dom-thread-12.c: Same.
> >       * gcc.dg/tree-ssa/ssa-dom-thread-14.c: Same.
> >       * gcc.dg/tree-ssa/ssa-dom-thread-16.c: Same.
> >       * gcc.dg/tree-ssa/ssa-dom-thread-2b.c: Same.
> >       * gcc.dg/tree-ssa/ssa-dom-thread-7.c: Same.
> >       * gcc.dg/tree-ssa/ssa-thread-14.c: Same.
> >       * gcc.dg/tree-ssa/ssa-thread-backedge.c: Same.
> >       * gcc.dg/tree-ssa/ssa-vrp-thread-1.c: Same.
> >       * gcc.dg/tree-ssa/vrp02.c: Same.
> >       * gcc.dg/tree-ssa/vrp03.c: Same.
> >       * gcc.dg/tree-ssa/vrp05.c: Same.
> >       * gcc.dg/tree-ssa/vrp06.c: Same.
> >       * gcc.dg/tree-ssa/vrp07.c: Same.
> >       * gcc.dg/tree-ssa/vrp08.c: Same.
> >       * gcc.dg/tree-ssa/vrp09.c: Same.
> >       * gcc.dg/tree-ssa/vrp106.c: Same.
> >       * gcc.dg/tree-ssa/vrp33.c: Same.
> OK.  And yes, there will probably be fallout.  Fully expected and we'll
> deal with it.

Btw, in case the "fully resolving" mode is slower than not fully resolving
please consider gating it on -fexpensive-optimizations (aka -O2+), thus
run the passes in not fully resolving modes at-O1.

Btw, there were quite a few big compile-time hogs with the vrp_threader
passes, not sure if this solves those.

Richard.

> jeff
>

  reply	other threads:[~2021-10-29  7:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 15:24 Aldy Hernandez
2021-10-28 16:08 ` Aldy Hernandez
2021-10-28 18:33 ` Jeff Law
2021-10-29  7:29   ` Richard Biener [this message]
2021-10-29  8:06     ` Aldy Hernandez
2021-10-29  8:10       ` Richard Biener
2021-10-29  8:15         ` Aldy Hernandez
2021-10-29 14:36         ` Aldy Hernandez
2021-10-29 20:57 ` David Malcolm
2021-10-29 23:58   ` Aldy Hernandez

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='CAFiYyc0z8UcPBav+ff3oV+_J00USCfhPRnaMxpVFEgPp=qhXBw@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).