Repository navigation
[JIT] [Wasm]: Check IsInvariantInRange for LEA base addr in GetFoldableAddrMode - #134358
Merged
adamperlin merged 1 commit intoSep 22, 2026
Merged
adamperlin merged 1 commit into
adamperlin merged 1 commit into
Conversation
|
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. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
|
Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara |
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Add a regression test covering the Wasm address-ordering pattern before approval.
Review effort: Lite
Findings: None
What changed in this PR
This PR fixes Wasm JIT address folding by ensuring an LEA base remains invariant before containment, preventing LIR ordering and assertion failures.
Changes:
- Adds an
IsInvariantInRangeguard for LEA base addresses. - Preserves existing SIMD12 and write-barrier exclusions.
- Requires a regression test for the reported Wasm address-ordering pattern.
| File | Summary |
|---|---|
src/coreclr/jit/lowerwasm.cpp |
Adds the Wasm LEA base-address invariance guard. |
Member
|
any chance #134262 is related? |
AndyAyersMS
approved these changes
Sep 22, 2026
Member
Seems unlikely at first glance. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Fixes #132987; This issue was found by an experimental version of Fuzzlyn that supports Wasm.
It fixes an LIR semantics assert and possible operand containment/ordering issue on Wasm with a
STOREINDwhere we attempt to contain part of the computation of the destination address, which is a field, as anLEA+Naddressing mode, even though the base address for the field is reloaded during the computation of the value to store. This happens in cases like the following:where the address of field
s_1is used on the left- and right-hand sides of an assignment. Diffs show a regression as expected, but a small one.