Skip to content

JIT: Disallow splitting prologs and epilogs across multiple fragments#130070

Draft
jakobbotsch wants to merge 5 commits into
dotnet:mainfrom
jakobbotsch:no-split-during-unwind
Draft

JIT: Disallow splitting prologs and epilogs across multiple fragments#130070
jakobbotsch wants to merge 5 commits into
dotnet:mainfrom
jakobbotsch:no-split-during-unwind

Conversation

@jakobbotsch

@jakobbotsch jakobbotsch commented Jul 1, 2026

Copy link
Copy Markdown
Member

The JIT internally expects that all fragments can be unwound by executing all unwind codes, so unwind info for all fragments mark that all prolog codes should be executed. After #126552 we started splitting prologs into multiple IGs, and emitSplit in these cases would allow splitting the prolog across multiple fragments.
This was a stress only issue.

Fix #128590

Copilot AI review requested due to automatic review settings July 1, 2026 09:25
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jul 1, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the JIT emitter’s STRESS_EMITTER instruction-group splitting behavior to avoid splitting during unwind-info prolog generation, which can produce invalid/unexpected unwind metadata under stress conditions (notably impacting arm32 thread hijacking scenarios).

Changes:

  • Prevent STRESS_EMITTER from forcing a new instruction group while compGeneratingUnwindProlog is true.
  • Add an explanatory comment clarifying why prolog splitting is disallowed during unwind generation.

Copilot AI review requested due to automatic review settings July 1, 2026 09:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

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

Copilot AI review requested due to automatic review settings July 1, 2026 09:46
@jakobbotsch jakobbotsch changed the title JIT: Disallow splitting prologs while generating unwind JIT: Disallow splitting prologs across multiple fragments Jul 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread src/coreclr/jit/emit.cpp Outdated
@jakobbotsch

Copy link
Copy Markdown
Member Author

/azp run runtime-coreclr jitstress, runtime-coreclr libraries-jitstress

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@JulieLeeMSFT JulieLeeMSFT left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. It disallows splitting epilog as well.

@jakobbotsch jakobbotsch changed the title JIT: Disallow splitting prologs across multiple fragments JIT: Disallow splitting prologs and epilogs across multiple fragments Jul 1, 2026
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.

Test Failure: Multiple library test assemblies

3 participants