about summary refs log tree commit diff
path: root/compiler/rustc_query_system
AgeCommit message (Collapse)AuthorLines
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.
2020-12-18rustc_query_system: explicitly register reused dep nodesTyson Nottingham-50/+23
Register nodes that we've reused from the previous session explicitly with `OnDiskCache`. Previously, we relied on this happening as a side effect of accessing the nodes in the `PreviousDepGraph`. For the sake of performance and avoiding unintended side effects, register explictily.
2020-12-10Use `def_path_hash_to_def_id` when re-using a `RawDefId`Aaron Hill-2/+2
Fixes #79890 Previously, we just copied a `RawDefId` from the 'old' map to the 'new' map. However, the `RawDefId` for a given `DefPathHash` may be different in the current compilation session. Using `def_path_hash_to_def_id` ensures that the `RawDefId` we use is valid in the current session.
2020-12-04Properly re-use def path hash in incremental modeAaron Hill-19/+58
Fixes #79661 In incremental compilation mode, we update a `DefPathHash -> DefId` mapping every time we create a `DepNode` for a foreign `DefId`. This mapping is written out to the on-disk incremental cache, and is read by the next compilation session to allow us to lazily decode `DefId`s. When we decode a `DepNode` from the current incremental cache, we need to ensure that any previously-recorded `DefPathHash -> DefId` mapping gets recorded in the new mapping that we write out. However, PR #74967 didn't do this in all cases, leading to us being unable to decode a `DefPathHash` in certain circumstances. This PR refactors some of the code around `DepNode` deserialization to prevent this kind of mistake from happening again.
2020-11-25Fix rebase falloutAaron Hill-1/+1
2020-11-25Lazy DefPath decoding for incremental compilationAaron Hill-0/+16
2020-11-21Fix typosDániel Buga-3/+3
2020-11-18Make PackedFingerprint's Fingerprint privateTyson Nottingham-4/+4
2020-11-18Use PackedFingerprint in DepNode to reduce memory consumptionTyson Nottingham-6/+6
2020-10-30Fix even more clippy warningsJoshua Nelson-8/+4
2020-10-22Remove unused ProfileCategory.Camille GILLOT-2/+0
2020-10-22Auto merge of #77871 - Julian-Wollersberger:less-query-context, r=oli-obkbors-156/+195
Make fewer types generic over QueryContext While trying to refactor `rustc_query_system::query::QueryContext` to make it dyn-safe, I noticed some smaller things: * QueryConfig doesn't need to be generic over QueryContext * ~~The `kind` field on QueryJobId is unused~~ * Some unnecessary where clauses * Many types in `job.rs` where generic over `QueryContext` but only needed `QueryContext::Query`. If handle_cycle_error() could be refactored to not take `error: CycleError<CTX::Query>`, all those bounds could be removed as well. Changing `find_cycle_in_stack()` in job.rs to not take a `tcx` argument is the only functional change here. Everything else is just updating type signatures. (aka compile-error driven development ^^) ~~Currently there is a weird bug where memory usage suddenly skyrockets when running UI tests. I'll investigate that tomorrow. A perf run probably won't make sense before that is fixed.~~ EDIT: `kind` actually is used by `Eq`, and re-adding it fixed the memory issue.
2020-10-19Remove <CTX: QueryContext> in a bunch of places.Julian Wollersberger-152/+193
It was only needed by `find_cycle_in_stack()` in job.rs, but needed to be forwarded through dozens of types.
2020-10-14Remove unused code from rustc_query_systemest31-27/+1
2020-10-12Remove generic argument from `QueryConfig`.Julian Wollersberger-4/+2
2020-09-12update the version of itertools and parking_lotAndreas Jonson-1/+1
this is to avoid compiling multiple version of the crates in rustc
2020-08-30mv compiler to compiler/mark-0/+3467