Speaking of which, AMD's Bulldozer architecture processors, launched in 2011, have received a compiler performance optimization after 15 years.
On November 30, the LLVM project merged an optimization for the AMD Bulldozer family into its main branch, covering four generations of architectures: Bulldozer, Piledriver, Steamroller, and Excavator, including FX series processors and some APUs.
It all started with a bug report submitted this September, in which testers used a 16-core AMD Opteron 6386 SE processor to test a loop containing 100,000 floating-point multiply-add operations.
The generic x86-64 code generated by Clang 22.1.8 completed the operation in just 27 microseconds, but enabling the -march=bdver2 optimization option for the Piledriver architecture increased the time to 93.2 microseconds, roughly 3.4 times the original.
In comparison, the generic code generated by GCC 16.2.1 took 30.1 microseconds, which was reduced to 26.5 microseconds after optimization for Piledriver.
Testers found that prioritizing 128-bit vectors in Clang restored performance to levels comparable with GCC.
The issue is related to Bulldozer's unique modular design, where each module's two integer cores share a floating-point unit with two 128-bit wide fused multiply-add (FMA) pipelines.
256-bit AVX operations need to be split for execution, which not only fails to directly increase the throughput of these pipelines but also consumes additional decoding and scheduling resources.
This update sets 128-bit vectors as the preferred option for auto-vectorization across four generations of Bulldozer architectures, without removing support for 256-bit instructions.
Interestingly, GCC had already adopted similar optimizations before Bulldozer's launch in 2011, while LLVM is only catching up now.
The relevant changes are expected to be included in the official LLVM 24.1 release around March 2027. In the meantime, users can manually add the -mprefer-vector-width=128 parameter when compiling with Clang.

