-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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: Propagate LCL_ADDRs into handlers #109182
Conversation
Expand the support for LCL_ADDR propagation to keep assertions around in handler blocks when they are true at all points in all predecessor blocks of those handlers. This requires keeping track of the "always true" assertions for each block.
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
cc @AndyAyersMS |
It seems like we could avoid storing both sets of assertions if we pushed facts into successors instead of pulling them from predecessors; then at the end of each block we would just intersect the regular successor's "assertions-in" set with the block's "assertions-out" set, and the EH successor's "assertions-in" set with the block's "always-assertions" set. However, it would add a visit to all block's successors, and we wouldn't be able to remove the loop over predecessors since it's still needed to know if this block is a target of a backedge. If the DFS traversal saved the targets of backedges we would be able to avoid the loop over the pred list (and loop finding could use it to directly find header candidates). But overall it seems simpler to just stick to the current approach and store an extra 8 bytes per basic block, which is a very small amount of memory anyway. |
cc @dotnet/jit-contrib PTAL @AndyAyersMS |
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.
This seems better than what I had in mind. Thanks!
Expand the support for LCL_ADDR propagation to keep assertions around in handler blocks when they are true at all points in all predecessor blocks of those handlers. This requires keeping track of the "always true" assertions for each block.
For context, see discussion around #102965 (comment)