-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Suboptimal struct zeroing in case of gc pointers #83297
Labels
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
in-pr
There is an active PR which will close this issue when it is merged
Milestone
Comments
dotnet-issue-labeler
bot
added
the
area-CodeGen-coreclr
CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
label
Mar 11, 2023
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch, @kunalspathak Issue Detailspublic struct MyStruct
{
public long a;
public long b;
public long c;
public long d;
public long e;
public long f;
public long g;
public long h;
public long i;
public long j;
public long k;
public long l;
public long m;
public long n;
public long o;
public string s;
}
public MyStruct Foo()
{
MyStruct s = default;
return s;
} ; Method Program:Foo():Program+MyStruct:this
33C0 xor eax, eax
488902 mov qword ptr [rdx], rax
48894208 mov qword ptr [rdx+08H], rax
48894210 mov qword ptr [rdx+10H], rax
48894218 mov qword ptr [rdx+18H], rax
48894220 mov qword ptr [rdx+20H], rax
48894228 mov qword ptr [rdx+28H], rax
48894230 mov qword ptr [rdx+30H], rax
48894238 mov qword ptr [rdx+38H], rax
48894240 mov qword ptr [rdx+40H], rax
48894248 mov qword ptr [rdx+48H], rax
48894250 mov qword ptr [rdx+50H], rax
48894258 mov qword ptr [rdx+58H], rax
48894260 mov qword ptr [rdx+60H], rax
48894268 mov qword ptr [rdx+68H], rax
48894270 mov qword ptr [rdx+70H], rax
48894278 mov qword ptr [rdx+78H], rax
488BC2 mov rax, rdx
C3 ret
; Total bytes of code: 69 JIT gives up on SIMDs because of gc pointers in a struct while it could use SIMD only for unmanaged part
|
Arm64 does use SIMD in this case ; Method MyBenchmarks:Foo():MyBenchmarks+MyStruct:this
G_M35785_IG01: ;; offset=0000H
A9BF7BFD stp fp, lr, [sp, #-0x10]!
910003FD mov fp, sp
4F00E410 movi v16.16b, #0
AD004110 stp q16, q16, [x8]
AD014110 stp q16, q16, [x8, #0x20]
AD024110 stp q16, q16, [x8, #0x40]
AD034110 stp q16, q16, [x8, #0x60]
F900411F str xzr, [x8, #0x80]
A8C17BFD ldp fp, lr, [sp], #0x10
D65F03C0 ret lr
Presumably because stp is atomic |
This was referenced Mar 11, 2023
Is this one fixed @EgorBo? |
Nope, the codegen is the same |
dotnet-policy-service
bot
added
the
in-pr
There is an active PR which will close this issue when it is merged
label
May 12, 2024
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
in-pr
There is an active PR which will close this issue when it is merged
JIT gives up on SIMDs because of gc pointers in a struct while it could use SIMD only for unmanaged part
The text was updated successfully, but these errors were encountered: