Commit 0891cc9
committed
Implement Tarjan's strongly-connected components algorithm
This commit implements [Tarjan's algorithm] for finding strongly-connected
components.
This algorithm takes `O(V+E)` time and uses `O(V+E)` space.
Tarjan's algorithm is usually presented as a recursive algorithm, but we do not
trust the input and cannot recurse over it for fear of blowing the
stack. Therefore, this implementation is iterative.
This will be used to do bottom-up inlining in Wasmtime's compilation
orchestration.
[Tarjan's algorithm]: https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm1 parent 4b51827 commit 0891cc9
File tree
3 files changed
+538
-0
lines changed- cranelift/entity/src
- crates/wasmtime/src
- compile
3 files changed
+538
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
151 | 159 | | |
152 | 160 | | |
153 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
0 commit comments