[ThinLTO] Remove BlockCount for non partial sample profile builds
authorTeresa Johnson <tejohnson@google.com>
Wed, 19 Apr 2023 21:51:10 +0000 (14:51 -0700)
committerTeresa Johnson <tejohnson@google.com>
Thu, 20 Apr 2023 18:45:15 +0000 (11:45 -0700)
commit3adc6e03080c6d38a51f5c5b6744b7c0d9c7541b
treee95855cb0ec33430203bd1d118fa48d6990f2af0
parent3ba4d082da3dd6856887774fab694f81adc15a64
[ThinLTO] Remove BlockCount for non partial sample profile builds

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 for 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.

Differential Revision: https://reviews.llvm.org/D148746
25 files changed:
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 [new file with mode: 0644]
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 [new file with mode: 0644]
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