[PATCH] D142963: [AArch64] Handle negative architecture features

Tomas Matheson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 02:42:24 PST 2023


tmatheson added a comment.

It looks like this has these odd behaviours:

- `-target-feature +v9.3a -target-feature -v9.2a` will remove `v9.2a` but add all the dependent features of both `v9.3a` and `v9.2a`.
- `-target-feature -v9.2a -target-feature +v9.3a` will add the `v9.2a` back, and also add all the dependent features of both `v9.3a` and `v9.2a`.
- `-target-feature +v9.3a -target-feature -v9.3a` will remove `v9.3a` but add all the dependent features of `v9.3a`.

This seems like a bit of a minefield. Is there even a use case for negative architectural features?



================
Comment at: clang/lib/Basic/Targets/AArch64.cpp:687-688
 
-  if (ArchInfo == llvm::AArch64::INVALID)
-    return; // Not an architecure, nothing more to do.
+  if (ArchInfo == llvm::AArch64::INVALID || !Enabled)
+    return; // Not an architecture, nothing more to do.
 
----------------
pratlucas wrote:
> I believe these changes require a rebase. `llvm::AArch64::INVALID` was removed by D142539.



CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142963/new/

https://reviews.llvm.org/D142963



More information about the llvm-commits mailing list