JVM_IR generate range loops as counter loops when possible

This commit is contained in:
Dmitry Petrov
2021-07-28 16:21:01 +03:00
committed by teamcityserver
parent d0f207071c
commit 38d6c8ded0
35 changed files with 167 additions and 223 deletions
@@ -6,9 +6,6 @@ fun test(a: Char, b: Char): String {
return s
}
// JVM non-IR uses while.
// JVM IR uses if + do-while.
// 0 iterator
// 0 getStart
// 0 getEnd
@@ -16,11 +13,6 @@ fun test(a: Char, b: Char): String {
// 0 getLast
// 0 getStep
// JVM_TEMPLATES
// 1 IF_ICMPGE
// 0 IF_ICMPLT
// 1 IF
// JVM_IR_TEMPLATES
// 1 IF_ICMPGE
// 1 IF_ICMPLT
// 2 IF
@@ -8,9 +8,6 @@ fun f(a: Char): Int {
return n
}
// JVM non-IR uses while.
// JVM IR uses if + do-while.
// 0 iterator
// 0 getStart
// 0 getEnd
@@ -18,11 +15,6 @@ fun f(a: Char): Int {
// 0 getLast
// 0 getStep
// JVM_TEMPLATES
// 1 IF_ICMPGE
// 0 IF_ICMPLT
// 1 IF
// JVM_IR_TEMPLATES
// 1 IF_ICMPGE
// 1 IF_ICMPLT
// 2 IF
@@ -8,9 +8,6 @@ fun f(a: Char): Int {
return n
}
// JVM non-IR uses while.
// JVM IR uses if + do-while.
// 0 iterator
// 0 getStart
// 0 getEnd
@@ -18,8 +15,5 @@ fun f(a: Char): Int {
// 0 getLast
// 0 getStep
// JVM_TEMPLATES
// 1 IF
// JVM_IR_TEMPLATES
// 2 IF
// 1 IFGE
// 1 IF
@@ -6,9 +6,6 @@ fun test(a: Int, b: Int): Int {
return sum
}
// JVM non-IR uses while.
// JVM IR uses if + do-while.
// 0 iterator
// 0 getStart
// 0 getEnd
@@ -16,11 +13,5 @@ fun test(a: Int, b: Int): Int {
// 0 getLast
// 0 getStep
// JVM_TEMPLATES
// 1 IF_ICMPGE
// 1 IF
// JVM_IR_TEMPLATES
// 1 IF_ICMPGE
// 1 IF_ICMPLT
// 2 IF
@@ -8,9 +8,6 @@ fun f(a: Int): Int {
return n
}
// JVM non-IR uses while.
// JVM IR uses if + do-while.
// 0 iterator
// 0 getStart
// 0 getEnd
@@ -18,11 +15,5 @@ fun f(a: Int): Int {
// 0 getLast
// 0 getStep
// JVM_TEMPLATES
// 1 IF_ICMPGE
// 1 IF
// JVM_IR_TEMPLATES
// 1 IF_ICMPGE
// 1 IF_ICMPLT
// 2 IF
@@ -18,8 +18,5 @@ fun f(a: Int): Int {
// 0 getLast
// 0 getStep
// JVM_TEMPLATES
// 1 IF_ICMPGE
// 1 IF
// JVM_IR_TEMPLATES
// 2 IF
@@ -6,9 +6,6 @@ fun test(a: Long, b: Long): Long {
return sum
}
// JVM non-IR uses while.
// JVM IR uses if + do-while.
// 0 iterator
// 0 getStart
// 0 getEnd
@@ -16,13 +13,6 @@ fun test(a: Long, b: Long): Long {
// 0 getLast
// 0 getStep
// JVM_TEMPLATES
// 1 LCMP
// 1 IFGE
// 1 IF
// JVM_IR_TEMPLATES
// 2 LCMP
// 1 IFGE
// 1 IFLT
// 2 IF
@@ -8,9 +8,6 @@ fun f(a: Long): Int {
return n
}
// JVM non-IR uses while.
// JVM IR uses if + do-while.
// 0 iterator
// 0 getStart
// 0 getEnd
@@ -18,13 +15,6 @@ fun f(a: Long): Int {
// 0 getLast
// 0 getStep
// JVM_TEMPLATES
// 1 LCMP
// 1 IFGE
// 1 IF
// JVM_IR_TEMPLATES
// 2 LCMP
// 1 IFGE
// 1 IFLT
// 2 IF
@@ -8,9 +8,6 @@ fun f(a: Long): Int {
return n
}
// JVM non-IR uses while.
// JVM IR uses if + do-while.
// 0 iterator
// 0 getStart
// 0 getEnd
@@ -18,8 +15,5 @@ fun f(a: Long): Int {
// 0 getLast
// 0 getStep
// JVM_TEMPLATES
// 1 IFGE
// 1 IF
// JVM_IR_TEMPLATES
// 2 IF