Skip to content

Utilize VN-based non-null knowledge better#69808

Merged
jakobbotsch merged 1 commit intodotnet:mainfrom
SingleAccretion:More-Non-Null-AssertionProp
Jun 4, 2022
Merged

Utilize VN-based non-null knowledge better#69808
jakobbotsch merged 1 commit intodotnet:mainfrom
SingleAccretion:More-Non-Null-AssertionProp

Conversation

@SingleAccretion
Copy link
Copy Markdown
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.

@ghost ghost added 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 labels May 25, 2022
@ghost
Copy link
Copy Markdown

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 force-pushed the More-Non-Null-AssertionProp branch from b535337 to b874a31 Compare May 25, 2022 18:12
@SingleAccretion SingleAccretion marked this pull request as ready for review May 25, 2022 20:55
@SingleAccretion
Copy link
Copy Markdown
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