public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/113326] Optimize vector shift with constant delta on shifting-count operand
Date: Thu, 11 Jan 2024 07:30:05 +0000	[thread overview]
Message-ID: <bug-113326-4-1bQGSgsyD9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113326-4@http.gcc.gnu.org/bugzilla/>

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
          Component|tree-optimization           |target
           Severity|normal                      |enhancement
   Last reconfirmed|                            |2024-01-11
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note on aarch64 with SVE, you should be able to generate those constants
without a load, using the index instruction.  Though aarch64 does not generate
them currently.  So this is definitely target specific and all.

Plus this is simplification happens after the vectorizer which produces:
```
  <bb 3> [local count: 252544065]:
  # i_13 = PHI <i_10(5), 0(2)>
  # ivtmp_3 = PHI <ivtmp_2(5), 16(2)>
  # vect_vec_iv_.4_11 = PHI <_16(5), { 0, 1, 2, 3 }(2)>
  # vectp_array.6_19 = PHI <vectp_array.6_20(5), &array(2)>
  # ivtmp_22 = PHI <ivtmp_23(5), 0(2)>
  _16 = vect_vec_iv_.4_11 + { 4, 4, 4, 4 };
  vect__1.5_18 = vect_cst__17 >> vect_vec_iv_.4_11;
  _1 = value_8(D) >> i_13;
  MEM <vector(4) int> [(int *)vectp_array.6_19] = vect__1.5_18;
  i_10 = i_13 + 1;
  ivtmp_2 = ivtmp_3 - 1;
  vectp_array.6_20 = vectp_array.6_19 + 16;
  ivtmp_23 = ivtmp_22 + 1;
  if (ivtmp_23 < 4)
    goto <bb 5>; [75.00%]
  else
    goto <bb 4>; [25.00%]
```

  reply	other threads:[~2024-01-11  7:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-11  7:13 [Bug tree-optimization/113326] New: " fxue at os dot amperecomputing.com
2024-01-11  7:30 ` pinskia at gcc dot gnu.org [this message]
2024-01-11  7:44 ` [Bug target/113326] " pinskia at gcc dot gnu.org
2024-01-11  7:52 ` fxue at os dot amperecomputing.com
2024-01-11  7:56 ` pinskia at gcc dot gnu.org
2024-01-11  8:10 ` pinskia at gcc dot gnu.org
2024-01-11  9:13 ` rguenth at gcc dot gnu.org
2024-01-11  9:58 ` fxue at os dot amperecomputing.com

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-113326-4-1bQGSgsyD9@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).