Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[perf experiment] Enable DeduplicateBlocks#106551

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@saethlin
Copy link
Member

It looks to me like all this really does is delete duplicated emptyunreachable blocks, and the occasionalStorageDead + drop block. Perhaps something unexpected turns up in perf.

r?@ghost

@rustbotrustbot added S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties. T-compilerRelevant to the compiler team, which will review and decide on the PR/issue. labelsJan 7, 2023
@saethlin
Copy link
MemberAuthor

@bors try@rust-timer queue

@rust-timer

This comment has been minimized.

@rustbotrustbot added the S-waiting-on-perfStatus: Waiting on a perf run to be completed. labelJan 7, 2023
@bors
Copy link
Collaborator

bors commentedJan 7, 2023

⌛ Trying commit 098af8fbffa06926b3d72b2e136cc2e3c224431f with merge 11d6ba903e6762c93f69ccf2ece4c445cfc575ae...

@bors
Copy link
Collaborator

bors commentedJan 7, 2023

☀️ Try build successful -checks-actions
Build commit: 11d6ba903e6762c93f69ccf2ece4c445cfc575ae (11d6ba903e6762c93f69ccf2ece4c445cfc575ae)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (11d6ba903e6762c93f69ccf2ece4c445cfc575ae):comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with@rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
0.9%[0.3%, 2.1%]7
Regressions ❌
(secondary)
1.4%[0.2%, 2.6%]11
Improvements ✅
(primary)
-0.6%[-1.0%, -0.3%]15
Improvements ✅
(secondary)
-0.5%[-0.6%, -0.3%]4
All ❌✅ (primary)-0.2%[-1.0%, 2.1%]22

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
2.7%[1.2%, 4.7%]3
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
-1.7%[-3.0%, -0.0%]3
Improvements ✅
(secondary)
--0
All ❌✅ (primary)0.5%[-3.0%, 4.7%]6

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
2.2%[2.2%, 2.2%]1
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
-1.2%[-1.2%, -1.2%]1
Improvements ✅
(secondary)
--0
All ❌✅ (primary)0.5%[-1.2%, 2.2%]2

@rustbotrustbot added perf-regressionPerformance regression. and removed S-waiting-on-perfStatus: Waiting on a perf run to be completed. labelsJan 7, 2023
@saethlin
Copy link
MemberAuthor

saethlin commentedJan 7, 2023
edited
Loading

Cachegrind diffs look like this:

--------------------------------------------------------------------------------Ir          --------------------------------------------------------------------------------173,178,186  PROGRAM TOTALS--------------------------------------------------------------------------------Ir           file:function--------------------------------------------------------------------------------176,073,369  ???:<rustc_data_structures::obligation_forest::ObligationForest<rustc_trait_selection::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection::traits::fulfill::FulfillProcessor>

pubfnprocess_obligations<P>(&mutself,processor:&mutP) ->P::OUT

Which is interesting. I have never seen a case like this where the whole regression is accounted for by a codegen change in one function.

@saethlin
Copy link
MemberAuthor

Compiling rustc, here is the size of the blocks that get deduplicated:

(  1)     9855 (91.4%, 91.4%): 0(  2)      597 ( 5.5%, 96.9%): 2(  3)      260 ( 2.4%, 99.3%): 1(  4)       55 ( 0.5%, 99.8%): 3(  5)        7 ( 0.1%, 99.9%): 4(  6)        1 ( 0.0%, 99.9%): 5

And with DestinationPropagation enabled, this distribution slants much more towards 0.

The limit of this pass was previously set at 10. Things must have been very different back in the day to justify setting it that high. I'm setting the limit down to 3.

@bors try@rust-timer queue

@rust-timer

This comment has been minimized.

@rustbotrustbot added the S-waiting-on-perfStatus: Waiting on a perf run to be completed. labelJan 8, 2023
@bors
Copy link
Collaborator

bors commentedJan 8, 2023

⌛ Trying commitee29825 with merge 303c0a1f5a0e2a8be2e7b8e1eac1978c0a63f3e5...

@bors
Copy link
Collaborator

bors commentedJan 8, 2023

