After delivering benchmarks in March showing the performance gains of GCC 4.7 on Intel's Sandy Bridge processors, here's a look at how the latest LLVM/Clang 3.1 compiler from Apple is shaping up for these latest Intel CPUs.
As written about back in January, open-source compilers have matured for Intel Sandy/Ivy Bridge CPUs and are already prepping for Intel Haswell (2013). LLVM has received this work too. With LLVM 3.1, which will be released next month, there are "Bug fixes and improved support for AVX1" (as introduced on Intel Sandy Bridge CPUs, continued on with Ivy Bridge, and on the AMD side found with Bulldozer CPUs) while offering "Support for AVX2 (still incomplete at this point)." The Advanced Vector Extensions 2 (AVX2) instruction set is not coming to processors until next year with Haswell.
From the six-core Intel Core i7 3960X with Hyper Threading, LLVM/Clang 3.1 from a recent SVN snapshot was tested and compared to LLVM/Clang 3.0, GCC 4.6.3, and GCC 4.7.0. A variety of C/C++ benchmarks were run from this system with the $1000 USD Sandy Bridge Extreme Edition CPU that was overclocked to 4.5GHz.
All of the compilers were built in their respective release/optimized modes. CFLAGS/CXXFLAGS of "-O3 -march=corei7-avx" were set before test installation.