[PATCH] D127812: [AArch64] Function multiversioning support added.

Daniel Kiss via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 12:53:35 PDT 2022


danielkiss added a comment.

In D127812#3602688 <https://reviews.llvm.org/D127812#3602688>, @aaron.ballman wrote:

> In D127812#3602645 <https://reviews.llvm.org/D127812#3602645>, @erichkeane wrote:
>
>> In D127812#3601476 <https://reviews.llvm.org/D127812#3601476>, @danielkiss wrote:
>>
>>> Your understanding is correct. `target` attribute has two usage model. One is just redefine the to be used codegen options, this is used already widely for Arm and AArch64. The other use of the `target` attribute is the multi versioning and the rational for the `target_version` attribute is the easier distinction between the two usage mode, also not to break any code out there by changing the behaviour of an attribute.
>>
>> I don't think differentiating the uses here is a good idea.  I think it would have been a GREAT idea about 10 years ago, but that ship has already sailed once GCC started using it that way however.  We should be keeping the current behavior, otherwise we're going to have a horrible mix of target/target_version working inconsistently between platforms.
>
> That largely is my concern as well. The existing behavior of `target` is just that -- the existing behavior. I think deviating from that existing behavior will be confusing in practice. Adding additional attributes doesn't improve that confusion because users then have to know to decide between two very similar attributes, which means they then need to educate themselves on the differences between them. If we're going to push them towards the documentation to correctly use the attribute anyway, that's basically the same situation they're in today with the confusing dual behavior of `target`.

We started with the ACLE to be sure the platforms and compilers will implement the same for Arm targets so make the developers life easier with a consistent behaviour on Arm platforms. Users of the attributes anyway need to aware of the architecture differences. Like `-mtune` is different between Arm/AArch64 and x86.

I have some hope others may see the benefits of the new semantics (e.g. make the `"default"` optional for `target_clones` ) will be picked up by other architectures.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127812



More information about the llvm-commits mailing list