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

New feature: LICM - Include repeat optimization? #68

Open
jcrodriguez1989 opened this issue Aug 20, 2019 · 0 comments

Comments

@jcrodriguez1989
Copy link
Owner

commented Aug 20, 2019

Since determining the conditional that causes a repeat loop to stop is not that simple, it is not easy to remove invariant variables and place them in an if.

For example, the code:

y <- 1
repeat{
  if (y > 4) {
    break
  }
  x <- 8 * 8
  y <- y + 1
}

Should be optimized to:

y <- 1
if (y <= 4) {
  x <- 8 * 8
}
repeat{
  if (y > 4) {
    break
  }
  y <- y + 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.