Skip to content

Remove no-op cleanups as post-mono MIR opt #143208

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

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

Conversation

Mark-Simulacrum
Copy link
Member

On cargo this cuts ~5% of the LLVM IR lines we generate (measured with -Cno-prepopulate-passes). Opening to assess performance.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 29, 2025
@Mark-Simulacrum
Copy link
Member Author

@bors2 try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors
Copy link

rust-bors bot commented Jun 29, 2025

⌛ Trying commit e0423d5 with merge fb9de75

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jun 29, 2025
Remove no-op cleanups as post-mono MIR opt

On cargo this cuts ~5% of the LLVM IR lines we generate (measured with -Cno-prepopulate-passes). Opening to assess performance.
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 29, 2025
@rust-bors
Copy link

rust-bors bot commented Jun 29, 2025

☀️ Try build successful (CI)
Build commit: fb9de75 (fb9de75a813ea747c43682b22929463ada3f80de, parent: 5e749eb66f93ee998145399fbdde337e57cd72ef)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fb9de75): comparison URL.

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

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @rustbot label: +perf-regression-triaged. If not, please fix the regressions and do another perf run. If its results are neutral or positive, the label will be automatically removed.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
18.6% [0.2%, 60.9%] 6
Regressions ❌
(secondary)
9.4% [0.4%, 18.4%] 2
Improvements ✅
(primary)
-1.9% [-3.8%, -0.2%] 18
Improvements ✅
(secondary)
-2.5% [-17.6%, -0.2%] 21
All ❌✅ (primary) 3.2% [-3.8%, 60.9%] 24

Max RSS (memory usage)

