Repository navigation
[release/11.0] Preserve side effects in SIMD classification helpers - #133016
Merged
JulieLeeMSFT merged 2 commits intoSep 1, 2026
Merged
JulieLeeMSFT merged 2 commits into
JulieLeeMSFT merged 2 commits into
Conversation
Fixes dotnet#132902 SIMD classification helpers that produce constant results now preserve side effects from their operands. This covers all nine affected classification operations rather than only the reported `IsInfinity` case. Adds regression coverage using an exception-bearing `Vector128.WithElement` operand, which exercises the shared x64 and WASM import shape. > [!NOTE] > This pull request was created with GitHub Copilot. Co-authored-by: Copilot App <[email protected]> (cherry picked from commit 23c1225)
…oding-backport-132921
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 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
🟢 Approval recommended
Review tier: Lite
Findings: None
What changed in this PR
Backports a CoreCLR JIT fix to ensure SIMD classification helpers that fold to constant results still evaluate their operand, preserving any observable side effects (notably exceptions) that would otherwise be dropped.
Changes:
- Wrap constant-folded SIMD classification results with
gtWrapWithSideEffects(..., op1, GTF_ALL_EFFECT)so operand side effects are preserved. - Add a JIT regression test (
Runtime_132902) that asserts an exception from the operand is not optimized away. - Wire the new regression test into the
Regression_ro_2JIT regression project.
| File | Description |
|---|---|
| src/coreclr/jit/gentree.cpp | Preserves operand side effects when classification helpers return constant nodes for integral base types. |
| src/tests/JIT/Regression/JitBlue/Runtime_132902/Runtime_132902.cs | New xUnit regression coverage validating side-effect preservation across the affected classification operations. |
| src/tests/JIT/Regression/Regression_ro_2.csproj | Includes the new regression test source file in the existing regression project. |
This was referenced Sep 1, 2026
Open
JulieLeeMSFT
approved these changes
Sep 1, 2026
Member
|
/ba-g known test failures. |
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 #132902
main PR #132921
Description
Backports the fix that preserves operand side effects when SIMD classification helpers fold to constant results. This covers all nine affected classification operations.
Customer Impact
Without this fix, the JIT can remove observable side effects, including exceptions, from operands passed to SIMD classification APIs. Behavior can differ depending on the compilation tier.
Regression
No known regression in .NET 11.
Testing
Built the checked CoreCLR runtime and the priority-1
Regression_ro_2project. The checked consolidated regression shard passed, including all nineRuntime_132902cases.jit-formatcompleted successfully for Windows x64.Risk
Low. The change is limited to preserving side effects on existing constant-folding paths by using the established
gtWrapWithSideEffectshelper. Regression coverage exercises every affected classification operation.Package authoring no longer needed in .NET 9
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.
Note
This pull request description was generated with GitHub Copilot.