Skip to content

JIT: Fix async analysis filter dataflow - #132027

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-132015
Aug 10, 2026
Merged

jakobbotsch merged 1 commit into
dotnet:mainfrom
jakobbotsch:fix-132015

Conversation

@jakobbotsch

Copy link
Copy Markdown
Member

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 #132015
Fix #132016
Fix #132017

…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
Copilot AI review requested due to automatic review settings August 7, 2026 20:24
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 7, 2026
@azure-pipelines

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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::MergeHandler in async analysis to merge using BlockPredsWithEH rather than iterating the contiguous try block range.
  • Clear the BlockPredsWithEH predecessor 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.

Comment thread src/coreclr/jit/asyncanalysis.cpp
Comment thread src/tests/async/regression/132017.cs
@jakobbotsch
jakobbotsch marked this pull request as ready for review August 10, 2026 10:34
@azure-pipelines

Copy link
Copy Markdown
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.

Comment thread src/coreclr/jit/asyncanalysis.cpp
@jakobbotsch

Copy link
Copy Markdown
Member Author

cc @dotnet/jit-contrib PTAL @AndyAyersMS

Diffs, few regressions where the optimization no longer kicks in.

@jakobbotsch
jakobbotsch merged commit 382a215 into dotnet:main Aug 10, 2026
143 of 145 checks passed
@jakobbotsch
jakobbotsch deleted the fix-132015 branch August 10, 2026 16:54
@aevitas

aevitas commented Aug 11, 2026

Copy link
Copy Markdown

Thanks @jakobbotsch - been waiting for this one for a long time.

@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 11, 2026
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.
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI runtime-async

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unskip NestedCatch_DuplicateLocal_NoAwaitInNestedCatch Unskip NestedCatch_DuplicateLocal_Level2 Unskip AsyncInCatchFilter

4 participants