Skip to content

JIT: also check gc-ness of layout for GT_BLK during escape analysis #115844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025

Conversation

AndyAyersMS
Copy link
Member

Otherwise we may mistakenly build a connection to the unknown source and try retyping a non-gc struct.

Fixes #115831.

Otherwise we may mistakenly build a connection to the unknown source and
try retyping a non-gc struct.

Fixes dotnet#115831.
@Copilot Copilot AI review requested due to automatic review settings May 21, 2025 16:08
@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 May 21, 2025
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 an escape analysis issue in the JIT by checking the GC‐ness of a struct's layout for GT_BLK nodes, preventing misclassification of non-GC structs.

  • Introduces additional logic in objectalloc.cpp to inspect a block's layout for GC pointers.
  • Adds a new test case to validate the new behavior and updates the test project configuration.

Reviewed Changes

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

File Description
src/tests/JIT/opt/ObjectStackAllocation/Runtime_115831.csproj Adds project configuration for the test
src/tests/JIT/opt/ObjectStackAllocation/Runtime_115831.cs New test validating escape analysis behavior
src/coreclr/jit/objectalloc.cpp Updates the escape analysis logic to check GC layout for GT_BLK

Copy link
Contributor

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

@AndyAyersMS
Copy link
Member Author

AndyAyersMS commented May 21, 2025

@dotnet/jit-contrib PTAL

Recent "regression" from #115689.

No diffs but a lot of missed contexts.

@AndyAyersMS
Copy link
Member Author

@dotnet/jit-contrib ping

@AndyAyersMS AndyAyersMS merged commit ed055b1 into dotnet:main May 22, 2025
115 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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: Assertion failed 'newType == TYP_I_IMPL' during 'Allocate Objects'
2 participants