Skip to content

Commit 3ec10fe

Browse files
committed
Auto merge of #141667 - lqd:lazy-maybe-init, r=matthewjasper
Add fast path for maybe-initializedness in liveness r? `@matthewjasper` Correct me if I'm wrong Matthew, but my understanding is that 1. `MaybeInitializedPlaces` is currently eagerly computed, in `do_mir_borrowck` 2. but this data is only used in liveness 3. and `liveness::trace` actually only uses it for drop-liveness This PR moves the computation to `liveness::trace` which looks to be its only use-site. We also add a fast path there, so that it's only computed by drop-liveness. This is interesting because 1) liveness is only computed for relevant live locals, 2) drop-liveness is only computed for relevant live locals with >0 drop points; 0 is the common case from our benchmarks, as far as I can tell, so even just computing the entire data lazily helps. It seems possible to also reduce the domain here, and speed up the analysis for the cases where it has to be computed -- so I've left a fixme for that, and may look into it soon. (I've come upon this while doing implementation work for polonius, so don't be too enamored with possible wins: the goal is to reduce the eventual polonius overhead and make it more palatable 😓)
2 parents 415e792 + 699a4f5 commit 3ec10fe

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)