summaryrefslogtreecommitdiff
path: root/llvm/test/Bitcode/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2023-05-23 13:02:48 -0700
committerTeresa Johnson <tejohnson@google.com>2023-05-25 08:32:48 -0700
commitaae8524bcc26cf04729f2bbc02ecb54233a587e4 (patch)
tree61db142ae78cd68ec14a7e43b82d53887e73edcb /llvm/test/Bitcode/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll
parent27c37327da67020f938aabf0f6405f57d688441e (diff)
[ThinLTO] Disable partial sample profile scaling by default
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. This was only used for partial sample profiles, and was therefore removed for other cases (3adc6e03080c6d38a51f5c5b6744b7c0d9c7541b). Subsequent testing did not show a performance effect of disabling this feature even for partial sample profiles. Therefore, switch the default to false. If this does not cause a noticeable performance degradation after the default flip, we can remove this support completely. Differential Revision: https://reviews.llvm.org/D151249
Diffstat (limited to 'llvm/test/Bitcode/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll')
-rw-r--r--llvm/test/Bitcode/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll55
1 files changed, 31 insertions, 24 deletions
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
index 1906229879f5..b843c04949c7 100644
--- 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: <SOURCE_FILENAME
+; PERMODULE: <SOURCE_FILENAME
; "hot_function"
-; CHECK-NEXT: <FUNCTION op0=0 op1=12
+; PERMODULE-NEXT: <FUNCTION op0=0 op1=12
; "hot1"
-; CHECK-NEXT: <FUNCTION op0=12 op1=4
+; PERMODULE-NEXT: <FUNCTION op0=12 op1=4
; "hot2"
-; CHECK-NEXT: <FUNCTION op0=16 op1=4
+; PERMODULE-NEXT: <FUNCTION op0=16 op1=4
; "hot3"
-; CHECK-NEXT: <FUNCTION op0=20 op1=4
+; PERMODULE-NEXT: <FUNCTION op0=20 op1=4
; "hot4"
-; CHECK-NEXT: <FUNCTION op0=24 op1=5
+; PERMODULE-NEXT: <FUNCTION op0=24 op1=5
; "cold"
-; CHECK-NEXT: <FUNCTION op0=29 op1=5
+; PERMODULE-NEXT: <FUNCTION op0=29 op1=5
; "none1"
-; CHECK-NEXT: <FUNCTION op0=34 op1=5
+; PERMODULE-NEXT: <FUNCTION op0=34 op1=5
; "none2"
-; CHECK-NEXT: <FUNCTION op0=39 op1=5
+; PERMODULE-NEXT: <FUNCTION op0=39 op1=5
; "none3"
-; CHECK-NEXT: <FUNCTION op0=44 op1=5
-; CHECK-NEXT: <FUNCTION op0=49 op1=5
+; PERMODULE-NEXT: <FUNCTION op0=44 op1=5
+; PERMODULE-NEXT: <FUNCTION op0=49 op1=5
-; CHECK-LABEL: <GLOBALVAL_SUMMARY_BLOCK
-; CHECK-NEXT: <VERSION
-; CHECK-NEXT: <FLAGS
-; CHECK-NEXT: <VALUE_GUID op0=27 op1=123/>
+; PERMODULE-LABEL: <GLOBALVAL_SUMMARY_BLOCK
+; PERMODULE-NEXT: <VERSION
+; PERMODULE-NEXT: <FLAGS
+; PERMODULE-NEXT: <VALUE_GUID op0=27 op1=123/>
; op4=none1 op6=hot1 op8=cold1 op10=none2 op12=hot2 op14=cold2 op16=none3 op18=hot3 op20=cold3 op22=123
-; CHECK-NEXT: <PERMODULE_PROFILE {{.*}} op7=7 op8=0 op9=1 op10=3 op11=4 op12=1 op13=8 op14=0 op15=2 op16=3 op17=5 op18=1 op19=9 op20=0 op21=3 op22=3 op23=6 op24=1 op25=27 op26=4/>
-; CHECK-NEXT: <BLOCK_COUNT op0=4/>
-; CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK>
+; PERMODULE-NEXT: <PERMODULE_PROFILE {{.*}} op7=7 op8=0 op9=1 op10=3 op11=4 op12=1 op13=8 op14=0 op15=2 op16=3 op17=5 op18=1 op19=9 op20=0 op21=3 op22=3 op23=6 op24=1 op25=27 op26=4/>
+; PERMODULE-NEXT: <BLOCK_COUNT op0=4/>
+; PERMODULE-NEXT: </GLOBALVAL_SUMMARY_BLOCK>
-; CHECK: <STRTAB_BLOCK
-; CHECK-NEXT: blob data = 'hot_functionhot1hot2hot3cold1cold2cold3none1none2none3{{.*}}'
+; PERMODULE: <STRTAB_BLOCK
+; PERMODULE-NEXT: blob data = 'hot_functionhot1hot2hot3cold1cold2cold3none1none2none3{{.*}}'
; COMBINED: <GLOBALVAL_SUMMARY_BLOCK
; COMBINED-NEXT: <VERSION