-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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: Stop using ref counts in forward sub #85909
JIT: Stop using ref counts in forward sub #85909
Conversation
Instead of going to great lengths to keep the ref counts correct in physical promotion just stop using them in forward sub. The last use information generalizes what forward sub needs except for when the tracking limit is reached, which shows in the improvements we actually get from consulting the ref counts -- the improvements are very modest and in tests only. This makes early liveness the only consumer of the "regular" ref counts computed by local morph. Weighted ref counts are still used for undoing regular promotion of implicit byref parameters.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsInstead of going to great lengths to keep the ref counts correct in physical promotion just stop using them in forward sub. The last use information generalizes what forward sub needs except for when the tracking limit is reached, which shows in the improvements we actually get from consulting the ref counts -- the improvements are very modest and in tests only. This makes early liveness the only consumer of the "regular" ref counts computed by local morph. Weighted ref counts are still used for undoing regular promotion of implicit byref parameters.
|
cc @dotnet/jit-contrib PTAL @AndyAyersMS Let me know if you have any objections to this... |
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.
I'm fine with removing reliance on early ref counts.
src/coreclr/jit/forwardsub.cpp
Outdated
// | ||
bool livenessBased = false; | ||
if (varDsc->lvRefCnt(RCS_EARLY) != 2) | ||
if (!fgDidEarlyLiveness) |
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.
Bail up in fgForwardSub
, and assert `fgDidEarlyLiveness' is true 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.
Makes sense, done
Instead of going to great lengths to keep the ref counts correct in physical promotion just stop using them in forward sub. The last use information generalizes what forward sub needs except for when the tracking limit is reached, which shows in the improvements we actually get from consulting the ref counts -- the improvements are very modest and in tests only.
This makes early liveness the only consumer of the "regular" ref counts computed by local morph. Weighted ref counts are still used for undoing regular promotion of implicit byref parameters.