Skip to content

Conversation

@jakobbotsch
Copy link
Member

Before starting replacements within a statement we now look for physically promoted struct locals passed as call args and write those back if necessary. This has two benefits:

  1. It avoids creating a lot of comma nodes that we would otherwise create
  2. More importantly, it allows morph's last-use copy omission to kick in because we no longer have complex trees as the argument.

Fix #87471

Before starting replacements within a statement we now look for
physically promoted struct locals passed as call args and write those
back if necessary. This has two benefits:
1. It avoids creating a lot of comma nodes that we would otherwise
   create
2. More importantly, it allows morph's last-use copy omission to kick in
   because we no longer have complex trees as the argument.

Fix dotnet#87471
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 21, 2023
@jakobbotsch jakobbotsch marked this pull request as draft June 21, 2023 15:53
@ghost ghost assigned jakobbotsch Jun 21, 2023
@ghost
Copy link

ghost commented Jun 21, 2023

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

Issue Details

Before starting replacements within a statement we now look for physically promoted struct locals passed as call args and write those back if necessary. This has two benefits:

  1. It avoids creating a lot of comma nodes that we would otherwise create
  2. More importantly, it allows morph's last-use copy omission to kick in because we no longer have complex trees as the argument.

Fix #87471

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch
Copy link
Member Author

/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress, runtime-jit-experimental

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @EgorBo

Diffs with physical promotion, diffs without old promotion.

@jakobbotsch jakobbotsch requested a review from EgorBo June 22, 2023 21:43
Copy link
Member

@EgorBo EgorBo left a comment

Choose a reason for hiding this comment

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

lgtm assuming the arm failure is unrelated

@jakobbotsch jakobbotsch merged commit 8b2dc46 into dotnet:main Jun 23, 2023
@jakobbotsch jakobbotsch deleted the physical-promotion-call-args branch June 23, 2023 22:41
@ghost ghost locked as resolved and limited conversation to collaborators Jul 24, 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 this pull request may close these issues.

JIT: Last-use copy elision does not handle IR created by physical promotion

2 participants