This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Add +feature names to TargetParser extensions table
ClosedPublic

Authored by bsmith on Nov 18 2015, 6:47 AM.

Details

Reviewers
rengolin
Summary

In order to support the AArch64 +feature syntax used in -mcpu/-march on ARM, the TargetParser needs to be taught how to map the extension names to the LLVM feature names.

This change adds this support which will be used in my next (clang) patch to support this type of targeting. For now we just enable use of +crc/+nocrc since this is the only optional extension we want to expose on the command line.

Diff Detail

Repository
rL LLVM

Event Timeline

bsmith updated this revision to Diff 40501.Nov 18 2015, 6:47 AM
bsmith retitled this revision from to [ARM] Add +feature names to TargetParser extensions table.
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 added inline comments.Nov 18 2015, 6:55 AM
include/llvm/Support/ARMTargetParser.def
113

I thought crypto would have, too.

lib/Support/TargetParser.cpp
335

Most extensions don't have a name, it'd be good to avoid constructing a StringRef out of a nullptr + another out of "no" + nullptr for every extension but one.

bsmith updated this revision to Diff 40514.Nov 18 2015, 8:23 AM

Only call getName/getNegName if the respective feature name is not nullptr. Also enable use of +crypto, I had originally omitted this due to it being specified in -mfpu, but I see no reason why it can't be here also.

rengolin accepted this revision.Nov 18 2015, 8:24 AM
rengolin edited edge metadata.

LGTM, thanks!

This revision is now accepted and ready to land.Nov 18 2015, 8:24 AM
bsmith closed this revision.Nov 18 2015, 8:35 AM

Thanks, committed as r253470.