Intel SIMD and processor frequency

Has anyone done any analysis of how Rust's/LLVM's SIMD support interacts with Intel's automatic frequency scaling for AVX instructions?

It sounds like there's a potential pitfall that could cause slowdown overall if a section of code uses some AVX instructions but is not primarily comprised of AVX.

I maintain a performance-sensitive Rust codebase that uses both explicit vector operations and autovectorization. We don't explicitly use AVX512 because (1) there are some pre-Haswell machines lurking around still and (2) this clock scaling thing.

I have never seen LLVM produce an AVX512 instruction from autovectorization. Maybe it's happening and I've missed it, but if it affected performance, my benchmarks would notice.

So my conclusion, at the moment, is: you won't be hit by this by surprise, but rather if you (or a dependency) explicitly asks for a smattering of AVX512.

1 Like