]> granicus.if.org Git - clang/commit
[AArch64] Fix PR34625 -mtune without -mcpu should not set -target-cpu
authorPeter Smith <peter.smith@linaro.org>
Tue, 24 Oct 2017 09:51:55 +0000 (09:51 +0000)
committerPeter Smith <peter.smith@linaro.org>
Tue, 24 Oct 2017 09:51:55 +0000 (09:51 +0000)
commit55c536c5901afcbe111e76ed16fbe8ce4434c563
tree1abd139518c4c876c5fe3e647a2555e8fe48a456
parenta45d5bb59f1d95d850d6bf1ec2448ac6cf653415
[AArch64] Fix PR34625 -mtune without -mcpu should not set -target-cpu

When -mtune is used on AArch64 the -target-cpu is passed the value of the
cpu given to -mtune. As well as setting micro-architectural features of the
-mtune cpu, this will also add the architectural features such as support
for instructions. This can result in the backend using instructions that
are supported in the -mtune cpu but not supported in the target
architecture. For example use of the v8.1-a LSE extensions with -march=v8.

This change removes the setting of -target-cpu for -mtune, the -mcpu must
be used to set -target-cpu. This has the effect of removing all non-hard
coded benefits of mtune but it does produce correct output when -mtune cpu
with a later architecture than v8 is used.

Fixes PR34625

Differential Revision: https://reviews.llvm.org/D39179

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316424 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Driver/ToolChains/Arch/AArch64.cpp
test/Driver/aarch64-cpus.c