-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[SampleFDO] Support enabling sample loader pass in O0 mode #113985
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
9b41a3a
2d4a253
cde256b
efb68d2
1750ff5
eb496bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,8 +9,9 @@ | |
| ; when the profile uses md5. | ||
| ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/inline-mergeprof.md5.prof -sample-profile-merge-inlinee=true -use-profiled-call-graph=0 -S | FileCheck -check-prefix=MERGE %s | ||
|
|
||
| ; Test we properly merge not inlined profile with '--sample-profile-merge-inlinee' even if '--disable-sample-loader-inlining' is true | ||
| ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/inline-mergeprof.md5.prof -sample-profile-merge-inlinee=true --disable-sample-loader-inlining -use-profiled-call-graph=0 -S | FileCheck -check-prefix=MERGE %s | ||
| ; Test we properly use flattened profile when using '--disable-sample-loader-inlining'. | ||
|
|
||
| ; RUN: opt < %s -passes=sample-profile -sample-profile-file=%S/Inputs/inline-mergeprof.prof -sample-profile-merge-inlinee=true --disable-sample-loader-inlining -use-profiled-call-graph=0 -S | FileCheck -check-prefix=FLATTEN %s | ||
|
|
||
| @.str = private unnamed_addr constant [11 x i8] c"sum is %d\0A\00", align 1 | ||
|
|
||
|
|
@@ -103,3 +104,10 @@ declare i32 @printf(ptr, ...) | |
| ; MERGE: !{!"branch_weights", i32 10} | ||
| ; MERGE: name: "sub" | ||
| ; MERGE-NEXT: {!"function_entry_count", i64 3} | ||
|
|
||
| ; FLATTEN: name: "sum" | ||
| ; FLATTEN-NEXT: {!"function_entry_count", i64 35} | ||
| ; FLATTEN: !{!"branch_weights", i32 13, i32 23} | ||
| ; FLATTEN: !{!"branch_weights", i32 12} | ||
|
||
| ; FLATTEN: name: "sub" | ||
| ; FLATTEN-NEXT: {!"function_entry_count", i64 3} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense to flatten profile if we are loading profile for O0. However, if we just disable sample loader inlining, but still runs O3/LTO, we may not want to flatten profile, because CGSCC inliner may have done some inlining, and we wanted to leverage context profile if possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Good point, sounds good to use flattened profile for only O0 mode.