Skip to content

Comments

Merge throw blocks in fgHeadTailMerge#122070

Merged
EgorBo merged 3 commits intodotnet:mainfrom
EgorBo:merge-throw-bb
Dec 2, 2025
Merged

Merge throw blocks in fgHeadTailMerge#122070
EgorBo merged 3 commits intodotnet:mainfrom
EgorBo:merge-throw-bb

Conversation

@EgorBo
Copy link
Member

@EgorBo EgorBo commented Dec 1, 2025

Should fix the regression in #122065

Diffs

@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 Dec 1, 2025
@dotnet-policy-service
Copy link
Contributor

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

@EgorBo EgorBo marked this pull request as ready for review December 1, 2025 14:26
Copilot AI review requested due to automatic review settings December 1, 2025 14:26
Copy link
Contributor

Copilot AI left a comment

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 extends the tail merge optimization in fgHeadTailMerge to handle BBJ_THROW blocks in addition to BBJ_RETURN blocks. The change allows the JIT compiler to merge common tail statements from throw blocks, which should fix a regression introduced in a previous PR.

Key Changes

  • Modified the block kind check to include both BBJ_RETURN and BBJ_THROW blocks for tail merge consideration
  • This enables tail merging optimization to work on throw blocks, similar to how it already works on return blocks

@EgorBo
Copy link
Member Author

EgorBo commented Dec 1, 2025

PTAL @dotnet/jit-contrib Diffs
I've analyzed a couple of PerfScore regressions and didn't find anything terrible. I guess this PR has no perfscore improvements because it removes blocks with 0 weight, hence no positive impact on PerfScore

@EgorBo EgorBo requested a review from a team December 1, 2025 15:42
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