Initial version of RangeContainsLowering, which optimizes calls to

contains() on ClosedRanges.
This commit is contained in:
Mark Punzalan
2020-08-04 23:44:04 -07:00
committed by Alexander Udalov
parent ca541337d1
commit 1c1b1b4b0f
36 changed files with 1194 additions and 57 deletions
@@ -1,11 +1,11 @@
// IGNORE_BACKEND: JVM_IR
// TODO KT-36829 Optimize 'in' expressions in JVM_IR
fun Byte.inByte(left: Byte, right: Byte) = this in left..right
fun Short.inInt(left: Int, right: Int) = this in left .. right
fun Short.inByte(left: Byte, right: Byte) = this in left..right
fun inChar(x: Char, left: Char, right: Char) = x in left..right
fun inInt(x: Int, left: Int, right: Int) = x in left..right
fun inDouble(x: Double, left: Double, right: Double) = x in left..right
@@ -23,3 +23,4 @@ fun inCharWithNullableParameter(x: Char?, left: Char, right: Char) = x!! in left
// 0 CHECKCAST
// 0 INVOKEINTERFACE
// 0 <init>
// 0 contains