Repository navigation
JIT: fix SIMD12 relocatable-address containment check in ContainCheckIndir - #132676
Merged
Merged
Conversation
|
Azure Pipelines: 16 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: MichalStrehovsky <[email protected]>
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Copilot
AI
changed the title
[WIP] Fix incorrect SIMD12 containment check in Lowering::ContainCheckIndir
JIT: fix SIMD12 relocatable-address containment check in ContainCheckIndir
Aug 24, 2026
MichalStrehovsky
marked this pull request as ready for review
August 24, 2026 01:20
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Member
|
@dotnet/jit-contrib I'm running into the |
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes xarch containment analysis for indirections so the “don’t contain relocatable constants for SIMD12 (Vector3)” restriction is applied to the indirection node type rather than the address operand type, ensuring NativeAOT/reloc scenarios don’t incorrectly contain a relocatable constant address.
Changes:
- Update
Lowering::ContainCheckIndirto gate the relocatable-constant containment rule onnode->TypeIs(TYP_SIMD12)instead ofaddr->TypeIs(TYP_SIMD12). - Prevent SIMD12 indir codegen paths (which may adjust the address by
+8) from encountering contained relocatable address constants on xarch.
jakobbotsch
approved these changes
Aug 24, 2026
EgorBo
approved these changes
Aug 24, 2026
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.
Lowering::ContainCheckIndiron xarch testedaddr->TypeIs(TYP_SIMD12), butaddris the address operand and is always pointer/byref typed — so the condition was vacuously true and the relocation restriction described in the comment right below it never applied.The restriction belongs on the indirection's type:
genLoadIndTypeSimd12/genStoreIndTypeSimd12reach the upper element via a second access at+8, which they implement by mutating a contained address constant (icon->SetIconValue(icon->IconValue() + 8)) underassert(!icon->ImmedValNeedsReloc(m_compiler)).JIT_FLAG_RELOC(AOT). For the runtime JITImmedValNeedsRelocis always false, so containment behavior is unchanged there.addr->TypeIs(TYP_SIMD12)occurrence in the JIT.Verification
A NativeAOT compile (checked JIT) of a static
Vector3load/store hits this today:With the change the address constant is no longer contained and the upper-element access is correct:
On regression tests
No test added. The path requires AOT relocations, so a
JitBluetest cannot reach it; conversely any NativeAOT compilation of a staticVector3store trips the assert under a checked JIT, so existing NativeAOT legs already cover the class broadly. Happy to add an explicit test undersrc/tests/nativeaot/if reviewers prefer one.