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

Enable global constant propagation for small types #57726

Merged
merged 3 commits into from
Sep 10, 2021

Conversation

SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented Aug 19, 2021

Just as the title says - remove the restriction that we do not propagate constants for small-typed trees. It is safe because VN adds the necessary truncating casts when evaluating the assignment.

Now, small-typed nodes themselves are a bit rare, but one scenario where they come up is in field-by-field copying and initialization of promoted structs, which is where practically all the diffs for this change come from.

The substantial code here is only in the third commit, the rest is miscellaneous cleanup.

Some nice diffs for this change: win-x64, win-arm64, win-x86

Small regressions here and there are due to slightly different register allocation and the fact that sometimes containing a constant is not profitable size-wise.

Because this is an impactful change, I think stress testing is warranted for this PR. SPMI replay already revealed one bug (#57450), there may be more.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Aug 19, 2021
@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 Aug 19, 2021
@ghost
Copy link

ghost commented Aug 19, 2021

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

Issue Details

Just as the title says - remove the restriction that we do not propagate constants for small-typed trees. It is safe because VN adds the necessary truncating casts when evaluating the assignment.

Now, small-typed nodes themselves are a bit rare, but one scenario where they come up is in field-by-field copying of promoted structs, which is where practically all the diffs for this change come from.

The substantial code here is only in the third commit, the rest is miscellaneous cleanup.

Diffs for this change: win-x64

Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr, community-contribution

Milestone: -

@SingleAccretion SingleAccretion force-pushed the Enable-GCP-For-Small-Types branch from 808faf5 to 97f96dd Compare August 19, 2021 12:29
@SingleAccretion SingleAccretion marked this pull request as ready for review August 19, 2021 16:33
@JulieLeeMSFT
Copy link
Member

CC @dotnet/jit-contrib please review the community PR.

@JulieLeeMSFT JulieLeeMSFT added this to the 7.0.0 milestone Sep 7, 2021
Copy link
Member

@jakobbotsch jakobbotsch left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks!

Because this is an impactful change, I think stress testing is warranted for this PR. SPMI replay already revealed one bug (#57450), there may be more.

I'll try running Fuzzlyn with this for a while before we merge it, and let me kick off some more CI legs.

@jakobbotsch
Copy link
Member

/azp run runtime-coreclr jitstress, outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jakobbotsch
Copy link
Member

/azp run runtime-coreclr outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jakobbotsch
Copy link
Member

I ran Fuzzlyn for a while and didn't find anything that looked specific to this PR. The failures look like #58481.

@jakobbotsch jakobbotsch merged commit 84bad7e into dotnet:main Sep 10, 2021
@jakobbotsch
Copy link
Member

Thanks!

@SingleAccretion SingleAccretion deleted the Enable-GCP-For-Small-Types branch September 10, 2021 15:16
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
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.

3 participants