-
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
Use unsigned casts for array/Span indexers #57970
Conversation
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsArray and Span length is never negative and after bounds checking index is also guaranteed to be non-negative. Unsigned casts get rid of quite a few PMI diffs for System.Private.CoreLib show only 8 regressions, of which only a couple are because of CSE misses, most are from loop alignment changes.
Detailed diffs for win-x64
|
I guess it does similar to what #52414 did, @BruceForstall had some objections about it. |
It's somewhat similar, but we don't have to wait for all of these magical features to get some nice wins right now without any hacks. |
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.
This looks great to me, let me kick off outerloop and then I'll merge assuming it passes.
FWIW, it doesn't seem like there were any actual objections in #52414.
/azp run runtime-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
@pentp did you verify that the original test failures were unrelated? I saw one failing job but I couldn't see the test log, so I tried rerunning it, but looks like the build timed out. Can you rebase/merge this change so we can see if we can get a green CI run? The outerloop failure looks unrelated, it's #58481. |
I looked at the two failing test runs and I think they were some test infra failures (like sending to helix failed), don't remember exactly. Rebased the commits. |
The failure is #11063. |
Improvements on Linux/x64 - dotnet/perf-autofiling-issues#1482 |
Improvements on windows/x64 - dotnet/perf-autofiling-issues#1490 |
Improvements on windows amd x64 - dotnet/perf-autofiling-issues#1512 |
Improvements on win-arm64: dotnet/perf-autofiling-issues#1538 |
Improvements on win-x64: dotnet/perf-autofiling-issues#1488 |
Improvements on alpine 3.12: dotnet/perf-autofiling-issues#1503 |
Noticed IniArray improved on win/arm64. @DrewScoggins - any idea why this was not caught by autofiler? |
Array and Span length is never negative and after bounds checking index is also guaranteed to be non-negative. Unsigned casts get rid of quite a few
movsxd
instructions and replace the rest with cheapermov
variants.PMI diffs for System.Private.CoreLib show only 8 regressions, of which only a couple are because of CSE misses, most are from loop alignment changes.
Detailed diffs for win-x64