Skip to content

Commit 4e24ca1

Browse files
committed
[CSSPGO] Turn on Profi by default
As titled. Reviewed By: wenlei, wlei Differential Revision: https://reviews.llvm.org/D115011
1 parent d2386ab commit 4e24ca1

File tree

5 files changed

+15
-12
lines changed

5 files changed

+15
-12
lines changed

llvm/lib/Transforms/IPO/SampleProfile.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,6 +1982,9 @@ bool SampleProfileLoader::doInitialization(Module &M,
19821982
// Enable iterative-BFI by default for CSSPGO.
19831983
if (!UseIterativeBFIInference.getNumOccurrences())
19841984
UseIterativeBFIInference = true;
1985+
// Enable Profi by default for CSSPGO.
1986+
if (!SampleProfileUseProfi.getNumOccurrences())
1987+
SampleProfileUseProfi = true;
19851988

19861989
// Tracker for profiles under different context
19871990
ContextTracker = std::make_unique<SampleContextTracker>(

llvm/test/Transforms/SampleProfile/csspgo-import-list.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ for.body: ; preds = %for.body, %entry
4848
; _Z3fibi:-2016976694713209516
4949

5050
; CHECK: distinct !DISubprogram(name: "main"
51-
; CHECK: !{!"function_entry_count", i64 3, i64 446061515086924981, i64 3815895320998406042, i64 7102633082150537521, i64 -2862076748587597320}
51+
; CHECK: !{!"function_entry_count", i64 1, i64 446061515086924981, i64 3815895320998406042, i64 7102633082150537521, i64 -2862076748587597320}
5252

5353
; CHECK-ORDERED: FuncOffsetTableSection {{.*}} {ordered}
5454

55-
; THRESHOLD: !{!"function_entry_count", i64 3}
56-
; THRESHOLD-REPLAY: !{!"function_entry_count", i64 3, i64 446061515086924981, i64 3815895320998406042, i64 6309742469962978389, i64 7102633082150537521, i64 -2862076748587597320, i64 -2016976694713209516}
57-
; THRESHOLD-REPLAY-NO-FUNCA: !{!"function_entry_count", i64 3, i64 446061515086924981, i64 3815895320998406042, i64 6309742469962978389, i64 7102633082150537521, i64 -2862076748587597320}
55+
; THRESHOLD: !{!"function_entry_count", i64 1}
56+
; THRESHOLD-REPLAY: !{!"function_entry_count", i64 1, i64 446061515086924981, i64 3815895320998406042, i64 6309742469962978389, i64 7102633082150537521, i64 -2862076748587597320, i64 -2016976694713209516}
57+
; THRESHOLD-REPLAY-NO-FUNCA: !{!"function_entry_count", i64 1, i64 446061515086924981, i64 3815895320998406042, i64 6309742469962978389, i64 7102633082150537521, i64 -2862076748587597320}
5858

5959
attributes #0 = { nofree noinline norecurse nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" "use-sample-profile" }
6060

llvm/test/Transforms/SampleProfile/csspgo-summary.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
; Test for CSSPGO's profile summary computation with and without pre-merging context profiles
22

3-
; RUN: opt < %s -passes=sample-profile,print-profile-summary -sample-profile-file=%S/Inputs/profile-context-tracker.prof -profile-summary-cutoff-hot=999900 -profile-sample-accurate -profile-summary-contextless=0 -S -o /dev/null 2>&1 | FileCheck %s --check-prefix=SUMMARY-UNMERGED
4-
; RUN: opt < %s -passes=sample-profile,print-profile-summary -sample-profile-file=%S/Inputs/profile-context-tracker.prof -profile-summary-cutoff-hot=999900 -profile-sample-accurate -profile-summary-contextless=1 -S -o /dev/null 2>&1 | FileCheck %s --check-prefix=SUMMARY-MERGED
3+
; RUN: opt < %s -passes=sample-profile,print-profile-summary -sample-profile-use-profi=0 -sample-profile-file=%S/Inputs/profile-context-tracker.prof -profile-summary-cutoff-hot=999900 -profile-sample-accurate -profile-summary-contextless=0 -S -o /dev/null 2>&1 | FileCheck %s --check-prefix=SUMMARY-UNMERGED
4+
; RUN: opt < %s -passes=sample-profile,print-profile-summary -sample-profile-use-profi=0 -sample-profile-file=%S/Inputs/profile-context-tracker.prof -profile-summary-cutoff-hot=999900 -profile-sample-accurate -profile-summary-contextless=1 -S -o /dev/null 2>&1 | FileCheck %s --check-prefix=SUMMARY-MERGED
55

66
; SUMMARY-UNMERGED: main :hot entry
77
; SUMMARY-MERGED-NOT: main :hot entry

llvm/test/Transforms/SampleProfile/profile-context-tracker.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ entry:
110110
ret i32 %call, !dbg !53
111111
}
112112

113-
; INLINE-ALL-DAG: [[MAIN_PROF]] = !{!"function_entry_count", i64 13}
113+
; INLINE-ALL-DAG: [[MAIN_PROF]] = !{!"function_entry_count", i64 1}
114114
; INLINE-ALL-DAG: [[FUNCA_PROF]] = !{!"function_entry_count", i64 0}
115115
; INLINE-ALL-DAG-SAME: [[LEAF_PROF]] = !{!"function_entry_count", i64 0}
116-
; INLINE-ALL-DAG: [[FUNCB_PROF]] = !{!"function_entry_count", i64 33}
116+
; INLINE-ALL-DAG: [[FUNCB_PROF]] = !{!"function_entry_count", i64 13}
117117

118-
; INLINE-HOT-DAG: [[MAIN_PROF]] = !{!"function_entry_count", i64 13}
118+
; INLINE-HOT-DAG: [[MAIN_PROF]] = !{!"function_entry_count", i64 1}
119119
; INLINE-HOT-DAG: [[FUNCA_PROF]] = !{!"function_entry_count", i64 12}
120120
; INLINE-HOT-DAG-SAME: [[LEAF_PROF]] = !{!"function_entry_count", i64 0}
121-
; INLINE-HOT-DAG: [[FUNCB_PROF]] = !{!"function_entry_count", i64 33}
121+
; INLINE-HOT-DAG: [[FUNCB_PROF]] = !{!"function_entry_count", i64 13}
122122

123123
declare i32 @_Z3fibi(i32)
124124

llvm/test/Transforms/SampleProfile/pseudo-probe-inline.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ if.end:
6969
; CHECK: !llvm.pseudo_probe_desc = !{![[#DESC0:]], ![[#DESC1:]]}
7070
; CHECK: ![[#DESC0]] = !{i64 [[#GUID1]], i64 [[#HASH1:]], !"foo"}
7171
; CHECK: ![[#DESC1]] = !{i64 [[#GUID2]], i64 [[#HASH2:]], !"zen"}
72-
; CHECK: ![[PD1]] = !{!"branch_weights", i32 25, i32 1}
73-
; CHECK: ![[PD2]] = !{!"branch_weights", i32 382916, i32 25}
72+
; CHECK: ![[PD1]] = !{!"branch_weights", i32 5, i32 0}
73+
; CHECK: ![[PD2]] = !{!"branch_weights", i32 382915, i32 5}
7474

7575
; Checking to see if YAML file is generated and contains remarks
7676
;YAML: --- !Passed

0 commit comments

Comments
 (0)