public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/108916] New: Miss vectorization for masked gather w/o restrict qualifier.
@ 2023-02-24  5:08 crazylht at gmail dot com
  2023-02-24  5:10 ` [Bug tree-optimization/108916] " crazylht at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: crazylht at gmail dot com @ 2023-02-24  5:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108916
           Summary: Miss vectorization for masked gather w/o restrict
                    qualifier.
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: crazylht at gmail dot com
  Target Milestone: ---

void
foo1 (double* __restrict a, long long* b, double* c, long long* d)
{
    for (long long i = 0; i != 10000; i++)
      {
        if (b[i])
          a[i] = 0;
        else
          a[i] = c[d[i]];
      }
}


void
foo2 (double* __restrict a, long long* b, double* __restrict c, long long* d)
{
    for (long long i = 0; i != 10000; i++)
      {
        if (b[i])
          a[i] = 0;
        else
          a[i] = c[d[i]];
      }
}

w/ -Ofast -march=skylake-avx512, foo1 can't be vectorized, but foo2 can, the
only difference between foo1 and foo2 is restrict qualifier for double* c.
But there's already a restrict qualifier for double* __restrict a in both
cases,   why double* __restrict c matters.

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

end of thread, other threads:[~2023-02-24 12:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-24  5:08 [Bug tree-optimization/108916] New: Miss vectorization for masked gather w/o restrict qualifier crazylht at gmail dot com
2023-02-24  5:10 ` [Bug tree-optimization/108916] " crazylht at gmail dot com
2023-02-24  5:24 ` pinskia at gcc dot gnu.org
2023-02-24 12:59 ` rguenth 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).