Skip to content

JIT: prevent comparison folding using relocatable handle placeholders - #134899

Closed
EgorBo with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-nativeaot-relational-comparison
Closed

EgorBo with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-nativeaot-relational-comparison

Conversation

Copilot AI commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

NativeAOT can fold typeof(Program).TypeHandle.Value > 0x1000000 using ILC’s synthetic handle value instead of the relocated address.

  • Comparison folding: Reject address-dependent folds while preserving handle identity and equality against zero.
  • Value numbering: Prevent constant narrowing from stripping handle markers and sign inference from using placeholder values.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@EgorBo EgorBo added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Sep 29, 2026
@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 changed the title [WIP] Fix NativeAOT relational comparison of type handle with constant JIT: prevent comparison folding using relocatable handle placeholders Sep 29, 2026
Copilot AI requested a review from EgorBo September 29, 2026 23:28
@EgorBo EgorBo closed this Sep 29, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 30, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JIT: (bug) NativeAOT: relational comparison of a type handle with a constant is folded using the compile-time handle placeholder

2 participants