IR KT-49372 cache progression loop parameters if their values can change
This commit is contained in:
committed by
teamcityserver
parent
7fb82232cd
commit
45a4cea655
@@ -0,0 +1,16 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(): Int {
|
||||
var sum = 0
|
||||
for (i in sum downTo sum) {
|
||||
sum += 1 + i
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val t1 = test()
|
||||
if (t1 != 1) return "Failed: t1=$t1"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -35,8 +35,8 @@ fun box(): String {
|
||||
// 1 IF_ICMPEQ
|
||||
// 1 IFGT
|
||||
// 3 IF
|
||||
// 9 ILOAD
|
||||
// 4 ISTORE
|
||||
// 10 ILOAD
|
||||
// 5 ISTORE
|
||||
// 1 IADD
|
||||
// 0 ISUB
|
||||
// 0 IINC
|
||||
Vendored
+2
-2
@@ -42,8 +42,8 @@ fun box(): String {
|
||||
// 1 IFGE
|
||||
// 7 IF
|
||||
// 1 INEG
|
||||
// 18 ILOAD
|
||||
// 8 ISTORE
|
||||
// 19 ILOAD
|
||||
// 9 ISTORE
|
||||
// 1 IADD
|
||||
// 0 ISUB
|
||||
// 0 IINC
|
||||
+2
-2
@@ -35,8 +35,8 @@ fun box(): String {
|
||||
// 1 IF_ICMPEQ
|
||||
// 2 IFGT
|
||||
// 4 IF
|
||||
// 13 ILOAD
|
||||
// 6 ISTORE
|
||||
// 14 ILOAD
|
||||
// 7 ISTORE
|
||||
// 1 IADD
|
||||
// 0 ISUB
|
||||
// 0 IINC
|
||||
|
||||
Vendored
+2
-2
@@ -42,8 +42,8 @@ fun box(): String {
|
||||
// 1 INEG
|
||||
// 0 INVOKESTATIC kotlin/UInt.constructor-impl
|
||||
// 0 INVOKE\w+ kotlin/UInt.(un)?box-impl
|
||||
// 19 ILOAD
|
||||
// 9 ISTORE
|
||||
// 20 ILOAD
|
||||
// 10 ISTORE
|
||||
// 1 IADD
|
||||
// 0 ISUB
|
||||
// 0 IINC
|
||||
Reference in New Issue
Block a user