[PATCH] D24779: [ThinLTO] Always emit a summary when compiling in ThinLTO mode

Teresa Johnson via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 13:08:29 PDT 2016


tejohnson created this revision.
tejohnson added a reviewer: mehdi_amini.
tejohnson added subscribers: pcc, llvm-commits.
Herald added a subscriber: mehdi_amini.

Emit an empty summary section, instead of no summary section, when
there are no global variables in the index. This ensures that LTO
will treat these files as ThinLTO inputs, instead of as regular
LTO inputs.

In addition to not being what the user likely intended when
compiling with -flto=thin, the current behavior is problematic for
distributed build systems that expect to get ThinLTO index and imports
files back for each input compiled with -flto=thin. Combining into
a single regular LTO module also reduces the backend parallelism.
And in the case where the index was suppressed due to uses in
inline assembly, combining into a single LTO module could provoke
renaming of duplicates that we were trying to prevent by suppressing
the index.

This change required a couple of fixes to handle the empty summary
section.

https://reviews.llvm.org/D24779

Files:
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  lib/LTO/LTO.cpp
  test/ThinLTO/X86/Inputs/emit_imports.ll
  test/ThinLTO/X86/Inputs/empty.ll
  test/ThinLTO/X86/emit_imports.ll
  test/tools/gold/X86/Inputs/thinlto_empty.ll
  test/tools/gold/X86/thinlto_emit_imports.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24779.71971.patch
Type: text/x-patch
Size: 7220 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160920/5e8f4696/attachment-0001.bin>


More information about the llvm-commits mailing list