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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Blocks|                            |53947
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2026-05-05
           Keywords|                            |missed-optimization
             Target|                            |x86_64-*-*

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  The issue is that affine data dependence analysis has no support
to represent that y[a[i]%16] is an (invariant in a vector iteration)
permutation
of the same contiguous part of y[].  And since we cannot do a runtime
check on x[] vs. y[] aliasing we fail (we actually could, given y[] has
a fixed size but we don't implement that).

You do not provide a vector form for

    for (int k=0; k<16; ++k) j[k] = int(a[i+k])%16;

but I suppose the modulo 16 can be done as bitwise and and a[] is accessed
contiguously.

Practically it's difficult to fit this in nicely.  Pattern-matching
the gather somehow might work.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53947
[Bug 53947] [meta-bug] vectorizer missed-optimizations

Reply via email to