Skip to content

JIT: Refactor async analysis#126028

Open
jakobbotsch wants to merge 3 commits intodotnet:mainfrom
jakobbotsch:async-refactor
Open

JIT: Refactor async analysis#126028
jakobbotsch wants to merge 3 commits intodotnet:mainfrom
jakobbotsch:async-refactor

Conversation

@jakobbotsch
Copy link
Member

Purely mechanical changes that should be no-diff.

  • Rename AsyncLiveness -> AsyncAnalysis since it also tracks other analyses now
  • Introduce asyncanalysis.cpp and move DefaultValueAnalysis, PreservedValueAnalysis and AsyncAnalysis into it
  • Share the data flow callback between DefaultValueAnalysis and PreservedValueAnalysis
  • Rename fgTrysNotContiguous -> fgTrysContiguous and assert it as part of DataFlow::ForwardAnalysis that depends on contiguity

- Rename `AsyncLiveness` -> `AsyncAnalysis` since it also tracks other
  analyses now
- Introduce asyncanalysis.cpp and move `DefaultValueAnalysis`,
  `PreservedValueAnalysis` and `AsyncAnalysis` into it
- Share the data flow callback between `DefaultValueAnalysis` and
  `PreservedValueAnalysis`
- Rename `fgTrysNotContiguous` -> `fgTrysContiguous` and assert it as
  part of `DataFlow::ForwardAnalysis` that depends on contiguity
Copilot AI review requested due to automatic review settings March 24, 2026 13:19
@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 Mar 24, 2026
// Once we have run wasm layout, try regions may no longer be contiguous.
//
bool fgTrysNotContiguous() { return fgIndexToBlockMap != nullptr; }
bool fgTrysContiguous() { return fgIndexToBlockMap == nullptr; }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took the liberty of flipping this to avoid the negation

@dotnet-policy-service
Copy link
Contributor

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

Copy link
Contributor

Copilot AI left a 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 refactors CoreCLR JIT async transformation analysis code by renaming and regrouping the async-related analyses into a dedicated translation unit, while also clarifying and enforcing assumptions around EH try-region contiguity used by forward dataflow.

Changes:

  • Renamed AsyncLiveness to AsyncAnalysis and moved DefaultValueAnalysis, PreservedValueAnalysis, and AsyncAnalysis into the new asyncanalysis.cpp.
  • Shared a single DataFlow::ForwardAnalysis callback implementation between DefaultValueAnalysis and PreservedValueAnalysis.
  • Renamed fgTrysNotContiguous to fgTrysContiguous and added a contiguity assert in DataFlow::ForwardAnalysis; updated EH verification/diagnostics call sites accordingly.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/coreclr/jit/jiteh.cpp Updates EH verification logic to use fgTrysContiguous() semantics.
src/coreclr/jit/fgdiagnostic.cpp Updates EH predecessor checking to use fgTrysContiguous() semantics.
src/coreclr/jit/dataflow.h Asserts try-region contiguity as a precondition for forward dataflow.
src/coreclr/jit/compiler.h Renames the contiguity predicate to fgTrysContiguous().
src/coreclr/jit/asyncanalysis.cpp New file containing async-related analyses and shared dataflow callback.
src/coreclr/jit/async.h Exposes analysis class declarations and renames AsyncLivenessAsyncAnalysis.
src/coreclr/jit/async.cpp Wires up AsyncAnalysis usage and updates call sites accordingly.
src/coreclr/jit/CMakeLists.txt Adds asyncanalysis.cpp to the JIT build sources.

@jakobbotsch jakobbotsch marked this pull request as ready for review March 24, 2026 17:02
Copilot AI review requested due to automatic review settings March 24, 2026 17:02
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @AndyAyersMS

No diffs.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants