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

drop unused assignemnts #52

Open
Constellation opened this issue Oct 14, 2012 · 2 comments
Open

drop unused assignemnts #52

Constellation opened this issue Oct 14, 2012 · 2 comments

Comments

@Constellation
Copy link
Member

Drop unused assignments

function test() {
  var i;
  i = 20;
}

to

function test() {
  var i;
  20;
}

and then

function test() {
  var i;
}

and finally

function test() { }
@Constellation
Copy link
Member Author

My model is following.

  • construct CFG
  • assign variable slots to basic block
  • numbering assigned variable (SSA-like)
  • track numbered definition and when use-list is empty, we can remove this definition

@Constellation
Copy link
Member Author

We can start it with simple case.
If complicated pattern is found (such as try-catch-finally), we can give up constructing CFG on this function, like optimizing compiler does.

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

No branches or pull requests

1 participant