[all-commits] [llvm/llvm-project] a2d309: [FMV][AArch64] Do not emit ifunc resolver on use. ...

Alexandros Lamprineas via All-commits all-commits at lists.llvm.org
Thu Jul 18 08:34:38 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a2d309912a2863dfe7286ffde67b968e8c720b07
      https://github.com/llvm/llvm-project/commit/a2d309912a2863dfe7286ffde67b968e8c720b07
  Author: Alexandros Lamprineas <alexandros.lamprineas at arm.com>
  Date:   2024-07-18 (Thu, 18 Jul 2024)

  Changed paths:
    M clang/lib/CodeGen/CodeGenModule.cpp
    A clang/test/CodeGen/aarch64-fmv-resolver-emission.c
    M clang/test/CodeGen/aarch64-mixed-target-attributes.c
    M clang/test/CodeGen/attr-target-clones-aarch64.c
    M clang/test/CodeGen/attr-target-version.c
    A clang/test/CodeGenCXX/aarch64-fmv-resolver-emission.cpp
    M clang/test/CodeGenCXX/attr-target-clones-aarch64.cpp
    M clang/test/CodeGenCXX/attr-target-version.cpp
    M clang/test/CodeGenCXX/fmv-namespace.cpp

  Log Message:
  -----------
  [FMV][AArch64] Do not emit ifunc resolver on use. (#97761)

It was raised in https://github.com/llvm/llvm-project/issues/81494 that
we are not generating correct code when there is no TU-local caller.

The suggestion was to emit a resolver:
* Whenever there is a use in the TU.
* When the TU has a definition of the default version.

See the comment for more details:

https://github.com/llvm/llvm-project/issues/81494#issuecomment-1985963497

This got addressed with https://github.com/llvm/llvm-project/pull/84405.

Generating a resolver on use means that we may end up with multiple
resolvers across different translation units. Those resolvers may not be
the same because each translation unit may contain different version
declarations (user's fault). Therefore the order of linking the final
image determines which of these weak symbols gets selected, resulting in
non consisted behavior. I am proposing to stop emitting a resolver on
use and only do so in the translation unit which contains the default
definition. This way we guarantee the existence of a single resolver.
Now, when a versioned function is used we want to emit a declaration of
the function symbol omitting the multiversion mangling.

I have added a requirement to ACLE mandating that all the function
versions are declared in the translation unit which contains the default
definition: https://github.com/ARM-software/acle/pull/328



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list