GCC 4.8 vs. LLVM/Clang 3.3 On Intel's Core i7 4770K
Phoronix: GCC 4.8 vs. LLVM/Clang 3.3 On Intel's Core i7 4770K
Complementing the earlier Phoronix article about optimized binaries for Intel Haswell CPUs via the "-march=core-avx2" Haswell compiler optimizations, in this article is a comparison of the GCC and LLVM/Clang compilers when targeting the new Core i7 4770K CPU. GCC 4.7.3, GCC 4.8.1, LLVM Clang 3.2, and LLVM Clang 3.3 were the tested compilers under Ubuntu Linux when seeing how well these different compilers optimized for Haswell.
What is with the insistance of using tests that are designed to compile with OpenMP
Well it's more interesting than doing a test where one compiler uses openmp and the other doesn't, that's totally pointless. Now atleast he doesn't use openmp.
Originally Posted by Marc Driftmeyer
or in C-Ray's case use -ffast-math that isn't even supported in LLVM/Clang to show comparison results?
The specified commandline for the C-Ray test was:
-lm -lpthread -O3 -march=core-avx2
-O3 does not enable -ffast-math, -Ofast does, so this test should be without -ffast-math. For the record -ffast-math is a very useful optimization for software which doesn't need the precision, but again, it's not enabled by the settings used in this benchmark.
The tests which are worthless are the Scimark ones as for some reason Michael won't declare the optimizations used for those.
For all we know they could be done using -O0, -O1, -O2, which doesn't say anything really as there is no standard correlation of what is enabled in these optimization settings between compilers.
This is why if you only use one option and want to compare for performance of generated code, you will use -O3 as it is the option which is supposed to generate the fastest code across these compilers.