public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rsandifo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/103116] New: SLP vectoriser fails to peel for gaps
Date: Sun, 07 Nov 2021 11:36:08 +0000	[thread overview]
Message-ID: <bug-103116-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 103116
           Summary: SLP vectoriser fails to peel for gaps
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsandifo at gcc dot gnu.org
                CC: rguenth at gcc dot gnu.org
  Target Milestone: ---

Created attachment 51744
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51744&action=edit
testcase

Compiling the attached testcase on x86_64-linux-gnu with -O2
-fno-vect-cost-model triggers a segfault.  We implement the y[] reads in:

  for (int i = 0; i < COUNT; ++i)
    {
      x[i * 4] = y[i * 2] + 1;
      x[i * 4 + 1] = y[i * 2] + 2;
      x[i * 4 + 2] = y[i * 2 + 1] + 3;
      x[i * 4 + 3] = y[i * 2 + 1] + 4;
    }

using a load and permute in which only the low half of the loaded data is used.
 The high half of the final iteration overruns the array.

I guess the usual approach of peeling one iteration for gaps will be enough,
but haven't thought about it much.  Are there corner cases where we might need
to peel more?

(We get away with this on AArch64 because we fall back to load/store lanes
instead.)

             reply	other threads:[~2021-11-07 11:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-07 11:36 rsandifo at gcc dot gnu.org [this message]
2021-11-08  8:20 ` [Bug tree-optimization/103116] " rguenth at gcc dot gnu.org
2022-05-03 13:19 ` rguenth at gcc dot gnu.org
2022-05-04  7:34 ` rguenth at gcc dot gnu.org
2022-05-04  8:42 ` rguenth at gcc dot gnu.org
2022-05-04 13:05 ` rsandifo at gcc dot gnu.org
2022-05-04 13:06 ` rguenther at suse dot de
2022-05-04 13:12 ` cvs-commit at gcc dot gnu.org
2022-05-04 13:14 ` rguenth at gcc dot gnu.org
2022-05-20  7:10 ` cvs-commit at gcc dot gnu.org
2022-07-22 11:21 ` cvs-commit at gcc dot gnu.org
2022-07-22 11:23 ` rguenth at gcc dot gnu.org
2024-03-10  4:59 ` pinskia 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-103116-4@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).