[llvm-bugs] [Bug 43580] New: Slow code generated by Clang for 525.x264_r-like loop

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Oct 6 17:15:43 PDT 2019


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

            Bug ID: 43580
           Summary: Slow code generated by Clang for 525.x264_r-like loop
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: david.bolvansky at gmail.com
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    llvm-dev at redking.me.uk, spatel+llvm at rotateright.com

Pattern:

typedef signed char schar;

void foo (schar *__restrict a, schar *__restrict b,
   schar *__restrict c, int n, int step)
{
  for (int j = 0; j < n; ++j)
    {
      for (int i = 0; i < 16; ++i)
        a[i] = (b[i] + c[i]) >> 1;
      a += step;
      b += step;
      c += step;
    }
}

Current codegen:
https://godbolt.org/z/0Lo66v

Clang generates 2x slower code than icc/gcc.

Microbenchmark:
https://pastebin.com/rECq65sa

Clang SVN -O3   0m5,619s
ICC 19    -O3   0m2,525s
GCC SVN   -O3   0m2,432s

With -march=haswell
Clang SVN   0m3,540s
ICC 19      0m1,892s
GCC SVN     0m2,608s

-- 
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/20191007/0cc66d9e/attachment.html>


More information about the llvm-bugs mailing list