-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Use helpers in Guid's ROS<byte> constructor #78446
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Closes #78440. (SharpLab demo)
Moves the big endian path and exception throwing to a helper, resulting in improved codegen when the constructor is inlined.