JVM_IR generate range-based loop closer to Java counter loop
KT-48435 KT-48507
This commit is contained in:
Vendored
+10
@@ -1,4 +1,14 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun box(): String {
|
||||
for ((i, v) in (7 downTo 4).withIndex()) {
|
||||
}
|
||||
|
||||
Vendored
+10
@@ -1,4 +1,14 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun box(): String {
|
||||
for ((i, v) in listOf(4, 5, 6, 7).indices.withIndex()) {
|
||||
}
|
||||
|
||||
Vendored
+10
@@ -1,4 +1,14 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun box(): String {
|
||||
for ((i, v) in (4..7).withIndex()) {
|
||||
}
|
||||
|
||||
+10
@@ -1,4 +1,14 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun box(): String {
|
||||
for ((i, v) in ((4..11).reversed() step 2).withIndex()) {
|
||||
}
|
||||
|
||||
Vendored
+10
@@ -1,4 +1,14 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun box(): String {
|
||||
for ((i, v) in (4..7).reversed().withIndex()) {
|
||||
}
|
||||
|
||||
+10
@@ -1,4 +1,14 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun box(): String {
|
||||
for ((i, v) in (4..11 step 2).reversed().withIndex()) {
|
||||
}
|
||||
|
||||
Vendored
+10
@@ -1,4 +1,14 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun box(): String {
|
||||
for ((i, v) in (4..11 step 2).withIndex()) {
|
||||
}
|
||||
|
||||
Vendored
+10
@@ -1,4 +1,14 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun box(): String {
|
||||
for ((i, v) in (4 until 8).withIndex()) {
|
||||
}
|
||||
|
||||
+10
@@ -1,4 +1,14 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun box(): String {
|
||||
for ((_, _) in (4..7).withIndex()) {
|
||||
}
|
||||
|
||||
+9
@@ -1,3 +1,12 @@
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun box(): String {
|
||||
for (iv in (4..7).withIndex()) {
|
||||
}
|
||||
|
||||
Vendored
+9
@@ -1,3 +1,12 @@
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun box(): String {
|
||||
for ((i, v) in (4..7).withIndex().reversed()) {
|
||||
}
|
||||
|
||||
Vendored
+10
@@ -1,4 +1,14 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
// IMPORTANT!
|
||||
// Please, when your changes cause failures in bytecodeText tests for 'for' loops,
|
||||
// examine the resulting bytecode shape carefully.
|
||||
// Range and progression-based loops generated with Kotlin compiler should be
|
||||
// as close as possible to Java counter loops ('for (int i = a; i < b; ++i) { ... }').
|
||||
// Otherwise it may result in performance regression due to missing HotSpot optimizations.
|
||||
// Run Kotlin compiler benchmarks (https://github.com/Kotlin/kotlin-benchmarks)
|
||||
// with compiler built from your changes if you are not sure.
|
||||
|
||||
fun box(): String {
|
||||
for ((outer, iv) in (4..7).withIndex().withIndex()) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user