Show Your Support: Have you heard of Phoronix Premium? It's what complements advertisements on this site for our premium ad-free service. For less than $4 USD per month, you can help support our site while the funds generated allow us to keep doing Linux hardware reviews, performance benchmarking, maintain our community forums, and much more.
LLVM Clang 12 Benchmarks At Varying Optimization Levels, LTO
Earlier this month were benchmarks looking at GCC 11 performance with varying optimization levels and features like link-time optimizations. Stemming from reader requests, here are now similar reference benchmarks off LLVM Clang 12.0 on the same system with going from -O0 to -Ofast and toggling -march=native and LTO usage.
With this Clang 12.0 benchmarking a number of different C/C++ benchmarks were carried out across 13 different builds consisting of:
-O3 -march=native -flto
-Ofast -march=native -flto
The same open-source C/C++ benchmarks were used as in the GCC 11 testing except where any LLVM/Clang problems were encountered in just a couple situations.
The Clang 12 compiler benchmarking was done on Fedora Workstation 34 from an Intel Core i9 11900K Rocket Lake system.
If wanting the "TLDR" version, above is the geometric mean of the 44 different benchmarks carried out. Overall they are inline with expectations. Unlike the GCC 11 tests where the "-flto" runs actually were coming in slightly slower overall, that wasn't the case with this Clang benchmarking.