about summary refs log tree commit diff
path: root/compiler/rustc_data_structures
AgeCommit message (Collapse)AuthorLines
2023-10-17Remove unused features from `rustc_data_structures`.Nicholas Nethercote-2/+0
2023-10-16docs: add Rust logo to more compiler cratesMichael Howell-0/+2
c6e6ecb1afea9695a42d0f148ce153536b279eb5 added it to some of the compiler's crates, but avoided adding it to all of them to reduce bit-rot. This commit adds to more.
2023-10-10Remove unused dominator iteratorTomasz Miąsko-26/+1
2023-10-05Optimize dominators for small path graphsTomasz Miąsko-10/+65
Generalizes the small dominators approach from #107449.
2023-10-05Remove redundant Dominators::start_node fieldTomasz Miąsko-3/+2
2023-10-05Test immediate dominators using public APITomasz Miąsko-24/+21
2023-09-25Rename `cold_path` to `outline`John Kåre Alsaker-9/+6
2023-09-24Add OwnedTargetMachine to manage llvm:TargetMachine. Uses pointersFlorian Schmiderer-0/+6
instead of &'static mut and provides safe interface to create/dispose it.
2023-09-21Auto merge of #115230 - Vtewari2311:mod-hurd-latest, r=b-naberbors-4/+20
added support for GNU/Hurd adding support for i686-unknown-hurd-gnu
2023-09-21added support for GNU/HurdSamuel Thibault-4/+20
2023-09-19use pretty_print_const_value from MIR constant 'extra' printingRalf Jung-0/+19
2023-09-18coverage: Simplify sorting of coverage spans extracted from MIRZalathar-3/+3
Switching to `Ordering::then_with` makes control-flow less complicated, and there is no need to use `partial_cmp` here.
2023-09-11Rollup merge of #115548 - Zoxc:parallel-extract, r=wesleywiserMatthias Krüger-171/+193
Extract parallel operations in `rustc_data_structures::sync` into a new `parallel` submodule This extracts parallel operations in `rustc_data_structures::sync` into a new `parallel` submodule. This cuts down on the size of the large `cfg_if!` in `sync` and makes it easier to compare between serial and parallel variants.
2023-09-11Auto merge of #115388 - Zoxc:sharded-lock, r=SparrowLiibors-194/+242
Add optimized lock methods for `Sharded` and refactor `Lock` This adds methods to `Sharded` which pick a shard and also locks it. These branch on parallelism just once instead of twice, improving performance. Benchmark for `cfg(parallel_compiler)` and 1 thread: <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.6461s</td><td align="right">1.6345s</td><td align="right"> -0.70%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2414s</td><td align="right">0.2394s</td><td align="right"> -0.83%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9205s</td><td align="right">0.9143s</td><td align="right"> -0.67%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.4981s</td><td align="right">1.4869s</td><td align="right"> -0.75%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">5.7629s</td><td align="right">5.7256s</td><td align="right"> -0.65%</td></tr><tr><td>Total</td><td align="right">10.0690s</td><td align="right">10.0008s</td><td align="right"> -0.68%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9928s</td><td align="right"> -0.72%</td></tr></table> cc `@SparrowLii`
2023-09-09Use `FreezeLock` for `CStore`John Kåre Alsaker-16/+45
2023-09-08Add Freeze::cloneJohn Kåre Alsaker-0/+10
2023-09-08Remove the `LockMode` enum and `dispatch`John Kåre Alsaker-107/+79
2023-09-08Refactor `Lock` implementationJohn Kåre Alsaker-246/+216
2023-09-08Add optimized lock methods for `Sharded`John Kåre Alsaker-17/+123
2023-09-07Use `Freeze` for `SourceFile.lines`John Kåre Alsaker-0/+12
2023-09-07Use `Freeze` for `SourceFile.external_src`John Kåre Alsaker-3/+44
2023-09-06Use a reference to the lock in the guardsJohn Kåre Alsaker-15/+14
2023-09-06Extract parallel operations in `rustc_data_structures::sync` into a new ↵John Kåre Alsaker-171/+193
`parallel` submodule
2023-09-02Rename `Freeze` to `FreezeLock`John Kåre Alsaker-8/+8
2023-09-02Add some commentsJohn Kåre Alsaker-1/+4
2023-09-02Use `RwLock` for `Freeze`John Kåre Alsaker-8/+10
2023-09-02Add `Freeze` type and use it to store `Definitions`John Kåre Alsaker-0/+107
2023-09-01Use `OnceLock` for `SingleCache`John Kåre Alsaker-2/+2
2023-08-30Use a `parallel_guard` function to handle the parallel guardJohn Kåre Alsaker-60/+55
2023-08-30Use `Mutex` to avoid issue with conditional locksJohn Kåre Alsaker-4/+3
2023-08-30Add `ParallelGuard` type to handle unwinding in parallel sectionsJohn Kåre Alsaker-121/+68
2023-08-30Make parallel! an expressionJohn Kåre Alsaker-2/+2
2023-08-30Use conditional synchronization for LockJohn Kåre Alsaker-91/+298
2023-08-29Auto merge of #114894 - Zoxc:sharded-cfg-cleanup2, r=cjgillotbors-7/+18
Remove conditional use of `Sharded` from query state `Sharded` is already a zero cost abstraction, so it shouldn't affect the performance of the single thread compiler if LLVM does its job. r? `@cjgillot`
2023-08-28don't use SnapshotVec in Graph implementation, as it looks unused; use Vec ↵klensy-19/+4
instead
2023-08-24Rollup merge of #114987 - RalfJung:unsound-mmap, r=cjgillotWeihang Lo-1/+6
elaborate a bit on the (lack of) safety in 'Mmap::map' Sadly none of the callers of this function even consider it worth mentioning in their unsafe block that what they are doing is completely unsound.
2023-08-24Optimize `lock_shards`John Kåre Alsaker-7/+18
2023-08-24Auto merge of #115082 - Zoxc:syntax-context-decode-race, r=cjgillotbors-0/+6
Fix races conditions with `SyntaxContext` decoding This changes `SyntaxContext` decoding to work with concurrent decoding. The `remapped_ctxts` field now only stores `SyntaxContext` which have completed decoding, while the new `decoding` and `local_in_progress` keeps track of `SyntaxContext`s which are in process of being decoding and on which threads. This fixes 2 issues with the current implementation. It can return an `SyntaxContext` which contains dummy data if another thread starts decoding before the first one has completely finished. Multiple threads could also allocate multiple `SyntaxContext`s for the same `raw_id`.
2023-08-24Auto merge of #115094 - Mark-Simulacrum:bootstrap-update, r=ozkanonurbors-1/+1
Update bootstrap compiler to 1.73.0 beta
2023-08-23Bump cfg(bootstrap)Mark Rousskov-1/+1
2023-08-22Fix races conditions with `SyntaxContext` decodingJohn Kåre Alsaker-0/+6
2023-08-19elaborate a bit on the (lack of) safety in 'Mmap::map'Ralf Jung-1/+6
2023-08-16Remove `count`John Kåre Alsaker-10/+9
2023-08-16Keep SHARDS fixed instead of a function of `cfg!(parallel_compiler)`John Kåre Alsaker-4/+19
2023-08-15Make Sharded an enum and specialize it for the single thread caseJohn Kåre Alsaker-36/+30
2023-08-08Auto merge of #114339 - ttsugriy:unsafe-utf8, r=davidtwcobors-1/+4
[rustc_data_structures][base_n][perf] Remove unnecessary utf8 check. Since all output characters taken from `BASE_64` are valid UTF8 chars there is no need to waste cycles on validation. Even though it's obviously a perf win, I've also used a [benchmark](https://gist.github.com/ttsugriy/e1e63c07927d8f31e71695a9c617bbf3) on M1 MacBook Air with following results: ``` Running benches/base_n_benchmark.rs (target/release/deps/base_n_benchmark-825fe5895b5c2693) push_str/old time: [14.670 µs 14.852 µs 15.074 µs] Found 11 outliers among 100 measurements (11.00%) 4 (4.00%) high mild 7 (7.00%) high severe push_str/new time: [12.573 µs 12.674 µs 12.801 µs] Found 11 outliers among 100 measurements (11.00%) 7 (7.00%) high mild 4 (4.00%) high severe ```
2023-08-04Rollup merge of #114418 - klensy:parking_lot, r=oli-obkMatthias Krüger-1/+1
bump parking_lot to 0.12 Bumps parking_lot to 0.12, replaces few explicit uses of parking_lot with rustc_data_structures::sync ones. <strike>cc `@oli-obk` this touches recent https://github.com/rust-lang/rust/pull/114283</strike> cc `@SparrowLii` i've checked that this builds with parallel-compiler measureme's bump https://github.com/rust-lang/measureme/pull/209 https://github.com/rust-lang/rust/blob/fcf3006e0133365ecd26894689c086387edcbecb/compiler/rustc_data_structures/src/sync.rs#L18-L34
2023-08-03bump parking_lot 0.11 to 0.12klensy-1/+1
2023-08-03Add `internal_features` lintNilstrieb-0/+1
It lints against features that are inteded to be internal to the compiler and standard library. Implements MCP #596. We allow `internal_features` in the standard library and compiler as those use many features and this _is_ the standard library from the "internal to the compiler and standard library" after all. Marking some features as internal wasn't exactly the most scientific approach, I just marked some mostly obvious features. While there is a categorization in the macro, it's not very well upheld (should probably be fixed in another PR). We always pass `-Ainternal_features` in the testsuite About 400 UI tests and several other tests use internal features. Instead of throwing the attribute on each one, just always allow them. There's nothing wrong with testing internal features^^
2023-08-01[rustc_data_structures][base_n][perf] Remove unnecessary utf8 check.Taras Tsugrii-1/+4
Since all output characters taken from `BASE_64` are valid UTF8 chars there is no need to waste cycles on validation. Even though it's obviously a perf win, I've also used a [benchmark](https://gist.github.com/ttsugriy/e1e63c07927d8f31e71695a9c617bbf3) on M1 MacBook Air with following results: ``` Running benches/base_n_benchmark.rs (target/release/deps/base_n_benchmark-825fe5895b5c2693) push_str/old time: [14.670 µs 14.852 µs 15.074 µs] Performance has regressed. Found 11 outliers among 100 measurements (11.00%) 4 (4.00%) high mild 7 (7.00%) high severe push_str/new time: [12.573 µs 12.674 µs 12.801 µs] Performance has regressed. Found 11 outliers among 100 measurements (11.00%) 7 (7.00%) high mild 4 (4.00%) high severe ```