Skip to content
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

Merged
merged 2 commits into from
Mar 29, 2021

Conversation

AndyAyersMS
Copy link
Member

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.

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.
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Mar 24, 2021
@AndyAyersMS
Copy link
Member Author

cc @dotnet/jit-contrib

Two diffs across SPMI, both places where we were enabling guarded PGO even though fetching PGO data had failed.

@AndyAyersMS AndyAyersMS mentioned this pull request Mar 25, 2021
54 tasks
@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: inconsisten

@@ -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
Copy link
Member

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
Copy link
Member

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.

Copy link
Member Author

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.

@AndyAyersMS AndyAyersMS merged commit a55b7e0 into dotnet:main Mar 29, 2021
@AndyAyersMS AndyAyersMS deleted the TolerateInconsistentProfiles branch March 29, 2021 15:55
@ghost ghost locked as resolved and limited conversation to collaborators Apr 28, 2021
@karelz karelz added this to the 6.0.0 milestone May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants