Use while loop for progressions that cannot overflow (instead of

do-while with enclosing "not empty" check).

Also do not add additional "not empty" condition for `until` loops when
the given bound is a constant != MIN_VALUE.
This commit is contained in:
Mark Punzalan
2019-03-29 10:33:30 -07:00
committed by max-kammerer
parent ba0e016c4e
commit 7680e7fd56
25 changed files with 403 additions and 94 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun test(): Int {
var sum = 0
for (i in 4 downTo 1) {
@@ -12,5 +11,4 @@ fun test(): Int {
// 0 getEnd
// 0 getFirst
// 0 getLast
// 0 IF_ICMPEQ
// 1 IF_ICMPLT
// 1 IF_ICMP