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

Infer nounwind and use it in MIR opts #130909

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

saethlin
Copy link
Member

r? @ghost

Sinking this into layout::fn_can_unwind yields bigger MIR diffs. That's something to try tweaking.

But also, this analysis reduces incrementality because call sites depend on callee bodies. So I've currently disabled it when incremental is enabled. That's another tweak I want to try.

@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 Sep 26, 2024
@rustbot
Copy link
Collaborator

rustbot commented Sep 26, 2024

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@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 Sep 26, 2024
@bors
Copy link
Contributor

bors commented Sep 26, 2024

⌛ Trying commit 3f46a8e with merge f3b115d...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 26, 2024
Infer nounwind and use it in MIR opts

r? `@ghost`

Sinking this into `layout::fn_can_unwind` yields bigger MIR diffs. That's something to try tweaking.

But also, this analysis reduces incrementality because call sites depend on callee bodies. So I've currently disabled it when incremental is enabled. That's another tweak I want to try.
@bors
Copy link
Contributor

bors commented Sep 27, 2024

☀️ Try build successful - checks-actions
Build commit: f3b115d (f3b115d087b14b64c943bbc70991eb643f40490a)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f3b115d): comparison URL.

Overall result: ❌ regressions - 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.4% [0.2%, 1.2%] 93
Regressions ❌
(secondary)
0.6% [0.1%, 1.6%] 29
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.2%, 1.2%] 93

Max RSS (memory usage)

Results (primary -1.8%, secondary 3.8%)

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.7% [0.5%, 1.1%] 6
Regressions ❌
(secondary)
5.7% [1.8%, 12.0%] 6
Improvements ✅
(primary)
-3.4% [-8.3%, -1.2%] 9
Improvements ✅
(secondary)
-1.9% [-3.2%, -0.7%] 2
All ❌✅ (primary) -1.8% [-8.3%, 1.1%] 15

Cycles

Results (primary 2.1%, secondary -0.2%)

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.1% [2.0%, 2.2%] 2
Regressions ❌
(secondary)
2.2% [2.1%, 2.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-3.1%, -2.1%] 2
All ❌✅ (primary) 2.1% [2.0%, 2.2%] 2

Binary size

Results (primary -0.1%, secondary 0.0%)

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.0% [0.0%, 0.1%] 2
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 4
Improvements ✅
(primary)
-0.1% [-0.2%, -0.0%] 9
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-0.2%, 0.1%] 11

Bootstrap: 774.091s -> 776.669s (0.33%)
Artifact size: 341.36 MiB -> 341.40 MiB (0.01%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 27, 2024
@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 Sep 27, 2024
@bors
Copy link
Contributor

bors commented Sep 27, 2024

⌛ Trying commit e0da778 with merge 7a4aba2...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 27, 2024
Infer nounwind and use it in MIR opts

r? `@ghost`

Sinking this into `layout::fn_can_unwind` yields bigger MIR diffs. That's something to try tweaking.

But also, this analysis reduces incrementality because call sites depend on callee bodies. So I've currently disabled it when incremental is enabled. That's another tweak I want to try.
@saethlin
Copy link
Member Author

@rust-timer build 7a4aba2

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (7a4aba2): comparison URL.

Overall result: ❌ regressions - 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.3% [0.2%, 0.8%] 57
Regressions ❌
(secondary)
0.5% [0.2%, 1.2%] 17
Improvements ✅
(primary)
-0.7% [-0.7%, -0.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [-0.7%, 0.8%] 58

Max RSS (memory usage)

Results (primary -0.3%, secondary 1.8%)

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.5% [0.4%, 2.7%] 10
Regressions ❌
(secondary)
3.2% [1.8%, 5.5%] 4
Improvements ✅
(primary)
-3.8% [-7.4%, -1.0%] 5
Improvements ✅
(secondary)
-4.0% [-4.0%, -4.0%] 1
All ❌✅ (primary) -0.3% [-7.4%, 2.7%] 15

Cycles

Results (primary 1.9%, secondary -2.6%)

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.9% [1.8%, 1.9%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-3.2%, -2.2%] 5
All ❌✅ (primary) 1.9% [1.8%, 1.9%] 3

Binary size

Results (primary -0.1%, secondary 0.0%)

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.1%] 2
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 4
Improvements ✅
(primary)
-0.1% [-0.2%, -0.0%] 9
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.1% [-0.2%, 0.1%] 11

Bootstrap: 774.44s -> 776.149s (0.22%)
Artifact size: 341.36 MiB -> 341.37 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 27, 2024

// the `by_move_body` query uses the raw mir, so make sure it is run.
if tcx.needs_coroutine_by_move_body_def_id(def.to_def_id()) {
tcx.ensure_with_value().coroutine_by_move_body_def_id(def);
}

tcx.ensure_with_value().mir_flags(def);
Copy link
Member

Choose a reason for hiding this comment

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

gotta be really sure

@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 Sep 27, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 27, 2024
Infer nounwind and use it in MIR opts

r? `@ghost`

Sinking this into `layout::fn_can_unwind` yields bigger MIR diffs. That's something to try tweaking.

But also, this analysis reduces incrementality because call sites depend on callee bodies. So I've currently disabled it when incremental is enabled. That's another tweak I want to try.
@bors
Copy link
Contributor

bors commented Sep 27, 2024

⌛ Trying commit f0b3a5e with merge 2696107...

@bors
Copy link
Contributor

bors commented Sep 27, 2024

☀️ Try build successful - checks-actions
Build commit: 2696107 (2696107c5fdecccecdcef52fca9aa9b8dfdbbcbb)

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

bors commented Sep 28, 2024

⌛ Trying commit def0a31 with merge 04f21f2...

bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 28, 2024
Infer nounwind and use it in MIR opts

r? `@ghost`

Sinking this into `layout::fn_can_unwind` yields bigger MIR diffs. That's something to try tweaking.

But also, this analysis reduces incrementality because call sites depend on callee bodies. So I've currently disabled it when incremental is enabled. That's another tweak I want to try.
@bors
Copy link
Contributor

bors commented Sep 28, 2024

☀️ Try build successful - checks-actions
Build commit: 04f21f2 (04f21f294a092c02eeba644d9cbc13a26e14d09d)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (04f21f2): 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)
3.2% [3.2%, 3.3%] 3
Regressions ❌
(secondary)
0.8% [0.1%, 3.9%] 10
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 3
All ❌✅ (primary) 3.2% [3.2%, 3.3%] 3

