LLVM Clang Will Finally Honor "-mtune=" On x86/x86_64 CPUs

Written by Michael Larabel in LLVM on 27 August 2020 at 02:49 AM EDT. 9 Comments
Starting with LLVM Clang 12.0 next year, the Clang compiler on x86/x86_64 CPUs will finally honor -mtune= in a similar manner to GCC.

GCC has long allowed the -mtune= option on Intel/AMD processors for supporting microarchitectural tuning optimizations (scheduler model) to be applied independent of the CPU being targeted for instructions to enable that is set via the -march=. LLVM Clang is now supporting -mtune= as well in its x86 code for allowing this finer-grained tuning separate from -march=. Like GCC, if -mtune is not set it will follow the value specified via -march otherwise the defaults (generic).

The support landed across multiple commits in recent days in the code-base forming for LLVM 12.0.

This contribution to Clang was led by one of Intel's compiler engineers. Presumably them adding -mtune support in 2020 is for tuning with regards to their upcoming hybrid architectures featuring a mix of big/little cores and among them the possibility of different instruction sets supported between cores. With -mtune they would at least allow some better tuning while sticking to the least common denominator of the core features for -march. We'll see if it's for something along those lines or other reasons that they are finally adding this support.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week