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

Use the impls module to import pre-existing dataflow analyses #71893

Merged
merged 2 commits into from
May 6, 2020

Conversation

ecstatic-morse
Copy link
Contributor

@ecstatic-morse ecstatic-morse commented May 4, 2020

Currently, existing analyses live in the same module as the traits and types used to define new dataflow analyses. This muddles the documentation for the dataflow module. After this PR, dataflow::impls will refer to concrete dataflow analyses, and dataflow to the generic interface.

@rust-highfive
Copy link
Collaborator

r? @estebank

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 4, 2020
@jonas-schievink
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented May 4, 2020

📌 Commit 095d1fd has been approved by jonas-schievink

@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 May 4, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request May 6, 2020
Rollup of 7 pull requests

Successful merges:

 - rust-lang#71269 (Define UB in float-to-int casts to saturate)
 - rust-lang#71591 (use new interface to create threads on HermitCore)
 - rust-lang#71819 (x.py: Give a more helpful error message if curl isn't installed)
 - rust-lang#71893 (Use the `impls` module to import pre-existing dataflow analyses)
 - rust-lang#71929 (Use -fvisibility=hidden for libunwind)
 - rust-lang#71937 (Ignore SGX on a few ui tests)
 - rust-lang#71944 (Add comment for `Ord` implementation for array)

Failed merges:

r? @ghost
@bors bors merged commit d30988e into rust-lang:master May 6, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request May 22, 2020
…e-analysis, r=tmandry

Clean up logic around live locals in generator analysis

Resolves rust-lang#69902. Requires rust-lang#71893.

I've found it difficult to make changes in the logic around live locals in `generator/transform.rs`. It uses a custom dataflow analysis, `MaybeRequiresStorage`, that AFAICT computes whether a local is either initialized or borrowed. That analysis is using `before` effects, which we should try to avoid if possible because they are harder to reason about than ones only using the unprefixed effects. @pnkfelix has suggested removing "before" effects entirely to simplify the dataflow framework, which I might pursue someday.

This PR replaces `MaybeRequiresStorage` with a combination of the existing `MaybeBorrowedLocals` and a new `MaybeInitializedLocals`. `MaybeInitializedLocals` is just `MaybeInitializedPlaces` with a coarser resolution: it works on whole locals instead of move paths. As a result, I was able to simplify the logic in `compute_storage_conflicts` and `locals_live_across_suspend_points`.

This is not exactly equivalent to the old logic; some generators are now smaller than before. I believe this was because the old logic was too conservative, but I'm not as familiar with the constraints as the original implementers were, so I could be wrong. For example, I don't see a reason the size of the `mixed_sizes` future couldn't be 5K. It went from 7K to 6K in this PR.

r? @jonas-schievink @tmandry
@ecstatic-morse ecstatic-morse deleted the dataflow-impls-import branch October 6, 2020 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants