[llvm-bugs] [Bug 27826] New: Code explosion when LoopVectorize vectorizes a loop with a stride of 8 floats

via llvm-bugs llvm-bugs at lists.llvm.org
Fri May 20 09:45:44 PDT 2016


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

            Bug ID: 27826
           Summary: Code explosion when LoopVectorize vectorizes a loop
                    with a stride of 8 floats
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Loop Optimizer
          Assignee: unassignedbugs at nondot.org
          Reporter: filcab at gmail.com
                CC: davide at freebsd.org, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk
    Classification: Unclassified

The following code (compile with -O3 -Wall -std=c++11 -ffast-math -march=btver2
):
typedef float T;
T foo(T *a, T *b, int n) {
  if (n % 8 != 0)
    __builtin_unreachable();
  T s = 0;
  for (int i=0; i<n; i+=8) {
    s += (a[i]+b[i]);
  }
  return s;
}

Currently expands to a huge blob of code which shuffles around values like
crazy.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160520/a0602fa1/attachment.html>


More information about the llvm-bugs mailing list