[ARM] Compute a target feature which corresponds to the ARM version.

Description

[ARM] Compute a target feature which corresponds to the ARM version.

Currently, the interaction between the triple, the CPU, and the
supported features is a mess: the driver edits the triple to indicate
the supported architecture version, and the LLVM backend uses this to
figure out what instructions are legal. This makes it difficult to
understand what's happening, and makes it impossible to LTO together two
modules with different computed architectures.

Instead of relying on triple rewriting to get the correct target
features, we should add the right target features explicitly.

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

Details

Committed
efriedmaApr 16 2018, 4:52 PM
Differential Revision
D45240: [ARM] Compute a target feature which corresponds to the ARM version.
Branches
Unknown
Tags
Unknown
stuij added a subscriber: stuij.Apr 24 2018, 8:25 AM

Unfortunately, after this commit, we in some cases choose the wrong fpu settings when providing -mfpu.

For example when compiling with clang --target=arm-none-eabi test.c -mcpu=cortex-a5 -mfpu=vfpv4-d16 -S -o test.s, the neon-vfpv4 fpu directive is produced, instead of vfpv4-d16.

It looks like it doesn't actually generate NEON instructions; we're just end up with the wrong .fpu directive. Looking.

As far as I can tell, this commit didn't change the behavior for your testcase.

As far as I can tell, this commit didn't change the behavior for your testcase.

Nevermind, messed up my testing; it's definitely behaving differently. Still looking.