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

JIT: Pick some low-hanging fruit in physical promotion throughput #86792

Merged
merged 3 commits into from May 26, 2023

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented May 26, 2023

  • Skip any IR traversals entirely if there are no candidate locals for
    physical promotion
  • During accounting, do a quick pre-check for candidates in each
    statement using the linked locals list, before doing the tree walk.

* Skip any IR traversals entirely if there are no candidates locals for
  physical promotion
* During accounting, do a quick pre-check for candidates in each
  statement using the linked locals list, before doing the tree walk.

Result:

Diff JIT options: JitEnablePhysicalPromotion=1

FullOpts (+0.25% to +0.82%)

|Collection|PDIFF|
|---|--:|
|aspnet.run.windows.x64.checked.mch              |+0.82%|
|benchmarks.run.windows.x64.checked.mch          |+0.35%|
|benchmarks.run_pgo.windows.x64.checked.mch      |+0.58%|
|benchmarks.run_tiered.windows.x64.checked.mch   |+0.59%|
|coreclr_tests.run.windows.x64.checked.mch       |+0.25%|
|libraries.crossgen2.windows.x64.checked.mch     |+0.40%|
|libraries.pmi.windows.x64.checked.mch           |+0.54%|
|libraries_tests.pmi.windows.x64.checked.mch     |+0.32%|
Process scalar uses via the linked list and struct uses with the tree
walk. The tree walk can skip any entire subtree without
GTF_CALL/GTF_ASG.

Diff JIT options: JitEnablePhysicalPromotion=1
FullOpts (+0.25% to +0.85%)

|Collection                                     |PDIFF |
|---                                            |   --:|
|aspnet.run.windows.x64.checked.mch             |+0.85%|
|benchmarks.run.windows.x64.checked.mch         |+0.36%|
|benchmarks.run_pgo.windows.x64.checked.mch     |+0.61%|
|benchmarks.run_tiered.windows.x64.checked.mch  |+0.62%|
|coreclr_tests.run.windows.x64.checked.mch      |+0.25%|
|libraries.crossgen2.windows.x64.checked.mch    |+0.40%|
|libraries.pmi.windows.x64.checked.mch          |+0.55%|
|libraries_tests.pmi.windows.x64.checked.mch    |+0.33%|
This reverts commit a5ed498.

This is worse than the existing approach.
@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 May 26, 2023
@ghost ghost assigned jakobbotsch May 26, 2023
@ghost
Copy link

ghost commented May 26, 2023

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

Issue Details
  • Skip any IR traversals entirely if there are no candidates local for
    physical promotion
  • During accounting, do a quick pre-check for candidates in each
    statement using the linked locals list, before doing the tree walk.
Author: jakobbotsch
Assignees: -
Labels:

area-CodeGen-coreclr

Milestone: -

@jakobbotsch
Copy link
Member Author

jakobbotsch commented May 26, 2023

cc @dotnet/jit-contrib PTAL @EgorBo
Diffs:

Throughput cost of enabling this by default looks reasonable, but I definitely need to study more cases, especially on linux-x64 and win-x86. Hopefully benchmarks will help to prioritize where to look.

@jakobbotsch jakobbotsch reopened this May 26, 2023
@EgorBo
Copy link
Member

EgorBo commented May 26, 2023

Throughput cost of enabling this by default looks reasonable

Agree 👍

@jakobbotsch jakobbotsch merged commit 87d6bba into dotnet:main May 26, 2023
127 checks passed
@jakobbotsch jakobbotsch deleted the physical-promotion-throughput branch May 26, 2023 19:39
@ghost ghost locked as resolved and limited conversation to collaborators Jun 26, 2023
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.

None yet

2 participants