-
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
[Perf] Windows/x64: Regressions in System.MathBenchmarks.Double #80359
Comments
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue DetailsRun Information
Regressions in System.MathBenchmarks.Double
Reprogit clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f net8.0 --filter 'System.MathBenchmarks.Double*' PayloadsHistogramSystem.MathBenchmarks.Double.FusedMultiplyAdd
Description of detection logic
; System.MathBenchmarks.Double.FusedMultiplyAddTest()
push rsi
sub rsp,80
vzeroupper
vmovaps [rsp+70],xmm6
vmovaps [rsp+60],xmm7
vmovaps [rsp+50],xmm8
xor eax,eax
mov [rsp+28],rax
vxorps xmm4,xmm4,xmm4
vmovdqa xmmword ptr [rsp+30],xmm4
vmovdqa xmmword ptr [rsp+40],xmm4
vxorps xmm6,xmm6,xmm6
vmovsd xmm0,qword ptr [7FFADFF34240]
vmovsd xmm1,qword ptr [7FFADFF34248]
vmovsd xmm2,qword ptr [7FFADFF34250]
xor ecx,ecx
vmovsd xmm3,qword ptr [7FFADFF34258]
vmovsd xmm4,qword ptr [7FFADFF34260]
M01_L00:
vmovaps xmm5,xmm0
vmovaps xmm7,xmm1
vmovaps xmm8,xmm2
vfmadd213sd xmm5,xmm7,xmm8
vaddsd xmm6,xmm5,xmm6
vaddsd xmm0,xmm0,xmm3
vaddsd xmm1,xmm1,xmm4
vaddsd xmm2,xmm2,xmm3
inc ecx
cmp ecx,1388
jl short M01_L00
vmovsd xmm0,qword ptr [7FFADFF34268]
vsubsd xmm0,xmm0,xmm6
vandps xmm0,xmm0,[7FFADFF34270]
vucomisd xmm6,xmm6
jp short M01_L01
vucomisd xmm0,qword ptr [7FFADFF34280]
ja short M01_L01
vmovaps xmm6,[rsp+70]
vmovaps xmm7,[rsp+60]
vmovaps xmm8,[rsp+50]
add rsp,80
pop rsi
ret
M01_L01:
lea rcx,[rsp+28]
mov edx,20
mov r8d,2
call qword ptr [7FFAE0517030]
mov ecx,5E71
mov rdx,7FFAE066B498
call CORINFO_HELP_STRCNS
mov rdx,rax
lea rcx,[rsp+28]
call qword ptr [7FFAE0517120]
mov ecx,5E93
mov rdx,7FFAE066B498
call CORINFO_HELP_STRCNS
mov r9,rax
vmovsd xmm1,qword ptr [7FFADFF34268]
lea rcx,[rsp+28]
mov r8d,14
call qword ptr [7FFAE08479F0]
mov ecx,5E9B
mov rdx,7FFAE066B498
call CORINFO_HELP_STRCNS
mov rdx,rax
lea rcx,[rsp+28]
call qword ptr [7FFAE0517120]
mov ecx,5E93
mov rdx,7FFAE066B498
call CORINFO_HELP_STRCNS
mov r9,rax
lea rcx,[rsp+28]
vmovaps xmm1,xmm6
mov r8d,14
call qword ptr [7FFAE08479F0]
mov rcx,offset MT_System.Exception
call CORINFO_HELP_NEWSFAST
mov rsi,rax
lea rcx,[rsp+28]
call qword ptr [7FFAE05170C0]
mov rdx,rax
mov rcx,rsi
call qword ptr [7FFADFEF7C18]
mov rcx,rsi
call CORINFO_HELP_THROW
int 3
; Total bytes of code 436 Compare Jit Disasm; System.MathBenchmarks.Double.FusedMultiplyAdd()
jmp qword ptr [7FFE01E2F918]
; Total bytes of code 6 DocsProfiling workflow for dotnet/runtime repository
|
possibly from #79681? @DeepakRajendrakumaran - can you please confirm. |
I don't see other commits in the range are related - 97a51cc...c6045ad |
This is very very unlikely since this change should not affect normal runs. This code is used for calculating compressed displacement for EVEX encoding and as such only called when I'll go ahead and try to confirm it's not this change anyway - is the best way to do this to rerun the test and compare the disassembly? Assuming if there is no diff, it's all good? |
@kunalspathak, I'd take a guess it could be #79363 instead since that also impacts HWIntrinsic logic If there is an asm diff that'd be helpful. Noting that we didn't have any report regressions in superpmi diffs when it was merged, but the performance repo has some unique code so it's possible there is something that was impacted still. |
I thought so, but my understanding was that it was mainly some refactoring. Haven't looked into details. |
@tannergooding - will you be able to check if #79363 is causing the regression? |
This was caused by #79363 and while it adds an additional instruction in this case, it fixes other cases. It is within an acceptable range for the API overall. |
Run Information
Regressions in System.MathBenchmarks.Double
Test Report
Repro
Payloads
Baseline
Compare
Histogram
System.MathBenchmarks.Double.FusedMultiplyAdd
Description of detection logic
Compare Jit Disasm
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
The text was updated successfully, but these errors were encountered: