JIT: always home register params on wasm#130446
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR fixes a wasm-specific prolog correctness issue where register-parameter homing could be skipped due to calleeRegArgMaskLiveIn not being populated on wasm (since wasm uses WasmRegAlloc rather than LSRA). The change makes wasm always invoke genHomeRegisterParams during prolog generation and updates wasm’s homing filter to use ref-counts instead of entry liveness.
Changes:
- In
genFnProlog, always callgenHomeRegisterParamsunderTARGET_WASMinstead of gating oncalleeRegArgMaskLiveIn. - In wasm
genHomeRegisterParams, switch the “spill / don’t spill” decision fromfgFirstBB->bbLiveIntolvRefCnt().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/coreclr/jit/codegenwasm.cpp | Changes wasm parameter-homing eligibility check to use ref-counts rather than entry liveness. |
| src/coreclr/jit/codegencommon.cpp | Makes wasm prolog always home register params, bypassing the calleeRegArgMaskLiveIn gate used for LSRA-based targets. |
…wasm Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
@adamperlin PTAL This gets us bit farther through SPC bring up. |
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Looks like we still have some older versions of node out there? |
Node version seems ok, we just need to pass |
Fixed now @AndyAyersMS |
Always home the live params on Wasm (we do not produce or rely on the
calleeRegArgMaskLiveIn). Initialize this anyways to avoid random behavior in case somebody does look at it.Addresses the caller-side
this-drop blocker in #129850.SuperPMI (corelib crossgen2, browser): +28 bytes / 4 contexts / 0.00%.
Note
This change was authored with the assistance of GitHub Copilot.