[libcxx-commits] [lld] [clang] [flang] [libcxx] [clang-tools-extra] [llvm] [compiler-rt] [lldb] [libc] [Clang] Fix linker error for function multiversioning (PR #71706)

Tom Honermann via libcxx-commits libcxx-commits at lists.llvm.org
Tue Dec 5 11:12:49 PST 2023


================
@@ -2515,6 +2515,12 @@ example, the following will emit 4 versions of the function:
     __attribute__((target_clones("arch=atom,avx2","arch=ivybridge","default")))
     void foo() {}
 
+Dispatch is done via ``ifunc`` mechanism. The assembler name of the indirect
+function is the original assembler name of the multiversioned function. For
+backward compatibility, an alias to this function is currently generated
+with an ``.ifunc`` suffix. This symbol is deprecated and may be removed
+in the future.
+
----------------
tahonermann wrote:

Not all x86/x86-64 targets support the ifunc feature.
```suggestion
For targets that support the GNU indirect function (IFUNC) feature, dispatch
is performed by emitting an indirect function that is resolved to the appropriate
target clone at load time. The indirect function is given the name the
multiversioned function would have if it had been declared without the attribute.
For backward compatibility with earlier Clang releases, a function alias with an
``.ifunc`` suffix is also emitted. The  ``.ifunc`` suffixed symbol is a deprecated
feature and support for it may be removed in the future.
```

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


More information about the libcxx-commits mailing list