Skip to content

Fix missing side-effects handling in gtFoldTypeCompare - #121875

Merged
EgorBo merged 1 commit into
dotnet:mainfrom
EgorBo:fix-side-effects-naot
Nov 21, 2025
Merged

EgorBo merged 1 commit into
dotnet:mainfrom
EgorBo:fix-side-effects-naot

Conversation

@EgorBo

@EgorBo EgorBo commented Nov 21, 2025

Copy link
Copy Markdown
Member

Fixes #121874

Copilot AI review requested due to automatic review settings November 21, 2025 09:23
@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 Nov 21, 2025
@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.

Pull Request Overview

This PR fixes a bug where side effects from objOp were not preserved when optimizing type comparisons that are known at JIT time to always be false (when comparing against a type that is never allocated).

Key Changes

  • Moved the getExactClasses check to after objOp extraction so side effects can be properly preserved
  • Added side-effects handling using gtWrapWithSideEffects and conditional null check generation

@EgorBo
EgorBo merged commit eec5790 into dotnet:main Nov 21, 2025
@EgorBo
EgorBo deleted the fix-side-effects-naot branch November 21, 2025 12:28
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 22, 2025
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeEqualitySealed test is failing with full trimming on

3 participants