about summary refs log tree commit diff
path: root/compiler/rustc_query_system
AgeCommit message (Collapse)AuthorLines
2021-03-27Remove (lots of) dead codeJoshua Nelson-19/+3
Found with https://github.com/est31/warnalyzer. Dubious changes: - Is anyone else using rustc_apfloat? I feel weird completely deleting x87 support. - Maybe some of the dead code in rustc_data_structures, in case someone wants to use it in the future? - Don't change rustc_serialize I plan to scrap most of the json module in the near future (see https://github.com/rust-lang/compiler-team/issues/418) and fixing the tests needed more work than I expected. TODO: check if any of the comments on the deleted code should be kept.
2021-03-26Use iter::zip in compiler/Josh Stone-2/+3
2021-03-19Debug-print result when an unstable fingerprint is detectedAaron Hill-1/+1
2021-03-15Auto merge of #82999 - cuviper:rustc-rayon-0.3.1, r=Mark-Simulacrumbors-1/+1
Update to rustc-rayon 0.3.1 This pulls in rust-lang/rustc-rayon#8 to fix #81425. (h/t `@ammaraskar)` That revealed weak constraints on `rustc_arena::DropArena`, because its `DropType` was holding type-erased raw pointers to generic `T`. We can implement `Send` for `DropType` (under `cfg(parallel_compiler)`) by requiring all `T: Send` before they're type-erased.
2021-03-13Auto merge of #83007 - Aaron1011:incr-verify-default, r=Mark-Simulacrumbors-11/+18
Turn `-Z incremental-verify-ich` on by default Issue #82920 showed that the kind of bugs caught by this flag have soundness implications.
2021-03-13Always run `incremental_verify_ich` when re-computing query resultsAaron Hill-11/+18
Issue #82920 showed that the kind of bugs caught by this flag have soundness implications. This causes performance regressions of up to 15.2% during incremental compilation, but this is necessary to catch miscompilations caused by bugs in query implementations.
2021-03-12rustc_query_system: simplify QueryCache::iterTyson Nottingham-22/+17
Minor cleanup to reduce a small amount of complexity and code bloat. Reduces the number of mono items in rustc_query_impl by 15%.
2021-03-10Update to rustc-rayon 0.3.1Josh Stone-1/+1
This pulls in rust-lang/rustc-rayon#8 to fix #81425. (h/t @ammaraskar) That revealed weak constraints on `rustc_arena::DropArena`, because its `DropType` was holding type-erased raw pointers to generic `T`. We can implement `Send` for `DropType` (under `cfg(parallel_compiler)`) by requiring all `T: Send` before they're type-erased.
2021-02-21Simplify hashing.Camille GILLOT-33/+24
2021-02-20Move print_query_stack to rustc_query_system.Camille GILLOT-5/+43
2021-02-20Move report_cycle to rustc_query_system.Camille GILLOT-7/+47
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-95/+124
Rename it to QueryStackFrame and document a bit.
2021-02-20Do not hold query key in Query.Camille GILLOT-4/+7
2021-02-20Access the session directly from DepContext.Camille GILLOT-17/+13
2021-02-19Use a QueryContext for try_mark_green.Camille GILLOT-40/+35
2021-02-19Move try_load_from_on_disk_cache to the QueryContext.Camille GILLOT-6/+8
2021-02-19Decouple QueryContext from DepContext.Camille GILLOT-51/+85
2021-02-19Remove QueryAccessors::to_dep_node.Camille GILLOT-7/+0
2021-02-19Don't require a QueryContext to access the DepGraph.Camille GILLOT-9/+8
2021-02-18Print -Ztime-passes (and misc stats/logs) on stderr, not stdout.Eduard-Mihai Burtescu-14/+14
2021-02-16Inline try_get_cachedTomasz Miąsko-0/+1
2021-02-15Auto merge of #81855 - cjgillot:ensure-cache, r=oli-obkbors-190/+218
Check the result cache before the DepGraph when ensuring queries Split out of https://github.com/rust-lang/rust/pull/70951 Calling `ensure` on already forced queries is a common operation. Looking at the results cache first is faster than checking the DepGraph for a green node.
2021-02-14bumped smallvec depsklensy-1/+1
2021-02-13Check query cache before calling into the query engine.Camille GILLOT-17/+35
2021-02-13Drop the cache lock earlier.Camille GILLOT-16/+17
2021-02-13Separate the query cache from the query state.Camille GILLOT-100/+130
2021-02-13Return a Result for query cache.Camille GILLOT-87/+68
2021-02-13Merge {get,ensure}_query.Camille GILLOT-24/+22
2021-02-09Auto merge of #81892 - jyn514:no-inline, r=cjgillotbors-10/+0
[experiment] remove `#[inline]` from rustc_query_system::plumbing These functions have a ton of generic parameters and are instantiated over and over again. Hopefully this will reduce binary bloat and speed up bootstrapping times. r? `@cjgillot`
2021-02-08Switch query descriptions to just StringMark Rousskov-2/+1
In practice we never used the borrowed variant anyway.
2021-02-08[experiment] remove `#[inline]` from rustc_query_system::plumbingJoshua Nelson-10/+0
These functions have a ton of generic parameters and are instantiated over and over again. Hopefully this will reduce binary bloat and speed up bootstrapping times.
2021-01-26Auto merge of #80692 - Aaron1011:feature/query-result-debug, r=estebankbors-6/+8
Enforce that query results implement Debug Currently, we require that query keys implement `Debug`, but we do not do the same for query values. This can make incremental compilation bugs difficult to debug - there isn't a good place to print out the result loaded from disk. This PR adds `Debug` bounds to several query-related functions, allowing us to debug-print the query value when an 'unstable fingerprint' error occurs. This required adding `#[derive(Debug)]` to a fairly large number of types - hopefully, this doesn't have much of an impact on compiler bootstrapping times.
2021-01-19Auto merge of #80957 - tgnottingham:direct_serialize_depgraph, ↵bors-95/+321
r=michaelwoerister Serialize dependency graph directly from DepGraph Reduce memory usage by serializing dep graph directly from `DepGraph`, rather than copying it into `SerializedDepGraph` and serializing that.
2021-01-16Undo assertion changeAaron Hill-6/+1
2021-01-16Run fmtAaron Hill-3/+8
2021-01-16Print result on unstable fingerprint errorAaron Hill-1/+1
2021-01-16Enforce that query results implement DebugAaron Hill-6/+8
2021-01-14Use Option::map_or instead of `.map(..).unwrap_or(..)`LingMan-1/+1
2021-01-12Serialize dependency graph directly from DepGraphTyson Nottingham-95/+321
Reduce memory usage by serializing dep graph directly from `DepGraph`, rather than copying it into `SerializedDepGraph` and serializing that.
2021-01-08Don't mark `force_query_with_job` as `inline(always)`Joshua Nelson-1/+0
It's rather large, and using `inline(always)` forces it to be recompiled in each calling crate.
2021-01-08Use a side-table of consts instead of matching on the DepKind enum.Camille GILLOT-1/+1
2021-01-08Simplify DepNodeParams.Camille GILLOT-6/+0
2020-12-22rustc_query_system: avoid race condition when using edge_countTyson Nottingham-11/+6
2020-12-22rustc_query_system: add more comments for dependency graphTyson Nottingham-1/+33
2020-12-22rustc_query_system: rename intern_node to intern_new_nodeTyson Nottingham-3/+3
2020-12-22rustc_query_system: remove inline annotation from edge_countTyson Nottingham-1/+0
This isn't called frequently enough to justify inlining.
2020-12-22rustc_query_system: minor cleanupTyson Nottingham-17/+3
Remove effectively unused parameter and delete out of date comment.
2020-12-22rustc_query_system: use more space-efficient edges representationTyson Nottingham-52/+103
Use single vector of edges rather than per-node vector. There is a small hit to instruction counts (< 0.5%), but the memory savings make up for it.
2020-12-22rustc_query_system: share previous graph edges with current graphTyson Nottingham-65/+159
Reduce memory consumption by sharing the previous dependency graph's edges with the current graph when it is known to be valid to do so. It is known to be valid whenever we mark a node green because all of its dependencies were green. It is *not* known to be valid when we mark a node green because we re-executed its query and its result was the same as in the previous compilation session. In that case, the dependency set might have changed (we don't try to determine whether or not it changed and whether or not we can share).
2020-12-22rustc_query_system: share previous graph data with current graphTyson Nottingham-216/+499
Reduce memory consumption by taking advantage of red/green algorithm properties to share the previous dependency graph's node data with the current graph instead of storing node data redundantly. Red nodes can share the `DepNode`, and green nodes can share the `DepNode` and `Fingerprint`. Edges will be shared when possible in a later change.