This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Allow TargetParser to accurately target architectures
ClosedPublic

Authored by bsmith on Nov 13 2015, 9:32 AM.

Details

Reviewers
rengolin
Summary

This patch changes the TargetParser to properly handle the generic CPU.

Currently generic is handled by having a row in the CPU lists mapping it to ARMv8.1-A since this is the only architecture without a supported CPU. There are two problems with this. Firstly, it stops us from properly targeting architectures, we would ideally like -mcpu=generic to mean target the specified architecture, rather than ARMv8.1-A. Secondly, it prevents us from having more than one architecture in the TargetParser without a supported CPU, whilst the CPU list will allow multiple 'generic' entries, the TargetParser iterates through the list finding only a first one, never a second.

To achieve this change we add a default FPU for each architecture, so that we can fall back to it when the CPU is generic. We also change the API such that an architecture is specified for fetching of defaults for extensions and FPU, for use when a generic CPU is specified.

To co-inside with the generic support improved in D14660 we also default to 'generic' instead of an empty string in the cases of no valid default CPU being found but the architecture is valid.

Diff Detail

Repository
rL LLVM

Event Timeline

bsmith updated this revision to Diff 40157.Nov 13 2015, 9:32 AM
bsmith retitled this revision from to [ARM] Allow TargetParser to accurately target architectures.
bsmith updated this object.
bsmith added a reviewer: rengolin.
bsmith set the repository for this revision to rL LLVM.
bsmith added a subscriber: llvm-commits.
rengolin accepted this revision.Nov 13 2015, 10:07 AM
rengolin edited edge metadata.

LGTM, thanks!

This revision is now accepted and ready to land.Nov 13 2015, 10:07 AM

Thanks, committed as r253198.

bsmith closed this revision.Nov 16 2015, 3:19 AM