Uh oh!
There was an error while loading. Please reload this page.
JIT: Remove BB limit from importer_vectorization - #66534
Conversation
ghost
commented
Mar 12, 2022
Tagging subscribers to this area: @JulieLeeMSFT Issue Details#66529 where due to large method size we end up with the following codegen for all movrdx,1FCA7409060 movrdx,[rdx]learcx,[rbp+4C0]call System.MemoryExtensions.AsSpan(System.String) mov[rbp+10],rbxmov[rbp+18],r14dmovrcx,[rbp+4C0]mov[rbp+20],rcxmovecx,[rbp+4C8]mov[rbp+28],ecxlearcx,[rbp+10]leardx,[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 |
stephentoub
commented
Mar 12, 2022
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. |
EgorBo
commented
Mar 12, 2022
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 |
kasperk81
commented
Mar 13, 2022
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. |
jkotas
commented
Mar 13, 2022
Opened #66555 |
EgorBo
commented
Mar 14, 2022
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)