Skip to content
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

JIT: Remove fallthrough constraint for BBJ_SWITCH -> BBJ_COND conversion #105651

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

amanasifkhalid
Copy link
Member

I noticed this unnecessary fallthrough check while exploring if we can avoid calling fgUpdateFlowGraph again after reordering blocks, as the new layout doesn't introduce any new blocks. Switch conversion shouldn't rely on what the current block layout happens to be when it's run; if we can do these transformations before running block layout, then removing the post-layout fgUpdateFlowGraph call should be a no-diff change.

Local diffs are relatively small, though more BBJ_SWITCH -> BBJ_COND conversion tends to unlock other flow opts, like more block compaction (we currently skip compacting target into block if target is the successor a switch block, as we don't bother updating the switch block's successor table).

@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 Jul 29, 2024
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

cc @dotnet/jit-contrib, @AndyAyersMS PTAL. Small diffs.

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

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

Ok with taking this for .NET 9.

@amanasifkhalid amanasifkhalid merged commit dfa66c8 into dotnet:main Jul 30, 2024
106 of 108 checks passed
@amanasifkhalid amanasifkhalid deleted the switch-conversion branch July 30, 2024 00:35
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 2024
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