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

Remove GT_ARGPLACE nodes #68140

Merged
merged 7 commits into from
Apr 23, 2022
Merged

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Apr 17, 2022

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
@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 Apr 17, 2022
@ghost
Copy link

ghost commented Apr 17, 2022

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
Member Author

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

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@jakobbotsch
Copy link
Member Author

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

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

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

Thanks. Another good cleanup.

@@ -8352,33 +8348,30 @@ void Compiler::fgMorphRecursiveFastTailCallIntoLoop(BasicBlock* block, GenTreeCa
// Process early args. They may contain both setup statements for late args and actual args.
// 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
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
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.

@@ -3887,12 +3887,6 @@ GenTree* Compiler::fgSetTreeSeq(GenTree* tree, bool isLIR)
if (m_isLIR)
{
node->ClearReverseOp();

// ARGPLACE nodes are not threaded into the LIR sequence.
Copy link
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
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants