rustc_mir_dataflow cleanups, including some renamings by nnethercote · Pull Request #133938 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation6 Commits9 Checks6 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

nnethercote

Some opinionated commits in this collection, let's see how we go.

r? @cjgillot

@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

Dec 5, 2024

@nnethercote

This will have some conflicts with #133328, but I can resolve them if/when necessary.

@rustbot

Some changes occurred to the CTFE machinery

cc @rust-lang/wg-const-eval

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@bors

@nnethercote

@nnethercote

@nnethercote

They are only present because it's currently defined in terms of the domains of Borrows and MaybeUninitializedPlaces and EverInitializedPlaces via associated types. This commit introduces typedefs for those domains, avoiding the lifetimes.

@nnethercote

Via the Analysis::Domain associated types, instead of the direct type name.

@nnethercote

Currently they are called (most common) state, or trans, or (rare) on_entry. I think trans is short for "transfer function", which perhaps made more sense when GenKillAnalysis existed. Using state everywhere now is more consistent.

@nnethercote

"Set" doesn't make much sense here, we refer to domain values as "state" everywhere else. (This name confused me for a while.)

@nnethercote

It uses MaybeInitializedPlaces and MaybeUninitializedPlaces, but calls the results live and dead. This is very confusing given that there are also analyses called MaybeLiveLocals and MaybeStorageLive and MaybeStorageDead.

This commit changes it to use maybe_init and maybe_uninit.

@nnethercote

The words "before" and "after" have an obvious temporal meaning, e.g. seek_before_primary_effect, visit_statement_{before,after}_primary_effect. But "before" is also used to name the effect that occurs before the primary effect of a statement/terminator; this is Effect::Before. This leads to the confusing possibility of talking about things happening "before/after the before event".

This commit removes this awkward overloading of "before" by renaming Effect::Before as Effect::Early. It also renames some of the Analysis and ResultsVisitor methods to be more consistent.

Here are the before and after names:

(And s/statement/terminator/ for all the terminator events.)

@nnethercote

In most places, the early method is listed before the corresponding primary method, like you'd expect. This commit fixes two places where that isn't the case.

@nnethercote

oli-obk

@oli-obk

@bors

📌 Commit dddc09d 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

Dec 13, 2024

bors added a commit to rust-lang-ci/rust that referenced this pull request

Dec 13, 2024

@bors

…iaskrgr

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request

Dec 13, 2024

@bors

…iaskrgr

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Dec 14, 2024

@rust-timer

Rollup merge of rust-lang#133938 - nnethercote:rustc_mir_dataflow-renamings, r=oli-obk

rustc_mir_dataflow cleanups, including some renamings

Some opinionated commits in this collection, let's see how we go.

r? @cjgillot

flip1995 pushed a commit to flip1995/rust that referenced this pull request

Dec 15, 2024

@bors

…iaskrgr

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

github-merge-queue bot pushed a commit to model-checking/kani that referenced this pull request

Dec 16, 2024

@carolynzech

Culprit PRs:

For coroutine closures, I opened #3783 to track feature support--adding support for this appears non-trivial, and I didn't want to block toolchain upgrades on it.

Resolves #3781

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

Labels

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.