Skip to content

Improve fgValueNumberBlockAssignment - #64110

Merged
jakobbotsch merged 1 commit into
dotnet:mainfrom
SingleAccretion:Simplify-fgVNBlkAsg
Feb 3, 2022
Merged

jakobbotsch merged 1 commit into
dotnet:mainfrom
SingleAccretion:Simplify-fgVNBlkAsg

Conversation

@SingleAccretion

@SingleAccretion SingleAccretion commented Jan 21, 2022 •

Copy link
Copy Markdown
Contributor

fgValueNumberBlockAssignment had a very interesting oddity: it re-VNd the source tree of the assignment. This is unnecessary, and is in fact a pessimization, as it means we will fail to VN assignments from sources it does not understand. This change fixes that, bringing along some positive diffs from numbering stores from field indirections.

fgValueNumberBlockAssignment also needs to maintain the invariant that a location's VN will always match its type.
It was failing to do that in cases where the assignment's source was not local. This change fixes that.

Finally, this change unifies the code common to numbering CopyBlk and InitBlk cases. There is no need for them to be different.

Some positive diffs from the aforementioned more precise numbering.

Part of #58312.

@ghost ghost added community-contribution Indicates that the PR has been added by a community member area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed community-contribution Indicates that the PR has been added by a community member labels Jan 21, 2022
@ghost

ghost commented Jan 21, 2022

Copy link
Copy Markdown

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

Issue Details

fgValueNumberBlockAssignment had a very interesting oddity: it re-VNs the source tree of the assignment. This is unnecessary, and is in fact a pessimization, as it means we will fail to VN assignments from sources it does not understand. This change fixes that, bringing along some positive diffs from numbering stores from field indirections.

fgValueNumberBlockAssignment also needs to maintain the invariant that a location's VN will always match its type.
It was failing to do that in cases where the assignment's source was not local. This change fixes that.

Finally, this change unifies the code common to numbering CopyBlk and InitBlk cases. There is no need for them to be different.

We're expecting some positive diffs from the aforementioned more precise numbering.

Part of #58312.

Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@SingleAccretion
SingleAccretion marked this pull request as ready for review January 22, 2022 12:20
@SingleAccretion SingleAccretion changed the title Refactor fgValueNumberBlockAssignment Improve fgValueNumberBlockAssignment Jan 22, 2022
@SingleAccretion

Copy link
Copy Markdown
Contributor Author

@dotnet/jit-contrib

"fgValueNumberBlockAssignment" had a very interesting oddity:
it re-VNs the source tree of the assignment. This is unnecessary,
and is in fact a pessimization, as it means we will fail to VN
assignments from sources it does not understand. This change
fixes that, bringing along some positive diffs from numbering
stores from field indirections.

"fgValueNumberBlockAssignment" also needs to maintaint the
invariant that a location's VN will always match its type.
It was failing to do that in cases where the assignment's
source was not local. This change fixes that.

Finally, this change unifies the code common to numbering
"CopyBlk" and "InitBlk" cases. There is no need for them to
be different.
@jakobbotsch

Copy link
Copy Markdown
Member

/azp run Antigen, Fuzzlyn

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@jakobbotsch jakobbotsch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, nice catch!

@jakobbotsch
jakobbotsch merged commit c85f02d into dotnet:main Feb 3, 2022
@SingleAccretion
SingleAccretion deleted the Simplify-fgVNBlkAsg branch February 3, 2022 21:02
@ghost ghost locked as resolved and limited conversation to collaborators Mar 6, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants