Skip to content

Conversation

jakobbotsch
Copy link
Member

Fix #99759

@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 Jul 21, 2025
Copy link
Contributor

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

@jakobbotsch jakobbotsch changed the title JIT: Fold cast of local address on inline arguments JIT: Handle byref<->nint casts on addresses in local morph Jul 22, 2025
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @EgorBo

Diffs

@jakobbotsch jakobbotsch requested a review from EgorBo July 23, 2025 10:19
Copy link
Contributor

@Copilot Copilot AI left a comment

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 issue #99759 by adding proper handling of byref-to-nint and nint-to-byref casts on addresses during local morphing in the JIT compiler. The change ensures that cast operations between these pointer-like types are correctly processed in the LocalAddressVisitor without causing addresses to escape unnecessarily.

Key changes:

  • Added GT_CAST case handling in LocalAddressVisitor to process byref<->nint casts on addresses
  • Minor comment formatting fix in importer.cpp

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/coreclr/jit/lclmorph.cpp Added GT_CAST case to handle byref<->nint casts on addresses in LocalAddressVisitor
src/coreclr/jit/importer.cpp Fixed comment formatting by adding missing "//"

@jakobbotsch jakobbotsch merged commit 5c1ba69 into dotnet:main Jul 23, 2025
107 of 110 checks passed
@jakobbotsch jakobbotsch deleted the fix-99759 branch July 23, 2025 12:37
@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 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.

JIT generates different code for pointer and reference arguments

2 participants