Skip to content

Remove GT_ARGPLACE nodes - #68140

Merged
jakobbotsch merged 7 commits into
dotnet:mainfrom
jakobbotsch:remove-argplace-nodes
Apr 23, 2022
Merged

Remove GT_ARGPLACE nodes#68140
jakobbotsch merged 7 commits into
dotnet:mainfrom
jakobbotsch:remove-argplace-nodes

Conversation

@jakobbotsch

@jakobbotsch jakobbotsch commented Apr 17, 2022

Copy link
Copy Markdown
Member

These do not serve much purpose today -- instead just use null and add a
helper function to iterate non-null early args, which is somewhat
common.

In addition to saving some TP and memory, teaching the backend about
null early nodes will also be beneficial because I am planning to change
rationalization to null out non-values in the early arg list so that all
nodes have only values as their operands in LIR.

No diffs and some nice throughput gains:

Collection Base # instructions Diff # instructions PDIFF
aspnet.run.windows.x64.checked.mch 69,717,468,395 69,206,312,087 -0.73%
benchmarks.run.windows.x64.checked.mch 54,695,846,729 54,294,078,768 -0.73%
coreclr_tests.pmi.windows.x64.checked.mch 340,169,515,528 337,478,749,067 -0.79%
libraries.crossgen2.windows.x64.checked.mch 128,653,906,043 126,926,566,191 -1.34%
libraries.pmi.windows.x64.checked.mch 228,653,702,806 226,554,618,843 -0.92%
libraries_tests.pmi.windows.x64.checked.mch 531,053,530,645 525,233,144,101 -1.10%

Memory stats (libraries.pmi)
https://www.diffchecker.com/0iigCXGB
Before: 25961399533 bytes
After: 25770612141 bytes (-0.7%)

These do not serve much purpose today -- instead just use null and add a
helper function to iterate non-null early args, which is somewhat
common.

In addition to saving some TP and memory, teaching the backend about
null early nodes will also be beneficial because I am planning to change
rationalization to null out non-values in the early arg list so that all
nodes have only values as their operands in LIR.

PIN (libraries.pmi):
Before: 316460895992
After: 315456532599 (-0.3%)

Memory stats (libraries.pmi)
Before: 25961399533 bytes
After: 25770612141 bytes (-0.7%)
@ghost ghost assigned jakobbotsch Apr 17, 2022
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 17, 2022
@ghost

ghost commented Apr 17, 2022

Copy link
Copy Markdown

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

Issue Details

These do not serve much purpose today -- instead just use null and add a
helper function to iterate non-null early args, which is somewhat
common.

In addition to saving some TP and memory, teaching the backend about
null early nodes will also be beneficial because I am planning to change
rationalization to null out non-values in the early arg list so that all
nodes have only values as their operands in LIR.

PIN (libraries.pmi):
Before: 316460895992
After: 315456532599 (-0.3%)

Memory stats (libraries.pmi)
https://www.diffchecker.com/0iigCXGB
Before: 25961399533 bytes
After: 25770612141 bytes (-0.7%)

Author: jakobbotsch
Assignees: jakobbotsch
Labels:

area-CodeGen-coreclr

Milestone: -
@jakobbotsch

Copy link
Copy Markdown
Member Author

/azp run runtime-coreclr superpmi-replay, runtime-coreclr superpmi-asmdiffs

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).
@jakobbotsch

Copy link
Copy Markdown
Member Author

cc @dotnet/jit-contrib, any thoughts and does anyone want to take this one?

@AndyAyersMS AndyAyersMS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks. Another good cleanup.

Comment thread src/coreclr/jit/morph.cpp
// Early args don't include 'this' arg. We need to account for that so that the call to gtArgEntryByArgNum
// below has the correct second argument.
for (CallArg& arg : recursiveTailCall->gtArgs.Args())
for (CallArg& arg : recursiveTailCall->gtArgs.EarlyArgs())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is the comment above stale?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, will fix that.

{
node->ClearReverseOp();

// ARGPLACE nodes are not threaded into the LIR sequence.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It's probably not worth re-running the CI for this, but the function header now has an outdated comment:

//    isLIR - whether the sequencing is being done for LIR. If so,
//            ARGPLACE nodes will not be threaded into the linear
//            order, and the GTF_REVERSE_OPS flag will be cleared

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There was another instance of this and I also took the opportunity to change some uses of GetEarlyNode() to GetNode().

More obviously correct. Also add some asserts.
@jakobbotsch
jakobbotsch merged commit bb6954e into dotnet:main Apr 23, 2022
@jakobbotsch
jakobbotsch deleted the remove-argplace-nodes branch April 23, 2022 18:58
@ghost ghost locked as resolved and limited conversation to collaborators May 23, 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

3 participants