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

Introducing the dead code elimination phase #6

Open
takagi opened this issue Feb 28, 2015 · 2 comments
Open

Introducing the dead code elimination phase #6

takagi opened this issue Feb 28, 2015 · 2 comments

Comments

@takagi
Copy link
Owner

takagi commented Feb 28, 2015

The dead code elimination phase is to be introduced within the compiler phases for optimization.

@takagi takagi changed the title Introducing the unused definition elimination phase Introducing the dead code elimination phase Mar 6, 2015
@takagi
Copy link
Owner Author

takagi commented Mar 6, 2015

For now, dead code elimination is introduced on 5e41949 and b7dde69.

This eliminates the following kinds of dead codes:

  • local function definitions
  • variable definitions
  • top-level function definitions

Currently, top-level functions' dead code elimination is imcomplete because indirect dead codes are not eliminated. For example, foo, called by bar that is not called anywhere, is not eliminated.

foo -> bar -> x

Currently the following forms are supposed to be with side effects:

  • SETREG forms
  • function applications (because no ways to know if being with side effects)

@takagi
Copy link
Owner Author

takagi commented Mar 8, 2015

Now, on ad6f4e5, indirectly dead codes in top-level function definitions are eliminated.

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