Show Your Support: This site is primarily supported by advertisements. Ads are what have allowed this site to be maintained on a daily basis for the past 18+ years. We do our best to ensure only clean, relevant ads are shown, when any nasty ads are detected, we work to remove them ASAP. If you would like to view the site without ads while still supporting our work, please consider our ad-free Phoronix Premium.
LLVM Clang Will Finally Honor "-mtune=" On x86/x86_64 CPUs
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.