Using the LLVM Clang 3.8 code-branches for this soon-to-be-out compiler, I ran some compiler benchmarks on an Intel Haswell Xeon system when trying out the different common compiler optimization flags; similar to what's been done in past Phoronix articles, but always interesting to see the performance impact of the generated binaries by these different optimization levels.
Tested for this article was -O0, -O1, -O2, -Oz, -O3, and -O3 -march=native. Ubuntu 16.04 daily x86_64 was running on this system.
For some tests, -march=native makes the biggest impact...
In others, the most basic optimizations are enough.
Of course, the more optimization passes, the longer the compiler times.
To see all of these LLVM Clang 3.8 compiler optimization level benchmarks, visit this OpenBenchmarking.org result file to analyze all of the results.