diff --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp --- a/llvm/lib/Analysis/ProfileSummaryInfo.cpp +++ b/llvm/lib/Analysis/ProfileSummaryInfo.cpp @@ -37,8 +37,13 @@ "partial-profile", cl::Hidden, cl::init(false), cl::desc("Specify the current profile is used as a partial profile.")); +// TODO: Remove this support completely after ensuring that disabling by +// default has no unexpected effects. This causes the global number of basic +// blocks to be recorded in the ThinLTO summary, which breaks caching in the +// distributed ThinLTO case. cl::opt ScalePartialSampleProfileWorkingSetSize( - "scale-partial-sample-profile-working-set-size", cl::Hidden, cl::init(true), + "scale-partial-sample-profile-working-set-size", cl::Hidden, + cl::init(false), cl::desc( "If true, scale the working set size of the partial sample profile " "by the partial profile ratio to reflect the size of the program " diff --git a/llvm/test/Bitcode/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll b/llvm/test/Bitcode/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll --- a/llvm/test/Bitcode/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll +++ b/llvm/test/Bitcode/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll @@ -1,43 +1,50 @@ -; Test to check the callgraph in summary when there is PGO -; RUN: opt -module-summary %s -o %t.o -; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s -; RUN: opt -module-summary %p/Inputs/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll -o %t2.o +;; Test to check the callgraph in summary when partial sample profile scaling +;; enabled. +; RUN: opt -module-summary %s -o %t.o -scale-partial-sample-profile-working-set-size +; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s --check-prefix=PERMODULE +; RUN: opt -module-summary %p/Inputs/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll -o %t2.o -scale-partial-sample-profile-working-set-size ; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o ; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED +;; Check that we don't get block count records when it isn't explicitly enabled. +; RUN: opt -module-summary %s -o %t.o +; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s --implicit-check-not=BLOCK_COUNT +; RUN: opt -module-summary %p/Inputs/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll -o %t2.o +; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o +; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --implicit-check-not=BLOCK_COUNT -; CHECK: +; PERMODULE-LABEL: ; op4=none1 op6=hot1 op8=cold1 op10=none2 op12=hot2 op14=cold2 op16=none3 op18=hot3 op20=cold3 op22=123 -; CHECK-NEXT: -; CHECK-NEXT: -; CHECK-NEXT: +; PERMODULE-NEXT: +; PERMODULE-NEXT: +; PERMODULE-NEXT: -; CHECK: