LLVM Clang Will Finally Honor "-mtune=" On x86/x86_64 CPUs
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.
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.
9 Comments