[PATCH] D14195: Move metadata linking after lazy global materialization/linking.

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 29 21:47:38 PDT 2015


tejohnson created this revision.
tejohnson added reviewers: dexonsmith, tra, dblaikie.
tejohnson added a subscriber: llvm-commits.

Currently, named metadata is linked before the LazilyLinkGlobalValues
list is walked and materialized/linked. As a result, references
from DISubprogram and DIGlobalVariable metadata to yet unmaterialized
functions and variables cause them to be added to the lazy linking
list and their definitions are materialized and linked.

This makes the llvm-link -only-needed option not have the intended
effect when debug information is present, as the otherwise unneeded
functions/variables are still linked in.

Additionally, for ThinLTO I have implemented a mechanism to only link
in debug metadata needed by imported functions. Moving named metadata
linking after lazy GV linking will facilitate applying this mechanism
to the LTO and "llvm-link -only-needed" cases as well.

http://reviews.llvm.org/D14195

Files:
  lib/Linker/LinkModules.cpp
  test/Linker/Inputs/linkage_debug.b.ll
  test/Linker/Inputs/linkage_debug.c.ll
  test/Linker/link-flags-debug.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D14195.38784.patch
Type: text/x-patch
Size: 4949 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151030/6f4d99db/attachment.bin>


More information about the llvm-commits mailing list