public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/113281] [14 Regression] Wrong code due to vectorization of shift reduction and missing promotions since r14-3027
Date: Wed, 24 Jan 2024 09:54:07 +0000	[thread overview]
Message-ID: <bug-113281-4-as0NOf8kpQ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113281-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113281

--- Comment #19 from rguenther at suse dot de <rguenther at suse dot de> ---
On Wed, 24 Jan 2024, pinskia at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113281
> 
> --- Comment #17 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> (In reply to rguenther@suse.de from comment #16)
> > On Wed, 24 Jan 2024, pinskia at gcc dot gnu.org wrote:
> > 
> > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113281
> > > 
> > > --- Comment #15 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
> > > (In reply to Richard Biener from comment #14)
> > > > a >= 16 ? 0 : 32872 >> MIN (a, 15) (the MIN is still required to
> > > > avoid requiring masking).
> > > 
> > > Note maybe instead of MIN here we use `a & 0xf` since that will more likely be
> > > cheaper than a MIN.
> > 
> > But it's incorrect (that's what I did originally).
> 
> But `(a>= 16)? 0: (32872>> (a&0xf))` is correct.
> 
> So is `(a>=16 ? 0 : 32872) >> ( a & 0xf)` .
> 
> Or is it you want to avoid the conditional here.

Yeah - at some point not trying to optimize the widening/shortening
is going to be cheaper, no?  Esp. if it is "just" because of
GIMPLE being limited with no way to express the desired semantics
for "out-of-bound" shifts (and no way to query target behavior for
them of course).

The widening/shortening might or might not have an effect on the
VF (we don't know) and we don't (yet) compute if the target
supports it.  We could force a smaller vector size (if the target
supports it) to avoid increasing the VF.

  parent reply	other threads:[~2024-01-24  9:54 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-08 19:17 [Bug target/113281] New: [14] RISC-V rv64gcv_zvl256b vector: Runtime mismatch with rv64gc patrick at rivosinc dot com
2024-01-08 19:20 ` [Bug target/113281] " patrick at rivosinc dot com
2024-01-08 21:49 ` rdapp at gcc dot gnu.org
2024-01-09  1:32 ` juzhe.zhong at rivai dot ai
2024-01-09  2:06 ` juzhe.zhong at rivai dot ai
2024-01-09  2:08 ` juzhe.zhong at rivai dot ai
2024-01-09  2:12 ` [Bug tree-optimization/113281] " pinskia at gcc dot gnu.org
2024-01-09  2:16 ` pinskia at gcc dot gnu.org
2024-01-09  2:17 ` juzhe.zhong at rivai dot ai
2024-01-09  2:58 ` [Bug tree-optimization/113281] [14 Regression] Wrong code due to vectorization of shift reduction and missing promotions pinskia at gcc dot gnu.org
2024-01-09  2:59 ` pinskia at gcc dot gnu.org
2024-01-09  8:32 ` rguenth at gcc dot gnu.org
2024-01-10 13:26 ` rguenth at gcc dot gnu.org
2024-01-12 12:16 ` cvs-commit at gcc dot gnu.org
2024-01-15 12:06 ` cvs-commit at gcc dot gnu.org
2024-01-23 16:58 ` [Bug tree-optimization/113281] [14 Regression] Wrong code due to vectorization of shift reduction and missing promotions since r14-3027 jakub at gcc dot gnu.org
2024-01-24  7:48 ` rguenth at gcc dot gnu.org
2024-01-24  7:54 ` pinskia at gcc dot gnu.org
2024-01-24  8:32 ` rguenther at suse dot de
2024-01-24  8:38 ` pinskia at gcc dot gnu.org
2024-01-24  9:52 ` jakub at gcc dot gnu.org
2024-01-24  9:54 ` rguenther at suse dot de [this message]
2024-01-24 10:00 ` jakub at gcc dot gnu.org
2024-01-24 13:23 ` jakub at gcc dot gnu.org
2024-01-24 20:49 ` rsandifo at gcc dot gnu.org
2024-01-29 12:33 ` cvs-commit at gcc dot gnu.org
2024-01-29 12:34 ` [Bug tree-optimization/113281] " rsandifo at gcc dot gnu.org
2024-01-31 17:30 ` [Bug tree-optimization/113281] [11/12/13 Regression] Latent wrong code due to vectorization of shift reduction and missing promotions since r9-1590 jakub at gcc dot gnu.org
2024-03-13 20:17 ` ewlu at rivosinc dot com
2024-03-13 20:22 ` pinskia at gcc dot gnu.org
2024-03-13 20:29 ` patrick at rivosinc dot com
2024-03-13 23:18 ` juzhe.zhong at rivai dot ai
2024-05-31  8:12 ` rdapp at gcc dot gnu.org
2024-05-31 14:56 ` cvs-commit at gcc dot gnu.org
2024-06-04  7:48 ` [Bug tree-optimization/113281] [11/12 " cvs-commit at gcc dot gnu.org
2024-06-04 12:47 ` [Bug tree-optimization/113281] [11 " cvs-commit at gcc dot gnu.org
2024-06-04 12:49 ` rsandifo at gcc dot gnu.org

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=bug-113281-4-as0NOf8kpQ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).