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

[WIP] Compute always-storage-liveness more efficiently #99025

Closed
wants to merge 6 commits into from

Conversation

pierwill
Copy link
Member

@pierwill pierwill commented Jul 7, 2022

See #99021.

r? @ghost

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jul 7, 2022
@pierwill pierwill marked this pull request as draft July 7, 2022 18:43
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Jul 9, 2022

☔ The latest upstream changes (presumably #99082) 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 Jul 9, 2022
@rustbot
Copy link
Collaborator

rustbot commented Jul 12, 2022

The Miri submodule was changed

cc @rust-lang/miri

Some changes occurred in src/tools/cargo

cc @ehuss

@pierwill
Copy link
Member Author

I didn't mean to pull in those changes....

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jul 13, 2022
@pierwill
Copy link
Member Author

@nikomatsakis and I discussed this PR and issue yesterday. The tradeoff involved is this: improving the performance of this for loop, versus complicating a common data structure--to help with this one case. In the absence of profiling data, it's not clear how valuable this work is. Especially, in my view, if there are outstanding questions about MIR semantics that this could complicate.

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   |
18 | use rustc_mir_dataflow::storage::always_storage_live_locals;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------
   |     |                            |
   |     |                            help: a similar name exists in the module: `always_live_locals`
   |     no `always_storage_live_locals` in `storage`
error[E0432]: unresolved import `rustc_mir_dataflow::storage::always_storage_live_locals`
  --> compiler/rustc_const_eval/src/transform/validate.rs:18:5
   |
18 | use rustc_mir_dataflow::storage::always_storage_live_locals;
18 | use rustc_mir_dataflow::storage::always_storage_live_locals;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------
   |     |                            |
   |     |                            help: a similar name exists in the module: `always_live_locals`
   |     no `always_storage_live_locals` in `storage`
    Checking rustc_typeck v0.0.0 (/checkout/compiler/rustc_typeck)
    Checking rustc_plugin_impl v0.0.0 (/checkout/compiler/rustc_plugin_impl)
For more information about this error, try `rustc --explain E0432`.
error: could not compile `rustc_const_eval` due to 2 previous errors

@nikomatsakis
Copy link
Contributor

To elaborate slightly:

We are basically trading off doing an O(1) walk of the MIR with having to keep some kind of flag up-to-date. It's reasonably easy to set that flag correctly when building the MIR initially, but keeping it up to date as liveness statements are added/removed etc seems harder, and harder to guarantee going forward. Unless this code is a perf hit, I'd be inclined to just recompute the property.

@pierwill pierwill deleted the 99021-always-storage-live branch July 15, 2022 18:17
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jul 16, 2022
… r=oli-obk

Remove FIXME from MIR `always_storage_live_locals`

See discussion in rust-lang#99025 (comment).
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jul 16, 2022
… r=oli-obk

Remove FIXME from MIR `always_storage_live_locals`

See discussion in rust-lang#99025 (comment).
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. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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