-
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
Unnecessary stack spilling for struct instant property access #57055
Comments
Interesting -- I would have guessed const prop could handle this one either way. |
The issue is that in the first example Roslyn dups an address and the jit doesn't clean this up very well.
The fix is likely to consider
spilling makes us very conservative:
The logic to update is runtime/src/coreclr/jit/importer.cpp Lines 13796 to 13824 in 6b2f051
Since this is an optimization, marking as future. |
Seems that #64171 doesn't fix this issue. |
Yes it didn't, but it did improve the case from the tweet. |
Description
Repro:
Codegen:
But if I change the code to:
The codegen will become:
I think JIT should recognize patterns like:
initobj
-call
-stloc
-ldloc
Also applies to method calls.
Configuration
.NET 6 Preivew 6
The text was updated successfully, but these errors were encountered: