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

MIR: Compute always live locals more efficiently #99021

Closed
pierwill opened this issue Jul 7, 2022 · 2 comments
Closed

MIR: Compute always live locals more efficiently #99021

pierwill opened this issue Jul 7, 2022 · 2 comments
Assignees
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@pierwill
Copy link
Member

pierwill commented Jul 7, 2022

See FIXME below:

/// The set of locals in a MIR body that do not have `StorageLive`/`StorageDead` annotations.
///
/// These locals have fixed storage for the duration of the body.
//
// FIXME: Currently, we need to traverse the entire MIR to compute this. We should instead store it
// as a field in the `LocalDecl` for each `Local`.
pub fn always_live_locals(body: &mir::Body<'_>) -> BitSet<Local> {

@rustbot label +T-compiler +A-mir

@rustbot rustbot added A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 7, 2022
@pierwill
Copy link
Member Author

pierwill commented Jul 7, 2022

@rustbot claim

pierwill added a commit to pierwill/rust that referenced this issue Jul 7, 2022
pierwill added a commit to pierwill/rust that referenced this issue Jul 7, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 8, 2022
…, r=pierwill

MIR dataflow: Rename function to `always_storage_live_locals`

Related to rust-lang#99021.

r?  `@JakobDegen` (as discussed on Zulip)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 9, 2022
…, r=pierwill

MIR dataflow: Rename function to `always_storage_live_locals`

Related to rust-lang#99021.

r?  ``@JakobDegen`` (as discussed on Zulip)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jul 9, 2022
…, r=pierwill

MIR dataflow: Rename function to `always_storage_live_locals`

Related to rust-lang#99021.

r?  ```@JakobDegen``` (as discussed on Zulip)
@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.

#99025 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants