Skip to content
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

Remove unused GETFIELD/SETFIELD helpers #105023

Merged
merged 11 commits into from
Jul 18, 2024
Merged

Conversation

EgorBo
Copy link
Member

@EgorBo EgorBo commented Jul 17, 2024

Also, JIT used to pretend that CORINFO_HELP_UNBOX_NULLABLE returned a TYP_STRUCT and had some special handling around multi-reg return. While in fact the helper is VOID

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 17, 2024
Copy link
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@EgorBo EgorBo changed the title A small clean up for CORINFO_HELP_UNBOX_NULLABLE Remove unused GETFIELD/SETFIELD helpers Jul 17, 2024
@EgorBo EgorBo mentioned this pull request Jul 17, 2024
5 tasks
@EgorBo
Copy link
Member Author

EgorBo commented Jul 17, 2024

@MihuBot

@jakobbotsch
Copy link
Member

Also, JIT used to pretend that CORINFO_HELP_UNBOX_NULLABLE returned a TYP_STRUCT and had some special handling around multi-reg return. While in fact the helper is VOID

This is actually an optimization done by the importer. It avoids introducing unnecessary copies by passing the address of the store destination of the unbox operation directly as the address to the helper call, in the same way as return buffers from regular calls are handled.

I'm fine with simplifying all of this, especially if it's going to be on the cold path, just wanted to add some context and add it here for posterity.

@EgorBo
Copy link
Member Author

EgorBo commented Jul 17, 2024

Also, JIT used to pretend that CORINFO_HELP_UNBOX_NULLABLE returned a TYP_STRUCT and had some special handling around multi-reg return. While in fact the helper is VOID

This is actually an optimization done by the importer. It avoids introducing unnecessary copies by passing the address of the store destination of the unbox operation directly as the address to the helper call, in the same way as return buffers from regular calls are handled.

I'm fine with simplifying all of this, especially if it's going to be on the cold path, just wanted to add some context and add it here for posterity.

Yeah it's understandable, I presume it's better to use a separate node/GT_INTRINSIC for such case to avoid dealing with ABI stuff too early?

Here are the SPMI diffs on win-x64 (although, I couldn't download libraries.pmi.tests collection): https://gist.github.com/EgorBo/6d6f29c571b09f058ab3f2f80ba6e70a not too bad IMO

@EgorBo EgorBo marked this pull request as ready for review July 17, 2024 20:41
@EgorBo
Copy link
Member Author

EgorBo commented Jul 17, 2024

@jakobbotsch does the jit part look good otherwise? I've applied the lvHasLdAddrOp fix

Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice clean up!

@EgorBo EgorBo deleted the nullable-cleanup branch July 18, 2024 08:48
@github-actions github-actions bot locked and limited conversation to collaborators Aug 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants