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 middle-end/111156] [14 Regression] aarch64 aarch64/sve/mask_struct_store_4.c failures
Date: Fri, 02 Feb 2024 03:51:48 +0000	[thread overview]
Message-ID: <bug-111156-4-UXC5lXTlDD@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-111156-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note I think GCC should be able to vectorize this loop but it goes wrong.


SVE the 7 part gets lost:

```
  vect__3.12_54 = .MASK_LOAD (_48, 16B, loop_mask_52);
  _32 = cond_17(D) + POLY_INT_CST [16, 16];
  _25 = &MEM <vector([8,8]) short unsigned int> [(uint16_t *)_32 + ivtmp_77 *
2];
  vect__3.13_56 = .MASK_LOAD (_25, 16B, loop_mask_53);
  _1 = &MEM <vector([16,16]) signed char> [(int8_t *)src_18(D) + ivtmp_77 * 1];
  vect_pretmp_29.16_60 = .MASK_LOAD (_1, 8B, loop_mask_59);
  mask__14.19_66 = vect__3.12_54 > { 2, ... };
  mask__14.19_67 = vect__3.13_56 > { 2, ... };
  mask_patt_4.20_68 = VEC_PACK_TRUNC_EXPR <mask__14.19_66, mask__14.19_67>;
  vect_array.23 ={v} {CLOBBER};
  vect_array.23[0] = vect_pretmp_29.16_60;
  vect_array.23[1] = vect_pretmp_29.16_60;
  vec_mask_and_74 = loop_mask_59 & mask_patt_4.20_68;
  _2 = ivtmp_77 * 2;
  _3 = &MEM <vector([16,16]) signed char[2]> [(int8_t *)dest_19(D) + _2 * 1];
```


But RISCV is able to vectorize it correctly:
```
  vect__3.12_52 = .MASK_LEN_LOAD (vectp_cond.10_13, 16B, { -1, ... }, _72, 0);
  vect_pretmp_29.15_56 = .MASK_LEN_LOAD (vectp_src.13_54, 8B, { -1, ... }, _72,
0);
  mask__27.16_58 = vect__3.12_52 <= { 7, ... };
  .MASK_LEN_SCATTER_STORE (vectp_dest.17_60, { 0, 2, 4, ... }, 1,
vect_pretmp_29.15_56, mask__27.16_58, _72, 0);
  mask__14.19_64 = vect__3.12_52 > { 2, ... };
  .MASK_LEN_SCATTER_STORE (vectp_dest.20_67, { 0, 2, 4, ... }, 1,
vect_pretmp_29.15_56, mask__14.19_64, _72, 0);

```

By using 2 stores and scatter here.

  parent reply	other threads:[~2024-02-02  3:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-25 13:35 [Bug middle-end/111156] New: " adhemerval.zanella at linaro dot org
2023-08-25 18:02 ` [Bug middle-end/111156] " dcb314 at hotmail dot com
2023-08-25 18:12 ` dcb314 at hotmail dot com
2023-08-25 18:15 ` dcb314 at hotmail dot com
2023-08-28  7:13 ` rguenth at gcc dot gnu.org
2023-08-31 17:25 ` adhemerval.zanella at linaro dot org
2023-11-24  0:45 ` pinskia at gcc dot gnu.org
2024-01-15 13:52 ` rguenth at gcc dot gnu.org
2024-02-01 10:15 ` tnfchris at gcc dot gnu.org
2024-02-02  3:31 ` pinskia at gcc dot gnu.org
2024-02-02  3:51 ` pinskia at gcc dot gnu.org [this message]
2024-02-02 20:10 ` pinskia at gcc dot gnu.org
2024-02-02 20:26 ` pinskia at gcc dot gnu.org
2024-02-14 20:11 ` tnfchris at gcc dot gnu.org
2024-02-15  8:34 ` rguenth at gcc dot gnu.org
2024-02-15  8:39 ` tnfchris at gcc dot gnu.org
2024-02-15  8:41 ` tnfchris at gcc dot gnu.org
2024-02-15 10:57 ` rguenth at gcc dot gnu.org
2024-02-15 12:41 ` rguenth at gcc dot gnu.org
2024-02-15 13:02 ` rguenth at gcc dot gnu.org
2024-02-15 14:38 ` cvs-commit at gcc dot gnu.org
2024-02-15 14:39 ` rguenth at gcc dot gnu.org
2024-02-15 18:53 ` tnfchris at gcc dot gnu.org
2024-02-15 21:05 ` rguenther at suse dot de
2024-02-16 13:19 ` rguenth 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-111156-4-UXC5lXTlDD@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).