This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add 'fillValidCPUArchList' to ARM targets
ClosedPublic

Authored by erichkeane on Feb 6 2018, 11:06 AM.

Details

Summary

This is a support change for a CFE change (https://reviews.llvm.org/D42978)
that allows march and -target-cpu to list the valid targets in a note. The changes
are limited to the ARM/AArch64, since this is the only target that gets the CPU
list from LLVM.

Diff Detail

Event Timeline

erichkeane created this revision.Feb 6 2018, 11:06 AM
samparker added inline comments.
lib/Support/TargetParser.cpp
692

Could you not just copy the values from CPUNames and AArch64CPUNames?

fhahn added a comment.Feb 7 2018, 1:24 AM

Thanks for the patch, I think this would be a nice UI improvement. I agree with Sam, please use CPUNames and AArch64CPUNames. Also there are unit tests for the target parser in unittests/Support/TargetParserTest.cpp. Could you add some for the new functions?

Changed to using the CPUNames lists.

erichkeane marked an inline comment as done.Feb 7 2018, 10:20 AM

Just realized I forgot the unittest, i'll toss a couple in, sorry about that!

Added tests as requested. Should cover all current comments.

samparker accepted this revision.Feb 8 2018, 12:53 AM

Thanks. LGTM to me with two small nits.

lib/Support/TargetParser.cpp
702

CpuNames has the getName helper for just this.

unittests/Support/TargetParserTest.cpp
285

Why create a SmallVector with fewer elements than you know will be required?

This revision is now accepted and ready to land.Feb 8 2018, 12:53 AM
erichkeane closed this revision.Feb 8 2018, 8:51 AM
erichkeane marked 2 inline comments as done.