Simplify MaybeRequiresStorage - #160055
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
Unlikely to affect perf, but let's check: @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…<try> Simplify `MaybeRequiresStorage`
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (865fdae): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up. @rustbot label: -S-waiting-on-perf -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.4%, secondary 2.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 0.6%, secondary 4.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 487.856s -> 487.985s (0.03%) |
|
So much cleaner r=me with a nit |
It currently contains a `MaybeBorrowedLocals` cursor. The cursor is within a `RefCell` because cursor traversal requires mutation. The cursor is used in the `MaybeRequiresStorage::check_for_move` operation. Instead of using this cursor within `MaybeRequiresStorage` it's possible to do a pre-traversal of `MaybeBorrowedLocals` to extract the necessary information and then give that (immutably) to `MaybeRequiresStorage`. This commit makes that change. The extracted information is in the new `KillableLocals` type, which is computed by the `KillableLocalsVisitor` type within `MaybeRequiresStorage::new`. `MaybeRequiresStorage` no longer needs lifetimes. `MoveVisitor` is no longer needed. And the complicated `locals_live_across_suspend_points` gets a little simpler.
176271d to
0f0b9f8
Compare
|
I added an extra comment. @bors r=cjgillot |
|
@bors rollup=iffy (because of very small perf improvements in two secondary benchmarks) |
Rollup of 11 pull requests Successful merges: - #158168 (Added implementation on `set_permissions_nofollow` for all primary platforms) - #160055 (Simplify `MaybeRequiresStorage`) - #157226 (Partially stabilize `box_vec_non_null`) - #158879 (simplify `slice::Iter[Mut]::next_chunk` implementation) - #159413 (Enable `#[diagnostic::on_unknown]` during late res) - #160091 (Fix rustdoc toolbar height when title is taller than one line) - #158615 (fix: don't fire `explicit_outlives_requirements` on `?Sized` type params) - #159666 (fix(ld64.lld): route version mismatch warnings to linker_info on macOS) - #160032 (rustdoc-json: Make `Stability` compatible with non-self-describing serde formats) - #160039 (Add regression test for enum unconstrained parameter ) - #160049 (Use assert_eq! in splat codegen tests)
Rollup of 11 pull requests Successful merges: - #158168 (Added implementation on `set_permissions_nofollow` for all primary platforms) - #160055 (Simplify `MaybeRequiresStorage`) - #157226 (Partially stabilize `box_vec_non_null`) - #158879 (simplify `slice::Iter[Mut]::next_chunk` implementation) - #159413 (Enable `#[diagnostic::on_unknown]` during late res) - #160091 (Fix rustdoc toolbar height when title is taller than one line) - #158615 (fix: don't fire `explicit_outlives_requirements` on `?Sized` type params) - #159666 (fix(ld64.lld): route version mismatch warnings to linker_info on macOS) - #160032 (rustdoc-json: Make `Stability` compatible with non-self-describing serde formats) - #160039 (Add regression test for enum unconstrained parameter ) - #160049 (Use assert_eq! in splat codegen tests)
Rollup merge of #160055 - nnethercote:simplify-MaybeRequiresStorage, r=cjgillot Simplify `MaybeRequiresStorage` It currently contains a `MaybeBorrowedLocals` cursor. The cursor is within a `RefCell` because cursor traversal requires mutation. The cursor is used in the `MaybeRequiresStorage::check_for_move` operation. Instead of using this cursor within `MaybeRequiresStorage` it's possible to do a pre-traversal of `MaybeBorrowedLocals` to extract the necessary information and then give that (immutably) to `MaybeRequiresStorage`. This commit makes that change. The extracted information is in the new `KillableLocals` type, which is computed by the `KillableLocalsVisitor` type within `MaybeRequiresStorage::new`. `MaybeRequiresStorage` no longer needs lifetimes. `MoveVisitor` is no longer needed. And the complicated `locals_live_across_suspend_points` gets a little simpler. r? @cjgillot
It currently contains a
MaybeBorrowedLocalscursor. The cursor is within aRefCellbecause cursor traversal requires mutation. The cursor is used in theMaybeRequiresStorage::check_for_moveoperation.Instead of using this cursor within
MaybeRequiresStorageit's possible to do a pre-traversal ofMaybeBorrowedLocalsto extract the necessary information and then give that (immutably) toMaybeRequiresStorage.This commit makes that change. The extracted information is in the new
KillableLocalstype, which is computed by theKillableLocalsVisitortype withinMaybeRequiresStorage::new.MaybeRequiresStorageno longer needs lifetimes.MoveVisitoris no longer needed. And the complicatedlocals_live_across_suspend_pointsgets a little simpler.r? @cjgillot