-
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
JIT: Remove BB limit from importer_vectorization #66534
Conversation
Tagging subscribers to this area: @JulieLeeMSFT Issue Details#66529 where due to large method size we end up with the following codegen for all mov rdx,1FCA7409060
mov rdx,[rdx]
lea rcx,[rbp+4C0]
call System.MemoryExtensions.AsSpan(System.String)
mov [rbp+10],rbx
mov [rbp+18],r14d
mov rcx,[rbp+4C0]
mov [rbp+20],rcx
mov ecx,[rbp+4C8]
mov [rbp+28],ecx
lea rcx,[rbp+10]
lea rdx,[rbp+20]
call System.MemoryExtensions.SequenceEqual[[System.Char, System.Private.CoreLib]](System.Span`1<Char>, System.ReadOnlySpan`1<Char>) so let's just unconditionally enable #65288 - surprisingly, it makes code even smaller. #66529 Benchmark:
Codegen diff for
|
@dotnet/jit-contrib @AndyAyersMS PTAL |
Thanks, Egor. I was surprised in the repro when Eric showed it to me last night that even AsSpan wasn't being inlined. Separate from this change, have we done an experiment around what things would look like if we always, unconditionally inlined AsSpan and span's ctors? I wonder if there's a set of critical, core, tiny APIs where we end up falling off a cliff due to inlining budget and we'd be better off with an internal MethodImplOptions.ForceInliningNoReallyThisNeedsToBeInlined setting. |
We plan to address it eventually with partial pre-scan to be able to go over-budget, I think there must be already an issue filed for it. |
Failures are not related, I suspect it's DST difference + #66540 |
what caused the regressions? |
It seems like it's always a size improvement to unroll SequenceEquals for spans, but it's often a size regression for string objects. |
Opened #66555 |
ping @dotnet/jit-contrib simple change |
#66529 where due to large method size we end up with the following codegen for all
loweredValue.SequenceEqual("<literal>".AsSpan())
:so let's just unconditionally enable #65288 - surprisingly, it makes code even smaller.
#66529 Benchmark:
2-3x improvement
Codegen diff for
GetNamedColorSpan
: https://www.diffchecker.com/bFuRMHNPSPMI Diffs are interesting - https://dev.azure.com/dnceng/public/_build/results?buildId=1660127&view=ms.vss-build-web.run-extensions-tab (I assume they caught all switches over string literals)