-
Notifications
You must be signed in to change notification settings - Fork 5.2k
JIT: More precise side effect propagation in loop hoisting #118736
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
base: main
Are you sure you want to change the base?
JIT: More precise side effect propagation in loop hoisting #118736
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.
Pull Request Overview
This PR improves the precision of side effect propagation during loop hoisting optimization in the JIT compiler. The change replaces a simple boolean flag with a more sophisticated bit vector approach to track which blocks have encountered side effects.
- Replaces the
m_beforeSideEffectboolean field with am_sideEffectBlocksbit vector - Tracks side effect state per block rather than globally across the entire loop
- Propagates side effect state to successor blocks when side effects are encountered
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
cc @dotnet/jit-contrib, @AndyAyersMS PTAL. Diffs show PerfScore improvements outnumbering regressions in most collections, except for |
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.
Can you call out some specific benchmarks where you expect to see perf improvements?
Can you verify any of these with local runs? Or via Egorbot?
AndyAyersMS
left a comment
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.
Approving but would still like to see some examples where this will resolve current perf issues.
|
@EgorBot --arm --filter |
|
@AndyAyersMS I'm not seeing as much impact in the microbenchmarks as I hoped for, mainly because this seems to impact the OSR variants of various benchmarks instead of their Tier 1 variants. Since this change looks riskier than #118463, I'm ok with holding off on this. |
Sure, makes sense. Thanks for checking. |
|
@AndyAyersMS, is this ready to merge? |
|
We backed out a previous change so I'd say no. We need to look at that one and this carefully. |
Follow-up to #118463. As we walk a loop's blocks in RPO, propagate the side-effecting nature of each block to its successors, rather than flipping a single flag once side-effecting code is encountered.