-
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
[RyuJIT] Eliminate unecessary copies when passing structs #9839
Comments
Maybe related to https://github.com/dotnet/coreclr/issues/11030 (dotnet/coreclr#11133 solved part of the problem). |
@fiigii thanks for adding those links (especially pointing to the existing issues that @RussKeldorph had linked to). |
A simple example illustrating the excessive copies can be seen with the test case introduced in PR dotnet/coreclr#17418 - tests/src/JIT/Regression/JitBlue/DevDiv_590358/DevDiv_590358.cs |
The main sysV problem was fixed with multireg work, I believe. The implicit byrefs case should be fixed by #79346, will leave it open for that. |
Currently the JIT introduces unnecessary copies when passing structs by value.
This impacts both the by-ref passing as in the x86/64 windows ABI, as well as the x86/64 unix ABI - though the impact is worse in the latter case.
This is especially problematic for small structs on x86/64 unix, which are passed in registers but needlessly forced to memory.
Span<T>
and similar types are specific examples of this.This issue started as https://github.com/dotnet/corefx/issues/27238, but is fundamentally a coreclr JIT issue.
The issues linked in this issue have largely been addressed, but this test case still shows unneessary copies: tests/src/JIT/Regression/JitBlue/DevDiv_590358/DevDiv_590358.cs
category:cq
theme:structs
skill-level:expert
cost:large
The text was updated successfully, but these errors were encountered: