Skip to content

JIT: capture all write barrier helper addresses for SPMI #97535

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

Merged
merged 2 commits into from
Jan 26, 2024

Conversation

AndyAyersMS
Copy link
Member

When varying CSEs we can sometimes alter the write barrier that is needed. In particular if we CSE a heap address computation we may lose track of the fact that an indir is writing to the heap, and so change which write barrier needs to be used.

See #97534.

Even if that's fixed it seems like we still might change our minds for various reasons, so when running under SPMI, just collect all the possible write barrier helper addresses.

When varying CSEs we can sometimes alter the write barrier that is
needed. In particular if we CSE a heap address computation we may
lose track of the fact that an indir is writing to the heap, and so
change which write barrier needs to be used.

See dotnet#97534.

Even if that's fixed it seems like we still might change our minds
for various reasons, so when running under SPMI, just collect all
the possible write barrier helper addresses.
@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 26, 2024
@ghost ghost assigned AndyAyersMS Jan 26, 2024
@ghost
Copy link

ghost commented Jan 26, 2024

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

Issue Details

When varying CSEs we can sometimes alter the write barrier that is needed. In particular if we CSE a heap address computation we may lose track of the fact that an indir is writing to the heap, and so change which write barrier needs to be used.

See #97534.

Even if that's fixed it seems like we still might change our minds for various reasons, so when running under SPMI, just collect all the possible write barrier helper addresses.

Author: AndyAyersMS
Assignees: AndyAyersMS
Labels:

area-CodeGen-coreclr

Milestone: -

@AndyAyersMS
Copy link
Member Author

@jakobbotsch PTAL
cc @dotnet/jit-contrib

@@ -173,6 +173,11 @@ class CodeGenInterface
bool genUseOptimizedWriteBarriers(GenTreeStoreInd* store);
CorInfoHelpFunc genWriteBarrierHelperForWriteBarrierForm(GCInfo::WriteBarrierForm wbf);

#ifdef DEBUG
bool genWriteBarrierUsed;
void WriteBarrierExtraSuperPmiQueries();
Copy link
Member

Choose a reason for hiding this comment

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

Looks like you were going to use a function, but then you didn't?

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. Removed.

@AndyAyersMS AndyAyersMS merged commit 7373fd0 into dotnet:main Jan 26, 2024
AndyAyersMS added a commit to AndyAyersMS/runtime that referenced this pull request Jan 29, 2024
Fixes an issue introduced by dotnet#97535. AOT hosts don't support all the
possible write barriers and blow things up if the JIT asks for ones
they don't support.
jakobbotsch pushed a commit that referenced this pull request Jan 30, 2024
Fixes an issue introduced by #97535. AOT hosts don't support all the
possible write barriers and blow things up if the JIT asks for ones
they don't support.

Also add back the initial semicolon to the metrics line
@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 2024
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