diff options
| author | bors <bors@rust-lang.org> | 2024-12-09 07:13:11 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-12-09 07:13:11 +0000 |
| commit | f6cb952dc115fd1311b02b694933e31d8dc8b002 (patch) | |
| tree | 80edf807196eafc8f1e9c6af6bf39be56c04103d /compiler/rustc_mir_dataflow/src/framework/lattice.rs | |
| parent | 1b3fb316751227d30b1523ed0e3f00d83956d4d0 (diff) | |
| parent | fa6ceba208fed892648679342fbf444d68385195 (diff) | |
| download | rust-f6cb952dc115fd1311b02b694933e31d8dc8b002.tar.gz rust-f6cb952dc115fd1311b02b694933e31d8dc8b002.zip | |
Auto merge of #133891 - nnethercote:MixedBitSet, r=Mark-Simulacrum
Introduce `MixedBitSet` `ChunkedBitSet` is good at avoiding excessive memory usage for programs with very large functgions where dataflow bitsets have very large domain sizes. But it's overly heavyweight for small bitsets, because any non-empty `ChunkedBitSet` takes up at least 256 bytes. This PR introduces `MixedBitSet`, which is a simple bitset that uses `BitSet` for small/medium bitsets and `ChunkedBitSet` for large bitsets. It's a speed and memory usage win. r? `@Mark-Simulacrum`
Diffstat (limited to 'compiler/rustc_mir_dataflow/src/framework/lattice.rs')
| -rw-r--r-- | compiler/rustc_mir_dataflow/src/framework/lattice.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_mir_dataflow/src/framework/lattice.rs b/compiler/rustc_mir_dataflow/src/framework/lattice.rs index e2b56aedca3..e063eaf74bd 100644 --- a/compiler/rustc_mir_dataflow/src/framework/lattice.rs +++ b/compiler/rustc_mir_dataflow/src/framework/lattice.rs @@ -40,7 +40,7 @@ use std::iter; -use rustc_index::bit_set::{BitSet, ChunkedBitSet}; +use rustc_index::bit_set::{BitSet, MixedBitSet}; use rustc_index::{Idx, IndexVec}; use crate::framework::BitSetExt; @@ -126,7 +126,7 @@ impl<T: Idx> JoinSemiLattice for BitSet<T> { } } -impl<T: Idx> JoinSemiLattice for ChunkedBitSet<T> { +impl<T: Idx> JoinSemiLattice for MixedBitSet<T> { fn join(&mut self, other: &Self) -> bool { self.union(other) } |