Max RSS (memory usage)

Results (primary -0.1%, secondary -0.9%)

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)
5.1% [1.7%, 6.5%] 4
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
-3.0% [-8.1%, -0.5%] 7
Improvements ✅
(secondary)
-2.5% [-3.3%, -1.6%] 2
All ❌✅ (primary) -0.1% [-8.1%, 6.5%] 11

Cycles

Results (primary 5.9%, secondary 2.9%)

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)
5.9% [5.6%, 6.2%] 3
Regressions ❌
(secondary)
2.9% [2.1%, 5.8%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 5.9% [5.6%, 6.2%] 3

Binary size

Results (primary -0.0%, secondary 0.0%)

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.2% [0.1%, 0.3%] 2
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 4
Improvements ✅
(primary)
-0.1% [-0.2%, -0.0%] 9
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.0% [-0.2%, 0.3%] 11

Bootstrap: 769.092s -> 768.139s (-0.12%)
Artifact size: 341.40 MiB -> 341.40 MiB (-0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Sep 29, 2024
@saethlin saethlin added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 6, 2024
@saethlin saethlin marked this pull request as draft November 6, 2024 14:03
@rust-log-analyzer

This comment has been minimized.

@saethlin
Copy link
Member Author

saethlin commented Dec 9, 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 Dec 9, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 9, 2024
Infer nounwind and use it in MIR opts

r? `@ghost`

Sinking this into `layout::fn_can_unwind` yields bigger MIR diffs. That's something to try tweaking.

But also, this analysis reduces incrementality because call sites depend on callee bodies. So I've currently disabled it when incremental is enabled. That's another tweak I want to try.
@bors
Copy link
Contributor

bors commented Dec 9, 2024

⌛ Trying commit 5bf6851 with merge cc9057d...

@bors
Copy link
Contributor

bors commented Dec 9, 2024

☀️ Try build successful - checks-actions
Build commit: cc9057d (cc9057d78536b9994c1cead9d34795a2c1b7279f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cc9057d): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

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 the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
3.3% [3.3%, 3.4%] 3
Regressions ❌
(secondary)
1.0% [0.3%, 5.2%] 11
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.4% [-0.4%, 3.4%] 4

Max RSS (memory usage)

Results (primary 0.8%, secondary -0.9%)

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)
3.7% [1.2%, 4.9%] 5
Regressions ❌
(secondary)
2.0% [1.4%, 2.4%] 3
Improvements ✅
(primary)
-2.8% [-4.1%, -1.2%] 4
Improvements ✅
(secondary)
-2.6% [-5.8%, -1.3%] 5
All ❌✅ (primary) 0.8% [-4.1%, 4.9%] 9

Cycles

Results (primary 3.5%, secondary 6.0%)

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)
4.9% [4.7%, 5.4%] 3
Regressions ❌
(secondary)
6.0% [6.0%, 6.0%] 1
Improvements ✅
(primary)
-1.0% [-1.0%, -1.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 3.5% [-1.0%, 5.4%] 4

Binary size

Results (primary -0.0%)

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.1%] 10
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.7%, -0.0%] 11
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.0% [-0.7%, 0.1%] 21

Bootstrap: 767.969s -> 763.676s (-0.56%)
Artifact size: 330.85 MiB -> 330.91 MiB (0.02%)

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

bors commented Jan 31, 2025

☔ The latest upstream changes (presumably #136350) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 31, 2025
@bors
Copy link
Contributor

bors commented Feb 2, 2025

☔ The latest upstream changes (presumably #136433) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

6 participants