[PATCH] D141518: [AArch64] Move default extensions from clang Driver to TargetParser

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 13 02:27:39 PST 2023


dmgreen added a comment.

In D141518#4047962 <https://reviews.llvm.org/D141518#4047962>, @pratlucas wrote:

> Sorry, I just noticed my previous comment wasn't clear on what I meant by passing on the target features.
> The features are indeed included as part of the IR attributes since D141411 <https://reviews.llvm.org/D141411>, but they are no longer included as `-target-feature` arguments in calls to cc1 by the clang driver. This is not the case when using `-mcpu`, for example. 
> I agree the end result will be the same assuming the information is consistent between the TargetParser and the backend's subtarget features, but I think it would be good to define the what's the clang driver's expected behaviour to avoid any inconsistencies in the future.

Ah I see, between the clang driver and cc1. Yes - I think in the past we were only caring about command line options like `-march` and `-mcpu`. In that case there is little difference in practice between adding the logic to the driver and adding it to clang proper. They both have the same effect in the end.
Nowadays we would like for attributes to be able to set architecture features too, as in function-multiversioning and using `__attribute__((target("arch=..")))` attributes.  When that becomes a consideration it is best for a lot of this logic to be handled in clang-proper, so it can be consistent between the two.


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

https://reviews.llvm.org/D141518



More information about the llvm-commits mailing list