Skip to content

JIT: Move hot/cold splitting phase to backend #108639

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 1 commit into from
Oct 10, 2024

Conversation

amanasifkhalid
Copy link
Member

Fixes #108611. Running hot/cold splitting at most once ensures the coldness of blocks (as tracked by BBF_COLD) is correct by the time we get to the emitter.

@dotnet/jit-contrib PTAL, thanks!

@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 8, 2024
@amanasifkhalid
Copy link
Member Author

/azp run Antigen

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@amanasifkhalid
Copy link
Member Author

No diffs. Antigen run didn't repro the failure in #108611. @BruceForstall could you PTAL? Thanks!

@amanasifkhalid amanasifkhalid requested a review from a team October 9, 2024 14:55
@amanasifkhalid
Copy link
Member Author

ping @dotnet/jit-contrib

@amanasifkhalid amanasifkhalid merged commit 76146ee into dotnet:main Oct 10, 2024
106 of 116 checks passed
@amanasifkhalid amanasifkhalid deleted the move-splitting-phase branch October 10, 2024 15:40
@kunalspathak
Copy link
Member

do you think we should have added the test case for this?

@amanasifkhalid
Copy link
Member Author

amanasifkhalid commented Oct 10, 2024

I don't think that test case in particular was revealing anything subtle. Looking at earlier Antigen runs, I believe #107483 broke hot/cold splitting pretty substantially, such that if we found a place to split before lowering/LSRA, then lowering/LSRA introduced new blocks, and the new blocks forced us to split later in the method, it would be possible for the emitter to assert later due to jumps being too short. I'm surprised runtime-jit-experimental didn't hit this, though running SPMI with fake hot/cold splitting quickly revealed this issue.

As for the fix, I was planning on moving hot/cold splitting later as part of the flowgraph modernization work -- I just didn't realize that this had correctness implications, too.

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.

osx/arm64: Assertion failed 'emitJumpCrossHotColdBoundary(srcOffs, dstOffs) == false' during 'Emit code'
3 participants