This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Make the TargetParser add CPU exts provided by the arch.
ClosedPublic

Authored by ab on May 2 2017, 6:01 PM.

Details

Summary

Otherwise, each CPU has to manually specify the extensions it supports,
even though they have to be a superset of the base arch extensions.
And when there's redundant data there's stale data, so most of the CPUs
lie about the features they support (most don't list AEK_FP).

Instead, do the saner thing: add the optional extensions on top of the
base extensions provided by the architecture.

The ARM TargetParser has the same behavior.

Diff Detail

Repository
rL LLVM

Event Timeline

ab created this revision.May 2 2017, 6:01 PM
rengolin accepted this revision.May 3 2017, 10:45 AM

I really thought it was there already! Thanks for the patch! LGTM.

--renato

unittests/Support/TargetParserTest.cpp
614 ↗(On Diff #97533)

I wonder what's the use of AEK_INVALID...

This revision is now accepted and ready to land.May 3 2017, 10:45 AM
This revision was automatically updated to reflect the committed changes.
ab added a comment.May 3 2017, 2:00 PM

Thanks Renato!

unittests/Support/TargetParserTest.cpp
614 ↗(On Diff #97533)

It's useful as a return value for completely unknown CPUs, no? 'invalid' is listed in the .def, so we only get AEK_NONE for that. I considered adding a test for a "foobar" CPU, and that should provide AEK_INVALID, but that doesn't seem like a very valuable test, so, eh!