JVM_IR: Do not materialize negated boolean for branches.

Instead, flip the branch targets. This generates java byte code
such as:

   L2
    IFNE L3
    ALOAD 0
    INVOKEVIRTUAL A.getX ()F
    GOTO L4
   L3

instead of:

   L2
    IFNE L3
    ICONST_1
    GOTO L4
   L3
    ICONST_0
   L4
    IFEQ L5
    ALOAD 0
    INVOKEVIRTUAL A.getX ()F
    GOTO L6
   L5
This commit is contained in:
Mads Ager
2018-12-21 17:09:05 +01:00
committed by Mikhael Bogdanov
parent 02d9c526e2
commit 864b90f8c0
3 changed files with 18 additions and 4 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
val two = 2
fun test2() {