about summary refs log tree commit diff
path: root/compiler/rustc_index/src/bit_set
AgeCommit message (Collapse)AuthorLines
2025-06-04index: add method for checking range on DenseBitSetNia Espera-0/+19
2025-02-08Rustfmtbjorn3-30/+40
2025-01-14Add `DenseBitSet::union_not`Zalathar-0/+26
This is similar to the existing `union`, except that bits in the RHS are negated before being incorporated into the LHS. Currently only `DenseBitSet` is supported. Supporting other bitset types is possible, but non-trivial, and currently isn't needed.
2025-01-11rename `BitSet` to `DenseBitSet`Rémy Rakic-23/+23
This should make it clearer that this bitset is dense, with the advantages and disadvantages that it entails.
2024-12-09Use `BitSet` in `SparseBitMatrix`.Nicholas Nethercote-3/+3
A `ChunkedBitSet` has to be at least 2048 bits for it to outperform a `BitSet`, because that's the chunk size. The largest `SparseBitMatrix` encountered when compiling the compiler and the entire rustc-perf benchmark suite is less than 600 bits. This change is a tiny perf win, but the motivation is more about avoiding uses of `ChunkedBitSet` outside of `MixedBitSet`. The test change is necessary to avoid hitting the `<BitSet<T> as BitRelations<ChunkedBitSet<T>>>::subtract` method that has `unimplemented!` in its body and isn't otherwise used.
2024-11-29Remove `HybridBitSet`.Nicholas Nethercote-177/+3
It's no longer used.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-40/+30
2024-07-29Reformat `use` declarations.Nicholas Nethercote-0/+1
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2022-07-08Fix cloning from a BitSet with a different domain sizeTomasz Miąsko-0/+17
The previous implementation incorrectly assumed that the number of words in a bit set is equal to the domain size. The new implementation delegates to `Vec::clone_from` which is specialized for `Copy` elements.
2022-06-14`BitSet` perf improvementsJakob Degen-13/+57
This commit makes two changes: 1. Changes `MaybeLiveLocals` to use `ChunkedBitSet` 2. Overrides the `fold` method for the iterator for `ChunkedBitSet`
2022-04-30Add element iterator for ChunkedBitSetTomasz Miąsko-0/+34
2022-02-23Introduce `ChunkedBitSet` and use it for some dataflow analyses.Nicholas Nethercote-0/+195
This reduces peak memory usage significantly for some programs with very large functions, such as: - `keccak`, `unicode_normalization`, and `match-stress-enum`, from the `rustc-perf` benchmark suite; - `http-0.2.6` from crates.io. The new type is used in the analyses where the bitsets can get huge (e.g. 10s of thousands of bits): `MaybeInitializedPlaces`, `MaybeUninitializedPlaces`, and `EverInitializedPlaces`. Some refactoring was required in `rustc_mir_dataflow`. All existing analysis domains are either `BitSet` or a trivial wrapper around `BitSet`, and access in a few places is done via `Borrow<BitSet>` or `BorrowMut<BitSet>`. Now that some of these domains are `ClusterBitSet`, that no longer works. So this commit replaces the `Borrow`/`BorrowMut` usage with a new trait `BitSetExt` containing the needed bitset operations. The impls just forward these to the underlying bitset type. This required fiddling with trait bounds in a few places. The commit also: - Moves `static_assert_size` from `rustc_data_structures` to `rustc_index` so it can be used in the latter; the former now re-exports it so existing users are unaffected. - Factors out some common "clear excess bits in the final word" functionality in `bit_set.rs`. - Uses `fill` in a few places instead of loops.
2021-11-03Optimize live point computationMark Rousskov-0/+95
This is just replicating the previous algorithm, but taking advantage of the bitset structures to optimize into tighter and better optimized loops. Particularly advantageous on enormous MIR blocks, which are relatively rare in practice.
2021-08-26FormattingWill Crichton-6/+6
2021-08-26Fix failing testWill Crichton-7/+7
2021-08-26Add comments and unit tests for new SparseBitMatrix methodsWill Crichton-0/+66
2021-08-26Compile failureWill Crichton-1/+1
2021-08-26Compilation failure in testsWill Crichton-6/+6
2021-08-26Fix sparse intersect bug, add more sparse / dense testsWill Crichton-1/+12
2021-08-25Add unit tests for BitSet intersect/subtractWill Crichton-1/+12
2021-02-02Add additional benchmarks to bit_setkadmin-0/+34
2020-08-30mv compiler to compiler/mark-0/+366