about summary refs log tree commit diff
path: root/src/librustc_data_structures/graph
AgeCommit message (Collapse)AuthorLines
2018-07-13nit: s/successor/successors/Niko Matsakis-2/+2
2018-07-13compute region values using SCCs not iterative flowNiko Matsakis-0/+5
The strategy is this: - we compute SCCs once all outlives constraints are known - we allocate a set of values **per region** for storing liveness - we allocate a set of values **per SCC** for storing the final values - when we add a liveness constraint to the region R, we also add it to the final value of the SCC to which R belongs - then we can apply the constraints by just walking the DAG for the SCCs and union'ing the children (which have their liveness constraints within) There are a few intermediate refactorings that I really ought to have broken out into their own commits: - reverse the constraint graph so that `R1: R2` means `R1 -> R2` and not `R2 -> R1`. This fits better with the SCC computation and new style of inference (`->` now means "take value from" and not "push value into") - this does affect some of the UI tests, since they traverse the graph, but mostly the artificial ones and they don't necessarily seem worse - put some things (constraint set, etc) into `Rc`. This lets us root them to permit mutation and iteration. It also guarantees they don't change, which is critical to the correctness of the algorithm. - Generalize various helpers that previously operated only on points to work on any sort of region element.
2018-07-12introduce a generic SCC computationNiko Matsakis-3/+531
2018-07-12rename `control_flow_graph` to `graph`Niko Matsakis-0/+1103
2018-07-12rename `graph` to `control_flow_graph::implementation`Niko Matsakis-556/+0
2018-03-20Implement some trivial size_hints for various iteratorsPhlosioneer-0/+13
This also implements ExactSizeIterator where applicable. Addresses most of the Iterator traits mentioned in #23708.
2018-03-07Run rustfmt on `src/librustc_data_structures/graph/mod.rs`.Corey Farwell-24/+29
2018-03-07Replace iterator structures with `impl Trait`.Corey Farwell-77/+25
2017-10-09Refactor to use `debug_struct` in several Debug implsMalo Jaffré-13/+2
Fixes #44771.
2017-09-14rustc: Preallocate when building the dep graphAlex Crichton-0/+7
This commit alters the `query` function in the dep graph module to preallocate memory using `with_capacity` instead of relying on automatic growth. Discovered in #44576 it was found that for the syntex_syntax clean incremental benchmark the peak memory usage was found when the dep graph was being saved, particularly the `DepGraphQuery` data structure itself. PRs like #44142 which add more queries end up just making this much larger! I didn't see an immediately obvious way to reduce the size of the `DepGraphQuery` object, but it turns out that `with_capacity` helps quite a bit! Locally 831 MB was used [before] this commit, and 770 MB is in use at the peak of the compiler [after] this commit. That's a nice 7.5% improvement! This won't quite make up for the losses in #44142 but I figured it's a good start. [before]: https://gist.github.com/alexcrichton/2d2b9c7a65503761925c5a0bcfeb0d1e [before]: https://gist.github.com/alexcrichton/6da51f2a6184bfb81694cc44f06deb5b
2017-08-19rustc: Remove some dead codeVadim Petrochenkov-190/+0
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-11/+11
Like #43008 (f668999), but _much more aggressive_.
2017-08-07rustc::middle::dataflow - visit the CFG in RPOAriel Ben-Yehuda-0/+79
We used to propagate bits in node-id order, which sometimes caused an excessive number of iterations, especially when macros were present. As everyone knows, visiting the CFG in RPO bounds the number of iterators by 1 plus the depth of the most deeply nested loop (times the height of the lattice, which is 1). Fixes #43704.
2016-12-15Warn unused type aliasesSeo Sanghyeon-2/+0
2016-11-02Added Graph::is_cyclicic_node algorithmHavvy-15/+82
2016-11-02Change Make comment into doc comment on Graph::iterate_until_fixed_pointHavvy-8/+5
2016-11-02Added general iterators for graph nodes and edgesHavvy-4/+44
Also used those general iterators in other methods.
2016-11-01Normalize generic bounds in graph iteratorsHavvy-3/+6
Use where clasues and only where clauses for bounds in the iterators for Graph. The rest of the code uses bounds on the generic declarations for Debug, and we may want to change those to for consistency. I did not do that here because I don't know whether or not that's a good idea. But for the iterators, they were inconsistent causing confusion, at least for me.
2016-10-20run rustfmt on graph folderSrinivas Reddy Thatiparthy-2/+2
2016-08-09isolate predecessor computationNiko Matsakis-18/+44
The new `Predecessors` type computes a set of interesting targets and their HIR predecessors, and discards everything in between.
2016-05-18identify inputs of `MetaData(X)` nodesNiko Matsakis-4/+10
Generate a second hash file that contains the metadata for an X node.
2016-03-05adopt new header style to sidestep rust-lang-nursery/rustfmt#836Niko Matsakis-12/+6
2016-03-05apply rustfmt to librustc_data_structures, correcting ↵Niko Matsakis-72/+86
rust-lang-nursery/rustfmt#836
2016-02-18Remove unnecessary explicit lifetime bounds.Corey Farwell-10/+10
These explicit lifetimes can be ommitted because of lifetime elision rules. Instances were found using rust-clippy.
2016-01-05Introduce the DepGraph and DepTracking map abstractions,Niko Matsakis-3/+11
along with a README explaining how they are to be used
2015-09-06add a few accessors to GraphNiko Matsakis-0/+10
2015-06-19Expand the "givens" set to cover transitive relations. The givens arrayNiko Matsakis-3/+3
stores relationships like `'c <= '0` (where `'c` is a free region and `'0` is an inference variable) that are derived from closure arguments. These are (rather hackily) ignored for purposes of inference, preventing spurious errors. The current code did not handle transitive cases like `'c <= '0` and `'0 <= '1`. Fixes #24085.
2015-04-24Change name of unit test sub-module to "tests".Johannes Oertel-1/+1
Changes the style guidelines regarding unit tests to recommend using a sub-module named "tests" instead of "test" for unit tests as "test" might clash with imports of libtest.
2015-04-17Add licenses.Niko Matsakis-0/+10
2015-04-17Port to using the newer graph, which offers iterators instead of theNiko Matsakis-0/+532
older `each` method, but is otherwise identical.