mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 04:16:09 +00:00

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
32 lines
1.2 KiB
LLVM
32 lines
1.2 KiB
LLVM
; Test to check the callgraph in summary
|
|
; RUN: opt -module-summary %s -o %t.o
|
|
; RUN: llvm-lto -thinlto-action=thinlink -o %t.index.bc %t.o
|
|
; RUN: llvm-bcanalyzer -dump %t.index.bc | FileCheck %s --check-prefix=COMBINED
|
|
|
|
; COMBINED: <GLOBALVAL_SUMMARY_BLOCK
|
|
; COMBINED-NEXT: <VERSION
|
|
; COMBINED-NEXT: <FLAGS
|
|
; COMBINED-NEXT: <VALUE_GUID {{.*}} op1=4947176790635855146/>
|
|
; COMBINED-NEXT: <VALUE_GUID {{.*}} op1=-6591587165810580810/>
|
|
; COMBINED-NEXT: <VALUE_GUID {{.*}} op1=-4377693495213223786/>
|
|
; COMBINED-DAG: <COMBINED{{ }}
|
|
; COMBINED-DAG: <COMBINED_ORIGINAL_NAME op0=6699318081062747564/>
|
|
; COMBINED-DAG: <COMBINED_GLOBALVAR_INIT_REFS
|
|
; COMBINED-DAG: <COMBINED_ORIGINAL_NAME op0=-2012135647395072713/>
|
|
; COMBINED-DAG: <COMBINED_ALIAS
|
|
; COMBINED-DAG: <COMBINED_ORIGINAL_NAME op0=-4170563161550796836/>
|
|
; COMBINED-NEXT: </GLOBALVAL_SUMMARY_BLOCK>
|
|
|
|
source_filename = "/path/to/source.c"
|
|
|
|
; ModuleID = 'thinlto-function-summary-callgraph.ll'
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
@bar = internal global i32 0
|
|
@fooalias = internal alias void (...), bitcast (void ()* @foo to void (...)*)
|
|
|
|
define internal void @foo() {
|
|
ret void
|
|
}
|