-
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
Undo the Const < (uint)span.Length
hacks in the BCL
#49450
Undo the Const < (uint)span.Length
hacks in the BCL
#49450
Conversation
3be8d15
to
b7be1d2
Compare
|
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.
Nice!
Huh, I'm still getting the bad codegen in sharplab (see here). Did the JIT fix miss the 5.0 RTM cutoff? That said, the change LGTM. But we do need to be mindful that we're not going to regress performance if we change code that's being cross-compiled for many different runtimes: some of which have the fix and some of which don't. It's relevant here because just the other day I started an internal thread asking if we should make an OOB |
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.
LGTM, but see comment at #49450 (comment).
Argh, I completely forgot about Egor's Disasmo tool! Thank you for the timely reminder. 🚀 |
Networking unit test failures are described at #48758 (comment). |
b7be1d2
to
5a3674f
Compare
With #40180 having been merged for some time (many thanks to @nathan-moore!), the
if (Const < (uint)span.Length)
pattern and its permutations can now be get rid of in the BCL. A quick regex search found the following places:I have manually verified that the codegen for them and the equivalent "natural" versions is the same on the main branch (even without the casts).
cc @GrabYourPitchforks
Do we know of any other places that may have similar things lying around?