mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
Using basic constant propagation (only integer constants, no arithmetic calculations), rewrite conditional jump instructions with constant arguments. This covers problem description in KT-17007. Note that it also works transparently with inline functions. Partial evaluation is required to cover more "advanced" cases. As a side effect, this also covers KT-3098: rewrite IF_ICMP<cmp_op>(x, 0) to IF<cmp0_op>(x).
9 lines
226 B
Kotlin
Vendored
9 lines
226 B
Kotlin
Vendored
fun testLt(x: String, y: String) = x < y
|
|
fun testLe(x: String, y: String) = x <= y
|
|
fun testGt(x: String, y: String) = x > y
|
|
fun testGe(x: String, y: String) = x >= y
|
|
|
|
// 0 IF_ICMPGE
|
|
// 0 IF_ICMPGT
|
|
// 0 IF_ICMPLE
|
|
// 0 IF_ICMPLT |