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

More XARCH PUTARG_STK CQ improvements #67400

Merged

Conversation

SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented Mar 31, 2022

Included:

Dissolve structs into primitives for PUTARG_STK

The primary benefit of this change is "free" support for
complex addressing modes, which is always desirable when
we are loading a primitive (as opposed to the large struct
case, where we would not want to use the 3-operand LEA
in a loop, but instead cache the address in a register).

The additional (future) benefit is that we will no longer
need to mark the source local as DNER, once LCL_VAR sources
for struct PUTARG_STKs are supported.

And also:

Contain PUTARG_STK sources for "push [mem]"

The latter change is responsible for some pretty nice x86 diffs for TYP_FLOAT sources:

-       vmovss   xmm0, dword ptr [ebp+0CH]
-       sub      esp, 4
-       vmovss   dword ptr [esp], xmm0
-       vmovss   xmm0, dword ptr [ebp+08H]
-       sub      esp, 4
-       vmovss   dword ptr [esp], xmm0
-       vmovss   xmm0, dword ptr [ebp+10H]
-       sub      esp, 4
-       vmovss   dword ptr [esp], xmm0
+       push     dword ptr [ebp+0CH]
+       push     dword ptr [ebp+08H]
+       push     dword ptr [ebp+10H]

We are expecting good improvements, with a few regressions due to different RA choices.

There were too many x86 diffs for SPMI in CI, plus there is an SPMI outage, so here is the full locally obtained version: win-x86.

Highlights:

benchmarks.run.windows.x86:      -9.6K
libraries.crossgen2.windows.x86: -125K
libraries.pmi.windows.x86:       -55K

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Mar 31, 2022
@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 Mar 31, 2022
@ghost
Copy link

ghost commented Mar 31, 2022

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

Issue Details

Included:

Dissolve structs into primitives for PUTARG_STK

The primary benefit of this change is "free" support for
complex addressing modes, which is always desirable when
we are loading a primitive is  (as opposed to the large
struct case, where we would not want to use the 3-operand
LEA in a loop, but instead cache the address in a register).

The additional (future) benefit is that we will no longer
need to mark the source local as DNER, once LCL_VAR sources
for struct PUTARG_STKs are supported.

And also:

Contain PUTARG_STK sources for "push [mem]"

The latter change is responsible for some pretty nice diffs for TYP_FLOAT sources:

-       vmovss   xmm0, dword ptr [ebp+0CH]
-       sub      esp, 4
-       vmovss   dword ptr [esp], xmm0
-       vmovss   xmm0, dword ptr [ebp+08H]
-       sub      esp, 4
-       vmovss   dword ptr [esp], xmm0
-       vmovss   xmm0, dword ptr [ebp+10H]
-       sub      esp, 4
-       vmovss   dword ptr [esp], xmm0
+       push     dword ptr [ebp+0CH]
+       push     dword ptr [ebp+08H]
+       push     dword ptr [ebp+10H]
Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr, community-contribution

Milestone: -

@SingleAccretion SingleAccretion force-pushed the PutargStk-Primitives-Containment branch 2 times, most recently from 13e269a to 3f00262 Compare March 31, 2022 21:26
The primary benefit of this change is "free" support for
complex addressing modes, which is always desirable when
we are loading a primitive (as opposed to the large struct
case, where we would not want to use the 3-operand LEA
in a loop, but instead cache the address in a register).

The additional (future) benefit is that we will no longer
need to mark the source local as DNER, once LCL_VAR sources
for struct PUTARG_STKs are supported.
@SingleAccretion SingleAccretion force-pushed the PutargStk-Primitives-Containment branch from 3f00262 to db08d4d Compare March 31, 2022 21:45
@SingleAccretion SingleAccretion marked this pull request as ready for review April 1, 2022 10:48
@SingleAccretion
Copy link
Contributor Author

@dotnet/jit-contrib

@BruceForstall BruceForstall self-requested a review April 1, 2022 19:37
Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

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

The diffs look great! Thanks for the contribution!

@BruceForstall BruceForstall merged commit 7e641e6 into dotnet:main Apr 2, 2022
@SingleAccretion SingleAccretion deleted the PutargStk-Primitives-Containment branch April 3, 2022 19:40
@ghost ghost locked as resolved and limited conversation to collaborators May 4, 2022
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 community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants