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

Dead code removal in canonicalizer. #465

Open
Rishav1 opened this issue Jul 5, 2019 · 0 comments
Open

Dead code removal in canonicalizer. #465

Rishav1 opened this issue Jul 5, 2019 · 0 comments

Comments

@Rishav1
Copy link
Contributor

Rishav1 commented Jul 5, 2019

Implement something like Vulture's NodVisitor to detect and purge non-reachable dead code, unused imports and functions. It would prevent generation of unused DAGs in ONNX.

The current canonicalizer translates this code snippet below

def func():
    do_something1()
    return
    do_something2()  # Should be purged from AST as it will never be hit.

to following.

def func():
    returned_value = None
    returned1 = False
    do_something1()
    returned_value = None
    returned1 = True
    if not returned1:
        do_something2()  # This dead code is being processed in Elichika.
    return returned_value

If we implement a dead code removal canonicalizer, the above can be avoided.

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