Skip to content

[release/11.0] Preserve side effects in SIMD classification helpers - #133016

Merged
JulieLeeMSFT merged 2 commits into
dotnet:release/11.0from
tannergooding:tannergooding-backport-132921
Sep 1, 2026
Merged

JulieLeeMSFT merged 2 commits into
dotnet:release/11.0from
tannergooding:tannergooding-backport-132921

Conversation

@tannergooding

Copy link
Copy Markdown
Member

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.

tannergooding and others added 2 commits August 31, 2026 14:08
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)
Copilot AI lite review requested due to automatic review settings September 1, 2026 13:43
@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 1, 2026
@azure-pipelines

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_2 JIT 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.

@JulieLeeMSFT

Copy link
Copy Markdown
Member

/ba-g known test failures.

@JulieLeeMSFT
JulieLeeMSFT merged commit 7ab4d96 into dotnet:release/11.0 Sep 1, 2026
115 of 119 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot modified the milestones: 11.0.0, 11.0-rc2 Sep 2, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants