public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/103116] New: SLP vectoriser fails to peel for gaps
@ 2021-11-07 11:36 rsandifo at gcc dot gnu.org
  2021-11-08  8:20 ` [Bug tree-optimization/103116] " rguenth at gcc dot gnu.org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2021-11-07 11:36 UTC (permalink / raw)
  To: gcc-bugs

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.)

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-03-10  4:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-07 11:36 [Bug tree-optimization/103116] New: SLP vectoriser fails to peel for gaps rsandifo at gcc dot gnu.org
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

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).