public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: "Li, Pan2" <pan2.li@intel.com>, Jakub Jelinek <jakub@redhat.com>,
	 "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Prevent TYPE_PRECISION on VECTOR_TYPEs
Date: Thu, 29 Jun 2023 08:11:27 +0000 (UTC)	[thread overview]
Message-ID: <nycvar.YFH.7.77.849.2306290806190.4723@jbgna.fhfr.qr> (raw)
In-Reply-To: <7483d3e6-cfac-dd21-e5d7-5f4611b2e214@gmail.com>

On Wed, 28 Jun 2023, Jeff Law wrote:

> 
> 
> On 6/28/23 22:04, Li, Pan2 wrote:
> > It seems this patch may result in many test ICE failures on RISC-V backend.
> > Could you help to double confirm about it follow the possible reproduce
> > steps like blow? Thank you!
> I've one ICE due to this change as well but it wasn't in the
> tree-ssa-math-opts.code like this one is.  In my case we're in a place where
> it doesn't look like we expect a vector type to show up, but it does and we
> can likely just prune it away.
> 
> Anyway, your fault is in here:
> 
> 
> 
> divmod_candidate_p:
> 
>      if (TYPE_PRECISION (type) <= HOST_BITS_PER_WIDE_INT
>           && TYPE_PRECISION (type) <= BITS_PER_WORD)
>         return false;
> 
> TYPE is almost certainly a vector type.  The question we need to answer (and
> I'm not likely to get to it tomorrow) would be whether or not TYPE can
> legitimately be a vector type here.

I think GCN people wanted to make this code work for vectors, the
most obvious local fix is to use element_precision (type) above.

Note usually vector integer divisions are not a thing so this might
explain why you're seeing this only with RVV?

Richard.

  reply	other threads:[~2023-06-29  8:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27  9:45 Richard Biener
2023-06-27  9:47 ` Jakub Jelinek
2023-06-29  4:04   ` Li, Pan2
2023-06-29  4:18     ` Li, Pan2
2023-06-29 10:03       ` juzhe.zhong
2023-06-29 10:06         ` Robin Dapp
2023-06-29 10:07           ` Robin Dapp
2023-06-29 10:09             ` juzhe.zhong
2023-06-29  4:25     ` Jeff Law
2023-06-29  8:11       ` Richard Biener [this message]
2023-06-29  9:55         ` Robin Dapp
2023-06-29  9:56           ` Richard Biener
2023-06-29 11:07             ` Robin Dapp
2023-06-29 15:13         ` Jeff Law
  -- strict thread matches above, loose matches on Subject: below --
2023-06-09 11:23 Richard Biener
2023-06-09 11:53 ` Richard Biener
2023-06-09  7:40 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.77.849.2306290806190.4723@jbgna.fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=jeffreyalaw@gmail.com \
    --cc=pan2.li@intel.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).