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

Minor rustc_mir_dataflow cleanups #118203

Merged
merged 16 commits into from
Nov 25, 2023
Merged

Conversation

nnethercote
Copy link
Contributor

The current order is a mess.
`lib.rs` is a strange place for it, and it's only used within
`rustc_peek.rs`, so it doesn't need to be `pub`.
It's not useful, and only obfuscates things.
Some types have a `body: &'mir Body<'tcx>` and some have `body: &'a
Body<'tcx>`. The former is more readable, so this commit converts some
fo the latter to the former.
`body` is already a `&Body`.
@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 Nov 23, 2023
@rustbot
Copy link
Collaborator

rustbot commented Nov 23, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

`on_all_children_bits` has two arguments that are unused: `tcx` and
`body`. This was not detected by the compiler because it's a recursive
function.

This commit removes them, and removes lots of other arguments and fields
that are no longer necessary.
`mut_results` immediately below is the `&mut self` version, this one
should be `&self`.
We can just call `ResultsCursor::state` and `ResultsCursor::analysis`
separately.
@nnethercote
Copy link
Contributor Author

BTW I am working on some more extensive simplifications to this code, but it's good to get lots of the little changes out of the way first in this PR.

@cjgillot
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Nov 25, 2023

📌 Commit 912eb1f 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 Nov 25, 2023
@bors
Copy link
Contributor

bors commented Nov 25, 2023

⌛ Testing commit 912eb1f with merge e2e978f...

@bors
Copy link
Contributor

bors commented Nov 25, 2023

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 25, 2023
@bors bors merged commit e2e978f into rust-lang:master Nov 25, 2023
12 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 25, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e2e978f): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

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)
- - 0
Regressions ❌
(secondary)
3.1% [3.0%, 3.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 673.908s -> 674.85s (0.14%)
Artifact size: 313.32 MiB -> 313.30 MiB (-0.00%)

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 23, 2024
…aflow-cleanups, r=<try>

Still more `rustc_mir_dataflow` cleanups

A sequel to rust-lang#118203, rust-lang#118230, rust-lang#118638, and rust-lang#131481.

I'm pleased with this PR. It cleans up a few things that have been bugging me for a while. It took quite some effort to find these improvements.

r? `@cjgillot`
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. 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.

5 participants