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

            Bug ID: 126366
           Summary: Re-alignment for early break ineffective on x86
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
            Blocks: 53947
  Target Milestone: ---
            Target: x86_64-*-*

char b[100];
int c(int a) {
  unsigned d = 0;
  for (; d < a; ++d)
    {
      if (b[0] + b[d + 1])
        return 0;
    }
  return 1;
}

fails to be vectorized with AVX512 - we chose to align b[], but that does
not help to make b[1] aligned.  I suspect the failure to consider
alignment peeling by mask is the reason this doesn't vectorize on x86 but
is vectorized with RVV.


Referenced Bugs:

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

Reply via email to