Skip to content

JIT: Avoid unnecessary write backs during physical promotion #112949

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

Closed
wants to merge 1 commit into from

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Feb 26, 2025

Physical promotion sometimes needs to insert writebacks to restore the struct local from a promoted replacement field. This is required if the field is more up to date and we end up in a situation where we need to represent something using the struct local.

Before this change the handling of this was quite simplistic. We assumed that the replacement was more up to date than the struct local at the beginning of every basic block.
This PR instead adds flow sensitive tracking to propagate this information across basic blocks. We now only consider the replacement local to be more up to date than the struct local if it was actually written in any of the predecessors.

This fixes some regressions I saw in #112740

Physical promotion sometimes needs to insert writebacks to restore the
struct local from a promoted replacement field. This is required if the
field is more up to date and we end up in a situation where we need to
represent something using the struct local.

Before this change the handling of this was quite simplistic. We assumed
that the replacement was more up to date than the struct local at the
beginning of every basic block.
This PR instead adds flow sensitive tracking to propagate this
information across basic blocks. We now only consider the replacement
local to be more up to date than the struct local if it was actually
written in any of the predecessors.
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 26, 2025
Copy link
Contributor

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

Copy link
Contributor

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 28, 2025
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.

1 participant