-
Notifications
You must be signed in to change notification settings - Fork 5k
JIT: Disallow flowgraph modifications during VN opts #115197
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
Conversation
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
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 fixes issues with flowgraph annotations becoming stale due to early value propagation by recomputing required structures during value numbering optimizations. The changes include:
- In valuenum.cpp, replacing an unconditional assertion on m_dfsTree with a conditional recomputation of the DFS tree and natural loop discovery.
- In copyprop.cpp, adding a check to compute the dominator tree if it is missing.
- In compiler.cpp, removing the redundant dominator tree computation from RecomputeFlowGraphAnnotations.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/coreclr/jit/valuenum.cpp | Recomputes DFS tree and associated loop info if m_dfsTree is missing. |
src/coreclr/jit/copyprop.cpp | Ensures m_domTree is computed based on a non-null m_dfsTree. |
src/coreclr/jit/compiler.cpp | Removes duplicate computation of the dominator tree in flowgraph annotation update. |
What flowgraph changes is it making? Copy prop is meant to closely match SSA. I am not sure we can tolerate flowgraph changes between them. |
Early value prop can fold null checks, which might enable us to fold the containing block into a |
/ba-g CI is green, but Build Analysis is stuck |
Early value propagation can invalidate the flowgraph annotations. Make sure downstream opts tolerate this by recomputing them as needed. Fixes #115168.