-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
JIT: tolerate edge profile inconsistencies better. #50213
JIT: tolerate edge profile inconsistencies better. #50213
Conversation
We should not blow up jitting just because edge counts are inconsistent. Also, make sure we're not doing any guarded devirt if we disable pgo. And, add an option JitEnablePgoRange to selectively enable use of PGO for problem isolation.
cc @dotnet/jit-contrib Two diffs across SPMI, both places where we were enabling guarded PGO even though fetching PGO data had failed. |
src/coreclr/jit/fgprofile.cpp
Outdated
@@ -2521,6 +2521,11 @@ void Compiler::fgIncorporateEdgeCounts() | |||
// slop - profile slush fund | |||
// wbUsedSlop [out] - true if we tapped into the slush fund | |||
// | |||
// Returns: | |||
// true if the edge weight was adjusted | |||
// false if the edge weight update was inconsisten with the |
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.
typo: inconsisten
src/coreclr/jit/fgprofile.cpp
Outdated
@@ -2620,6 +2620,11 @@ bool flowList::setEdgeWeightMinChecked(BasicBlock::weight_t newWeight, | |||
// slop - profile slush fund | |||
// wbUsedSlop [out] - true if we tapped into the slush fund | |||
// | |||
// Returns: | |||
// true if the edge weight was adjusted | |||
// false if the edge weight update was inconsisten with the |
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.
typo: inconsisten
@@ -463,7 +463,10 @@ CONFIG_INTEGER(JitClassProfiling, W("JitClassProfiling"), 1) | |||
CONFIG_INTEGER(JitEdgeProfiling, W("JitEdgeProfiling"), 1) | |||
|
|||
// Profile consumption options | |||
CONFIG_INTEGER(JitDisablePGO, W("JitDisablePGO"), 0) // Ignore pgo data | |||
CONFIG_INTEGER(JitDisablePgo, W("JitDisablePgo"), 0) // Ignore pgo data for all methods |
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.
Would this be easier to understand in reverse? E.g., JitEnablePgo=0
? Like we have COMPlus_TieredCompilation=0
.
Doesn't matter to me, but sometimes negatives get confusing. We certainly aren't consistent here.
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.
Since PGO is on by default and this option is mainly to do top-level triage/workaround for PGO issues, I think "disable" is less confusing.
Though when I needed to binary search I found having an "enable" less confusing.... so am not self-consistent here either.
We should not blow up jitting just because edge counts are inconsistent.
Also, make sure we're not doing any guarded devirt if we disable pgo.
And, add an option JitEnablePgoRange to selectively enable use of PGO for
problem isolation.