[PATCH] D39179: [AArch64] Fix PR34625 -mtune without -mcpu should not set -target-cpu

Peter Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 23 05:31:02 PDT 2017

peter.smith created this revision.
Herald added subscribers: javed.absar, rengolin, aemerson.

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. I've kept the hard-coded behaviour of -mtune for some Apple CPU codenames and have added in a call to check the -mtune cpu as there are some tests that depend on it.

Further work will be needed to implement -mtune properly, so that it affects only micro-architectural features.

fixes PR34625



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39179.119837.patch
Type: text/x-patch
Size: 43607 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171023/4f6549ad/attachment-0001.bin>

More information about the cfe-commits mailing list