JIT: Handle memory conservatively in handler blocks in VN #106274
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SSA does not model memory SSA faithfully inside try clauses. To model it
faithfully we would need to make all intermediate memory states in the
try block visible to the handler block. Doing so would require teaching
SSA about all nodes that define memory, and introduce a bunch of new
memory SSA states for EH constructs.
Instead of doing that this PR makes VN treat any handler block with
multiple incoming memory states (meaning that memory changed during the
try) conservatively. The diffs seem small enough; we can consider a more
elaborate fix in .NET 10.
Fix #86112