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

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 10:03:57 PST 2023


dmgreen added a comment.

In D142963#4093094 <https://reviews.llvm.org/D142963#4093094>, @tmatheson wrote:

> 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`. It also doesn't remove `v9.3a` which implies `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?

Yes - We don't have _any_ dependencies for negative target features at the moment. That is a larger job that will take some time to do properly though.

Between architecture revisions I would say that we can trust whatever is passing the parameters to get it right (not provide contradictory results). Otherwise it is a problem elsewhere. We just need to make sure we don't treat them invalidly. In this case from the linked bug, the features are coming from zig. Clang should always only use positive features. Which is why this bug exists - we didn't expect them to be passed as negative features. We can at least not get the dependent features wrong though.


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

https://reviews.llvm.org/D142963



More information about the llvm-commits mailing list