[llvm-bugs] [Bug 31817] New: AVX512 Regression: KNL backend does not use KNL processor features, SKX works

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jan 31 07:24:14 PST 2017


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

            Bug ID: 31817
           Summary: AVX512 Regression: KNL backend does not use KNL
                    processor features, SKX works
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: wenzel.jakob at epfl.ch
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

I've noticed a serious performance and code generation regression on Clang's
KNL (= Knight's Landing) target. 

With the latest trunk version of Clang & LLVM, the compiler no longer makes use
of any of the new AVX512 architectural features when working with non-512bit
registers (XMM & ZMM). This includes making full use of all 32 registers
(instead of 16) and using extensions such as builtin broadcasting of constants.
Losing half of the registers in particular is a serious performance regression
-- this wasn't the case with older versions of Clang.

Interestingly, the SKX == skylake-avx512 target remains unaffected.

Here is an example for the broadcasting of constants. Consider the following
snippet:

    #include <immintrin.h>

    __m256 mul_constant(__m256 x) {
        return _mm256_mul_ps(x, _mm256_set1_ps(1234.f));
    }

Compiling this for the "SKX" target produces the following code:

    $ clang-5.0 -march=knl -O3 -S -fomit-frame-pointer test.c -o test.o

Assembly (cleaned up):

    _mul_constant: 
            vmulps  LCPI0_0(%rip){1to8}, %ymm0, %ymm0    <----- good!
            retq

On the other hand, compiling for "KNL" yields

    $ clang-5.0 -march=knl -O3 -S -fomit-frame-pointer test.c -o test.o

Assembly (cleaned up):

    _mul_constant:
            vbroadcastss    LCPI0_0(%rip), %ymm1        <----- ?!?
            vmulps  %ymm1, %ymm0, %ymm0                 <----- code should be
identical
            retq

-- 
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/20170131/4460a652/attachment-0001.html>


More information about the llvm-bugs mailing list