[cfe-dev] Option -mtune

Joerg Sonnenberger via cfe-dev cfe-dev at lists.llvm.org
Wed Apr 22 17:53:17 PDT 2020

On Wed, Apr 22, 2020 at 12:12:40PM -0500, David Greene via cfe-dev wrote:
> * -mcpu implies -target (based on host machine), -march and -mtune
>   Example: -mcpu=skylake-avx512 sets
>     -target=x86_64-unknown-linux-gnu (when run on a Debian system)
>     -march=skylake-avx512
>     -mtune=skylake-avx512

This is just wrong. The CPU name has no 1:1 mapping to target
architectures. skylake-avx512 can still be happily used for
i386-unknown-linux-gnu to completement your example. The reverse is
somewhat true: the target triple can provide the default CPU

> Of course one could always pass -triple (or other options) explicitly to
> suppress the implied behaviors.  We still want -mtune and -march to
> operate independently of each other (i.e. neither implies the other) so
> that one can generate backward-compatible binaries while still tuning
> for recent microarchitectures.

Please submit patches then for making scheduling independent of the
architecture flags. Until then, this whole discussion seems to be a
waste of time to me. Always using the/a default scheduling is IMO a
perfectly sensible behavior and more often than not, what GCC is doing


More information about the cfe-dev mailing list