public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/115663] New: outer loop vectorization with inner loop grouped access and SLP should be possible
@ 2024-06-26 11:17 rguenth at gcc dot gnu.org
  2024-06-26 20:57 ` [Bug tree-optimization/115663] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-06-26 11:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115663
           Summary: outer loop vectorization with inner loop grouped
                    access and SLP should be possible
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

We do not support interleaving of accesses in the inner loop but SLP should
be possible if the group is contiguous with respect to the outer loop
evolution.

void foo (double * __restrict a, double *b, int n)
{
  for (int i = 0; i < 1024; ++i)
    {
      double res = a[i];
      for (int j = 0; j < 8; ++j)
        res += b[j * 16 + 2*i];
      a[i] = res;
    }
}

or

void foo (double * __restrict a, double *b, int n)
{
  for (int i = 0; i < 1024; ++i)
    {
      double res = a[i];
      for (int j = 0; j < 8; ++j)
        res += b[j * 16 + 2*i] + b[j * 16 + 2*i + 1];
      a[i] = res;
    }
}

should be possible to vectorize (the former is with a gap, the latter not).

In practice this is likely relevant for both image (pixel, w/ and w/o gap)
and complex numbers.

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

* [Bug tree-optimization/115663] outer loop vectorization with inner loop grouped access and SLP should be possible
  2024-06-26 11:17 [Bug tree-optimization/115663] New: outer loop vectorization with inner loop grouped access and SLP should be possible rguenth at gcc dot gnu.org
@ 2024-06-26 20:57 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-26 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
           Severity|normal                      |enhancement
   Last reconfirmed|                            |2024-06-26

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

end of thread, other threads:[~2024-06-26 20:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26 11:17 [Bug tree-optimization/115663] New: outer loop vectorization with inner loop grouped access and SLP should be possible rguenth at gcc dot gnu.org
2024-06-26 20:57 ` [Bug tree-optimization/115663] " 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).