Generate better code for branches based on comparisons.

For comparison intrinsics and for instanceof checks, make
it possible to get the the stack value produced and branch
on that directly instead of materializing a boolean to
branch on from it.

That reduces code such as

```
    IF_CMPEQ L1
    CONST_0
    GOTO L2
L1: CONST_1
L2: IFEQ L3
```

to just one IF_CMP instruction.
This commit is contained in:
Mads Ager
2019-02-08 11:04:13 +01:00
committed by max-kammerer
parent 7d2c59fb70
commit 057bdb3954
10 changed files with 96 additions and 36 deletions

View File

@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun test(x: String?) {
if (x !is String) return