-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Change loop cloning condition blocks flow graph #59233
Change loop cloning condition blocks flow graph #59233
Conversation
Currently, the loop choice condition blocks are created in a way that creates a confusing flow graph. Restructure them to be simpler, and lay the path for future work. The simpler layout (and, hopefully, code and logic to create them) also lays the groundwork to potentially put the slow path loop in the loop table, if desired, as it creates a "standard" loop header layout. While the flow graph has an extra block or two, there are almost no diffs, as subsequent phases clean up any extras. There are a few diffs where the new layout enables some downstream optimization phases that were stymied by the old layout, but mostly in cases where we leave around dead code slow cloned blocks (a known issue). Also, there are a couple trivial CSE changes.
Tagging subscribers to this area: @JulieLeeMSFT Issue DetailsCurrently, the loop choice condition blocks are created in a way that creates The simpler layout (and, hopefully, code and logic to create them) also While the flow graph has an extra block or two, there are almost no diffs, There are a few diffs where the new layout enables some downstream optimization
|
benchmarks.run.windows.x64.checked.mch:
Detail diffs
coreclr_tests.pmi.windows.x64.checked.mch:
Detail diffs
libraries.crossgen2.windows.x64.checked.mch:
Detail diffs
libraries.pmi.windows.x64.checked.mch:
Detail diffs
libraries_tests.pmi.windows.x64.checked.mch:
Detail diffs
|
@AndyAyersMS @dotnet/jit-contrib PTAL |
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.
LGTM.
// Insert condition 0 in 'h' and create other condition blocks and insert conditions in them. | ||
// On entry, block 'h' is a conditional block, but its bbJumpDest hasn't yet been set. | ||
// ... | ||
// slowHead -?> e2 (slowHead) branch or fall-through to e2 |
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.
e2
is the entry block of the slow loop, I take it?
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.
Yes, the "2" cases are the slow path blocks. I've tried to improve the comments over time, but I guess there is still room for improvement.
Currently, the loop choice condition blocks are created in a way that creates
a confusing flow graph. Restructure them to be simpler, and lay the path for
future work.
The simpler layout (and, hopefully, code and logic to create them) also
lays the groundwork to potentially put the slow path loop in the loop table,
if desired, as it creates a "standard" loop header layout.
While the flow graph has an extra block or two, there are almost no diffs,
as subsequent phases clean up any extras.
There are a few diffs where the new layout enables some downstream optimization
phases that were stymied by the old layout, but mostly in cases where we leave
around dead code slow cloned blocks (a known issue). Also, there are a couple
trivial CSE changes.