]> git.lizzy.rs Git - rust.git/commit
rewrite the predecessors code to create a reduced graph
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 31 Jan 2017 09:35:17 +0000 (04:35 -0500)
committerNiko Matsakis <niko@alum.mit.edu>
Tue, 31 Jan 2017 17:07:31 +0000 (12:07 -0500)
commitd848f1d7821a22ec2462e08401f966074041c324
tree54c7e4a4d3b0e9c0862aac598848768656270faa
parent55f9712d14126bce39357e6160a638ce7886e982
rewrite the predecessors code to create a reduced graph

The old code created a flat listing of "HIR -> WorkProduct" edges.
While perfectly general, this could lead to a lot of repetition if the
same HIR nodes affect many work-products. This is set to be a problem
when we start to skip typeck, since we will be adding a lot more
"work-product"-like nodes.

The newer code uses an alternative strategy: it "reduces" the graph
instead. Basically we walk the dep-graph and convert it to a DAG, where
we only keep intermediate nodes if they are used by multiple
work-products.

This DAG does not contain the same set of nodes as the original graph,
but it is guaranteed that (a) every output node is included in the graph
and (b) the set of input nodes that can reach each output node is
unchanged.

(Input nodes are basically HIR nodes and foreign metadata; output nodes
are nodes that have assocaited state which we will persist to disk in
some way. These are assumed to be disjoint sets.)
14 files changed:
src/librustc_incremental/lib.rs
src/librustc_incremental/persist/dirty_clean.rs
src/librustc_incremental/persist/load.rs
src/librustc_incremental/persist/preds.rs [deleted file]
src/librustc_incremental/persist/preds/compress/README.md [new file with mode: 0644]
src/librustc_incremental/persist/preds/compress/classify/mod.rs [new file with mode: 0644]
src/librustc_incremental/persist/preds/compress/classify/test.rs [new file with mode: 0644]
src/librustc_incremental/persist/preds/compress/construct.rs [new file with mode: 0644]
src/librustc_incremental/persist/preds/compress/dag_id.rs [new file with mode: 0644]
src/librustc_incremental/persist/preds/compress/mod.rs [new file with mode: 0644]
src/librustc_incremental/persist/preds/compress/test.rs [new file with mode: 0644]
src/librustc_incremental/persist/preds/compress/test_macro.rs [new file with mode: 0644]
src/librustc_incremental/persist/preds/mod.rs [new file with mode: 0644]
src/librustc_incremental/persist/save.rs