refactor(codegen-masm): remove petgraph from Linear tactic, add no_std SCC#713
Conversation
bitwalker
left a comment
There was a problem hiding this comment.
Looks great! I'd like to extract the basic digraph data structure so we can use it elsewhere when needed, but we don't need to expand on the APIs you've provided here now. See my other comment for details.
Aside from that, and a few tests to cover the new data structure, it'll be nice to finally close out this issue!
|
|
||
| /// Minimal, no_std-friendly directed graph for `Operand` nodes with SCC computation | ||
| #[derive(Default)] | ||
| struct SimpleDiGraph { |
There was a problem hiding this comment.
I think it'd be worthwhile to extract this to hir/src/adt/digraph.rs, and make it generic over the node type, but only provide an implementation of the graph for node types which implement Hash.
We may have other uses for a basic digraph data structure, so it makes sense to provide a common implementation that we can extend as needed.
Other than that, providing some tests for the provided APIs (namely neighbors_outgoing, reverse, and sccs) and we're good to go!
Thanks for review, ser, i've made corrections |
5b9d3fd to
4432bfe
Compare
bitwalker
left a comment
There was a problem hiding this comment.
Turns out petgraph now supports no-std builds, so I've modified this PR to use that instead, as well as clean up a few other dep-related things I spotted
Thank you very much for your help |
fix #447