-
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
Fold nullchecks in Interlocked.* #101956
Fold nullchecks in Interlocked.* #101956
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
PTAL @AndyAyersMS @jakobbotsch @dotnet/jit-contrib
It's interesting that |
Doesn't this transformation effectively undo what |
Perhaps it's sufficient to verify that the base is |
There's a call to |
Ah yes, it should be. I wonder then if it wouldn't be sufficient to just add a |
Thanks for the suggestion! |
This PR removes redundant nullchecks emitted with Interlocked.* apis since Interlocked load/store itself is an implicit nullcheck (like any other indir). Also, Interlocked implies a potentially contended memory so we should avoid probing it when it's not needed.
Example:
diff: