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

            Bug ID: 100846
           Summary: Different vector handling for strided IVs and modulo
                    conditions
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rsandifo at gcc dot gnu.org
  Target Milestone: ---

The following loops are equivalent, but we only vectorise the second:

void f1 (int *x)
{
  for (int i = 0; i < 100; ++i)
    if ((i & 1) == 0)
      x[i] += 1;
}

void f2 (int *x)
{
  for (int i = 0; i < 100; i += 2)
    x[i] += 1;
}

I guess this isn't vectorisation-specific.  Perhaps this is something that
ivcanon could handle?

Reply via email to