-
Notifications
You must be signed in to change notification settings - Fork 5k
JIT: Re-introduce late fgOptimizeBranch
pass
#113491
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: Re-introduce late fgOptimizeBranch
pass
#113491
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
cc @dotnet/jit-contrib, @AndyAyersMS PTAL. Diffs show size regressions as expected, though they are dominated by
Most of the above is easy to implement, but it will incur plenty of churn. This PR should at least reverse some long-standing regressions that benefitted from late branch opts, but I think there's more we can claw back here -- not sure if we want to pursue this now or later, though. |
/ba-g blocked by build timeouts |
Part of #107749.
fgReorderBlocks
runsfgOptimizeBranch
when it decides not to reorder a particular block. Turning off the old layout in favor of RPO layout in .NET 9 had the unintended consequence of also disabling the laterfgOptimizeBranch
pass the JIT used to do. After finding cases in #113108 (comment) that benefit from cloning and hoisting loop tests, I decided to reintroduce this late pass. These regressions also highlight thatfgOptimizeBranch
can create compaction opportunities inside loop bodies that we don't currently take advantage of; I've added a check to handle this.