[PATCH] D32544: LTO: Mark undefined module inline asm symbols as visible outside of ThinLTO.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 10:38:34 PDT 2017


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

The LTO bits look fine to me. I think this is also the correct fix for ThinLTO but Teresa should confirm



================
Comment at: llvm/lib/Object/IRSymtab.cpp:166-168
+    // Undefined module asm symbols act as GC roots and are implicitly used.
+    if (Flags & object::BasicSymbolRef::SF_Undefined)
+      Sym.Flags |= 1 << storage::Symbol::FB_used;
----------------
pcc wrote:
> davide wrote:
> > pcc wrote:
> > > davide wrote:
> > > > With this patch in place, do we still need the call to `collectAsmUndefined` in the ThinLTO backend? (I understand we need it for LTO, still)
> > > Good point. I actually think we can remove it from both because preventing internalization should be sufficient to keep the symbol alive.
> > You probably already noticed, but there may be some test in lld that needs updating (so you can catch it before the bots start yelling).
> Yes, that was `lld/test/ELF/lto/asmundef.ll`, which I already updated :)
Oh, was looking at a stale revision.


https://reviews.llvm.org/D32544





More information about the llvm-commits mailing list