https://bugs.llvm.org/show_bug.cgi?id=50686

            Bug ID: 50686
           Summary: [LV] expandBounds generates wrong runtime checks
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]

void m(int *p, int *p2, int q) {
  {
    int *a = p2;
    for (; k < q; k++)
      a[k] = 2;
  }
  int *a = p;
  int i, j, r;
  i = 0;
  for (; i < 63; i++) {
    r = j = 0;
    for (; j < 63; j++)
      r -= p2[j];
    a[i] = r;
  }
}

Compiled with `clang -O3`, the inner loop will be fully unrolled, and LV
determines it's possible to vectorize the outer loop with runtime checks.
However, the runtime checks generated are incorrect in that the range generated
for the `p2` group is [p2+62, p2+63) rather than [p2, p2+63).

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to