Skip to content

JIT: Run switch peeling only once #113326

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
Mar 11, 2025

Conversation

amanasifkhalid
Copy link
Member

Part of #107749. fgReorderBlocks runs switch peeling, which means we have both an early and a late pass of it; the former pass seems unnecessary. I've refactored our switch peeling pass to make it easier to incorporate into the switch recognition loop so that we only loop the block list once. I expected the refactor part of this PR to be no-diff, but it turns out we don't propagate the fgHasSwitch member of inlinee compilers to the root compiler, which pessimized the old switch peeling pass. These changes unlock switch peeling in a few more cases.

@Copilot Copilot AI review requested due to automatic review settings March 10, 2025 17:27
Copy link
Contributor

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

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

@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 Mar 10, 2025
Copy link
Contributor

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

@amanasifkhalid
Copy link
Member Author

@dotnet/jit-contrib PTAL. Diffs are a net size increase due switch peeling kicking in more often. Thanks!

@amanasifkhalid amanasifkhalid merged commit 8fad985 into dotnet:main Mar 11, 2025
114 checks passed
@amanasifkhalid amanasifkhalid deleted the switch-peeling branch March 11, 2025 15:00
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2025
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