1
Fork 0

Auto merge of #111396 - vlad20012:reduce-Borrows-dataflow-bitset-size, r=cjgillot

Reduce BitSet size used in `Borrows` dataflow analysis

It looks like it is not needed to multiply the number of borrows by 2. Bits greater than `self.borrow_set.len()` are never set in this bitset. This should decrease the memory usage by an epsilon.
This commit is contained in:
bors 2023-05-12 17:37:05 +00:00
commit 4a59ba4d54

View file

@ -328,7 +328,7 @@ impl<'tcx> rustc_mir_dataflow::AnalysisDomain<'tcx> for Borrows<'_, 'tcx> {
fn bottom_value(&self, _: &mir::Body<'tcx>) -> Self::Domain { fn bottom_value(&self, _: &mir::Body<'tcx>) -> Self::Domain {
// bottom = nothing is reserved or activated yet; // bottom = nothing is reserved or activated yet;
BitSet::new_empty(self.borrow_set.len() * 2) BitSet::new_empty(self.borrow_set.len())
} }
fn initialize_start_block(&self, _: &mir::Body<'tcx>, _: &mut Self::Domain) { fn initialize_start_block(&self, _: &mir::Body<'tcx>, _: &mut Self::Domain) {