-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Fix numbering of exposed LCL_VAR
s
#79772
Fix numbering of exposed LCL_VAR
s
#79772
Conversation
The conservative VN must be unique for different uses lest we risk running into memory safety issues, by, e. g. removing range checks based on "racy" data.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsThe conservative VN must be unique for different uses lest we risk running into memory safety issues, by, e. g., removing range checks based on "racy" data. It is very easy to reproduce bad codegen with this simple method and [MethodImpl(MethodImplOptions.NoInlining)]
private static void Problem(int[] a, int b)
{
JitUse(&b);
_ = a[b];
_ = a[b];
} Assertion propagation removes the second check, which is not legal as
|
Without the fix, 4 out of 5 runs fail on my machine.
@dotnet/jit-contrib |
aaf325e
to
51a7310
Compare
/azp run runtime-coreclr superpmi-asmdiffs |
No pipelines are associated with this pull request. |
/azp run runtime, runtime-coreclr superpmi-diffs |
Azure Pipelines successfully started running 2 pipeline(s). |
Looks like the new test needs to be disabled on wasm. |
No threading => no races.
Looks like the test is failing on x64 under the interpreter as well. Will disable it there and create an issue once the FullAot tests are done. |
Thanks! Let's see if this shows up in perf triage... |
FYI, I am seeing this new test crash on arm64 under PGO stress as part of #80481 -- suspect it's not related to that PR but haven't drilled in yet. |
Yes, in all likelihood not related. We've now seen it fail (not crash though) on x86 too. I will put up a change to disable the test for now. |
The conservative VN must be unique for different uses lest we risk running into memory safety issues, by, e. g., removing range checks based on "racy" data.
It is very easy to reproduce bad codegen with this simple method and
JitNoCSE=1
:Assertion propagation removes the second check, which is not legal as
b
's value may change once we get to it from the first check.Diffs will be regressions; I see in some cases we did illegal bounds checks removal.