-
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
ARM64: avoid memory barrier in InlinedMemmoveGCRefsHelper if dest is not on heap #102084
Conversation
Tagging subscribers to this area: @mangod9 |
PS: |
@jkotas I guess this is ready for review then? |
@@ -182,6 +182,9 @@ internal static unsafe void Memmove<T>(ref T destination, ref T source, nuint el | |||
#endif | |||
internal static void BulkMoveWithWriteBarrier(ref byte destination, ref byte source, nuint byteCount) | |||
{ | |||
if (byteCount == 0 || Unsafe.AreSame(ref destination, ref source)) |
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 method seems to be structured to allow inlining of BulkMoveWithWriteBarrier at every callsite.
I think it would be better to keep these checks inside the non-inlined portion of the helpers. The empty buffer or same buffer are rare cases. We do not need to optimize for them by inlining these checks at every callsite.
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. Thank you!
…not on heap (dotnet#102084) * don't put full barrier if dest is not on the heap * Address feedback --------- Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Should speed up on-stack struct copies
Linux-arm64 (Ampere):
Fixes #102044