Uh oh!
There was an error while loading. Please reload this page.
Invalidate PGO after Wasm SCC transform - #133122
Conversation
The Wasm SCC transform reroutes SCC entry flow through a dispatcher, which can leave incorporated PGO block weights structurally inconsistent with the rewritten CFG. Mark the profile data inconsistent after the transform so checked profile validation does not assert on stale weights. Fixes#133120 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: db8401cb-c388-4481-a625-34811ab8a269
|
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 'arch-wasm': @lewing, @pavelsavara |
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, matches an established pattern in the same file for CFG-rewriting passes, and the only feedback is a minor comment-wording nit.
Pull request overview
This PR updates the Wasm SCC transform phase to conservatively invalidate PGO “consistency” after CFG rewriting, preventing post-phase profile-weight verification asserts when multi-entry SCCs are rewritten through a dispatcher.
Changes:
- Mark
fgPgoConsistent = falseafterWasmTransformSccsruns (when irreducible loops are transformed). - Add a
JITDUMPnote explaining why profile data is considered inconsistent after SCC entry flow is rerouted.
File summaries
| File | Description |
|---|---|
| src/coreclr/jit/fgwasm.cpp | Invalidates PGO consistency after SCC transform rewires entry flow through a dispatcher to avoid checked profile verification asserts. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
| // Weight moved from the SCC entry blocks through the dispatcher, so any | ||
| // profile data we had is no longer self-consistent. |
AndyAyersMS
commented
Sep 2, 2026
I'd prefer to try and fix the profile, let me see if that looks tractable. If not, we can take this. |
AndyAyersMS
commented
Sep 2, 2026
#133132 fixes the weights -- if you can validate it, I'd prefer that fix. |
Summary
The Wasm SCC transform rewrites multi-entry SCCs to route entry flow through a dispatcher. When profile data has already been incorporated, that rewrite can leave block weights structurally inconsistent with the new CFG and trigger checked JIT profile verification asserts.
This conservatively marks PGO data inconsistent after the SCC transform, matching the existing approach used by
fgWasmRepairTryEntrieswhen it reroutes weighted flow.Fixes#133120.
Validation
./build.sh clr+libs+hostpython3 src/coreclr/scripts/jitformat.py -r . -o osx -a arm64./build.sh clrNote
This PR description was generated by GitHub Copilot.