[PATCH] D129009: [LTO] Fix LTO for aliased IFuncs

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 10 14:52:09 PDT 2022


MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.

  As https://github.com/llvm/llvm-project/issues/56290 indicates, when an ifunc is aliased in LTO, clang will attempt to create an alias summary; however, as ifunc is not included in the module summary, doing so will lead to problems.
  
  Fixes https://github.com/llvm/llvm-project/issues/56290

Don't repeat the link. You can use :

  Fixes https://github.com/llvm/llvm-project/issues/56290: when an ifunc ...



================
Comment at: llvm/include/llvm/IR/GlobalIFunc.h:102
+  /// aliases along the path.
+  void applyAlongResolverPath(function_ref<void(const GlobalValue *)> Op) const;
 };
----------------
Prefer `const GlobalValue &` if not-nullable.


================
Comment at: llvm/test/ThinLTO/X86/alias-ifunc.ll:22
+ at foo = ifunc i32 (i32), ptr @foo_resolver
+; CHECK-RESOLVER: (name: "foo_resolver"
+; CHECK-RESOLVER-SAME: live: 1
----------------
For the same check prefix, align the content.

```
; CHECK-RESOLVER:      (name: "foo_resolver"
; CHECK-RESOLVER-SAME: live: 1



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129009/new/

https://reviews.llvm.org/D129009



More information about the llvm-commits mailing list