-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Widespread regressions after #71498 (Spans to use ref fields) #71667
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsWe're seeing a lot of perf regressions (still being generated) due to #71498 @DrewScoggins noticed a similar picture on TE: Codegen example: Span<byte> Test(byte[] array) => array; Was: ; Method Program:Test(System.Byte[]):System.Span`1[Byte]:this
G_M42296_IG01:
G_M42296_IG02:
test r8, r8
je SHORT G_M42296_IG06
G_M42296_IG03:
lea rcx, bword ptr [r8+16]
mov r8d, dword ptr [r8+8]
G_M42296_IG04:
mov bword ptr [rdx], rcx
mov dword ptr [rdx+8], r8d
mov rax, rdx
G_M42296_IG05:
ret
G_M42296_IG06:
xor rcx, rcx
xor r8d, r8d
jmp SHORT G_M42296_IG04
; Total bytes of code: 31 After #71498: ; Method Program:Test(System.Byte[]):System.Span`1[Byte]:this
G_M42296_IG01:
push rdi
push rsi
push rbx
sub rsp, 16
vzeroupper
mov rbx, rdx
G_M42296_IG02:
vxorps xmm0, xmm0
vmovdqu xmmword ptr [rsp], xmm0
test r8, r8
je SHORT G_M42296_IG06
G_M42296_IG03:
lea rax, bword ptr [r8+16]
mov bword ptr [rsp], rax
mov eax, dword ptr [r8+8]
mov dword ptr [rsp+08H], eax
G_M42296_IG04:
mov rdi, rbx
lea rsi, bword ptr [rsp]
call CORINFO_HELP_ASSIGN_BYREF
movsq
mov rax, rbx
G_M42296_IG05:
add rsp, 16
pop rbx
pop rsi
pop rdi
ret
G_M42296_IG06:
vxorps xmm0, xmm0
vmovdqu xmmword ptr [rsp], xmm0
jmp SHORT G_M42296_IG04
; Total bytes of code: 79 Obviously, looks like a JIT issue that wasn't ready for that change, the question is - is it fixable in a short term.. /cc @tannergooding @kunalspathak @DrewScoggins @AaronRobinsonMSFT @dotnet/jit-contrib
|
JitDump diff: https://www.diffchecker.com/4Tn7vDrw (before vs after) |
I think the PR in general is still fairly critical to properly vetting and shipping It looks like this is likely coming down to two main points:
CC. @AaronRobinsonMSFT as requested |
The bulk of the regression is likely to have been caused by the fact the Jit now sees For reference, here's Jit code that talks about the problem: runtime/src/coreclr/jit/lclvars.cpp Lines 1878 to 1891 in bcbe87d
Essentially, before the change, Some possible fixes: |
For history: we also tried to introduce |
We're seeing a lot of perf regressions (large reports in dotnet/perf-autofiling-issues#6587 and dotnet/perf-autofiling-issues#6588) due to #71498
Example of a regression:

@DrewScoggins noticed a similar picture on TE:

Codegen example:
Before #71498:
After #71498:
Obviously, looks like a JIT issue that wasn't ready for that change, the question is - is it fixable in a short term..
/cc @tannergooding @kunalspathak @DrewScoggins @AaronRobinsonMSFT @dotnet/jit-contrib
The text was updated successfully, but these errors were encountered: