Repository navigation
[wasm] JIT: Add WasmLocals JIT Metric - #138560
Open
adamperlin wants to merge 1 commit into
Open
adamperlin wants to merge 1 commit into
adamperlin wants to merge 1 commit into
Conversation
Contributor
Author
|
@AndyAyersMS PTAL, cc @dotnet/wasm-contrib |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
Author
|
The jit-format errors seem to be from a blob storage account permissions issue. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change adding the WasmLocals metric has no active review issues.
No open issues 🎉
What changed in this PR
Adds a WasmLocals JIT metric so SuperPMI can compare declared WebAssembly local counts, helping evaluate local-reuse optimizations such as #138249.
Changes:
- Registers
WasmLocalsas a lower-is-better metric. - Accumulates declared locals during method and funclet prolog generation on WebAssembly; non-WebAssembly targets retain zero.
| File | Description |
|---|---|
src/coreclr/jit/jitmetadatalist.h |
Defines the WasmLocals metric and its comparison direction. |
src/coreclr/jit/codegenwasm.cpp |
Counts declared locals in method and funclet prologs. |
Review effort: Balanced
…als at codegen time across all funclets
adamperlin
force-pushed
the
adamperlin/wasm-local-count-metric
branch
from
December 1, 2026 17:04
35beb19 to
ab9d26d
Compare
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
On Wasm targets, this counts the total number of declared Wasm locals at codegen time across all funclets. The metric allows us to use
superpmi metricdiffto evaluate diffs in the number of locals which makes evaluating changes like those in #138249 much easier.On non-wasm targets, the metric is always
0.Validation
Ran
superpmi metricdiffon identical copies of the wasm JIT to ensure thatWasmLocalswere being counted and diffed to zero across identical JITs. Additionally, ranmetricdiffon an x64 collection to ensure non-wasm targets report the metric as0.