Results (primary 8.9%, secondary 2.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
9.2% [1.3%, 33.3%] 34
Regressions ❌
(secondary)
3.6% [2.9%, 4.9%] 4
Improvements ✅
(primary)
-1.6% [-1.6%, -1.6%] 1
Improvements ✅
(secondary)
-2.4% [-2.4%, -2.4%] 1
All ❌✅ (primary) 8.9% [-1.6%, 33.3%] 35

Cycles

Results (primary 3.0%, secondary -3.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
29.8% [26.6%, 33.1%] 2
Regressions ❌
(secondary)
17.1% [17.1%, 17.1%] 1
Improvements ✅
(primary)
-1.9% [-3.0%, -1.2%] 11
Improvements ✅
(secondary)
-6.2% [-20.2%, -2.1%] 8
All ❌✅ (primary) 3.0% [-3.0%, 33.1%] 13

Binary size

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

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 1
Improvements ✅
(primary)
-0.7% [-1.6%, -0.0%] 66
Improvements ✅
(secondary)
-0.9% [-3.7%, -0.0%] 30
All ❌✅ (primary) -0.7% [-1.6%, -0.0%] 66

Bootstrap: 695.323s -> 698.39s (0.44%)
Artifact size: 371.80 MiB -> 371.90 MiB (0.03%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 29, 2025
@Mark-Simulacrum
Copy link
Member Author

Mark-Simulacrum commented Jul 1, 2025

@bors2 try @rust-timer queue

@rust-bors
Copy link

rust-bors bot commented Jul 1, 2025

Missing command.

@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 Jul 1, 2025
@rust-timer

This comment has been minimized.

@Mark-Simulacrum
Copy link
Member Author

@bors2 try

@rust-bors
Copy link

rust-bors bot commented Jul 1, 2025

⌛ Trying commit 676eed3 with merge e3a4b05

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jul 1, 2025
Remove no-op cleanups as post-mono MIR opt

On cargo this cuts ~5% of the LLVM IR lines we generate (measured with -Cno-prepopulate-passes). Opening to assess performance.
@rust-bors
Copy link

rust-bors bot commented Jul 1, 2025

☀️ Try build successful (CI)
Build commit: e3a4b05 (e3a4b05fb719511c7b8d0306c3a9e0445abcdfda, parent: f46ce66fcc3d6058f90ac5bf0930f940f1e7b0ca)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e3a4b05): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.4% [0.4%, 0.4%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.0% [-4.6%, -0.2%] 22
Improvements ✅
(secondary)
-2.8% [-18.0%, -0.8%] 17
All ❌✅ (primary) -1.9% [-4.6%, 0.4%] 23

Max RSS (memory usage)

Results (primary -2.6%, secondary -1.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.6% [-3.8%, -1.2%] 6
Improvements ✅
(secondary)
-1.3% [-2.8%, -0.5%] 3
All ❌✅ (primary) -2.6% [-3.8%, -1.2%] 6

Cycles

Results (primary -2.4%, secondary -2.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.1% [1.1%, 1.1%] 1
Regressions ❌
(secondary)
3.2% [0.8%, 7.1%] 4
Improvements ✅
(primary)
-2.6% [-4.3%, -1.2%] 22
Improvements ✅
(secondary)
-5.0% [-20.0%, -0.5%] 11
All ❌✅ (primary) -2.4% [-4.3%, 1.1%] 23

Binary size

Results (primary -0.6%, secondary -0.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-1.4%, -0.0%] 66
Improvements ✅
(secondary)
-0.8% [-3.6%, -0.0%] 30
All ❌✅ (primary) -0.6% [-1.4%, -0.0%] 66

Bootstrap: 461.485s -> 461.37s (-0.02%)
Artifact size: 372.20 MiB -> 371.78 MiB (-0.11%)

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Jul 1, 2025
@Mark-Simulacrum
Copy link
Member Author

@bors2 try jobs=x86_64-msvc

@rust-bors
Copy link

rust-bors bot commented Jul 1, 2025

Unknown value for argument "jobs".

@Mark-Simulacrum
Copy link
Member Author

@bors2 try jobs=*x86_64-msvc*

@rust-bors
Copy link

rust-bors bot commented Jul 1, 2025

Unknown value for argument "jobs".

@Mark-Simulacrum
Copy link
Member Author

@bors2 try jobs=x86_64-msvc*

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 1, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 1, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@rust-bors
Copy link

rust-bors bot commented Jul 1, 2025

☀️ Try build successful (CI)
Build commit: b84bb16 (b84bb16650872972b9578b4aeeb3f78acd2d8912, parent: 076a0a26fd6f4c445647a33d6daaac56f732ac05)

@petrochenkov
Copy link
Contributor

r? mir-opts

@rustbot
Copy link
Collaborator

rustbot commented Jul 2, 2025

Failed to set assignee to mir-opts: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@petrochenkov
Copy link
Contributor

r? mir

@rustbot rustbot assigned oli-obk and unassigned petrochenkov Jul 2, 2025
@oli-obk
Copy link
Contributor

oli-obk commented Jul 2, 2025

@bors r+

@bors
Copy link
Collaborator

bors commented Jul 2, 2025

📌 Commit 676eed3 has been approved by oli-obk

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 Jul 2, 2025
@cjgillot
Copy link
Contributor

cjgillot commented Jul 2, 2025

Is there an opportunity to reuse code from RemoveNoopLandingPads MIR pass?

@RalfJung
Copy link
Member

RalfJung commented Jul 2, 2025

Given that comments and variable names don't line up, seems better to
@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 2, 2025
@rustbot

This comment was marked as resolved.

@Mark-Simulacrum
Copy link
Member Author

@bors2 try @rust-timer queue

This is essentially a re-write with @cjgillot's excellent suggestion to reuse the analysis in RemoveNoopLandingPads. Also adjusted some of the naming per @RalfJung's comments -- I'm not perfectly happy with the names, some of this is sort of quasi-true (e.g., reachable is only accurate if you apply the right filters while you traverse the MIR, since we currently can't edit it in-place).

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rust-bors
Copy link

rust-bors bot commented Jul 3, 2025

⌛ Trying commit c04a255 with merge d12ed3f

To cancel the try build, run the command @bors2 try cancel.

rust-bors bot added a commit that referenced this pull request Jul 3, 2025
Remove no-op cleanups as post-mono MIR opt

On cargo this cuts ~5% of the LLVM IR lines we generate (measured with -Cno-prepopulate-passes). Opening to assess performance.
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 3, 2025
@rust-log-analyzer

This comment has been minimized.

This speeds up LLVM and improves codegen overall. As an example, for
cargo this cuts ~5% of the LLVM IR lines we generate (measured with
-Cno-prepopulate-passes).
@rust-bors
Copy link

rust-bors bot commented Jul 3, 2025

☀️ Try build successful (CI)
Build commit: d12ed3f (d12ed3fc0cb645af2b945d13048aba82f574ee91, parent: 6677875279b560442a07a08d5119b4cd6b3c5593)

@rust-timer
Copy link
Collaborator

Queued d12ed3f with parent 6677875, future comparison URL.
There are currently 14 preceding artifacts in the queue.
It will probably take at least ~14.2 hours until the benchmark run finishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-perf Status: Waiting on a perf run to be completed. 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.

9 participants