about summary refs log tree commit diff
path: root/compiler/rustc_index/src/bit_set.rs
AgeCommit message (Collapse)AuthorLines
2022-02-23Introduce `ChunkedBitSet` and use it for some dataflow analyses.Nicholas Nethercote-27/+471
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.
2022-02-16Adopt let_else in even more placesest31-5/+1
2022-02-01implement lint for suspicious auto trait implslcnr-0/+6
2021-12-22Require Ord for rustc_index::SparseBitSet::last_set_inpierwill-3/+8
2021-12-22Remove `PartialOrd` and `Ord` from `LocalDefId`pierwill-1/+1
Implement `Ord`, `PartialOrd` for SpanData
2021-12-18Derive hash for BitSet and BitMatrixTomasz Miąsko-2/+2
2021-11-03Optimize live point computationMark Rousskov-1/+141
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-10-15Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, ↵Matthias Krüger-3/+4
r=petrochenkov" The PR had some unforseen perf regressions that are not as easy to find. Revert the PR for now. This reverts commit 6ae8912a3e7d2c4c775024f58a7ba4b1aedc4073, reversing changes made to 86d6d2b7389fe1b339402c1798edae8b695fc9ef.
2021-10-12Use Option::map_or instead of open coding itLingMan-1/+1
2021-10-11Remove unnecessary variableClemens Wasser-2/+1
2021-10-10Apply clippy suggestionsClemens Wasser-3/+3
2021-09-22rustc_index: Add some map-like APIs to `IndexVec`Vadim Petrochenkov-6/+2
2021-08-27Suggested changesWill Crichton-2/+2
2021-08-27Addd missing domain size assertionsWill Crichton-1/+3
2021-08-26Add comments and unit tests for new SparseBitMatrix methodsWill Crichton-0/+19
2021-08-26TypoWill Crichton-2/+2
2021-08-26Add remaining impl for hybrid X denseWill Crichton-21/+51
2021-08-26FormattingWill Crichton-2/+2
2021-08-26Add commentsWill Crichton-0/+12
2021-08-26Fix sparse intersect bug, add more sparse / dense testsWill Crichton-1/+1
2021-08-25Small fixesWill Crichton-3/+6
2021-08-25Add optimized sparse-hybrid / dense-hybrid intersectWill Crichton-6/+21
2021-08-25Remove BitRelations impls for SparseBitSet, add optimizationsWill Crichton-63/+29
2021-08-24Fix HybridBitSet port issueWill Crichton-3/+16
2021-08-24Refactor BitSet relational methods into trait with parameterizedWill Crichton-122/+231
right-hand side
2021-08-23Make SparseBitMatrix::ensure_row public to enable general mutation of rowsWill Crichton-1/+1
2021-05-04Change bitwise operator to more easily keep data in vector registersMark Rousskov-3/+7
2021-04-21Use arrayvec 0.7, drop smallvec 0.6Jubilee Young-1/+1
With the arrival of min const generics, many alt-vec libraries have updated to use it in some way and arrayvec is no exception. Use the latest with minor refactoring. Also, rustc_workspace_hack is the only user of smallvec 0.6 in the entire tree, so drop it.
2021-03-26Use iter::zip in compiler/Josh Stone-3/+3
2021-02-04relax adt unsizing requirementsBastian Kauschke-0/+12
2020-12-18Switch compiler/ to intra-doc linksJoshua Nelson-1/+0
rustc_lint and rustc_lint_defs weren't switched because they're included in the compiler book and so can't use intra-doc links.
2020-08-30Improve `BitSet` APIsDylan MacKenzie-17/+37
A few small cleanups to `BitSet` and friends: - Overload `clone_from` for `BitSet`. - Improve `Debug` represenation of `HybridBitSet`. - Make `HybridBitSet::domain_size` public. - Don't require `T: Idx` at the type level. The `Idx` bound is still on most `BitSet` methods, but like `HashMap`, it doesn't need to be satisfied for the type to exist.
2020-08-30mv compiler to compiler/mark-0/+1164