Repository navigation
Preserve side effects in SIMD classification helpers - #132921
tannergooding merged 1 commit into
Conversation
Co-authored-by: Copilot App <[email protected]>
|
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. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Review tier: Lite
Findings: None
What changed in this PR
This PR fixes a JIT correctness issue where certain SIMD classification intrinsics could fold to a constant result and inadvertently drop operand side effects (notably exceptions). The fix wraps the folded constant results with extracted side effects from the operand, and adds a targeted regression test to ensure the operand is still evaluated.
Changes:
- Update JIT SIMD classification helpers to preserve operand side effects when folding to constant results (e.g., integral-type cases).
- Add a new JIT regression test that validates exception-bearing operands are not elided across nine classification operations.
- Register the new regression test source file in the merged regression test project.
| File | Description |
|---|---|
| src/coreclr/jit/gentree.cpp | Wrap constant-folded SIMD classification results with extracted side effects from the operand to prevent eliding exceptions/calls. |
| src/tests/JIT/Regression/JitBlue/Runtime_132902/Runtime_132902.cs | Adds regression coverage using Vector128.WithElement with an out-of-range index to ensure operand exceptions are preserved across classification intrinsics. |
| src/tests/JIT/Regression/Regression_ro_2.csproj | Includes the new regression test in the merged JIT regression project build. |
|
/ba-g build monitor timeout |
|
/backport to release/11.0 |
|
Started backporting to |
|
@tannergooding backporting to git am output$ git cherry-pick 23c122538691178f01ab0bcafc4c2e03e9da2bb6
Auto-merging src/coreclr/jit/gentree.cpp
Auto-merging src/tests/JIT/Regression/Regression_ro_2.csproj
CONFLICT (content): Merge conflict in src/tests/JIT/Regression/Regression_ro_2.csproj
error: could not apply 23c12253869... Preserve side effects in SIMD classification helpers (#132921)
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Preserve side effects in SIMD classification helpers
Using index info to reconstruct a base tree...
M src/coreclr/jit/gentree.cpp
M src/tests/JIT/Regression/Regression_ro_2.csproj
Falling back to patching base and 3-way merge...
Auto-merging src/coreclr/jit/gentree.cpp
Auto-merging src/tests/JIT/Regression/Regression_ro_2.csproj
CONFLICT (content): Merge conflict in src/tests/JIT/Regression/Regression_ro_2.csproj
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Preserve side effects in SIMD classification helpers
Error: The process '/usr/bin/git' failed with exit code 128 |
…133016) 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_2` project. The checked consolidated regression shard passed, including all nine `Runtime_132902` cases. `jit-format` completed successfully for Windows x64. # Risk Low. The change is limited to preserving side effects on existing constant-folding paths by using the established `gtWrapWithSideEffects` helper. 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. Co-authored-by: Copilot App <[email protected]>
Fixes #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
IsInfinitycase.Adds regression coverage using an exception-bearing
Vector128.WithElementoperand, which exercises the shared x64 and WASM import shape.Note
This pull request was created with GitHub Copilot.