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

JIT: Avoid unnecessary write backs during physical promotion #112949

Draft
wants to merge 1 commit into
base: main
Choose a base branch
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.
@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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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