Remove use of ByReference in Memmove ABI by GrabYourPitchforks · Pull Request #17889 · dotnet/coreclr (original) (raw)

This is a follow-up to #15947. Now that Roslyn's ref reassignment feature is available, we can use that rather than the earlier workaround of passing ByReference<T> through Memmove's internal ABI.

On x64, there's no difference in the codegen between using ByReference<T> vs. ref reassignment. On x86, this change results in an approx. 15% decrease in codegen size for the Memmove method, and there is a commensurate increase in throughput in my brief testing. This is expected, as we knew during the original change that RyuJIT x86 doesn't quite optimize passing ByReference<T> around as well as its x64 counterpart does.