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

Only collect mono items from reachable blocks #123272

Merged
merged 2 commits into from
Apr 9, 2024

Conversation

saethlin
Copy link
Member

@saethlin saethlin commented Mar 31, 2024

Fixes the wrong comment pointed out in: #121421 (comment)
Moves the analysis to use the worklist strategy: #121421 (comment)
Also fixes #85836, using the same reachability analysis

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 31, 2024
@rust-log-analyzer

This comment has been minimized.

@saethlin
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Mar 31, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 31, 2024
…try>

Only collect mono items from reachable blocks

Fixes the wrong commented pointed out in: rust-lang#121421 (comment)
Moves the analysis to use the worklist strategy: rust-lang#121421 (comment)
Also fixes rust-lang#85836, using the same reachability analysis
@bors
Copy link
Contributor

bors commented Mar 31, 2024

⌛ Trying commit 5fa7d14 with merge 93c3b66...

@bors
Copy link
Contributor

bors commented Mar 31, 2024

☀️ Try build successful - checks-actions
Build commit: 93c3b66 (93c3b66198cc1afa981b6b65c72f6ef987a1f619)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (93c3b66): 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.

mean range count
Regressions ❌
(primary)
1.0% [0.2%, 2.1%] 37
Regressions ❌
(secondary)
1.3% [1.1%, 1.5%] 3
Improvements ✅
(primary)
-0.7% [-1.2%, -0.2%] 8
Improvements ✅
(secondary)
-0.5% [-0.6%, -0.3%] 6
All ❌✅ (primary) 0.7% [-1.2%, 2.1%] 45

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.

mean range count
Regressions ❌
(primary)
2.6% [0.9%, 6.3%] 8
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.7% [-3.3%, -0.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.8% [-3.3%, 6.3%] 10

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.

mean range count
Regressions ❌
(primary)
1.8% [1.2%, 2.6%] 11
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
-1.2% [-1.6%, -0.7%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [-1.6%, 2.6%] 14

Binary size

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.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.3%] 7
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-1.6%, -0.0%] 43
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-1.6%, 0.3%] 50

Bootstrap: 666.819s -> 668.345s (0.23%)
Artifact size: 315.68 MiB -> 315.74 MiB (0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Apr 1, 2024
@saethlin
Copy link
Member Author

saethlin commented Apr 1, 2024

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 1, 2024
@bors
Copy link
Contributor

bors commented Apr 1, 2024

⌛ Trying commit 5a6e55a with merge b1b76aa...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 1, 2024
…try>

Only collect mono items from reachable blocks

Fixes the wrong commented pointed out in: rust-lang#121421 (comment)
Moves the analysis to use the worklist strategy: rust-lang#121421 (comment)
Also fixes rust-lang#85836, using the same reachability analysis
@bors
Copy link
Contributor

bors commented Apr 1, 2024

☀️ Try build successful - checks-actions
Build commit: b1b76aa (b1b76aac3c9ca8c2e1809c6f0b624a26367ebcf2)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b1b76aa): 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.

mean range count
Regressions ❌
(primary)
0.6% [0.2%, 1.2%] 28
Regressions ❌
(secondary)
0.6% [0.6%, 0.7%] 3
Improvements ✅
(primary)
-0.8% [-1.3%, -0.3%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [-1.3%, 1.2%] 34

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.

mean range count
Regressions ❌
(primary)
2.2% [0.5%, 5.2%] 14
Regressions ❌
(secondary)
1.6% [1.4%, 1.9%] 3
Improvements ✅
(primary)
-1.3% [-2.6%, -0.2%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.6% [-2.6%, 5.2%] 17

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.

mean range count
Regressions ❌
(primary)
1.2% [0.9%, 1.5%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [0.9%, 1.5%] 2

Binary size

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.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.3%] 7
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-1.6%, -0.0%] 44
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-1.6%, 0.3%] 51

Bootstrap: 667.778s -> 668.661s (0.13%)
Artifact size: 315.75 MiB -> 315.71 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 1, 2024
@saethlin
Copy link
Member Author

saethlin commented Apr 1, 2024

Great. There is actually measurable query overhead here.

@saethlin
Copy link
Member Author

saethlin commented Apr 1, 2024

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 1, 2024
@bors
Copy link
Contributor

bors commented Apr 1, 2024

⌛ Trying commit 97df1ef with merge a237415...

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 7, 2024
@bors
Copy link
Contributor

bors commented Apr 7, 2024

⌛ Testing commit 447ac10 with merge 8bae5f9...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 7, 2024
…jgillot

Only collect mono items from reachable blocks

Fixes the wrong comment pointed out in: rust-lang#121421 (comment)
Moves the analysis to use the worklist strategy: rust-lang#121421 (comment)
Also fixes rust-lang#85836, using the same reachability analysis
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Apr 7, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 7, 2024
@rustbot
Copy link
Collaborator

rustbot commented Apr 7, 2024

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

@saethlin
Copy link
Member Author

saethlin commented Apr 7, 2024

This seems like a fiddly invariant to uphold in cg_clif. But also, this probably improves compile time especially of large programs when using cranelift. So maybe this is still a good idea. 🤷 @bjorn3 what do you think?

@bjorn3
Copy link
Member

bjorn3 commented Apr 8, 2024

The cg_clif change seems fine to me.

@saethlin
Copy link
Member Author

saethlin commented Apr 8, 2024

@bors r=cjgillot

@bors
Copy link
Contributor

bors commented Apr 8, 2024

📌 Commit b5b4928 has been approved by cjgillot

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 8, 2024
@bors
Copy link
Contributor

bors commented Apr 9, 2024

⌛ Testing commit b5b4928 with merge bb78dba...

@bors
Copy link
Contributor

bors commented Apr 9, 2024

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing bb78dba to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 9, 2024
@bors bors merged commit bb78dba into rust-lang:master Apr 9, 2024
12 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 9, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bb78dba): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

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

mean range count
Regressions ❌
(primary)
0.4% [0.2%, 1.5%] 8
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.8% [-1.5%, -0.3%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-1.5%, 1.5%] 14

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.

mean range count
Regressions ❌
(primary)
2.8% [1.1%, 3.7%] 5
Regressions ❌
(secondary)
3.6% [2.0%, 5.2%] 6
Improvements ✅
(primary)
-2.1% [-2.1%, -2.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.0% [-2.1%, 3.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.

mean range count
Regressions ❌
(primary)
1.4% [1.4%, 1.4%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.8% [-1.9%, -1.6%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.7% [-1.9%, 1.4%] 3

Binary size

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.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.4%] 7
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.3% [-1.6%, -0.0%] 39
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-1.6%, 0.4%] 46

Bootstrap: 674.109s -> 672.151s (-0.29%)
Artifact size: 318.37 MiB -> 318.39 MiB (0.00%)

@pnkfelix
Copy link
Member

pnkfelix commented Apr 9, 2024

  • fixed an important bug.
  • from the comment history, it looks like the minor restricted regressions were anticipated.
  • marking as triaged.

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Apr 9, 2024
@saethlin saethlin deleted the reachable-mono-cleanup branch April 9, 2024 21:45
self.worklist.remove(idx);
if !self.visited.insert(idx) {
continue;
}
Copy link

Choose a reason for hiding this comment

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

This is quadratic for the case where all blocks reference all earlier blocks, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Could be. Would that be remarkable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dead-code optimize if const { expr } even in opt-level=0
9 participants