You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[RyuJIT] Eliminate unecessary copies when passing structs #9839
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
@fiigii thanks for adding those links (especially pointing to the existing issues that @RussKeldorph had linked to). #7897 had to do with struct returns, which have similar issues, but somewhat different causes.
I'm going to keep this open, as there are ineffiences on Windows as well as Unix, whereas the existng issues are described as Unix-specific. However, I'm going to explicitly link those issues here for cross-reference purposes: #2908 #5785 #6316 #6265 #6266
It may be that some of the specific issues can be addressed individually, while this overall issue remains open.
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
Activity
fiigii commentedon Feb 27, 2018
Maybe related to https://github.com/dotnet/coreclr/issues/11030 (dotnet/coreclr#11133 solved part of the problem).
CarolEidt commentedon Feb 27, 2018
@fiigii thanks for adding those links (especially pointing to the existing issues that @RussKeldorph had linked to).
#7897 had to do with struct returns, which have similar issues, but somewhat different causes.
I'm going to keep this open, as there are ineffiences on Windows as well as Unix, whereas the existng issues are described as Unix-specific. However, I'm going to explicitly link those issues here for cross-reference purposes:
#2908#5785#6316#6265#6266It may be that some of the specific issues can be addressed individually, while this overall issue remains open.
CarolEidt commentedon Apr 6, 2018
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
Implement corefx/#16619 Add FormattableString.CurrentCulture
Implement corefx/#16619 Add FormattableString.CurrentCulture (#18253)
jakobbotsch commentedon Dec 14, 2022
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.