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: Allow hot/cold splitting between a BBJ_COND block and its false target #96431

Merged
merged 3 commits into from
Jan 3, 2024

Conversation

amanasifkhalid
Copy link
Member

Next step for #93020. When doing hot/cold splitting, if the first cold block succeeds a BBJ_COND block (meaning the false target is the first cold block), we previously needed to insert a BBJ_ALWAYS block at the end of the hot section to unconditionally jump to the cold section. Since we will need to conditionally generate a jump to the false target depending on its location once bbFalseTarget can diverge from bbNext, this seemed like a nice opportunity to add that logic in, and instead generate a jump to the cold section by checking if a jump is needed to the false target, rather than by appending a BBJ_ALWAYS block to the hot section.

@ghost ghost assigned amanasifkhalid Jan 3, 2024
@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 3, 2024
@ghost
Copy link

ghost commented Jan 3, 2024

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

Issue Details

Next step for #93020. When doing hot/cold splitting, if the first cold block succeeds a BBJ_COND block (meaning the false target is the first cold block), we previously needed to insert a BBJ_ALWAYS block at the end of the hot section to unconditionally jump to the cold section. Since we will need to conditionally generate a jump to the false target depending on its location once bbFalseTarget can diverge from bbNext, this seemed like a nice opportunity to add that logic in, and instead generate a jump to the cold section by checking if a jump is needed to the false target, rather than by appending a BBJ_ALWAYS block to the hot section.

Author: amanasifkhalid
Assignees: amanasifkhalid
Labels:

area-CodeGen-coreclr

Milestone: -

@amanasifkhalid
Copy link
Member Author

/azp run runtime-coreclr crossgen2

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@amanasifkhalid
Copy link
Member Author

/azp run runtime-coreclr crossgen2

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@amanasifkhalid amanasifkhalid marked this pull request as ready for review January 3, 2024 04:26
@amanasifkhalid
Copy link
Member Author

amanasifkhalid commented Jan 3, 2024

cc @dotnet/jit-contrib. No diffs, but a slight TP impact. SPMI failures don't seem to be related. Hot/Cold splitting tests passed in runtime-coreclr crossgen2.

Copy link
Member

@BruceForstall BruceForstall left a comment

Choose a reason for hiding this comment

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

Regarding no diffs: I don't believe we have any hot/cold splitting in any of the SPMI collections. We probably should.

@amanasifkhalid amanasifkhalid merged commit 867250c into dotnet:main Jan 3, 2024
147 of 155 checks passed
@amanasifkhalid amanasifkhalid deleted the split-bbj-cond branch January 3, 2024 16:22
@amanasifkhalid
Copy link
Member Author

Regarding no diffs: I don't believe we have any hot/cold splitting in any of the SPMI collections. We probably should.

Would that just entail enabling "fake" hot/cold splitting (e.g. DOTNET_JitFakeProcedureSplitting=1) for some methods?

@BruceForstall
Copy link
Member

Would that just entail enabling "fake" hot/cold splitting (e.g. DOTNET_JitFakeProcedureSplitting=1) for some methods?

That might be sufficient. Or maybe some crossgen2 + real splitting for some assemblies?

@amanasifkhalid
Copy link
Member Author

Or maybe some crossgen2 + real splitting for some assemblies?

Ah, I just remembered that fake splitting also "fakes" the unwind info by treating the whole method as hot, so turning on real splitting for some crossgen'd assemblies might be more interesting/useful.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 3, 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.

2 participants