[PATCH] D34156: [LTO] Add -femit-summary-index flag to emit summary for regular LTO

Tobias Edler von Koch via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 13 11:36:31 PDT 2017


tobiasvk created this revision.
Herald added subscribers: eraman, inglorion.

With https://reviews.llvm.org/D33921, we gained the ability to have module summaries in regular
LTO modules without triggering ThinLTO compilation. There is however,
currently, no way to trigger the emission of a module summary with
regular LTO in Clang. This patch adds a flag -femit-summary-index which
makes that possible.

Why would you want a summary with regular LTO?

The Qualcomm Linker performs a two-phase garbage collection (a.k.a. dead
stripping): firstly, before LTO compilation, and then again afterwards.
The key advantage of already running GC before LTO is that in links that
involve a heavy mix of ELF objects and bitcode (a critical use case for
us), we can prune some of the dependences between bitcode and ELF and
thus internalize more symbols in LTO.

For this to work, the linker needs to be able to inspect the reference
graphs for bitcode modules and the module summary provides exactly that.


https://reviews.llvm.org/D34156

Files:
  clang/include/clang/Driver/Options.td
  clang/include/clang/Frontend/CodeGenOptions.def
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/CodeGen/emit-summary-index.c
  clang/test/Misc/thinlto.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34156.102370.patch
Type: text/x-patch
Size: 7006 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170613/07b4f1bf/attachment-0001.bin>


More information about the cfe-commits mailing list