[PATCH] D107934: [LowerTypeTests] Emit cfi_jt aliases regardless of function export

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 13 16:47:30 PDT 2021


nickdesaulniers marked an inline comment as done.
nickdesaulniers added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/LowerTypeTests.cpp:1555
+      if (!IsJumpTableCanonical) {
+        GlobalAlias *JtAlias = GlobalAlias::create(
+            F->getValueType(), 0, GlobalValue::ExternalLinkage,
----------------
nickdesaulniers wrote:
> pcc wrote:
> > tejohnson wrote:
> > > Where and how does the new alias symbol get used in the LTO case? I only see it used when importing in the backend in the ThinLTO case.
> > I think the idea is that these symbols only exist for debugging purposes.
> > 
> > I think this could be cleaned up a bit though to ensure that the symbols aren't being exported unnecessarily. Can we set the linkage to internal for non-exported symbols and add to llvm.used to ensure that the symbols aren't dropped?
> I've added this; I've fixed up one of the regressions it causes, llvm/test/Transforms/LowerTypeTests/export-icall.ll, but I'm not sure about the other two:
> 1. compiler-rt/test/cfi/icall/external-call.c
> 2. compiler-rt/test/cfi/icall/weak.c
Specifically, it seems that the use of `GlobalValue::InternalLinkage` rather than `GlobalValue::ExternalLinkage` is what causes those two tests to regress.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107934



More information about the llvm-commits mailing list