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 unnecessary GcInfoEncoder::DoNotTrackInPartiallyInterruptible #113078

Merged

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Mar 3, 2025

The check as it was used always returned false (verified that with an assert on the first commit). Instead trust the user of the encoder on what registers to report and not report. This unblocks custom calling conventions like in #112406 and with runtime async.

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Mar 3, 2025
@jakobbotsch
Copy link
Member Author

This check always succeeds (tested with an assert otherwise on the first commit in this PR).

@jakobbotsch jakobbotsch changed the title Test for untracked slots in partially interruptible methods Remove unnecessary GcInfoEncoder::DoNotTrackInPartiallyInterruptible Mar 3, 2025
@jakobbotsch jakobbotsch added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Mar 3, 2025
Copy link
Contributor

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

@jakobbotsch jakobbotsch marked this pull request as ready for review March 3, 2025 18:57
@Copilot Copilot bot review requested due to automatic review settings March 3, 2025 18:57

Choose a reason for hiding this comment

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

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @VSadov

No diffs again. The JIT is already ensuring that the encoder does not see any "wrong" registers here, it seems.

@jakobbotsch jakobbotsch requested a review from VSadov March 3, 2025 21:27

// tells whether a slot cannot contain an object reference
// at call instruction or right after returning
bool GcInfoEncoder::DoNotTrackInPartiallyInterruptible(GcSlotDesc &slotDesc)
Copy link
Member

Choose a reason for hiding this comment

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

I think this was an optimization in the past to filter out volatile registers early.
It also claims to filter out things that cannot possibly contain a ref - but why would that even come as an input? The filtering probably did not help much in this regard.

Now that we record everything that is alive, the filtering is pointless indeed.

@@ -21,6 +21,7 @@ pr:
# so that this build can block dependency auto-updates (this build is currently ignored)
include:
- src/coreclr/jit/*
- src/coreclr/gcinfo/*
Copy link
Member

Choose a reason for hiding this comment

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

What are these changes for? (just curious)

Copy link
Member Author

Choose a reason for hiding this comment

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

superpmi-asmdiffs was not running for this change, even though the gcinfoencoder is statically linked into the JIT and affects its compilation results. This change is ensuring that superpmi-asmdiffs runs even on gcinfoencoder changes (so that we can see diffs).

Copy link
Member

@VSadov VSadov left a comment

Choose a reason for hiding this comment

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

LGTM!

@VSadov
Copy link
Member

VSadov commented Mar 3, 2025

This unblocks custom calling conventions like in #112406 and with runtime async.

Also it was a piece of code that needs to be maintained for every architecture/platform/ABI. Nice that it is gone.

@jakobbotsch jakobbotsch merged commit 574c48c into dotnet:main Mar 4, 2025
110 checks passed
@jakobbotsch jakobbotsch deleted the gcinfoencoder-remove-unnecessary-check branch March 4, 2025 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.

2 participants