[llvm] 96fb18a - Revert "[ThinLTO] Disable partial sample profile scaling by default"
Teresa Johnson via llvm-commits
llvm-commits at lists.llvm.org
Wed May 31 10:25:27 PDT 2023
Author: Teresa Johnson
Date: 2023-05-31T10:25:09-07:00
New Revision: 96fb18a32a7bc04bbd39ed36c26a3a2edadb7dcc
URL: https://github.com/llvm/llvm-project/commit/96fb18a32a7bc04bbd39ed36c26a3a2edadb7dcc
DIFF: https://github.com/llvm/llvm-project/commit/96fb18a32a7bc04bbd39ed36c26a3a2edadb7dcc.diff
LOG: Revert "[ThinLTO] Disable partial sample profile scaling by default"
This reverts commit aae8524bcc26cf04729f2bbc02ecb54233a587e4, which was
found to cause a few unexpected benchmark performance differences that
need investigation.
Added:
Modified:
llvm/lib/Analysis/ProfileSummaryInfo.cpp
llvm/test/Bitcode/thinlto-function-summary-callgraph-partial-sample-profile-summary.ll
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/ProfileSummaryInfo.cpp b/llvm/lib/Analysis/ProfileSummaryInfo.cpp
index 65843a0af78b2..6b9f15bf2f647 100644
--- a/llvm/lib/Analysis/ProfileSummaryInfo.cpp
+++ b/llvm/lib/Analysis/ProfileSummaryInfo.cpp
@@ -37,13 +37,8 @@ static cl::opt<bool> PartialProfile(
"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<bool> ScalePartialSampleProfileWorkingSetSize(
- "scale-partial-sample-profile-working-set-size", cl::Hidden,
- cl::init(false),
+ "scale-partial-sample-profile-working-set-size", cl::Hidden, cl::init(true),
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
index b843c04949c75..1906229879f5e 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,50 +1,43 @@
-;; 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.
+; 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 --implicit-check-not=BLOCK_COUNT
+; 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
; RUN: llvm-lto -thinlto -o %t3 %t.o %t2.o
-; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --implicit-check-not=BLOCK_COUNT
+; RUN: llvm-bcanalyzer -dump %t3.thinlto.bc | FileCheck %s --check-prefix=COMBINED
+
-; PERMODULE: <SOURCE_FILENAME
+; CHECK: <SOURCE_FILENAME
; "hot_function"
-; PERMODULE-NEXT: <FUNCTION op0=0 op1=12
+; CHECK-NEXT: <FUNCTION op0=0 op1=12
; "hot1"
-; PERMODULE-NEXT: <FUNCTION op0=12 op1=4
+; CHECK-NEXT: <FUNCTION op0=12 op1=4
; "hot2"
-; PERMODULE-NEXT: <FUNCTION op0=16 op1=4
+; CHECK-NEXT: <FUNCTION op0=16 op1=4
; "hot3"
-; PERMODULE-NEXT: <FUNCTION op0=20 op1=4
+; CHECK-NEXT: <FUNCTION op0=20 op1=4
; "hot4"
-; PERMODULE-NEXT: <FUNCTION op0=24 op1=5
+; CHECK-NEXT: <FUNCTION op0=24 op1=5
; "cold"
-; PERMODULE-NEXT: <FUNCTION op0=29 op1=5
+; CHECK-NEXT: <FUNCTION op0=29 op1=5
; "none1"
-; PERMODULE-NEXT: <FUNCTION op0=34 op1=5
+; CHECK-NEXT: <FUNCTION op0=34 op1=5
; "none2"
-; PERMODULE-NEXT: <FUNCTION op0=39 op1=5
+; CHECK-NEXT: <FUNCTION op0=39 op1=5
; "none3"
-; PERMODULE-NEXT: <FUNCTION op0=44 op1=5
-; PERMODULE-NEXT: <FUNCTION op0=49 op1=5
+; CHECK-NEXT: <FUNCTION op0=44 op1=5
+; CHECK-NEXT: <FUNCTION op0=49 op1=5
-; PERMODULE-LABEL: <GLOBALVAL_SUMMARY_BLOCK
-; PERMODULE-NEXT: <VERSION
-; PERMODULE-NEXT: <FLAGS
-; PERMODULE-NEXT: <VALUE_GUID op0=27 op1=123/>
+; CHECK-LABEL: <GLOBALVAL_SUMMARY_BLOCK
+; CHECK-NEXT: <VERSION
+; CHECK-NEXT: <FLAGS
+; CHECK-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
-; 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-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: <STRTAB_BLOCK
-; PERMODULE-NEXT: blob data = 'hot_functionhot1hot2hot3cold1cold2cold3none1none2none3{{.*}}'
+; CHECK: <STRTAB_BLOCK
+; CHECK-NEXT: blob data = 'hot_functionhot1hot2hot3cold1cold2cold3none1none2none3{{.*}}'
; COMBINED: <GLOBALVAL_SUMMARY_BLOCK
; COMBINED-NEXT: <VERSION
More information about the llvm-commits
mailing list