-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Use AggressiveOptimization for intrinsics-based SpanHelpers #22191
Use AggressiveOptimization for intrinsics-based SpanHelpers #22191
Conversation
I've only added it to methods that actually use the intrinsics directly, not sure if should be other methods also? |
Buffer.Memmove is in the same category. |
Yes, we may need to make this change for all the CoreLib methods that use SIMD intrinsic.
Adding |
I was looking at that earlier; it gets crossgened as it isn't doing anything non-AoT. If I add a G_M6891_IG11:
C5FA6F02 vmovdqu xmm0, qword ptr [rdx]
C5FA7F01 vmovdqu qword ptr [rcx], xmm0
C5FA6F4210 vmovdqu xmm0, qword ptr [rdx+16]
C5FA7F4110 vmovdqu qword ptr [rcx+16], xmm0
C5FA6F4220 vmovdqu xmm0, qword ptr [rdx+32]
C5FA7F4120 vmovdqu qword ptr [rcx+32], xmm0
C5FA6F4230 vmovdqu xmm0, qword ptr [rdx+48]
C5FA7F4130 vmovdqu qword ptr [rcx+48], xmm0
4883C140 add rcx, 64
4883C240 add rdx, 64 Don't know if that's a Jit change to use larger registers, or if should add some Avx2 intrinsics here? Its a fairly well annotated method as to what it wants to happen where |
I do not think this needs to be made for all methods. It should be made only for the methods that are very likely to be hot if they get used in the workload. MemCpy is definitely in this category. It is less clear for some of the methods in this PR - like LastIndexOfAny. |
I have not realized that. |
e.g. change copyblk as its using standard structs to do the copies [StructLayout(LayoutKind.Sequential, Size = 16)]
private struct Block16 { }
[StructLayout(LayoutKind.Sequential, Size = 64)]
private struct Block64 { } |
Jit change would have the advantage of being ready at crossgen as |
Removed from |
Seems like a bunch of the others are potentially problematic, too. For example, I chose a random method that uses |
Why would this change make |
Ugh, sorry, I completely misread the Aggressive* and thought it was AggressiveInlining not AggressiveOptimization. Ignore me. |
Test pri0 Linux_rhel6 x64 checked Job
|
Is there anyway to retrigger a sub-job of coreclr-ci? |
Yes, though it's not obvious and can't currently be done here via commands to a bot (I also don't know if you need special permissions). Basically:
|
cc: @safern |
Yeah, looks like it, I only have "Download the logs" I'll have to live vicariously though people that work at MS :) |
You need to be logged in and have permissions to do that. We've given that feedback and also asked for the feature to be able to retry it from a comment (rather than queue the whole build again). Also it seems like the Re-run button from the github UI is broken. All those issues are being raised and prioritized so that we can improve the experience. cc: @chcosta for your meeting tomorrow. |
…oreclr#22191) * Use AggressiveOptimization for intrinsics-based SpanHelpers * Remove from LastIndexOfAny Commit migrated from dotnet/coreclr@e0d6801
They are very commonly used as the heavy lifting functions of many other methods and their performance is heavily dependant on their inlines working; and code size heavily dependant on branch elimination based on supported architecture.
From: #22127 (comment)
/cc @AndyAyersMS @jkotas @fiigii @kouvel @tannergooding