Skip to content

JIT: teach local assertion prop about non-null helpers - #114749

Merged
AndyAyersMS merged 2 commits into
dotnet:mainfrom
AndyAyersMS:LocalAPNonNullNew
Apr 17, 2025
Merged

AndyAyersMS merged 2 commits into
dotnet:mainfrom
AndyAyersMS:LocalAPNonNullNew

Conversation

@AndyAyersMS

Copy link
Copy Markdown
Member

If we see lcl = newobj we can assert lcl is not null in local assertion prop. This sometimes lets us clean up control flow in morph.

If we see `lcl = newobj` we can assert `lcl` is not null in local assertion prop.
This sometimes lets us clean up control flow in morph.
Copilot AI review requested due to automatic review settings April 16, 2025 18:59
@ghost ghost added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Apr 16, 2025

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.

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

goto DONE_ASSERTION;
}

case GT_CALL:

Copilot AI Apr 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a comment above this case explaining that the non-null assertion is applied to helper calls returning non-null values, to aid future maintainability.

Copilot uses AI. Check for mistakes.
@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.

@AndyAyersMS

AndyAyersMS commented Apr 16, 2025 •

Copy link
Copy Markdown
Member Author

@EgorBo PTAL
cc @dotnet/jit-contrib

Mixed diffs, including a few cases where we now enable loop cloning (hence a few large regressions).

Also helps clean up span captures of stack allocated arrays: #113236 (comment)

@AndyAyersMS
AndyAyersMS merged commit 6ccb061 into dotnet:main Apr 17, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators May 18, 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.

3 participants