Repository navigation
MIR move elimination [3/6]: PreciseLiveness - #163337
Conversation
|
LLM disclosure: LLMs were used to double-check the correctness of the analysis against the RFC, Miri and existing MIR passes. It was useful since it found several issues, notably around the behavior of call destination places in the unwind path. |
e7ac990 to
191a6f0
Compare
191a6f0 to
8f7b938
Compare
8f7b938 to
1c34f63
Compare
This comment has been minimized.
This comment has been minimized.
|
Would it be possible to test this independently from move elimination? |
|
We don't really have good infrastructure for testing analysis passes directly. The best I can do is generate some analysis snapshots, but it won't have any CHECK comments since those only look at the final MIR. My preference is to instead have this tested indirectly through the tests in MoveElimination. |
|
Perhaps we could annotate final MIR with dataflow results and run file check on it? For example, along the lines of https://github.com/tmiasko/rust/tree/pretty-dataflow. |
|
Yes, this seems to work, see my latest commit that builds on top of yours. How do you plan to land this? Will you be making a separate PR with your pretty infrastructure? |
|
Opened #163721 with dataflow pretty printing. |
|
By the way, I'm not super happy about the name |
This comment has been minimized.
This comment has been minimized.
b1a44c7 to
3f7db5c
Compare
|
Some changes occurred in compiler/rustc_attr_parsing cc @jdonszelmann, @JonathanBrouwer Some changes occurred in compiler/rustc_attr_ir |
|
Thanks. r=me with "Add additional comments & clarify existing ones" and "Address review feedback" incorporated into earlier commits. |
02741ef to
c645363
Compare
|
@bors r=tmiasko |
…iveness, r=tmiasko MIR move elimination [3/6]: PreciseLiveness Depends on rust-lang#163335 This PR implements the lifetime analysis used by the `MoveElimination` pass from rust-lang/rfcs#3943. `PreciseLiveness` calculates, at a sub-statement granularity, the points in a function where a local requires storage to be allocated. This is more fine-grained than `MaybeStorageLive`, and takes borrows into account. r? tmiasko
…uwer Rollup of 7 pull requests Successful merges: - #162652 (Syntactically reject leading parenthesized precise capturing lists in bare trait object types (`(use<…>)+`)) - #163337 (MIR move elimination [3/6]: PreciseLiveness) - #163954 (fix(bootstrap/darwin): fix rpath for distributed LLD) - #163956 (Pass the unremapped path to the `rustc` invocation for doctests) - #163634 (move overflow lint computation into decorator) - #163727 (rigid aliases to non-rigid for fully normalized check) - #163745 (replace `fully_monomorphized` with `cx.typing_env()`)
…iveness, r=tmiasko MIR move elimination [3/6]: PreciseLiveness Depends on rust-lang#163335 This PR implements the lifetime analysis used by the `MoveElimination` pass from rust-lang/rfcs#3943. `PreciseLiveness` calculates, at a sub-statement granularity, the points in a function where a local requires storage to be allocated. This is more fine-grained than `MaybeStorageLive`, and takes borrows into account. r? tmiasko
…uwer Rollup of 11 pull requests Successful merges: - #162652 (Syntactically reject leading parenthesized precise capturing lists in bare trait object types (`(use<…>)+`)) - #163337 (MIR move elimination [3/6]: PreciseLiveness) - #163954 (fix(bootstrap/darwin): fix rpath for distributed LLD) - #163956 (Pass the unremapped path to the `rustc` invocation for doctests) - #163634 (move overflow lint computation into decorator) - #163666 (Updates the expect message library/core/src/time.rs) - #163727 (rigid aliases to non-rigid for fully normalized check) - #163745 (replace `fully_monomorphized` with `cx.typing_env()`) - #164000 (When mentioning that closure doesn't implement trait, point at closure) - #164007 ([rustdoc] Prefer local paths over remote ones when foreign item is locally reexported) - #164017 (cg_llvm: Avoid some explicit casts to `*const c_char`)
…iveness, r=tmiasko MIR move elimination [3/6]: PreciseLiveness Depends on rust-lang#163335 This PR implements the lifetime analysis used by the `MoveElimination` pass from rust-lang/rfcs#3943. `PreciseLiveness` calculates, at a sub-statement granularity, the points in a function where a local requires storage to be allocated. This is more fine-grained than `MaybeStorageLive`, and takes borrows into account. r? tmiasko
…iveness, r=tmiasko MIR move elimination [3/6]: PreciseLiveness Depends on rust-lang#163335 This PR implements the lifetime analysis used by the `MoveElimination` pass from rust-lang/rfcs#3943. `PreciseLiveness` calculates, at a sub-statement granularity, the points in a function where a local requires storage to be allocated. This is more fine-grained than `MaybeStorageLive`, and takes borrows into account. r? tmiasko
…uwer Rollup of 14 pull requests Successful merges: - #162652 (Syntactically reject leading parenthesized precise capturing lists in bare trait object types (`(use<…>)+`)) - #163337 (MIR move elimination [3/6]: PreciseLiveness) - #163954 (fix(bootstrap/darwin): fix rpath for distributed LLD) - #163193 (cfi: mangle `f128` as `e` rather than `g` on platforms without `_Float128`) - #163634 (move overflow lint computation into decorator) - #163666 (Updates the expect message library/core/src/time.rs) - #163727 (rigid aliases to non-rigid for fully normalized check) - #163745 (replace `fully_monomorphized` with `cx.typing_env()`) - #163912 (Fix debug assert failure in `note_obligation_cause_code_inner`) - #163972 (const-eval: ICE when we hit a non-const fn) - #164000 (When mentioning that closure doesn't implement trait, point at closure) - #164007 ([rustdoc] Prefer local paths over remote ones when foreign item is locally reexported) - #164017 (cg_llvm: Avoid some explicit casts to `*const c_char`) - #164025 (Less `CanonicalVarValues`)
…iveness, r=tmiasko MIR move elimination [3/6]: PreciseLiveness Depends on rust-lang#163335 This PR implements the lifetime analysis used by the `MoveElimination` pass from rust-lang/rfcs#3943. `PreciseLiveness` calculates, at a sub-statement granularity, the points in a function where a local requires storage to be allocated. This is more fine-grained than `MaybeStorageLive`, and takes borrows into account. r? tmiasko
…uwer Rollup of 14 pull requests Successful merges: - #162652 (Syntactically reject leading parenthesized precise capturing lists in bare trait object types (`(use<…>)+`)) - #163337 (MIR move elimination [3/6]: PreciseLiveness) - #163954 (fix(bootstrap/darwin): fix rpath for distributed LLD) - #163193 (cfi: mangle `f128` as `e` rather than `g` on platforms without `_Float128`) - #163634 (move overflow lint computation into decorator) - #163666 (Updates the expect message library/core/src/time.rs) - #163727 (rigid aliases to non-rigid for fully normalized check) - #163745 (replace `fully_monomorphized` with `cx.typing_env()`) - #163912 (Fix debug assert failure in `note_obligation_cause_code_inner`) - #163950 (don't treat inherited opaques as defining) - #164000 (When mentioning that closure doesn't implement trait, point at closure) - #164007 ([rustdoc] Prefer local paths over remote ones when foreign item is locally reexported) - #164017 (cg_llvm: Avoid some explicit casts to `*const c_char`) - #164025 (Less `CanonicalVarValues`)
…uwer Rollup of 24 pull requests Successful merges: - #161998 ( Support type-relative assoc item paths in generic param defaults & const param types) - #162106 (Helpful suggestions for incorrect address-of mutability (2)) - #162652 (Syntactically reject leading parenthesized precise capturing lists in bare trait object types (`(use<…>)+`)) - #163337 (MIR move elimination [3/6]: PreciseLiveness) - #163938 (-Zassumptions-on-binders: rewrite alias outlives constraints more goodly) - #163939 (Better debug impls for some assumptions on binders types) - #163954 (fix(bootstrap/darwin): fix rpath for distributed LLD) - #163956 (Pass the unremapped path to the `rustc` invocation for doctests) - #164042 (Allow testing cg-gcc on any target) - #162443 (Do not retain `Normalization` goal errors in nested goals for `BestObligationVisitor:: non_trivial_candidates `) - #162908 (Fix - const parameters rejected when identical) - #163193 (cfi: mangle `f128` as `e` rather than `g` on platforms without `_Float128`) - #163634 (move overflow lint computation into decorator) - #163666 (Updates the expect message library/core/src/time.rs) - #163727 (rigid aliases to non-rigid for fully normalized check) - #163745 (replace `fully_monomorphized` with `cx.typing_env()`) - #163912 (Fix debug assert failure in `note_obligation_cause_code_inner`) - #163950 (don't treat inherited opaques as defining) - #163972 (const-eval: ICE when we hit a non-const fn) - #164000 (When mentioning that closure doesn't implement trait, point at closure) - #164007 ([rustdoc] Prefer local paths over remote ones when foreign item is locally reexported) - #164008 (properly ignore the current goal's usages) - #164017 (cg_llvm: Avoid some explicit casts to `*const c_char`) - #164025 (Less `CanonicalVarValues`)
Rollup merge of #163337 - Amanieu:move-elimination/precise-liveness, r=tmiasko MIR move elimination [3/6]: PreciseLiveness Depends on #163335 This PR implements the lifetime analysis used by the `MoveElimination` pass from rust-lang/rfcs#3943. `PreciseLiveness` calculates, at a sub-statement granularity, the points in a function where a local requires storage to be allocated. This is more fine-grained than `MaybeStorageLive`, and takes borrows into account. r? tmiasko
View all comments
Depends on #163335
This PR implements the lifetime analysis used by the
MoveEliminationpass from rust-lang/rfcs#3943.PreciseLivenesscalculates, at a sub-statement granularity, the points in a function where a local requires storage to be allocated. This is more fine-grained thanMaybeStorageLive, and takes borrows into account.r? tmiasko