[llvm-bugs] [Bug 50400] New: Improved support for cpu_dispatch/cpu_specific attributes and function multi-versioning in AArch64 Clang

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 19 01:51:38 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50400

            Bug ID: 50400
           Summary: Improved support for cpu_dispatch/cpu_specific
                    attributes and function multi-versioning in AArch64
                    Clang
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: AArch64
          Assignee: unassignedbugs at nondot.org
          Reporter: srhines at google.com
                CC: arnaud.degrandmaison at arm.com, kristof.beyls at arm.com,
                    llozano at chromium.org, llvm-bugs at lists.llvm.org,
                    smithp352 at googlemail.com, Ties.Stuij at arm.com

https://lwn.net/Articles/691932/ describes function multi-versioning (FMV),
which has a different implementation in Clang based on using the attributes
https://clang.llvm.org/docs/AttributeReference.html#cpu-dispatch and
https://clang.llvm.org/docs/AttributeReference.html#cpu-specific. This
currently is implemented only for x86 targets, and doesn't work for other
(sub-)architectures like the many variants of AArch64.

The standard implementation in
https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/TargetInfo.h#L1311
for `CPUSpecificManglingCharacter()` makes it unreachable for unsupported
architectures. Only
https://github.com/llvm/llvm-project/blob/main/clang/lib/Basic/Targets/X86.cpp#L1081
shows an override for this function, and also implements the other necessary
helpers for function multi-versioning.

Function multi-versioning support for AArch64 would be a substantial help in
accelerating common library code both on the Android platform and for
developers shipping native applications. In each case, we often have to choose
the lowest common denominator version of AArch64 to ensure that our software
remains portable. Manually using ifuncs is insufficient because that requires
too much effort for most developers. Other AArch64 customers would also
probably benefit from having this feature as well.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210519/2f97ed02/attachment.html>


More information about the llvm-bugs mailing list