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

            Bug ID: 35448
           Summary: Loop unrolling breaks vectorization
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedb...@nondot.org
          Reporter: san...@playingwithpointers.com
                CC: llvm-bugs@lists.llvm.org

Perhaps this is already a known issue, but Clang/LLVM trunk does not vectorize
the inner matmult loop unless the "#pragma unroll" is enabled:

void f(int * __restrict__ a, int * __restrict__ b, int * __restrict__ r) {
  for (int m = 0; m < 64; m++) {
    int c = 0;
    // #pragma unroll
    for (int i = 0; i < 32; i++) {
      c += a[i] * b[m * 32 + i];
    }
    r[m] = c;
  }
}

It looks like the loop unroller fully unrolls the inner loop and the SLP
vectorizer is unable to vectorize as well as the Loop vectorizer would have
vectorized the not-unrolled loop.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to