[PATCH] D60421: [ThinLTO] Fix ThinLTOCodegenerator to export llvm.used symbols

Steven Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 8 13:46:05 PDT 2019


steven_wu created this revision.
steven_wu added reviewers: tejohnson, pcc, kromanova.
Herald added subscribers: dang, arphaman, dexonsmith, jkorous, hiraditya, eraman, inglorion, mehdi_amini.
Herald added a project: LLVM.

Reapply r357931 with fixes to ThinLTO testcases and llvm-lto tool.

ThinLTOCodeGenerator currently does not preserve llvm.used symbols and
it can internalize them. In order to pass the necessary information to the
legacy ThinLTOCodeGenerator, the input to the code generator is
rewritten to be based on lto::InputFile.

Now ThinLTO using the legacy LTO API will requires data layout in
Module.

"internalize" thinlto action in llvm-lto is updated to run both
"promote" and "internalize" with the same configuration as
ThinLTOCodeGenerator. The old "promote" + "internalize" option does not
produce the same output as ThinLTOCodeGenerator.

This fixes: PR41236
rdar://problem/49293439


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60421

Files:
  llvm/include/llvm/LTO/LTO.h
  llvm/include/llvm/LTO/legacy/ThinLTOCodeGenerator.h
  llvm/lib/LTO/LTO.cpp
  llvm/lib/LTO/ThinLTOCodeGenerator.cpp
  llvm/test/Bitcode/module_hash.ll
  llvm/test/ThinLTO/X86/Inputs/alias_import.ll
  llvm/test/ThinLTO/X86/Inputs/alias_resolution.ll
  llvm/test/ThinLTO/X86/Inputs/distributed_indexes.ll
  llvm/test/ThinLTO/X86/Inputs/merge-triple.ll
  llvm/test/ThinLTO/X86/Inputs/section.ll
  llvm/test/ThinLTO/X86/Inputs/thinlto-internalize-used2.ll
  llvm/test/ThinLTO/X86/alias_import.ll
  llvm/test/ThinLTO/X86/alias_resolution.ll
  llvm/test/ThinLTO/X86/deadstrip.ll
  llvm/test/ThinLTO/X86/distributed_indexes.ll
  llvm/test/ThinLTO/X86/internalize.ll
  llvm/test/ThinLTO/X86/linkonce_odr_unnamed_addr.ll
  llvm/test/ThinLTO/X86/merge-triple.ll
  llvm/test/ThinLTO/X86/prefix_replace.ll
  llvm/test/ThinLTO/X86/section.ll
  llvm/test/ThinLTO/X86/thinlto-internalize-used.ll
  llvm/test/ThinLTO/X86/weak_resolution.ll
  llvm/test/ThinLTO/X86/weak_resolution_single.ll
  llvm/test/Transforms/ThinLTOBitcodeWriter/no-type-md.ll
  llvm/tools/llvm-lto/llvm-lto.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60421.194202.patch
Type: text/x-patch
Size: 36768 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190408/761bed40/attachment.bin>


More information about the llvm-commits mailing list