-
Notifications
You must be signed in to change notification settings - Fork 5k
JIT: improve profile update for loop inversion #85265
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
Conversation
If the loop test block has multiple predecessors we will not do proper profile updates. This can lead to downstream problems with block layout (say leaving a cold block in a loop). Fix by changing how we compute the amount of profile that should remain in the test block. Fixes dotnet#84319.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsIf the loop test block has multiple predecessors we will not do proper profile updates. This can lead to downstream problems with block layout (say leaving a cold block in a loop). Fix by changing how we compute the amount of profile that should remain in the test block. Fixes #84319.
|
@BruceForstall PTAL I've had these changes sitting around for awhile but didn't have a case where it mattered. Now I do: #84264 (comment) Small number of diffs in SPMI PGO runs (though oddly not in the benchmark above -- likely because of how we do that collection). |
weightNext); | ||
bTest->inheritWeight(block->bbNext); | ||
weightTop); | ||
bTest->inheritWeight(bTop); |
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.
This is the actual fix -- the rest is just renaming and protecting against inconsistent profile data.
please don't try to clear the |
investigation is done |
Looking like this may have had mixed impact on benchmarks (just have arm64 autofiled so far) Improvements:
Regressions: |
If the loop test block has multiple predecessors we will not do proper profile updates. This can lead to downstream problems with block layout (say leaving a cold block in a loop).
Fix by changing how we compute the amount of profile that should remain in the test block.
Fixes #84319.
Diffs