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

Add post-mono MIR passes to make mono-reachable analysis more accurate #131650

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

saethlin
Copy link
Member

@saethlin saethlin commented Oct 13, 2024

As of #131650 (comment) I believe most of the incr overhead comes from re-computing, re-encoding, and loading a lot more MIR when all we're actually doing is traversing through it. I think that can be addressed by caching a query that looks up the mentioned/used items for an Instance.

I think the full-build regressions are pretty much just the expense of cloning, then monomorphizing, then caching the MIR.

@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 Oct 13, 2024
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the PG-exploit-mitigations Project group: Exploit mitigations label Oct 13, 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 Oct 13, 2024
@bors
Copy link
Contributor

bors commented Oct 13, 2024

⌛ Trying commit a211812 with merge b141564...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2024
Add post-mono MIR passes to make mono-reachable analysis more accurate

r? ghost
@bors
Copy link
Contributor

bors commented Oct 13, 2024

☀️ Try build successful - checks-actions
Build commit: b141564 (b1415647cdfcdd1b8dc5ed5f9a5aba87ade0b225)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b141564): 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)
12.2% [0.2%, 93.7%] 163
Regressions ❌
(secondary)
6.9% [0.2%, 266.3%] 119
Improvements ✅
(primary)
-0.7% [-3.0%, -0.2%] 6
Improvements ✅
(secondary)
-11.1% [-33.8%, -0.2%] 12
All ❌✅ (primary) 11.7% [-3.0%, 93.7%] 169

Max RSS (memory usage)

Results (primary 14.5%, secondary 1.7%)

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)
14.5% [0.7%, 56.9%] 108
Regressions ❌
(secondary)
4.5% [0.6%, 12.8%] 34
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-22.2% [-24.2%, -19.2%] 4
All ❌✅ (primary) 14.5% [0.7%, 56.9%] 108

Cycles

Results (primary 22.8%, secondary 13.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)
23.0% [0.8%, 108.5%] 111
Regressions ❌
(secondary)
19.4% [1.0%, 223.4%] 42
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
-33.2% [-42.8%, -1.3%] 5
All ❌✅ (primary) 22.8% [-3.0%, 108.5%] 112

Binary size

Results (primary -0.3%, secondary -2.3%)

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.8% [0.0%, 2.3%] 7
Regressions ❌
(secondary)
0.1% [0.1%, 0.1%] 1
Improvements ✅
(primary)
-0.4% [-1.7%, -0.0%] 76
Improvements ✅
(secondary)
-2.4% [-25.8%, -0.0%] 65
All ❌✅ (primary) -0.3% [-1.7%, 2.3%] 83

Bootstrap: 781.427s -> 807.023s (3.28%)
Artifact size: 331.96 MiB -> 332.21 MiB (0.08%)

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

bors commented Oct 14, 2024

⌛ Trying commit 6f6737a with merge 9233d9f...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2024
Add post-mono MIR passes to make mono-reachable analysis more accurate

r? ghost
@bors
Copy link
Contributor

bors commented Oct 14, 2024

☀️ Try build successful - checks-actions
Build commit: 9233d9f (9233d9f83ca672be3b2cfa697806fdb7c8970490)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9233d9f): 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)
7.6% [0.1%, 59.9%] 151
Regressions ❌
(secondary)
2.9% [0.2%, 18.7%] 107
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
-6.6% [-64.0%, -0.3%] 11
All ❌✅ (primary) 7.5% [-3.0%, 59.9%] 152

Max RSS (memory usage)

Results (primary 11.3%, secondary 2.4%)

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)
12.9% [1.3%, 52.1%] 93
Regressions ❌
(secondary)
3.6% [2.2%, 5.9%] 10
Improvements ✅
(primary)
-2.7% [-4.3%, -0.8%] 10
Improvements ✅
(secondary)
-3.4% [-3.5%, -3.4%] 2
All ❌✅ (primary) 11.3% [-4.3%, 52.1%] 103

Cycles

Results (primary 10.6%, secondary 3.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)
10.7% [1.0%, 50.1%] 94
Regressions ❌
(secondary)
5.4% [1.7%, 18.4%] 37
Improvements ✅
(primary)
-3.1% [-3.1%, -3.1%] 1
Improvements ✅
(secondary)
-17.2% [-62.3%, -1.6%] 4
All ❌✅ (primary) 10.6% [-3.1%, 50.1%] 95

Binary size

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

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.0%, 2.4%] 9
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.8%, -0.0%] 69
Improvements ✅
(secondary)
-0.3% [-0.8%, -0.0%] 51
All ❌✅ (primary) -0.1% [-0.8%, 2.4%] 78

