Re: [PATCH] [RFC] x86: avoid -mtune=atom with clang

From: Miguel Ojeda
Date: Tue Oct 19 2021 - 15:01:58 EST


On Tue, Oct 19, 2021 at 7:11 PM Arnd Bergmann <arnd@xxxxxxxxxx> wrote:
>
> +ifdef CONFIG_CC_IS_CLANG
> + cflags-$(CONFIG_MATOM) += -march=atom -mtune=generic
> +else
> cflags-$(CONFIG_MATOM) += -march=atom
> +endif

Is it possible to factor it out? Also, a comment with the LLVM version
we last checked would be good. Something like...

cflags-$(CONFIG_MATOM) += -march=atom

# Atom optimizations do not seem well exercised in, at least, LLVM <= 13,
# to the point of getting problems with register allocation.
ifdef CONFIG_CC_IS_CLANG
cflags-$(CONFIG_MATOM) += -mtune=generic
endif

Cheers,
Miguel