-
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: OSR is not conservative enough about exposing struct locals #83783
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Milestone
Comments
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 22, 2023
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue Detailsusing System;
using System.Runtime.CompilerServices;
public class MissingExposure
{
[MethodImpl(MethodImplOptions.NoInlining)]
static void Bar()
{
}
[MethodImpl(MethodImplOptions.NoInlining)]
static void Foo(int n)
{
S s = new S { F = 1234 };
ref int foo = ref s.F;
for (int i = 0; i < n; i++)
{
Bar();
}
int abc = s.F * 3 + 4;
foo = 25;
int def = s.F * 3 + 4;
Console.WriteLine("abc = {0} (expected {1}), def = {2} (expected {3})", abc, 1234 * 3 + 4, def, 25 * 3 + 4);
}
public static void Main()
{
Foo(50000);
}
public struct S
{
public int F;
}
} Output with OSR enabled: abc = 3706 (expected 3706), def = 3706 (expected 79) cc @AndyAyersMS
|
AndyAyersMS
removed
the
untriaged
New issue has not been triaged by the area owner
label
Mar 24, 2023
AndyAyersMS
added a commit
to AndyAyersMS/runtime
that referenced
this issue
Mar 24, 2023
For OSR compiles, always import from the original entry point in addtion to the OSR entry point. This gives the OSR compiler a chance to see all of the method and so properly compute address exposure, instead of relying on the Tier0 analysis. Once address exposure has been determined, revoke special protection for the original entry and try and prune away blocks that are no longer needed. Fixes dotnet#83783. May also fix some of the cases where OSR perf is lagging (though don't expect this to fix them all).
ghost
added
the
in-pr
There is an active PR which will close this issue when it is merged
label
Mar 24, 2023
ghost
removed
the
in-pr
There is an active PR which will close this issue when it is merged
label
Mar 26, 2023
AndyAyersMS
added a commit
that referenced
this issue
Mar 26, 2023
For OSR compiles, always import from the original entry point in addition to the OSR entry point. This gives the OSR compiler a chance to see all of the method and so properly compute address exposure, instead of relying on the Tier0 analysis. Once address exposure has been determined, revoke special protection for the original entry and try and prune away blocks that are no longer needed (we actually wait until morph). Fixes #83783. May also fix some of the cases where OSR perf is lagging (though don't expect this to fix them all).
ghost
locked as resolved and limited conversation to collaborators
Apr 25, 2023
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
Output with OSR enabled: abc = 3706 (expected 3706), def = 3706 (expected 79)
cc @AndyAyersMS
The text was updated successfully, but these errors were encountered: