Skip to content
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

Remove ZMM_RECOMMENDED_THRESHOLD workaround #86552

Merged
merged 1 commit into from
May 21, 2023

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented May 21, 2023

This was a weird-looking workaround for the avx-512 throttle problem, since it is no more - I delete the workaround. Expecting a few diffs in aspnet collection, e.g.:

bool Test(ReadOnlySpan<byte> a, Span<byte> b) => 
    a.Slice(0, 100).TryCopyTo(b);

Codegen:

; Method Program:Test
       sub      rsp, 40
       vzeroupper 
       cmp      dword ptr [rdx+08H], 100
       jb       SHORT G_M62689_IG06
       mov      rax, bword ptr [rdx]
       mov      rdx, bword ptr [r8]
       mov      ecx, dword ptr [r8+08H]
       xor      r8d, r8d
       cmp      ecx, 100
       jb       SHORT G_M62689_IG04
-      vmovdqu  ymm0, ymmword ptr [rax]
-      vmovdqu  ymm1, ymmword ptr [rax+20H]
-      vmovdqu  ymm2, ymmword ptr [rax+40H]
-      vmovdqu  xmm3, xmmword ptr [rax+54H]
-      vmovdqu  ymmword ptr [rdx], ymm0
-      vmovdqu  ymmword ptr [rdx+20H], ymm1
-      vmovdqu  ymmword ptr [rdx+40H], ymm2
-      vmovdqu  xmmword ptr [rdx+54H], xmm3
+      vmovdqu32 zmm0, zmmword ptr [rax]
+      vmovdqu32 zmm1, zmmword ptr [rax+24H]
+      vmovdqu32 zmmword ptr [rdx], zmm0
+      vmovdqu32 zmmword ptr [rdx+24H], zmm1
       mov      r8d, 1
G_M62689_IG04:  
       mov      eax, r8d
       add      rsp, 40
       ret      
G_M62689_IG06: 
       call     [System.ThrowHelper:ThrowArgumentOutOfRangeException()]
       int3     
; Total bytes of code: 90

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label May 21, 2023
@ghost ghost assigned EgorBo May 21, 2023
@ghost
Copy link

ghost commented May 21, 2023

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Issue Details

This was a weird-looking workaround for the avx-512 throttle problem, since it is no more - I delete the workaround (expect a few diffs)

Author: EgorBo
Assignees: EgorBo
Labels:

area-CodeGen-coreclr

Milestone: -

@EgorBo
Copy link
Member Author

EgorBo commented May 21, 2023

A couple of diffs in aspnet collection (https://dev.azure.com/dnceng-public/public/_build/results?buildId=281207&view=ms.vss-build-web.run-extensions-tab) - it'd nice if we could have larger SPMI coverage for AVX-512.

A few size regressions becuase vxorps zmm, zmm, zmm is 6 bytes (evex) compared to 4 bytes for VEX. But the good news that we can always use the VEX form for it, same what native compilers do:

image

@EgorBo EgorBo merged commit 37c2751 into dotnet:main May 21, 2023
@EgorBo EgorBo deleted the remove-zmm-recommended-size branch May 21, 2023 16:09
@EgorBo EgorBo added the avx512 Related to the AVX-512 architecture label May 22, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jun 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI avx512 Related to the AVX-512 architecture
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants