Fix Wasm SCC profile weights for #133120 - #133132
Conversation
Update the try header profile weight after Wasm SCC switch-dispatch transformation so the transformed CFG remains profile-consistent. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 6 pipeline(s). 10 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
@lewing alternative fix for #133120 |
There was a problem hiding this comment.
🔵 Needs a closer look
Although the change is small, it touches JIT CFG/profile invariants in the Wasm SCC transform and warrants final human validation of correctness and test effectiveness on the relevant browser-wasm R2R/PGO scenarios.
Pull request overview
Adjusts the Wasm SCC switch-dispatch transformation to keep block profile weights self-consistent after rerouting entry flow through a try header, and adds a JIT regression test intended to exercise the affected async try/catch control-flow shape under browser-wasm CrossGen2.
Changes:
- Update
Scc::TransformViaSwitchDispatch()to set the try header’s profile weight to the SCC’s aggregate entry weight after rewiring. - Add a new JitBlue regression project/test that runs on browser-wasm with CrossGen2 and passes
--codegenopt:JitSynthesizeCounts=1.
File summaries
| File | Description |
|---|---|
| src/coreclr/jit/fgwasm.cpp | Updates the try header profile weight after SCC entry-flow rerouting to avoid stale/inconsistent weights. |
| src/tests/JIT/Regression/JitBlue/Runtime_133120/Runtime_133120.csproj | Adds a new JitBlue regression project with browser CrossGen2 settings and extra CrossGen2 args. |
| src/tests/JIT/Regression/JitBlue/Runtime_133120/Runtime_133120.cs | Adds an async try/catch-based test body intended to trigger the SCC transform scenario. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
lewing
left a comment
There was a problem hiding this comment.
verified that this passes the failed check from the original issue
adamperlin
left a comment
There was a problem hiding this comment.
LGTM, pending the comments about the regression test.
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
|
/ba-g one of the build monitors is confused |
Fixes #133120.
The Wasm SCC switch-dispatch transformation routes all entry flow through an enclosing try header, but previously left that header's profile weight unchanged. This produced inconsistent profile weights and CrossGen2 assertions for ReadyToRun/PGO compilation.
This change updates the try header to the aggregate SCC entry weight after rewiring and adds a regression test covering the async validator/catch control-flow shape.
Validation performed:
End-to-end Node.js execution was unavailable because Node.js is not installed in the environment.
Note
This pull request description was generated with GitHub Copilot.