Skip to content

Fix constrained call local exposure blocking escape analysis - #121918

Merged
EgorBo merged 1 commit into
dotnet:mainfrom
MichalPetryka:patch-57
Nov 24, 2025
Merged

EgorBo merged 1 commit into
dotnet:mainfrom
MichalPetryka:patch-57

Conversation

@MichalPetryka

Copy link
Copy Markdown
Contributor

Constrained calls on ref types currently emit trees like

--C-G------                         *  CALLV vt-ind int    System.Object:Equals(System.Object):bool:this
n---G------ this                    +--*  IND       ref
-----------                         |  \--*  LCL_ADDR  long   V06 tmp5         [+0]
----------- arg1                    \--*  LCL_VAR   ref    V04 tmp3

which blocks escape analysis due to the LCL_ADDR marking the local as escaped.
Using the helper to get this here instead:

--C-G------                         *  CALLV vt-ind int    System.Object:Equals(System.Object):bool:this
----------- this                    +--*  LCL_VAR   ref    V06 tmp5
----------- arg1                    \--*  LCL_VAR   ref    V04 tmp3

solves the issue.

@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 24, 2025
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Nov 24, 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.

@EgorBo

EgorBo commented Nov 24, 2025

Copy link
Copy Markdown
Member

@MihuBot

@EgorBo

EgorBo commented Nov 24, 2025

Copy link
Copy Markdown
Member

Thanks!

@github-actions github-actions Bot locked and limited conversation to collaborators Dec 25, 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 community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants