diff options
author | ostannard <oliver.stannard@arm.com> | 2024-01-17 16:20:34 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-17 16:20:34 +0000 |
commit | 13e977d1738261487d8157918f14497517d75821 (patch) | |
tree | acac6b51ee32c3657f2ffd248d397f4488c52b7f /llvm/lib/Object/WasmObjectFile.cpp | |
parent | b7c81c1f91994fb6938875b62337ddc2a49bfd51 (diff) | |
download | llvm-13e977d1738261487d8157918f14497517d75821.zip llvm-13e977d1738261487d8157918f14497517d75821.tar.gz llvm-13e977d1738261487d8157918f14497517d75821.tar.bz2 |
[AArch64][Driver] Better handling of target feature dependencies (#78270)
Currently there are several bits of code in the AArch64 driver which
attempt to enforce dependencies between optional features in the -march=
and -mcpu= options. However, these are based on the list of feature
names being enabled/disabled, so they have a lot of logic to consider
the order in which features were turned on and off, which doesn't scale
well as dependency chains get longer.
This patch moves the code handling these dependencies to TargetParser,
and changes them to use a Bitset of enabled features. This makes it easy
to check which features are enabled, and is converted back to a list of
LLVM feature names once all of the command-line options are parsed.
The motivating example for this was the -mcpu=cortex-r82+nofp option.
Previously, the code handling the dependency between the fp16 and
fp16fml extensions did not consider the nofp modifier, so it added
+fullfp16 to the feature list. This should have been disabled by the
+nofp modifier, and also the backend did follow the dependency between
fullfp16 and fp, resulting in fp being turned back on in the backend.
Most of the dependencies added to AArch64TargetParser.h weren't known
about by clang before, I built that list by checking what the backend
thinks the dependencies between SubtargetFeatures are.
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
0 files changed, 0 insertions, 0 deletions