-
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: don't dead store OSR exposed locals #89867
JIT: don't dead store OSR exposed locals #89867
Conversation
Backport of dotnet#89743 to 7.0. The local var ref count for OSR locals can be misleading, since some of the appearances may be in the "tier0" parts of the methods and won't be visible once we trim the OSR method down to just the part we're going to compile. Fix by giving OSR-exposed locals an implicit ref count. Fixes dotnet#89666.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsBackport of #89743 to 7.0. Customer ImpactFixes customer reported issue #89666. Methods with loops might unexpectedly start running incorrectly after some time, because the runtime/JIT transitioned execution to a new native version via OSR, and in some rare cases the OSR method will not properly update a local variable. TestingVerified test from #89666 case fixed, added new test based on the underlying problem. SPMI screening of this fix in main showed minimal diffs and no instances of the problem. RiskLow, targeted fix for OSR that disable some optimizations. The local var ref count for OSR locals can be misleading, since some of the appearances may be in the "tier0" parts of the methods and won't be visible once we trim the OSR method down to just the part we're going to compile. Fix by giving OSR-exposed locals an implicit ref count; this prevents the JIT from inferring that a store to a local is not needed because the stored value cannot be read.
|
@jakobbotsch PTAL |
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.
approved. we will take for consideration in 7.0.x
Friendly reminder: if you want this servicing fix to be included in the September 2023 Release, you'll have to merge this PR before August 14th. |
@JulieLeeMSFT can you take a look at the CI failures? Once we understand them we can merge. |
There is only 1 failure on mono test, which is not related to this PR. It is a known issue. Merging this PR. |
df0930c
into
dotnet:release/7.0-staging
Backport of #89743 to 7.0.
Customer Impact
Fixes customer reported issue #89666.
Methods with loops might unexpectedly start running incorrectly after some time, because the runtime/JIT transitioned execution to a new native version via OSR, and in some rare cases the OSR method will not properly update a local variable.
Testing
Verified test from #89666 case fixed, added new test based on the underlying problem. SPMI screening of this fix in main showed minimal diffs and no instances of the problem.
Risk
Low, targeted fix for OSR that disable some optimizations.
The local var ref count for OSR locals can be misleading, since some of the appearances may be in the "tier0" parts of the methods and won't be visible once we trim the OSR method down to just the part we're going to compile.
Fix by giving OSR-exposed locals an implicit ref count; this prevents the JIT from inferring that a store to a local is not needed because the stored value cannot be read.