Bootstrap: 782.104s -> 806.252s (3.09%)
Artifact size: 332.57 MiB -> 332.81 MiB (0.07%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 14, 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 Oct 24, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 24, 2024
Add post-mono MIR passes to make mono-reachable analysis more accurate

As of rust-lang#131650 (comment) I believe most of the incr overhead comes from re-computing, re-encoding, and loading a lot more MIR when all we're actually doing is traversing through it. I think that can be addressed by caching a query that looks up the mentioned/used items for an Instance.

I think the full-build regressions are pretty much just the expense of cloning, then monomorphizing, then caching the MIR.
@bors
Copy link
Contributor

bors commented Oct 24, 2024

⌛ Trying commit 4ae3542 with merge 174810c...

@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 Oct 25, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 25, 2024
Add post-mono MIR passes to make mono-reachable analysis more accurate

As of rust-lang#131650 (comment) I believe most of the incr overhead comes from re-computing, re-encoding, and loading a lot more MIR when all we're actually doing is traversing through it. I think that can be addressed by caching a query that looks up the mentioned/used items for an Instance.

I think the full-build regressions are pretty much just the expense of cloning, then monomorphizing, then caching the MIR.
@bors
Copy link
Contributor

bors commented Oct 25, 2024

⌛ Trying commit 4d85f3e with merge ff70274...

@bors
Copy link
Contributor

bors commented Oct 25, 2024

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

@bors
Copy link
Contributor

bors commented Oct 25, 2024

☀️ Try build successful - checks-actions
Build commit: ff70274 (ff70274b13309d52d3b7cdcd10326a65d70c66bb)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ff70274): 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)
0.5% [0.1%, 2.0%] 40
Regressions ❌
(secondary)
0.4% [0.0%, 1.3%] 47
Improvements ✅
(primary)
-1.0% [-3.0%, -0.5%] 8
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) 0.3% [-3.0%, 2.0%] 48

Max RSS (memory usage)

Results (primary 10.7%, secondary 3.7%)

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)
10.7% [0.9%, 29.4%] 20
Regressions ❌
(secondary)
3.7% [3.7%, 3.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 10.7% [0.9%, 29.4%] 20

Cycles

Results (primary -0.3%, secondary -0.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.6% [1.2%, 2.0%] 6
Regressions ❌
(secondary)
1.4% [1.4%, 1.4%] 1
Improvements ✅
(primary)
-1.3% [-3.3%, -0.8%] 11
Improvements ✅
(secondary)
-1.7% [-2.3%, -1.0%] 2
All ❌✅ (primary) -0.3% [-3.3%, 2.0%] 17

Binary size

Results (primary 0.0%, secondary -0.3%)

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.4% [0.0%, 1.7%] 12
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.4%, -0.0%] 21
Improvements ✅
(secondary)
-0.3% [-0.8%, -0.1%] 43
All ❌✅ (primary) 0.0% [-0.4%, 1.7%] 33

Bootstrap: 790.301s -> 795.012s (0.60%)
Artifact size: 333.71 MiB -> 333.70 MiB (-0.00%)

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

bors commented Oct 26, 2024

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

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Oct 29, 2024

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

@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 Oct 31, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 31, 2024
Add post-mono MIR passes to make mono-reachable analysis more accurate

As of rust-lang#131650 (comment) I believe most of the incr overhead comes from re-computing, re-encoding, and loading a lot more MIR when all we're actually doing is traversing through it. I think that can be addressed by caching a query that looks up the mentioned/used items for an Instance.

I think the full-build regressions are pretty much just the expense of cloning, then monomorphizing, then caching the MIR.
@bors
Copy link
Contributor

bors commented Oct 31, 2024

⌛ Trying commit 0f9dca3 with merge 00925e2b25a5ac491adcaf7f9882218d435bd2a5...

@bors
Copy link
Contributor

bors commented Oct 31, 2024

☀️ Try build successful - checks-actions
Build commit: 00925e2 (00925e2b25a5ac491adcaf7f9882218d435bd2a5)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (00925e2): 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)
1.0% [0.1%, 3.2%] 88
Regressions ❌
(secondary)
0.8% [0.1%, 2.7%] 33
Improvements ✅
(primary)
-1.1% [-3.1%, -0.4%] 5
Improvements ✅
(secondary)
-2.1% [-2.4%, -1.4%] 3
All ❌✅ (primary) 0.9% [-3.1%, 3.2%] 93

Max RSS (memory usage)

Results (primary 6.9%, secondary 1.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)
7.2% [1.0%, 24.9%] 31
Regressions ❌
(secondary)
4.2% [3.8%, 4.9%] 3
Improvements ✅
(primary)
-1.1% [-1.1%, -1.1%] 1
Improvements ✅
(secondary)
-2.1% [-2.2%, -2.0%] 3
All ❌✅ (primary) 6.9% [-1.1%, 24.9%] 32

Cycles

Results (primary 2.0%, secondary 1.7%)

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.4% [1.1%, 4.5%] 28
Regressions ❌
(secondary)
2.8% [2.3%, 3.2%] 3
Improvements ✅
(primary)
-1.5% [-3.2%, -0.5%] 3
Improvements ✅
(secondary)
-1.6% [-1.6%, -1.6%] 1
All ❌✅ (primary) 2.0% [-3.2%, 4.5%] 31

Binary size

Results (primary -0.0%, secondary -0.3%)

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.6% [0.1%, 1.7%] 9
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.2% [-0.9%, -0.0%] 28
Improvements ✅
(secondary)
-0.3% [-1.5%, -0.1%] 41
All ❌✅ (primary) -0.0% [-0.9%, 1.7%] 37

Bootstrap: 783.574s -> 794.629s (1.41%)
Artifact size: 333.56 MiB -> 333.60 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. PG-exploit-mitigations Project group: Exploit mitigations 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