[PATCH] D68050: WIP Make attribute target work better with AArch64

Alexandros Lamprineas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 10:30:36 PDT 2019


labrinea added a comment.

> However, passing the AArch64 architecture names in target-cpu isn't supported by LLVM

The Clang documentation <https://clang.llvm.org/docs/AttributeReference.html#target> suggests that `arch` is used to override the CPU, not the Architecture (which is rather confusing if you ask me). GCC makes more sense having separate target attributes for CPU and Architecture (see the equivalent GCC documentation <https://gcc.gnu.org/onlinedocs/gcc/AArch64-Function-Attributes.html#AArch64-Function-Attributes>). I think `target-cpu` should remain `generic` when it is not explicitly specified either on the command line (-mcpu) or as a function attribute (i.e `target("arch=cortex-a57")`). However, if the function attribute specifies an Architecture (i.e `target("arch=armv8.4a")`), I agree we should favor the subtarget features corresponding to armv8.4 over those of the command line. Similarly we should favor the subtarget features corresponding to cortex-a57 (not sure if we do so atm - I think we don't). ARM and AArch64 have a way to list the implied target features using the TargetParser but we can't directly use that in CodeGenModule because it's tied to the backend.


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

https://reviews.llvm.org/D68050





More information about the llvm-commits mailing list