Validate store-coalescing constants before modifying IR - #133976
Open
tannergooding wants to merge 1 commit into
Open
tannergooding wants to merge 1 commit into
tannergooding wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
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. |
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add the required SDK configuration so the no-HW regression builds and runs.
Get a fresh assessment by requesting another Copilot review.
Review tier: Lite
Findings: 1
Open (1)
What changed in this PR
Fixes JIT store-coalescing corruption by validating constants before mutating IR.
Changes:
- Moves scalar and SIMD validation ahead of store rewriting.
- Adds
Vector2andVector64.CreateScalarregression coverage. - Adds a hardware-intrinsics-disabled test variant.
| File | Summary |
|---|---|
src/tests/JIT/Regression_2/Runtime_133746/Runtime_133746.csproj |
Configures the primary regression test. |
src/tests/JIT/Regression_2/Runtime_133746/Runtime_133746.cs |
Adds regression coverage for affected vector cases. |
src/tests/JIT/Regression_2/Runtime_133746/Runtime_133746_nohw.csproj |
Critical: lacks the root SDK configuration, so the no-HW regression cannot run. |
src/coreclr/jit/lower.cpp |
Validates constants before store removal and widening. |
| @@ -0,0 +1,6 @@ | |||
| <Project> | |||
This was referenced Sep 15, 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 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.

Fixes #133746.
LowerStoreCoalescingremoved the previous store and widened the current store before checking whether their constants could be combined. If constant extraction failed, lowering returned with the transformation only partially applied: the earlier bytes were lost and a narrow constant could be stored at the widened size without masking.Move scalar constant extraction and SIMD constant validation ahead of IR mutation. Unsupported combinations retain their original stores; supported combinations retain the existing packing and atomicity handling. This fixes the rejection path rather than special-casing
CreateScalaror disabling coalescing.Add regressions for a narrow write over a
Vector2constant and signedVector64.CreateScalarvalues, with normal and hardware-intrinsics-disabled configurations. On Windows x64, theVector2case reproduces the same invalid byte-to-long widening and fails against the baseline JIT; both variants pass with the fix. The exact reportedCreateScalarfailure did not reproduce on this host.Validation: checked Windows x64 CoreCLR, fixed JIT and cross-target JIT builds; both regression variants, AVX2-disabled execution, and 16 existing struct-promotion tests. Four existing coalescing-related methods have identical normalized disassembly before and after the fix (27, 55, 19, and 21 bytes respectively). JIT formatting passed. ARM64 execution was not performed.
Note
This PR description was drafted by GitHub Copilot.