about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src
AgeCommit message (Collapse)AuthorLines
2023-11-06Auto merge of #117435 - SparrowLii:nightly_parallel, r=oli-obk,davidtwcobors-2/+21
enable parallel rustc front end in nightly builds Refers to the [MCP](https://github.com/rust-lang/compiler-team/issues/681), this pr does: 1. Enable the parallel front end in nightly builds, and keep the default number of threads as 1. Then users can use the parallel rustc front end via -Z threads=n option. 2. Set it up to serial front end for beta/stable builds via bootstrap. 3. Switch over the alt builders from parallel rustc to serial, so we have artifacts without parallel to test against the artifacts with parallel. r? `@oli-obk` cc `@cjgillot` `@nnethercote` `@bjorn3` `@Kobzol`
2023-11-06use portable AtomicU64 for powerPC and MIPSSparrowLii-2/+21
2023-11-03Use `filter_map` in `try_par_for_each_in`Josh Stone-7/+6
This simplifies the expression, especially for the rayon part, and also lets us drop the `E: Copy` constraint.
2023-10-23Auto merge of #116849 - oli-obk:error_shenanigans, r=cjgillotbors-1/+30
Avoid a `track_errors` by bubbling up most errors from `check_well_formed` I believe `track_errors` is mostly papering over issues that a sufficiently convoluted query graph can hit. I made this change, while the actual change I want to do is to stop bailing out early on errors, and instead use this new `ErrorGuaranteed` to invoke `check_well_formed` for individual items before doing all the `typeck` logic on them. This works towards resolving https://github.com/rust-lang/rust/issues/97477 and various other ICEs, as well as allowing us to use parallel rustc more (which is currently rather limited/bottlenecked due to the very sequential nature in which we do `rustc_hir_analysis::check_crate`) cc `@SparrowLii` `@Zoxc` for the new `try_par_for_each_in` function
2023-10-20Avoid a `track_errors` by bubbling up most errors from `check_well_formed`Oli Scherer-1/+30
2023-10-19Initiate the inner usage of `cfg_match`Caio-47/+50
2023-10-18Auto merge of #116830 - nnethercote:rustc_type_ir, r=compiler-errorsbors-121/+0
Remove `IdFunctor` trait. It's defined in `rustc_data_structures` but is only used in `rustc_type_ir`. The code is shorter and easier to read if we remove this layer of abstraction and just do the things directly where they are needed. r? `@BoxyUwU`
2023-10-17Remove `IdFunctor` trait.Nicholas Nethercote-119/+0
It's defined in `rustc_data_structures` but is only used in `rustc_type_ir`. The code is shorter and easier to read if we remove this layer of abstraction and just do the things directly where they are needed.
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