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

[TODO-List-Cleanup] Delete NumChildren, GetChild and gtGetChildPointer #61875

Merged
merged 5 commits into from
Nov 30, 2021

Conversation

SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented Nov 20, 2021

All these functions represent what is essentially duplicated code.

No diffs.

TryGetUse does the same thing and is used more often.

Also some editorial renames to standardize on the "user/use" terminology.
In most situations these methods are the wrong thing
to call - they are not very efficient by design.

Not surprisingly, thus, they were mostly only used in debug
code. The few product dependencies were removed and replaced
with equivalent alternatives, deduplicating the code.

In the process, BasicBlock::firstNode() was removed as it was
not used anywhere.
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Nov 20, 2021
@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 Nov 20, 2021
@ghost
Copy link

ghost commented Nov 20, 2021

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

Issue Details

All these functions represent what is essentially duplicated code.

Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr, community-contribution

Milestone: -

@SingleAccretion SingleAccretion marked this pull request as ready for review November 20, 2021 19:23
@SingleAccretion
Copy link
Contributor Author

@dotnet/jit-contrib

@JulieLeeMSFT
Copy link
Member

@AndyAyersMS PTAL.

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.

Looks good overall, just one nit on parameter naming.

If you change that it, might ripple through to other similar APIs.

@@ -4986,199 +4986,20 @@ unsigned GenTree::GetScaledIndex()
}

//------------------------------------------------------------------------
// gtGetChildPointer: If 'parent' is the parent of this node, return the pointer
// to the child node so that it can be modified; otherwise, return nullptr.
// TryGetUse: Get the def -> def edge for a child of this tree.
Copy link
Member

Choose a reason for hiding this comment

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

Nit: def seems like an odd name choice here, and def -> def likewise.

Maybe child would be better?

Copy link
Contributor Author

@SingleAccretion SingleAccretion Nov 24, 2021

Choose a reason for hiding this comment

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

Renamed to operand as that's what other related APIs use (ReplaceOperand, VisitOperands, Operands).

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, that reads much better.

@AndyAyersMS AndyAyersMS merged commit eeb60e8 into dotnet:main Nov 30, 2021
@SingleAccretion SingleAccretion deleted the TODO-List-Cleanup-Part-One branch November 30, 2021 20:26
@ghost ghost locked as resolved and limited conversation to collaborators Dec 31, 2021
@AndyAyersMS
Copy link
Member

Did you look at JIT throughput with this change? Especially for Tier0 code and or Tier0 / w PGO?

Techempower runs show a notable drop in full PGO time to first response on around 11/30-12/1 and from a quick scan, this seems to be the only change that might be relevant. But a drop of this magnitude also seems a bit hard to believe...

image

@EgorBo
Copy link
Member

EgorBo commented Jan 10, 2022

@AndyAyersMS I've just checked - it's not this commit (I've checked the commit prior this one)

[] | application           |                                |
[] | --------------------- | ------------------------------ |
[] | Start Time (ms)       | 470                            |
[] | load                   |             |
[] | ---------------------- | ----------- |
[] | First Request (ms)     | 71          |

which is 541 (already improved result)

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.

4 participants