Preserve vector results when folding AVX-512 mask complements - #134520
Merged
tannergooding merged 1 commit intoSep 23, 2026
Merged
tannergooding merged 1 commit into
tannergooding merged 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
🔵 Needs a closer look
Release, other-architecture, and full-suite validation were not run.
Review effort: Lite
Findings: None
What changed in this PR
Fixes RyuJIT AVX-512 mask-complement folding so vector result conversions are preserved.
Changes:
- Reuses
ConvertMaskToVectorin both affected fold paths. - Adds focused regression coverage across vector widths, comparisons, NaNs, and element sizes.
| File | Description |
|---|---|
src/tests/JIT/Regression_ro_2/Runtime_134480.cs |
Adds focused regression tests. |
src/coreclr/jit/morph.cpp |
Preserves vector result types during mask folding. |
EgorBo
approved these changes
Sep 23, 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.
Preserve
ConvertMaskToVectorwhen folding a vector complement through an AVX-512 mask-producing operation. The comparison-mode reversal and double-NOT paths previously returned the innerTYP_MASKwhere the parent expected a vector, causing checked-build assertions and invalid release codegen.Reuse the existing conversion around the simplified mask and assert that the replacement preserves the outer NOT's result type. This leaves comparison predicates, mask element sizes, and operand evaluation unchanged.
Add focused regressions for both folds, including both comparison-reversal directions, equal/unequal/NaN inputs, 128/256/512-bit vectors, and double-NOT masks with byte/short/int/long elements. Both regression paths independently reproduce the assertion with the unfixed JIT.
Validation on Windows x64:
Release and other-architecture runs, and the full test suite, were not run. This fix is independent of the pending operand-ordering changes.
Resolves #134480
Note
This PR was prepared with GitHub Copilot.