[ARM][AArch64] generate subtarget feature flags
authorTomas Matheson <tomas.matheson@arm.com>
Wed, 23 Feb 2022 11:34:41 +0000 (11:34 +0000)
committerTomas Matheson <tomas.matheson@arm.com>
Fri, 18 Mar 2022 16:07:00 +0000 (16:07 +0000)
commit831ab35b2fc7ce2815a96e866b89ec4a0b8c2829
tree6a8fbf4fb1420648437b4abe4fada85f0538cb7a
parent453f8c87ff20932c79890d93474e862d52f6fe46
[ARM][AArch64] generate subtarget feature flags

Reland of D120906 after sanitizer failures.

This patch aims to reduce a lot of the boilerplate around adding new subtarget
features. From the SubtargetFeatures tablegen definitions, a series of calls to
the macro GET_SUBTARGETINFO_MACRO are generated in
ARM/AArch64GenSubtargetInfo.inc.  ARMSubtarget/AArch64Subtarget can then use
this macro to define bool members and the corresponding getter methods.

Some naming inconsistencies have been fixed to allow this, and one unused
member removed.

This implementation only applies to boolean members; in future both BitVector
and enum members could also be generated.

Differential Revision: https://reviews.llvm.org/D120906
llvm/lib/Target/AArch64/AArch64.td
llvm/lib/Target/AArch64/AArch64Subtarget.h
llvm/lib/Target/ARM/ARM.td
llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/lib/Target/ARM/ARMSubtarget.cpp
llvm/lib/Target/ARM/ARMSubtarget.h
llvm/utils/TableGen/SubtargetEmitter.cpp