Requesting Help with Optimizing Code

tsbockman thomas.bockman at gmail.com
Thu Apr 8 03:45:06 UTC 2021


On Thursday, 8 April 2021 at 03:27:12 UTC, Max Haughton wrote:
> Although the obvious point here is vector width (you have
> AVX-512 from what I can see, however I'm not sure if this is
> actually a win or not on Skylake W)

 From what I've seen, LLVM's code generation and optimization for 
AVX-512 auto-vectorization is still quite bad and immature 
compared to AVX2 and earlier, and the wider the SIMD register the 
more that data structures and algorithms have to be specifically 
tailored to really benefit from them. Also, using AVX-512 
instructions forces the CPU to downclock.

So, I wouldn't expect much benefit from AVX-512 for the time 
being, unless you're going to hand optimize for it.

> For LDC, you'll want -mcpu=native`.

Only do this if you don't care about the binary working on any 
CPU but your own. Otherwise, you need to look at something like 
the Steam Hardware survey and decide what percentage of the 
market you want to capture (open the "Other Settings" section): 
https://store.steampowered.com/hwsurvey


More information about the Digitalmars-d mailing list