-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 Unnecessary sign-extension for (nuint)span.Length
#88136
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsTest fix for #84564 Unconditionally set isNeverNegative in morph, use that data when optimizing casts
|
I think the right way to do this is to add FWIW, it's only a matter of time before we are going to end up with Edit: For this PR I would be fine with adding an |
Thank you! If adding Otherwise should I set |
Awesome! Looking forward to more PRs!
|
Adding GT_LCL_FLD did not affect arm. On linux x64 the field is already promoted it seems. So for now keep this strictly for win x64. I will look more closely at arm. |
I'd add the |
I've applied you suggestion and ran jit-format on it too. |
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.
Looks fine to me, just a few nits. The diffs are small, but I think taking this change anyway is fine since adding LclVarDsc::IsSpan
seems good and we'll likely need it for #82946 too.
It's hard to say actually, since this causes so many contexts to miss. Let's see with jit-diff. |
@jakobbotsch Is it okay that we now have both Also, jit-diffs are zero? This is weird. |
I think it's fine, we can leave it for now.
@MihaZupan's bot runs on linux-x64 where spans are passed by value. It means we always promote them so your optimization does not kick in. |
Small positive diffs - win86/64 benefits the most and even a small win for non-win systems in Overall TP hit is +0.01-0.02% Most notable win is for Win-x64 in
|
Removed some code changes in lclmorph (basically restored the original state). Let's see if my changes were redundant. |
/azp run runtime-coreclr superpmi-diffs |
Azure Pipelines successfully started running 1 pipeline(s). |
The SPMI collection I did yesterday failed. I'm still trying to make a collection based on this PR. Currently the diffs are misleading due to the misses. |
New spmi diff result is even weirder than no diffs at all :D |
Those diffs look like they are correct, some of the collection from yesterday succeeded and those diffs are in the collections with low amount of misses.
The implicit conversion from Sadly I'm still hitting issues getting a full clean SPMI collection... I don't think we can merge this PR until we get that since otherwise we will have too many misses. |
It's no problem. There is plenty of time till .Net 9 :D. I will try find another small thing to work on meanwhile. Thank you for your help again! |
/azp run runtime-coreclr superpmi-diffs |
Azure Pipelines successfully started running 1 pipeline(s). |
Thank you! |
Fixes #84564
After review upd:
This adds a new CORINFO_FLG_SPAN flag and a IsSpan property to simplify handling of unpromoted span.Length loads and possibly other optimizations of Spans