[JVM_IR] Avoid safe-call conversions from Byte? and Short? to Int? for

comparisons.

Having those conversions leads to unnecesary boxing and null checks.

This change does it only for JVM in the optimization lowering. It
is unclear to me if the other backends can get away with something
similar.
This commit is contained in:
Mads Ager
2020-05-07 15:09:25 +02:00
committed by Dmitry Petrov
parent 3d5003d476
commit 1f4a3b0d1c
8 changed files with 66 additions and 19 deletions
@@ -1,5 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun testBoolean1(a: Boolean?, b: Boolean) = a == b
fun testBoolean2(a: Boolean?, b: Boolean) = a != b
@@ -1,5 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun testBoolean1(a: Boolean, b: Boolean?) = a == b
fun testBoolean2(a: Boolean, b: Boolean?) = a != b