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

Allow deleting any kind of nodes after address mode formation #77872

Merged
merged 2 commits into from
Nov 7, 2022

Conversation

BruceForstall
Copy link
Member

This is a general solution to #77152, allowing for deleting any set of nodes that contributed to an address mode, especially those nodes on the op1 side of a GT_MUL with a zero op2.

Note that for the #77152 case, this deletes all the op1 nodes, but leaves behind a dead temp var that was created as part of long MUL rationalization.

Fixes #77152.

@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 3, 2022
@ghost ghost assigned BruceForstall Nov 3, 2022
@ghost
Copy link

ghost commented Nov 3, 2022

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

Issue Details

This is a general solution to #77152, allowing for deleting any set of nodes that contributed to an address mode, especially those nodes on the op1 side of a GT_MUL with a zero op2.

Note that for the #77152 case, this deletes all the op1 nodes, but leaves behind a dead temp var that was created as part of long MUL rationalization.

Fixes #77152.

Author: BruceForstall
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

{
JITDUMP("Removing unused node:\n ");
DISPNODE(unused);

BlockRange().Remove(unused);

if (unused->OperIs(GT_ADD, GT_MUL, GT_LSH))
for (GenTree* operand : unused->Operands())
{
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add DEBUG_DESTROY_NODE(unused); after the for loop?

@BruceForstall
Copy link
Member Author

@AndyAyersMS Do you think this is the "better" solution over the "targeted" (maybe: hack?) #77871?

@AndyAyersMS
Copy link
Member

@AndyAyersMS Do you think this is the "better" solution over the "targeted" (maybe: hack?) #77871?

Yes.

@BruceForstall
Copy link
Member Author

No diffs, about 0.01% throughput regression

This is a general solution to dotnet#77152, allowing for deleting any
set of nodes that contributed to an address mode, especially those
nodes on the `op1` side of a GT_MUL with a zero `op2`.

Note that for the dotnet#77152 case, this deletes all the `op1` nodes,
but leaves behind a dead temp var that was created as part of
long MUL rationalization.

Fixes dotnet#77152.
@BruceForstall BruceForstall merged commit c6549d9 into dotnet:main Nov 7, 2022
@BruceForstall BruceForstall deleted the Fix77152General branch November 7, 2022 20:57
@ghost ghost locked as resolved and limited conversation to collaborators Dec 8, 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.

Assertion failed 'unused->OperIs(GT_CNS_INT)'
2 participants