This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Introduce subtarget features per ARM architecture
ClosedPublic

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

Details

Summary

This change refactors the CPU definitions in ARM.td to pull out architecture as separate subtarget features, this has a few benefits:

  • It allows architectures to more accurately be targeted
  • It removes the hard-coded feature strings in the ARM backend's MCTargetDesc
  • It generally tidies up the target definitions ARM.td allowing CPUs to properly inherit from architectures

The rationale behind this is two fold, firstly to help support architectures being targeted using -mcpu=generic (see my next patch for details), and also so that multiple architectures without a supported CPU (such as ARMv8.1-A currently) can be targeted without having duplicate generic CPU fields in the TargetParser (which is currently broken, see my next patch also).

The intention here is not to change the the current set of features enabled for each CPU, the feature sets should be remaining the same.

Diff Detail

Repository
rL LLVM

Event Timeline

bsmith updated this revision to Diff 40153.Nov 13 2015, 9:29 AM
bsmith retitled this revision from to [ARM] Introduce subtarget features per ARM architecture.
bsmith updated this object.
bsmith added a reviewer: t.p.northover.
bsmith set the repository for this revision to rL LLVM.
bsmith added a subscriber: llvm-commits.

+echristo, since he's played with subtargets a lot recently so might have
some insight about good ways to do this/deficiencies in the current ARM
representation/whatnot

Hi Bradley,

Thanks for working on this, it's a massive improvement on the current state of sub-target description for ARM. I'd still like to hear Tim's and Eric's opinions, but the patch looks good to me.

cheers,
--renato

include/llvm/MC/MCSubtargetInfo.h
90

nitpick: FS may not be the best of names...

lib/Target/ARM/ARM.td
183

typo

513

I guess there's no easy way to extend it from A9...

rengolin accepted this revision.Nov 13 2015, 10:09 AM
rengolin edited edge metadata.
This revision is now accepted and ready to land.Nov 13 2015, 10:09 AM
echristo accepted this revision.Nov 13 2015, 2:51 PM
echristo edited edge metadata.

I think this is ok. I've got one inline comment (to update a comment).

-eric

include/llvm/MC/MCSubtargetInfo.h
90

FS is what we use approximately everywhere else.

That said, the comment needs to be updated.

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

Thanks all! Committed as r253196.