[PATCH] D42799: [ThinLTO] Serialize WithGlobalValueDeadStripping index flag for distributed backends

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 1 08:17:38 PST 2018


tejohnson created this revision.
tejohnson added reviewers: grimar, pcc.
Herald added subscribers: eraman, inglorion, mehdi_amini.

A recent fix to drop dead symbols (r323633) did not work for ThinLTO
distributed backends because we lose the WithGlobalValueDeadStripping
set on the index during the thin link. This patch adds a new flags
record to the bitcode format for the index, and serializes this flag
for the combined index (it would always be 0 for the per-module index
generated by the compile step, so no need to serialize the new flags
record there until/unless we add another flag that applies to the
per-module indexes).

Generally this flag should always be set for the distributed backends,
which are necessarily performed after the thin link. However, if we were
to simply set this flag on the index applied to the distributed backends
(invoked via clang), we would lose the ability to disable dead stripping
via -compute-dead=false for debugging purposes.


Repository:
  rL LLVM

https://reviews.llvm.org/D42799

Files:
  include/llvm/Bitcode/LLVMBitCodes.h
  lib/Bitcode/Reader/BitcodeReader.cpp
  lib/Bitcode/Writer/BitcodeWriter.cpp
  test/Bitcode/thinlto-alias.ll
  test/Bitcode/thinlto-deadstrip-flag.ll
  test/Bitcode/thinlto-function-summary-callgraph-pgo.ll
  test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll
  test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll
  test/Bitcode/thinlto-function-summary-callgraph.ll
  test/Bitcode/thinlto-function-summary-originalnames.ll
  test/tools/gold/X86/thinlto.ll
  test/tools/llvm-lto/thinlto.ll
  tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42799.132404.patch
Type: text/x-patch
Size: 8477 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180201/a18c2120/attachment.bin>


More information about the llvm-commits mailing list