rco
rco copied to clipboard
New feature: LICM - Include repeat optimization?
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
}