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: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

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.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to