about summary refs log tree commit diff
path: root/compiler/rustc_index/src/bit_set.rs
AgeCommit message (Collapse)AuthorLines
2023-03-21Use `SmallVec` in bitsetsNilstrieb-5/+7
This doesn't increase their size and means that we don't have to heap allocate for small sets.
2023-03-03Match unmatched backticks in compiler/ that are part of rustdocest31-1/+1
2023-01-05Fix `uninlined_format_args` for some compiler cratesnils-1/+1
Convert all the crates that have had their diagnostic migration completed (except save_analysis because that will be deleted soon and apfloat because of the licensing problem).
2022-12-12minor code cleanupsMatthias Krüger-1/+1
2022-07-08Fix cloning from a BitSet with a different domain sizeTomasz Miąsko-6/+2
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-07-04Use a bitset instead of a hash map in HIR ID validatorJakub Beránek-0/+10
2022-06-21Auto merge of #95576 - DrMeepster:box_erasure, r=oli-obkbors-0/+12
Remove dereferencing of Box from codegen Through #94043, #94414, #94873, and #95328, I've been fixing issues caused by Box being treated like a pointer when it is not a pointer. However, these PRs just introduced special cases for Box. This PR removes those special cases and instead transforms a deref of Box into a deref of the pointer it contains. Hopefully, this is the end of the Box<T, A> ICEs.
2022-06-15add From impls for BitSet and GrowableBitSetDrMeepster-0/+12
2022-06-14`BitSet` perf improvementsJakob Degen-5/+78
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/+48
2022-04-27tut tut tutEllen-1/+1
2022-03-30Spellchecking compiler commentsYuri Astrakhan-1/+1
This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-15Fix small typo in FIXMEMartin Gammelsæter-2/+2
2022-03-07Add comment linking to closed PR for future optimizersMartin Gammelsæter-4/+8
While optimizing these operations proved unfruitful w.r.t. improving compiler performance right now, faster versions might be needed at a later time.
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