[PATCH] D148746: [ThinLTO] Remove BlockCount for non partial sample profile builds

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 15:02:16 PDT 2023


tejohnson created this revision.
tejohnson added a reviewer: xur.
Herald added subscribers: ormris, wenlei, arphaman, steven_wu, hiraditya, inglorion, emaste.
Herald added projects: lld-macho, All.
Herald added a reviewer: lld-macho.
tejohnson requested review of this revision.
Herald added a subscriber: MaskRay.
Herald added a project: LLVM.

As pointed out in
https://discourse.llvm.org/t/undeterministic-thin-index-file/69985, the
block count added to distributed ThinLTO index files breaks incremental
builds on ThinLTO - if any linked file has a different number of BBs,
then the accumulated sum placed in the index files will change, causing
all ThinLTO backend compiles to be redone.

The block count is only used for scaling of partial sample profiles, and
was added in D80403 <https://reviews.llvm.org/D80403> for D79831 <https://reviews.llvm.org/D79831>.

This patch simply removes this field from the index files of non partial
sample profile compiles, which is NFC on the output of the compiler.

We subsequently need to see if this can be removed for partial sample
profiles without signficant performance loss, or redesigned in a way
that does not destroy caching.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148746

Files:
  lld/test/COFF/thinlto-index-only.ll
  lld/test/ELF/lto/thinlto-emit-index.ll
  lld/test/ELF/lto/thinlto-index-only.ll
  lld/test/MachO/thinlto-emit-index.ll
  lld/test/MachO/thinlto-index-only.ll
  llvm/include/llvm/IR/ModuleSummaryIndex.h
  llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
  llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/test/Bitcode/Inputs/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll
  llvm/test/Bitcode/thinlto-alias.ll
  llvm/test/Bitcode/thinlto-alias2.ll
  llvm/test/Bitcode/thinlto-function-summary-callgraph-cast.ll
  llvm/test/Bitcode/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll
  llvm/test/Bitcode/thinlto-function-summary-callgraph-pgo.ll
  llvm/test/Bitcode/thinlto-function-summary-callgraph-profile-summary.ll
  llvm/test/Bitcode/thinlto-function-summary-callgraph-relbf.ll
  llvm/test/Bitcode/thinlto-function-summary-callgraph-sample-profile-summary.ll
  llvm/test/Bitcode/thinlto-function-summary-callgraph.ll
  llvm/test/Bitcode/thinlto-function-summary-originalnames.ll
  llvm/test/Bitcode/thinlto-function-summary-paramaccess.ll
  llvm/test/Bitcode/thinlto-function-summary.ll
  llvm/test/Bitcode/thinlto-index-disassembled-by-llvm-dis.ll
  llvm/test/ThinLTO/X86/distributed_indexes.ll
  llvm/test/tools/gold/X86/thinlto.ll
  llvm/test/tools/llvm-lto/thinlto.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148746.515100.patch
Type: text/x-patch
Size: 22641 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230419/68199470/attachment-0001.bin>


More information about the llvm-commits mailing list