Skip to content
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

Utilize VN-based non-null knowledge better #69808

Merged

Conversation

SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented May 25, 2022

Previously, global non-null assertion propagation would give up on any non-ADD(LCL_VAR, CONST)-like trees. This is correct for actual assertion-based propagation (since we record assertions based on conservative VNs and those propagate only through locals), but is unnecessarily conservative when it comes to utilizing non-nullness provided by VN.

Fix this by moving the IR checks after the VN check.

Diffs.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label May 25, 2022
@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label May 25, 2022
@ghost
Copy link

ghost commented May 25, 2022

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

Issue Details

Previously, global non-null assertion propagation would give up on any non-ADD(LCL_VAR, CONST)-like trees. This is correct for actual assertion-based propagation (since we record assertions based on conservative VNs and those propagate only through locals), but is unnecessarily conservative when it comes to utilizing non-nullness provided by VN.

Fix this by moving the IR checks after the VN check.

We are expecting a moderate amount of positive diffs.

Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr, community-contribution

Milestone: -

@SingleAccretion SingleAccretion marked this pull request as ready for review May 25, 2022 20:55
@SingleAccretion
Copy link
Contributor Author

SingleAccretion commented May 25, 2022

Libraries Test Run checked coreclr Linux_musl arm Release failure is #60705

@dotnet/jit-contrib

Previously, global non-null assertion propagation would give up
on any non-"ADD(LCL_VAR, CONST)"-like trees. This is correct for
actual assertion-based propagation (since we record assertions
based on conservative VNs and those propagate only through locals),
but is unnecessarily conservative when it comes to utilizing
non-nullness provided by VN.

Fix this by moving the IR checks after the VN check.
@jakobbotsch jakobbotsch merged commit 684fc2d into dotnet:main Jun 4, 2022
@SingleAccretion SingleAccretion deleted the More-Non-Null-AssertionProp branch June 4, 2022 09:50
@ghost ghost locked as resolved and limited conversation to collaborators Jul 4, 2022
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.

2 participants