<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_data_structures/src/graph, branch 1.53.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.53.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.53.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2021-02-10T08:20:41+00:00</updated>
<entry>
<title>Only initialize what is used</title>
<updated>2021-02-10T08:20:41+00:00</updated>
<author>
<name>Dániel Buga</name>
<email>bugadani@gmail.com</email>
</author>
<published>2021-01-17T19:20:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3c1d792f498ae40eb759d4554540a94612a3df55'/>
<id>urn:sha1:3c1d792f498ae40eb759d4554540a94612a3df55</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Clean up dominators_given_rpo</title>
<updated>2021-01-24T12:32:18+00:00</updated>
<author>
<name>Dániel Buga</name>
<email>bugadani@gmail.com</email>
</author>
<published>2021-01-24T12:32:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f8416faaaf3a1fb6ca57ff8f0b3bdf972eed266f'/>
<id>urn:sha1:f8416faaaf3a1fb6ca57ff8f0b3bdf972eed266f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>don't redundantly repeat field names</title>
<updated>2020-12-29T21:26:58+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2020-12-29T21:02:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0c3af22e08124a371b182bfec94437d447e15810'/>
<id>urn:sha1:0c3af22e08124a371b182bfec94437d447e15810</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Switch compiler/ to intra-doc links</title>
<updated>2020-12-18T20:22:51+00:00</updated>
<author>
<name>Joshua Nelson</name>
<email>jyn514@gmail.com</email>
</author>
<published>2020-12-01T22:41:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=35f16c60e7d3fd1b42c90a0fc084689c817345cb'/>
<id>urn:sha1:35f16c60e7d3fd1b42c90a0fc084689c817345cb</id>
<content type='text'>
rustc_lint and rustc_lint_defs weren't switched because they're included
in the compiler book and so can't use intra-doc links.
</content>
</entry>
<entry>
<title>Auto merge of #78588 - HeroicKatora:sccc, r=nikomatsakis</title>
<updated>2020-11-21T01:30:26+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2020-11-21T01:30:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8cfa7b4ec9d314a412f79c1748bd2dfa7575b2e3'/>
<id>urn:sha1:8cfa7b4ec9d314a412f79c1748bd2dfa7575b2e3</id>
<content type='text'>
Reworks Sccc computation to iteration instead of recursion

Linear graphs, producing as many scc's as nodes, would recurse once for every node when entered from the start of the list. This adds a test that exhausted the stack at least on my machine with error:

```
thread 'graph::scc::tests::test_deep_linear' has overflowed its stack
fatal runtime error: stack overflow
```

This may or may not be connected to #78567. I was only reminded that I started this rework some time ago. It might be plausible as borrow checking a long function with many borrow regions around each other—((((((…))))))— may produce the linear list setup to trigger this stack overflow ? I don't know enough about borrow check to say for sure.

This is best read in two separate commits. The first addresses only `find_state` internally. This is classical union phase from union-find. There's also a common solution of using the parent pointers in the (virtual) linked list to track the backreferences while traversing upwards and then following them backwards in a second path compression phase.

The second is more involved as it rewrites the mutually recursive `walk_node` and `walk_unvisited_node`. Firstly, the caller is required to handle the unvisited case of `walk_node` so a new `start_walk_from` method is added to handle that by walking the unvisited node if necessary. Then `walk_unvisited_node`, where we would previously recurse into in the missing case, is rewritten to construct a manual stack of its frames. The state fields consist of the previous stack slots.
</content>
</entry>
<entry>
<title>Remove recursion from sccc walking</title>
<updated>2020-11-08T17:07:45+00:00</updated>
<author>
<name>Andreas Molzer</name>
<email>andreas.molzer@gmx.de</email>
</author>
<published>2020-10-30T22:12:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=eb597f5c4e258563cac1a957ae348f7c24cb0734'/>
<id>urn:sha1:eb597f5c4e258563cac1a957ae348f7c24cb0734</id>
<content type='text'>
This allows constructing the sccc for large that visit many nodes before
finding a single cycle of sccc, for example lists. When used to find
dependencies in borrow checking the list case is what occurs in very
long functions.
</content>
</entry>
<entry>
<title>Add test for sccc of a long list</title>
<updated>2020-11-05T18:24:49+00:00</updated>
<author>
<name>Andreas Molzer</name>
<email>andreas.molzer@gmx.de</email>
</author>
<published>2020-10-30T23:43:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=355904dca086675b1c3dac25e8c0410f27f80a6d'/>
<id>urn:sha1:355904dca086675b1c3dac25e8c0410f27f80a6d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Convert the recursive find_state to a loop</title>
<updated>2020-11-05T18:24:49+00:00</updated>
<author>
<name>Andreas Molzer</name>
<email>andreas.molzer@gmx.de</email>
</author>
<published>2019-05-22T23:00:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a41e2fd963915c940a46a67825ec053afb004f87'/>
<id>urn:sha1:a41e2fd963915c940a46a67825ec053afb004f87</id>
<content type='text'>
The basic conversion is a straightforward conversion of the linear
recursion to a loop forwards and backwards propagation of the result.
But this uses an optimization to avoid the need for extra space that
would otherwise be necessary to store the stack of unfinished states as
the function is not tail recursive.

Observe that only non-root-nodes in cycles have a recursive call and
that every such call overwrites their own node state. Thus we reuse the
node state itself as temporary storage for the stack of unfinished
states by inverting the links to a chain back to the previous state
update. When we hit the root or end of the full explored chain we
propagate the node state update backwards by following the chain until
a node with a link to itself.
</content>
</entry>
<entry>
<title>Move post order walk to iterative approach</title>
<updated>2020-10-31T17:52:00+00:00</updated>
<author>
<name>Andreas Molzer</name>
<email>andreas.molzer@gmx.de</email>
</author>
<published>2020-10-31T16:56:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=af72a70ee27faa85522f7656e042c85ab1ee275e'/>
<id>urn:sha1:af72a70ee27faa85522f7656e042c85ab1ee275e</id>
<content type='text'>
The previous recursive approach might overflow the stack when walking a
particularly deep, list-like, graph. In particular, dominator
calculation for borrow checking does such a traversal and very long
functions might lead to a region dependency graph with in this
problematic structure.
</content>
</entry>
<entry>
<title>Add a benchmark test for sccc finding</title>
<updated>2020-10-31T00:05:15+00:00</updated>
<author>
<name>Andreas Molzer</name>
<email>andreas.molzer@gmx.de</email>
</author>
<published>2019-05-22T23:00:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4fdf8a5630a621c44a0928a1e30d881b0e00022b'/>
<id>urn:sha1:4fdf8a5630a621c44a0928a1e30d881b0e00022b</id>
<content type='text'>
While a bit primitive, it should get us at least a better number than
nothing.
</content>
</entry>
</feed>