☀️ Try build successful -checks-actions
Build commit: 303c0a1f5a0e2a8be2e7b8e1eac1978c0a63f3e5 (303c0a1f5a0e2a8be2e7b8e1eac1978c0a63f3e5)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (303c0a1f5a0e2a8be2e7b8e1eac1978c0a63f3e5):comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with@rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
0.7%[0.3%, 1.1%]6
Regressions ❌
(secondary)
1.4%[0.1%, 2.5%]10
Improvements ✅
(primary)
-0.6%[-0.8%, -0.4%]4
Improvements ✅
(secondary)
--0
All ❌✅ (primary)0.2%[-0.8%, 1.1%]10

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
1.7%[1.7%, 1.7%]1
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
-2.4%[-4.7%, -0.0%]2
Improvements ✅
(secondary)
-3.4%[-3.7%, -3.1%]2
All ❌✅ (primary)-1.0%[-4.7%, 1.7%]3

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
--0
Regressions ❌
(secondary)
2.5%[2.5%, 2.5%]1
Improvements ✅
(primary)
--0
Improvements ✅
(secondary)
--0
All ❌✅ (primary)--0

@rustbotrustbot removed the S-waiting-on-perfStatus: Waiting on a perf run to be completed. labelJan 8, 2023
@saethlin
Copy link
MemberAuthor

saethlin commentedJan 8, 2023
edited
Loading

Adding a tighter limit to this seems to have removed our improvements but hardly altered the regressions. I would not have expected that. So if I remove the limit entirely, I should see huge regression due to makingoptimized_mir slow, but what else will show up?

@bors try@rust-timer queue

@rust-timer

This comment has been minimized.

@rustbotrustbot added the S-waiting-on-perfStatus: Waiting on a perf run to be completed. labelJan 8, 2023
@bors
Copy link
Collaborator

bors commentedJan 8, 2023

⌛ Trying commit3b77094 with merge 8992fea7489ae2ab19a68d91257bc3ea778fcf79...

@rust-timer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commentedJan 8, 2023

☀️ Try build successful -checks-actions
Build commit: 8992fea7489ae2ab19a68d91257bc3ea778fcf79 (8992fea7489ae2ab19a68d91257bc3ea778fcf79)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8992fea7489ae2ab19a68d91257bc3ea778fcf79):comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with@rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
0.6%[0.2%, 0.9%]5
Regressions ❌
(secondary)
1.3%[0.4%, 2.6%]17
Improvements ✅
(primary)
-0.5%[-0.9%, -0.2%]13
Improvements ✅
(secondary)
-0.5%[-0.7%, -0.3%]3
All ❌✅ (primary)-0.2%[-0.9%, 0.9%]18

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
2.3%[1.8%, 3.0%]3
Regressions ❌
(secondary)
--0
Improvements ✅
(primary)
-2.3%[-4.5%, -0.0%]2
Improvements ✅
(secondary)
-2.9%[-2.9%, -2.9%]1
All ❌✅ (primary)0.5%[-4.5%, 3.0%]5

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

meanrangecount
Regressions ❌
(primary)
1.6%[1.6%, 1.6%]1
Regressions ❌
(secondary)
2.6%[2.2%, 3.1%]4
Improvements ✅
(primary)
-0.6%[-0.6%, -0.6%]1
Improvements ✅
(secondary)
--0
All ❌✅ (primary)0.5%[-0.6%, 1.6%]2

@rustbotrustbot removed the S-waiting-on-perfStatus: Waiting on a perf run to be completed. labelJan 9, 2023
@cjgillotcjgillot added the A-mir-optArea: MIR optimizations labelJan 21, 2023
@NoratriebNoratrieb added S-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties. labelsFeb 24, 2023
@Noratrieb
Copy link
Member

Marking as waiting on author because it's still a draft.

@saethlin
Copy link
MemberAuthor

#106428 enabled deduplicating unreachable blocks. The distribution of block sizes now looks like this (it used to be dominated by 0):

(  1)     5006 (63.2%, 63.2%): 1(  2)     1469 (18.5%, 81.7%): 0(  3)     1301 (16.4%, 98.1%): 2(  4)       62 ( 0.8%, 98.9%): 3(  5)       54 ( 0.7%, 99.6%): 4(  6)        9 ( 0.1%, 99.7%): 6(  7)        6 ( 0.1%, 99.8%): 5(  8)        3 ( 0.0%, 99.8%): 7(  9)        2 ( 0.0%, 99.9%): 8( 10)        1 ( 0.0%, 99.9%): 9

It looks like most of the 0-statement blocks aredrop terminators. the 1-statement blocks are split between_0 = +goto andStorageDead +goto.

I suspect that this distribution will be significantly reshaped by jump threading or whatever other passes land, and since this pass isn't deleting enough MIR to produce a benefit, I'm closing this.

@saethlinsaethlin deleted the deduplicate-blocks branchApril 2, 2023 19:22
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

A-mir-optArea: MIR optimizationsperf-regressionPerformance regression.S-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@saethlin@rust-timer@bors@Noratrieb@cjgillot@rustbot

[8]ページ先頭

©2009-2025 Movatter.jp