We might not actually need these optimizations in practice, and removing them would allow to simplify the code. See also https://github.com/dotnet/coreclr/pull/24400 and https://github.com/dotnet/coreclr/issues/19672#issuecomment-415974153.