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: Investigate adding "phantom" replacements during physical promotion #87371

Closed
jakobbotsch opened this issue Jun 10, 2023 · 1 comment · Fixed by #87410
Closed

JIT: Investigate adding "phantom" replacements during physical promotion #87371

jakobbotsch opened this issue Jun 10, 2023 · 1 comment · Fixed by #87410
Assignees
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Comments

@jakobbotsch
Copy link
Member

By phantom I mean making replacements of fields that we have not seen any uses of. There are at least two situations where this would be beneficial:

  • Assignment decomposition will introduce new LCL_FLD nodes that we can try to anticipate.
  • If the unpromoted remainder can be represented as a primitive then that will allow us to get completely rid of the struct local. That often results in smaller prolog code.

The potential benefits can be predicted by simply repeating physical promotion a number of times. In my experiments, repeating physical promotion 10 times results in -120K with physical promotion enabled, and -2 MB with old promotion disabled.

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Jun 10, 2023
@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 Jun 10, 2023
@ghost
Copy link

ghost commented Jun 10, 2023

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

Issue Details

By phantom I mean making replacements of fields that we have not seen any uses of. There are at least two situations where this would be beneficial:

  • Assignment decomposition will introduce new LCL_FLD nodes that we can try to anticipate.
  • If the unpromoted remainder can be represented as a primitive then that will allow us to get completely rid of the struct local. That often results in smaller prolog code.

The potential benefits can be predicted by simply repeating physical promotion a number of times. In my experiments, repeating physical promotion 10 times results in -120K with physical promotion enabled, and -2 MB with old promotion disabled.

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr, untriaged

Milestone: -

@jakobbotsch jakobbotsch self-assigned this Jun 10, 2023
jakobbotsch added a commit to jakobbotsch/runtime that referenced this issue Jun 12, 2023
Add support for promoting fields based on the fact that assignment
decomposition induces new field accesses. To do so we store all struct
assignments that involve candidates for physical promotion as part of
the initial accounting pass. Then when picking the replacements we do it
as a fixpoint computation, iteratively expanding the set of replacements
based on field accesses induced by decomposition assignment with the
existing set of replacements.

Fix dotnet#87371
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jun 12, 2023
jakobbotsch added a commit that referenced this issue Jun 16, 2023
…7410)

Add support for promoting fields based on the fact that store decomposition
induces new field accesses. To do so we store all struct stores that involve
candidates for physical promotion as part of the initial accounting pass. Then
when picking the replacements we do it as a fixpoint computation, iteratively
expanding the set of replacements based on field accesses induced by store
decomposition with the existing set of replacements.


Fix #87371
@ghost ghost removed in-pr There is an active PR which will close this issue when it is merged untriaged New issue has not been triaged by the area owner labels Jun 16, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Jul 17, 2023
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 a pull request may close this issue.

1 participant