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

Add a method for deleting multi-return nodes #231

Open
ezyang opened this issue Sep 14, 2017 · 0 comments
Open

Add a method for deleting multi-return nodes #231

ezyang opened this issue Sep 14, 2017 · 0 comments

Comments

@ezyang
Copy link
Owner

ezyang commented Sep 14, 2017

Quote from DCE:

    if (node->hasMultipleOutputs() && allSelectsUnused(node)) {
      auto uses = node->uses(); // A copy so we don't modify it within a range loop
      for (auto & use : uses)
        use.user->destroy();
      it.destroyCurrent();
    } else if (node->uses().size() == 0) {
      it.destroyCurrent();
    } 

This is generally useful functionality and should be put in. Would seriously consider having destroyCurrent() learn this, but I also want to avoid putting too much node specific knowledge in the graph iterator (c.f. #229)

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

No branches or pull requests

1 participant