Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a "remove-nonlocal-edges" pass #1234

Open
1 task done
doug-q opened this issue Jun 28, 2024 · 1 comment · May be fixed by #1912
Open
1 task done

Create a "remove-nonlocal-edges" pass #1234

doug-q opened this issue Jun 28, 2024 · 1 comment · May be fixed by #1912

Comments

@doug-q
Copy link
Collaborator

doug-q commented Jun 28, 2024

By "remove" I mean mutate the hugr so that the what was a non-local edge becomes many edges threaded through all container nodes between(in the hierarchy sense) the two nodes.

I expect that for many passes, removing all nonlocal edges would make their implementation simpler.

I have in mind a hugr -> hugr transformation that involves converting a non-linear type into a linear type. Linear types cannot be on non-local edges, so it is natural to run "remove-nonlocal-edges" as the first stage.

Likely a "create-nonlocal-edges" pass that, wherever possible, removes non-linear edges into container nodes, would also be useful. One can construct graphs where nearly all edges are removed by such a pass, making the size of Hugr O(nodes) instead of O(nodes^2) although it's unclear what the gains would be in practise.

It may be worthwhile to create both passes at the same time, since their logic is very similar.

@doug-q
Copy link
Collaborator Author

doug-q commented Jul 25, 2024

Partially address by #1345.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant