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

JIT: Account for GT_JMP implicit uses in local morph ref counting #80734

Merged
merged 6 commits into from
Jan 18, 2023

Conversation

jakobbotsch
Copy link
Member

Fix #80731

Found by #80691.

@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 Jan 17, 2023
@ghost ghost assigned jakobbotsch Jan 17, 2023
@ghost
Copy link

ghost commented Jan 17, 2023

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

Issue Details

Fix #80731

Found by #80691.

Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @AndyAyersMS

@jakobbotsch
Copy link
Member Author

Let me see if I can do something for the MinOpts TP regression.

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.

Ah, I see normal ref counting has a special clause for register args when jmp is used.

case GT_LCL_FLD:
MorphLocalField(node, user);
assert(node->OperIsLocal());
__fallthrough;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
__fallthrough;
FALLTHROUGH;

(We use the macro version everywhere else)

Copy link
Member Author

Choose a reason for hiding this comment

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

I ended up reverting this because the case above also can potentially morph to a local, so also needs some more handling. There is a BasicBlock helper already to check for GT_JMP that it uses now.

Copy link
Contributor

@SingleAccretion SingleAccretion Jan 17, 2023

Choose a reason for hiding this comment

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

Just for my understanding: why not use compJmpOpUsed?

(Multiple JMPs?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes (BasicBlock::endsWithJmpMethod does use compJmpOpUsed as an early-out)

@jakobbotsch
Copy link
Member Author

One diff in the test that exposed the problem -- we no longer incorrectly omit a copy there.

@jakobbotsch jakobbotsch merged commit 6962fc2 into dotnet:main Jan 18, 2023
@jakobbotsch jakobbotsch deleted the fix-80731 branch January 18, 2023 09:06
@ghost ghost locked as resolved and limited conversation to collaborators Feb 17, 2023
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.

JIT: local morph ref counting does not handle GT_JMP
3 participants