Skip to content

JIT: Fix loop cloning with nested EH regions - #133790

Merged
AndyAyersMS merged 1 commit into
mainfrom
fix-133758
Sep 13, 2026
Merged

JIT: Fix loop cloning with nested EH regions#133790
AndyAyersMS merged 1 commit into
mainfrom
fix-133758

Conversation

@AndyAyersMS

Copy link
Copy Markdown
Member

When placing the slow-loop preheader, the loop's lexically bottommost block
may lie in a nested EH region. So instead, use the fast-loop preheader for
placement, as it belongs to the correct region.

Fixes #133758

Note

This pull request description was generated by GitHub Copilot.

When placing the slow-loop preheader, the loop's lexically bottommost block
may lie in a nested EH region. So instead, use the fast-loop preheader for
placement, as it belongs to the correct region.

Fixes #133758

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 12, 2026 15:20
@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 Sep 12, 2026
@AndyAyersMS
AndyAyersMS requested a review from EgorBo September 12, 2026 15:21
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@AndyAyersMS

Copy link
Copy Markdown
Member Author

@EgorBo ptal
fyi @dotnet/jit-contrib

No diffs, simple change.

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

🟢 Approval recommended

No unresolved review issues were identified.

Pull request overview

Fixes JIT loop cloning when the loop’s lexical bottom is inside a nested EH region.

Changes:

  • Uses the fast-loop preheader for valid slow-preheader placement.
  • Adds a nested-EH regression test.
File summaries
File Summary
src/coreclr/jit/loopcloning.cpp Corrects slow-preheader placement.
src/tests/JIT/opt/Cloning/loops_with_eh.cs Adds nested-EH regression coverage.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

@AndyAyersMS

Copy link
Copy Markdown
Member Author

Failures look like #133798 but with different error symptom.

@AndyAyersMS

Copy link
Copy Markdown
Member Author

/ba-g known mono test errors

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.

JIT: (bug) Loop cloning passes an out-of-region search start to fgFindInsertPoint when the loop's lexical bottom is in a nested try

3 participants