[PATCH] D67259: [X86] Enable -mprefer-vector-width=256 by default for Skylake-avx512 and later Intel CPUs.

Ori Livneh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 11 08:39:01 PDT 2019


atdt added a comment.

In D67259#1665675 <https://reviews.llvm.org/D67259#1665675>, @craig.topper wrote:

> In D67259#1662106 <https://reviews.llvm.org/D67259#1662106>, @RKSimon wrote:
>
> > Do we need to include some benchmark numbers?
>
>
> What tests do you think we should run?


I don't think it's practical to benchmark this. The effects are well-documented and well-understood. Additionally, the incidence and severity of high-power AVX frequency reductions are a function of system states and workload profile, which makes them difficult to reproduce in small, self-contained examples.

It's sufficient justification for this change to note that it brings Clang into line with other compilers. See here <https://lemire.me/blog/2018/09/07/avx-512-when-and-how-to-use-these-new-instructions/>:

> **A significant problem is compiler inserted AVX-512 instructions**. Even if you are not using any explicit AVX-512 instructions or intrinsics, compilers may decide to use them as a result of loop vectorization, within library functions and other optimization. Even something as simple as copying a structure may cause AVX-512 instructions to appear in your program. Current compiler behavior here varies greatly, and we can expect it to change in the future. In fact, it has already changed: Intel made more aggressive use of AVX-512 instructions in earlier versions of the icc compiler, but has since removed most use unless the user asks for it with a special command line option. Based on some not very comprehensive tests of LLVM’s clang (the default compiler on macOS), GNU gcc, Intel’s compiler (icc) and MSVC (part of Microsoft Visual Studio), **only clang makes aggressive use of 512-bit instructions** for simple constructs today: it used such instructions while copying structures, inlining memcpy, and vectorizing loops.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67259/new/

https://reviews.llvm.org/D67259





More information about the llvm-commits mailing list