about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src/plumbing.rs
AgeCommit message (Collapse)AuthorLines
2022-02-27Auto merge of #94084 - Mark-Simulacrum:drop-sharded, r=cjgillotbors-3/+2
Avoid query cache sharding code in single-threaded mode In non-parallel compilers, this is just adding needless overhead at compilation time (since there is only one shard statically anyway). This amounts to roughly ~10 seconds reduction in bootstrap time, with overall neutral (some wins, some losses) performance results. Parallel compiler performance should be largely unaffected by this PR; sharding is kept there.
2022-02-21Auto merge of #94066 - Mark-Simulacrum:factor-out-simple-def-kind, r=davidtwcobors-6/+4
Remove SimpleDefKind Now that rustc_query_system depends on rustc_hir, we can just directly make use of the regular DefKind.
2022-02-20Delete QueryLookupMark Rousskov-2/+1
This was largely just caching the shard value at this point, which is not particularly useful -- in the use sites the key was being hashed nearby anyway.
2022-02-20Move Sharded maps into each QueryCache implMark Rousskov-1/+1
2022-02-17Remove SimpleDefKindMark Rousskov-6/+4
2022-02-16Move ty::print methods to Drop-based scope guardsMark Rousskov-4/+5
2022-02-09Auto merge of #93741 - Mark-Simulacrum:global-job-id, r=cjgillotbors-12/+21
Refactor query system to maintain a global job id counter This replaces the per-shard counters with a single global counter, simplifying the JobId struct down to just a u64 and removing the need to pipe a DepKind generic through a bunch of code. The performance implications on non-parallel compilers are likely minimal (this switches to `Cell<u64>` as the backing storage over a `u64`, but the latter was already inside a `RefCell` so it's not really a significance divergence). On parallel compilers, the cost of a single global u64 counter may be more significant: it adds a serialization point in theory. On the other hand, we can imagine changing the counter to have a thread-local component if it becomes worrisome or some similar structure. The new design is sufficiently simpler that it warrants the potential for slight changes down the line if/when we get parallel compilation to be more of a default. A u64 counter, instead of u32 (the old per-shard width), is chosen to avoid possibly overflowing it and causing problems; it is effectively impossible that we would overflow a u64 counter in this context.
2022-02-08Switch QueryJobId to a single global counterMark Rousskov-12/+21
This replaces the per-shard counters with a single global counter, simplifying the JobId struct down to just a u64 and removing the need to pipe a DepKind generic through a bunch of code. The performance implications on non-parallel compilers are likely minimal (this switches to `Cell<u64>` as the backing storage over a `u64`, but the latter was already inside a `RefCell` so it's not really a significance divergence). On parallel compilers, the cost of a single global u64 counter may be more significant: it adds a serialization point in theory. On the other hand, we can imagine changing the counter to have a thread-local component if it becomes worrisome or some similar structure. The new design is sufficiently simpler that it warrants the potential for slight changes down the line if/when we get parallel compilation to be more of a default. A u64 counter, instead of u32 (the old per-shard width), is chosen to avoid possibly overflowing it and causing problems; it is effectively impossible that we would overflow a u64 counter in this context.
2022-02-0814956 -> 14952 exportsklensy-2/+2
2022-02-0715221 -> 14956 exportsklensy-1/+1
2021-12-14Remove `in_band_lifetimes` from `rustc_query_impl`LegionMammal978-4/+4
See #91867 for more information.
2021-12-12Query modifierDeadbeef-0/+12
2021-10-25Avoid a branch on key being local for queries that use the same local and ↵bjorn3-7/+19
extern providers
2021-10-23Do not require QueryCtxt for cache_on_disk.Camille GILLOT-2/+1
2021-10-23Build the query vtable directly.Camille GILLOT-31/+19
2021-10-21Do not depend on the stored value when trying to cache on disk.Camille GILLOT-1/+1
2021-10-20Build jump table at runtime.Camille GILLOT-59/+70
2021-10-20Invoke callbacks from rustc_middle.Camille GILLOT-31/+1
2021-10-20Merge two query callbacks arrays.Camille GILLOT-65/+33
2021-10-20Make hash_result an Option.Camille GILLOT-12/+6
2021-10-06Query the fingerprint style during key reconstructionMark Rousskov-3/+4
Keys can be reconstructed from fingerprints that are not DefPathHash, but then we cannot extract a DefId from them.
2021-10-05Auto merge of #89266 - cjgillot:session-ich, r=michaelwoeristerbors-1/+0
Move ICH to rustc_query_system Based on https://github.com/rust-lang/rust/pull/89183 The StableHashingContext does not need to be in rustc_middle. This PR moves it to rustc_query_system. This will avoid a dependency between rustc_ast_lowering and rustc_middle in https://github.com/rust-lang/rust/pull/89124.
2021-10-03Access StableHashingContext in rustc_query_system.Camille GILLOT-1/+0
2021-10-03Remove re-export.Camille GILLOT-1/+1
2021-10-02Prevent macro ambiguity errorsbjorn3-13/+13
The previous macro_rules! parsers failed when an additional modifier was added with ambiguity errors. The error is pretty unclear as to what exactly the cause here is, but this change simplifies the argument parsing code such that the error is avoided.
2021-09-21Disable visible path calculation for PrettyPrinter in Ok path of compilerAlik Aslanyan-2/+5
2021-08-29Retrieve `DefKind` from HIR map to reduce chance of cyclesNoah Lev-4/+6
`tcx.def_kind()` could theoretically invoke another query, which could cause an infinite query loop. Accessing the HIR map directly makes that less likely to happen. I also changed it to use `as_local()` (`tcx.def_kind()` seems to implicitly call `expect_local()`) and `opt_def_kind()` to reduce the chance of panicking on valid code.
2021-08-27Note that type aliases cannot be recursiveNoah Lev-1/+6
2021-07-25Create `QuerySideEffects` and use it for diagnosticsAaron Hill-9/+11
2021-07-18Remove deadlock virtual call.Camille GILLOT-6/+5
2021-07-18Move OnDiskCache to rustc_query_impl.Camille GILLOT-33/+43
2021-06-15Auto merge of #85154 - cjgillot:lessfn, r=bjorn3bors-5/+5
Reduce amount of function pointers in query invocation. r? `@ghost`
2021-05-31Auto merge of #85266 - cjgillot:hir-dep-clean, r=michaelwoeristerbors-34/+1
Remove obsolete workaround. The regression test for #62649 appears to pass even without the workaround.
2021-05-30Only test if key is local.Camille GILLOT-2/+1
2021-05-30Reduce amount of function pointers.Camille GILLOT-4/+5
2021-05-27Remove obsolete workaround.Camille GILLOT-34/+1
2021-05-15Remove def_path_str.Camille GILLOT-5/+2
2021-05-15Move key recovering into force_query.Camille GILLOT-14/+1
2021-05-01Apply `--cfg parallel_compiler` when documentingJoshua Nelson-6/+4
This also reverts commit 9823c2cc700fea541bf2670fcee93af662b63022 working around the bug.
2021-04-12Introduce CompileMonoItem DepNodebjorn3-0/+5
2021-03-30Stream the dep-graph to a file.Camille GILLOT-4/+1
2021-03-29Don't duplicate the extern providers once for each cratebjorn3-13/+12
2021-02-21Simplify hashing.Camille GILLOT-2/+2
2021-02-20Move print_query_stack to rustc_query_system.Camille GILLOT-32/+2
2021-02-20Move report_cycle to rustc_query_system.Camille GILLOT-56/+6
The call to `ty::print::with_forced_impl_filename_line` is done when constructing the description, at the construction of the QueryStackFrame.
2021-02-20Move Query to rustc_query_system.Camille GILLOT-42/+16
Rename it to QueryStackFrame and document a bit.
2021-02-20Do not hold query key in Query.Camille GILLOT-52/+61
2021-02-20Access the session directly from DepContext.Camille GILLOT-15/+0
2021-02-19Workaround rustdoc not honouring cfg(parallel_compiler).Camille GILLOT-4/+6
2021-02-19Move the query system to rustc_query_impl.Camille GILLOT-0/+726