[clang] [FMV] Allow multi versioning without default declaration. (PR #85454)

Alexandros Lamprineas via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 22 12:12:03 PDT 2024


================
@@ -68,13 +68,15 @@ int __attribute__((target_version(""))) unsup1(void) { return 1; }
 void __attribute__((target_version("crc32"))) unsup2(void) {}
 
 void __attribute__((target_version("default+fp16"))) koo(void) {}
+//expected-error at -1 {{function multiversioning doesn't support feature 'default'}}
 void __attribute__((target_version("default+default+default"))) loo(void) {}
+//expected-error at -1 {{function multiversioning doesn't support feature 'default'}}
----------------
labrinea wrote:

This diagnostic is unrelated to the patch. I believe it deserves a separate PR if at all. I am not confused by the message itself to be honest as the ACLE is clear that the attribute string is eather "default" or a list of features with '+' in between. What bothers me is the inconsistency with `target_clones`, where "default+fp16" is treated as a warning and "default" is ignored. Both attributes should either warn or error.

https://github.com/llvm/llvm-project/pull/85454


More information about the cfe-commits mailing list