about summary refs log tree commit diff
path: root/compiler/rustc_index/src/bit_set
AgeCommit message (Collapse)AuthorLines
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