JIT: Fix async analysis filter dataflow - #132027
Merged
Merged
Conversation
…tion The data flow used for default-value analysis and preserved-value analysis did not properly account for predecessors of filter handlers. Switch to `BlockPredsWithEH` which models all exceptional flow faithfully. Fix dotnet#132015 Fix dotnet#132016 Fix dotnet#132017
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates CoreCLR JIT async default/preserved-value dataflow to account for exceptional predecessors of handler blocks (via BlockPredsWithEH), and adds new async regression tests covering filtered/nested EH cases related to issues #132015/#132016/#132017.
Changes:
- Update
MutationDataFlowCallback::MergeHandlerin async analysis to merge usingBlockPredsWithEHrather than iterating the contiguous try block range. - Clear the
BlockPredsWithEHpredecessor cache before running async analyses to avoid using stale memoized results. - Add three new xUnit-based async regression tests (with minimal per-test csproj files) for the reported scenarios.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/coreclr/jit/asyncanalysis.cpp | Switch handler-merge predecessor enumeration to BlockPredsWithEH for more faithful exceptional-flow modeling. |
| src/coreclr/jit/async.cpp | Clear m_blockToEHPreds cache before async analyses that rely on BlockPredsWithEH. |
| src/tests/async/regression/132015.csproj | Add new regression test project for #132015. |
| src/tests/async/regression/132015.cs | Add regression tests validating value visibility across async suspension with filters/finally. |
| src/tests/async/regression/132016.csproj | Add new regression test project for #132016. |
| src/tests/async/regression/132016.cs | Add regression test for nested catch/filter behavior across async suspension. |
| src/tests/async/regression/132017.csproj | Add new regression test project for #132017. |
| src/tests/async/regression/132017.cs | Add regression test for catch-filter + nested catch starting an un-awaited task. |
jakobbotsch
marked this pull request as ready for review
August 10, 2026 10:34
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
jakobbotsch
commented
Aug 10, 2026
Member
Author
|
cc @dotnet/jit-contrib PTAL @AndyAyersMS Diffs, few regressions where the optimization no longer kicks in. |
This was referenced Aug 10, 2026
AndyAyersMS
approved these changes
Aug 10, 2026
|
Thanks @jakobbotsch - been waiting for this one for a long time. |
jtschuster
pushed a commit
to jtschuster/runtime
that referenced
this pull request
Aug 11, 2026
The data flow used for default-value analysis and preserved-value analysis did not properly account for predecessors of filter handlers. Switch to `BlockPredsWithEH` which models all exceptional flow faithfully.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The data flow used for default-value analysis and preserved-value analysis did not properly account for predecessors of filter handlers. Switch to
BlockPredsWithEHwhich models all exceptional flow faithfully.Fix #132015
Fix #132016
Fix #132017