public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Richard Sandiford <richard.sandiford@arm.com>
Cc: Stam Markianos-Wright <stam.markianos-wright@arm.com>,
	 "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	ook@ucw.cz,  Richard Earnshaw <richard.earnshaw@arm.com>,
	 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Subject: Re: [PATCH] slp tree vectorizer: Re-calculate vectorization factor in the case of invalid choices [PR96974]
Date: Mon, 29 Mar 2021 11:20:33 +0200 (CEST)	[thread overview]
Message-ID: <nycvar.YFH.7.76.2103291115030.17979@zhemvz.fhfr.qr> (raw)
In-Reply-To: <mpty2e9omt5.fsf@arm.com>

On Fri, 26 Mar 2021, Richard Sandiford wrote:

> Richard Biener <rguenther@suse.de> writes:
> > On Wed, 24 Mar 2021, Stam Markianos-Wright wrote:
> >
> >> Hi all,
> >> 
> >> This patch resolves bug:
> >> 
> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96974
> >> 
> >> This is achieved by forcing a re-calculation of *stmt_vectype_out if an
> >> incompatible combination of TYPE_VECTOR_SUBPARTS is detected, but with an
> >> extra introduced max_nunits ceiling.
> >> 
> >> I am not 100% sure if this is the best way to go about fixing this, because
> >> this is my first look at the vectorizer and I lack knowledge of the wider
> >> context, so do let me know if you see a better way to do this!
> >> 
> >> I have added the previously ICE-ing reproducer as a new test.
> >> 
> >> This is compiled as "g++ -Ofast -march=armv8.2-a+sve -fdisable-tree-fre4" for
> >> GCC11 and "g++ -Ofast -march=armv8.2-a+sve" for GCC10.
> >> 
> >> (the non-fdisable-tree-fre4 version has gone latent on GCC11)
> >> 
> >> Bootstrapped and reg-tested on aarch64-linux-gnu.
> >> Also reg-tested on aarch64-none-elf.
> >
> > I don't think this is going to work well given uses will expect
> > a vector type that's consistent here.
> >
> > I think giving up is for the moment the best choice, thus replacing
> > the assert with vectorization failure.
> >
> > In the end we shouldn't require those nunits vectypes to be
> > separately computed - we compute the vector type of the defs
> > anyway and in case they're invariant the vectorizable_* function
> > either can deal with the type mix or not anyway.
> 
> I agree this area needs simplification, but I think the direction of
> travel should be to make the assert valid.  I agree this is probably
> the pragmatic fix for GCC 11 and earlier though.

The issue is that we compute a vector type for a use that may differ
from what we'd compute for it in the context of its definition (or
in the context of another use).  Any such "local" decision is likely
flawed and I'd rather simplify further doing the only decision on
the definition side - if there's a disconnect between the number
of lanes (and thus altering the VF won't help) then we have to give
up anyway.

Richard.

  reply	other threads:[~2021-03-29  9:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 13:26 Stam Markianos-Wright
2021-03-24 13:46 ` Richard Biener
2021-03-25 13:48   ` Stam Markianos-Wright
2021-03-25 13:50     ` Richard Biener
2021-03-26 17:19   ` Richard Sandiford
2021-03-29  9:20     ` Richard Biener [this message]
2021-03-31 10:03       ` Stam Markianos-Wright
2021-03-31 10:08         ` 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=nycvar.YFH.7.76.2103291115030.17979@zhemvz.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kyrylo.tkachov@arm.com \
    --cc=ook@ucw.cz \
    --cc=richard.earnshaw@arm.com \
    --cc=richard.sandiford@arm.com \
    --cc=stam.markianos-wright@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).