Skip to content

Conversation

amanasifkhalid
Copy link
Contributor

Now that switch successor edge redirection is trivial, we can compact blocks with switch predecessors without worrying about invalidating the entire switch successor map.

@Copilot Copilot AI review requested due to automatic review settings June 30, 2025 19:14
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.

Pull Request Overview

This PR refactors the JIT by allowing compaction of blocks even if they have switch predecessors, taking advantage of trivial switch successor edge redirection.

  • Removed the check that prevented block compaction when a switch predecessor was present.
  • Simplified the logic in fgCanCompactBlock() to always return true when no blocking conditions besides the removed check exist.
Comments suppressed due to low confidence (1)

src/coreclr/jit/fgopt.cpp:838

  • Update the function's comment to reflect that compaction is now allowed for blocks with switch predecessors, ensuring that future maintainers understand this behavioral change.
        return false;

@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 Jun 30, 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
Contributor Author

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

@amanasifkhalid amanasifkhalid merged commit a28dfc7 into dotnet:main Jul 1, 2025
109 of 113 checks passed
@amanasifkhalid amanasifkhalid deleted the compact-switch branch July 1, 2025 21:37
@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 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