Skip to content

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

Closed
SingleAccretion wants to merge 1 commit into
dotnet:mainfrom
SingleAccretion:Do-Not-Hoist-Constants-Unnecessarily
Closed

SingleAccretion wants to merge 1 commit into
dotnet:mainfrom
SingleAccretion:Do-Not-Hoist-Constants-Unnecessarily

Conversation

@SingleAccretion

@SingleAccretion SingleAccretion commented Jan 20, 2022 •

Copy link
Copy Markdown
Contributor

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 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 labels Jan 20, 2022
@ghost

ghost commented Jan 20, 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

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
Copy Markdown
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