Use helpers in Guid's ROS<byte> constructor#78446
Conversation
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
|
Tagging subscribers to this area: @dotnet/area-system-runtime Issue DetailsCloses #78440. (SharpLab demo)
|
|
Technically, the BigEndian path doesn't need a helper, it's trimmed out anyway. It's the throw helper that messes inlining up: |
Is it properly trimmed out? The linker has a bad habit of leaving comparisons and branches that do nothing and that likely negatively impacts some analysis and opts we can do |
I've attached the IL ^, looks pretty normal to me 🤷 |
|
Thanks. I just read @EgorBo's comment. Given that, I think we should just outline the throw and keep the rest the same. Otherwise, we're possibly regressing Guid's ctor on big endian for little reason. |
|
That makes sense. When I added the |
Closes #78440. (SharpLab demo)
Moves the big endian path and exception throwing to a helper, resulting in improved codegen when the constructor is inlined.