public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alex Coplan <alex.coplan@arm.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Richard Biener <rguenther@suse.de>,
	Richard Sandiford <richard.sandiford@arm.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] tree-optimization/97832 - handle associatable chains in SLP discovery
Date: Wed, 9 Jun 2021 17:54:51 +0100	[thread overview]
Message-ID: <20210609165451.kfbmrzepg7ei3nyr@arm.com> (raw)
In-Reply-To: <CAFiYyc3VFAqPjfxS-U-__GDuqR84vTtO1Nk-pJYkhLxrPWcnKQ@mail.gmail.com>

Hi Richi,

On 09/06/2021 14:42, Richard Biener via Gcc-patches wrote:
> On Mon, May 31, 2021 at 5:00 PM Richard Biener <rguenther@suse.de> wrote:
> >
> > This makes SLP discovery handle associatable (including mixed
> > plus/minus) chains better by swapping operands across the whole
> > chain.  To work this adds caching of the 'matches' lanes for
> > failed SLP discovery attempts, thereby fixing a failed SLP
> > discovery for the slp-pr98855.cc testcase which results in
> > building an operand from scalars as expected.  Unfortunately
> > this makes us trip over the cost threshold so I'm XFAILing the
> > testcase for now.
> >
> > For BB vectorization all this doesn't work because we have no way
> > to distinguish good from bad associations as we eventually build
> > operands from scalars and thus not fail in the classical sense.
> >
> > Bootstrapped and tested on x86_64-unknown-linux-gnu, I'll re-do
> > last years SPEC tests as well.  Now that it is stage1 I'm considering
> > to push this if there are no further comments given I plan to
> > re-use some of the machinery for vectorization of BB reductions.
> 
> Now finally pushed as ce670e4faafb296d1f1a7828d20f8c8ba4686797

Looks like this introduces an ICE on aarch64:

spawn -ignore SIGHUP /data/ajc/toolchain/builds/rel/gcc/xgcc -B/data/ajc/toolchain/builds/rel/gcc/ /home/alecop01/toolchain/src/gcc/gcc/testsuite/gcc.dg/pr86179.c -fdiagnostics-plain-output -O3 -S -o pr86179.s
during GIMPLE pass: vect
/home/alecop01/toolchain/src/gcc/gcc/testsuite/gcc.dg/pr86179.c: In function 'c':
/home/alecop01/toolchain/src/gcc/gcc/testsuite/gcc.dg/pr86179.c:7:6: internal compiler error: in vect_slp_analyze_node_operations, at tree-vect-slp.c:4444
0x1132edb vect_slp_analyze_node_operations
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.c:4442
0x1132757 vect_slp_analyze_node_operations
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.c:4385
0x1132757 vect_slp_analyze_node_operations
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.c:4385
0x1132757 vect_slp_analyze_node_operations
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.c:4385
0x1132757 vect_slp_analyze_node_operations
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.c:4385
0x11355cf vect_slp_analyze_operations(vec_info*)
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-slp.c:4592
0x110cbe3 vect_analyze_loop_2
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-loop.c:2396
0x110e4af vect_analyze_loop(loop*, vec_info_shared*)
        /home/alecop01/toolchain/src/gcc/gcc/tree-vect-loop.c:2986
0x114381b try_vectorize_loop_1
        /home/alecop01/toolchain/src/gcc/gcc/tree-vectorizer.c:1009
0x11442d3 vectorize_loops()
        /home/alecop01/toolchain/src/gcc/gcc/tree-vectorizer.c:1243
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
compiler exited with status 1
FAIL: gcc.dg/pr86179.c (internal compiler error)

Alex

> 
> > Richard.
> >
> > 2021-05-31  Richard Biener  <rguenther@suse.de>
> >
> >         PR tree-optimization/97832
> >         * tree-vectorizer.h (_slp_tree::failed): New.
> >         * tree-vect-slp.c (_slp_tree::_slp_tree): Initialize
> >         failed member.
> >         (_slp_tree::~_slp_tree): Free failed.
> >         (vect_build_slp_tree): Retain failed nodes and record
> >         matches in them, copying that back out when running
> >         into a cached fail.  Dump start and end of discovery.
> >         (dt_sort_cmp): New.
> >         (vect_build_slp_tree_2): Handle associatable chains
> >         together doing more aggressive operand swapping.
> >
> >         * gcc.dg/vect/pr97832-1.c: New testcase.
> >         * gcc.dg/vect/pr97832-2.c: Likewise.
> >         * gcc.dg/vect/pr97832-3.c: Likewise.
> >         * g++.dg/vect/slp-pr98855.cc: XFAIL.
> > ---
> >  gcc/testsuite/g++.dg/vect/slp-pr98855.cc |   4 +-
> >  gcc/testsuite/gcc.dg/vect/pr97832-1.c    |  17 +
> >  gcc/testsuite/gcc.dg/vect/pr97832-2.c    |  29 ++
> >  gcc/testsuite/gcc.dg/vect/pr97832-3.c    |  50 +++
> >  gcc/testsuite/gcc.dg/vect/slp-50.c       |  20 +
> >  gcc/tree-vect-slp.c                      | 445 ++++++++++++++++++++++-
> >  gcc/tree-vectorizer.h                    |   5 +
> >  7 files changed, 560 insertions(+), 10 deletions(-)
> >  create mode 100644 gcc/testsuite/gcc.dg/vect/pr97832-1.c
> >  create mode 100644 gcc/testsuite/gcc.dg/vect/pr97832-2.c
> >  create mode 100644 gcc/testsuite/gcc.dg/vect/pr97832-3.c
> >  create mode 100644 gcc/testsuite/gcc.dg/vect/slp-50.c

  reply	other threads:[~2021-06-09 16:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-31 14:32 Richard Biener
2021-06-09 12:42 ` Richard Biener
2021-06-09 16:54   ` Alex Coplan [this message]
2021-06-09 20:13     ` Christophe Lyon

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=20210609165451.kfbmrzepg7ei3nyr@arm.com \
    --to=alex.coplan@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    --cc=richard.guenther@gmail.com \
    --cc=richard.sandiford@arm.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).