[clang] [AArch64][Clang] Fix linker error for function multiversioning (PR #74358)

via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 12 01:31:06 PST 2023


================
@@ -1752,8 +1754,10 @@ static void AppendTargetClonesMangling(const CodeGenModule &CGM,
   const TargetInfo &TI = CGM.getTarget();
   if (TI.getTriple().isAArch64()) {
----------------
DanielKristofKiss wrote:

As I see for other targets `"default"` is just copied as a feature string.
For AArch64 we want to have clones per feature or set of features instead of CPU.
```c
__attribute__((target_clones("crc32", "aes+sha1")))
int foo(){..}
```

would give 3 clones; the default, `crc32` and one for `aes` plus `sha1` mangled as `foo.default`, `foo._Mcrc32`,` foo._Msha1Maes` respectively.
Also "aes+sha1" should be the same as "sha1+aes" after mangling.


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


More information about the cfe-commits mailing list