1
Fork 0

Auto merge of #97863 - JakobDegen:bitset-choice, r=nnethercote

`BitSet` related perf improvements

This commit makes two changes:
 1. Changes `MaybeLiveLocals` to use `ChunkedBitSet`
 2. Overrides the `fold` method for the iterator for `ChunkedBitSet`

I have local benchmarks verifying that each of these changes individually yield significant perf improvements to #96451 . I'm hoping this will be true outside of that context too. If that is not the case, I'll try to gate things on where they help as needed

r? `@nnethercote` who I believe was working on closely related things, cc `@tmiasko` because of the destprop pr
This commit is contained in:
bors 2022-06-17 07:35:22 +00:00
commit ecdd374e61
5 changed files with 141 additions and 23 deletions

View file

@ -495,7 +495,8 @@ fn locals_live_across_suspend_points<'tcx>(
let loc = Location { block, statement_index: data.statements.len() };
liveness.seek_to_block_end(block);
let mut live_locals = liveness.get().clone();
let mut live_locals: BitSet<_> = BitSet::new_empty(body.local_decls.len());
live_locals.union(liveness.get());
if !movable {
// The `liveness` variable contains the liveness of MIR locals ignoring borrows.