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

Do not hoist constants if they will not be CSEed #64039

Conversation

SingleAccretion
Copy link
Contributor

@SingleAccretion SingleAccretion commented Jan 20, 2022

We can sometimes see cases where hoisting decides to hoist a constant on platforms where CSEing for them is disabled, leading to wasted work.

Fix this by folding the relevant checks into optIsCSEcandidate that the hoisting code uses.

Diffs are mixed... it seems we sometimes get better allocation and better flow with the pre-header, even if we don't get anything out of the hoist itself.

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

ghost commented Jan 20, 2022

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

Issue Details

We can sometimes see cases where hoisting decides to hoist a constant on platforms where CSEing for them is disabled, leading to wasted work.

Fix this by folding the relevant checks into optIsCSEcandidate that the hoisting code uses.

Diffs are RA noise (the pre-header blocks are no longer being created) plus unblocked new hoists of actually profitable trees.

Author: SingleAccretion
Assignees: -
Labels:

area-CodeGen-coreclr, community-contribution

Milestone: -

@SingleAccretion SingleAccretion force-pushed the Do-Not-Hoist-Constants-Unnecessarily branch 2 times, most recently from ae1c0ce to 1081488 Compare January 28, 2022 15:42
@SingleAccretion SingleAccretion force-pushed the Do-Not-Hoist-Constants-Unnecessarily branch 2 times, most recently from 60bb484 to a02170c Compare February 12, 2022 11:15
@SingleAccretion SingleAccretion force-pushed the Do-Not-Hoist-Constants-Unnecessarily branch 2 times, most recently from 679e1e5 to c434300 Compare February 25, 2022 20:54
We can sometimes see cases where hoisting decides
to hoist a constant on platforms where CSEing for
them is disabled, leading to wasted work.

Fix this by folding the relevant checks into
"optIsCSEcandidate" that the hoisting code uses.

Diffs are RA noise (the pre-header blocks are no
longer being created) plus unblocked new hoists
of actually profitable trees.
@SingleAccretion SingleAccretion force-pushed the Do-Not-Hoist-Constants-Unnecessarily branch from c434300 to eaadd63 Compare March 7, 2022 21:53
@SingleAccretion
Copy link
Contributor Author

Due to the regressions, I do not plan to pursue this further.

@SingleAccretion SingleAccretion deleted the Do-Not-Hoist-Constants-Unnecessarily branch March 29, 2022 15:16
@ghost ghost locked as resolved and limited conversation to collaborators Apr 28, 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.

1 participant