Open Mercerenies opened 3 years ago
Consider using
(while (if 1 2 3))
as a benchmark, which currently compiles to
while true:
if !2:
break
return null
(Note that the substance of the if
gets optimized out by other passes, but we can't get rid of the compound while yet; that's what this issue is meant to address)
Also consider
(while (and 1 2))
which currently compiles to
while true:
var _cond_0 = null
if !1:
_cond_0 = false
else:
_cond_0 = 2
if !_cond_0:
break
return null
But will hopefully become eligible for this optimization after #26 is resolved.
In the course of performing other optimizations (such as, in particular, #26), it is possible to end up with the following
This can be converted into