mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
JVM_IR: defer some branch optimizations to codegen.
Specifically, defer the removal of hand-written "if (true|false)" from JvmBuiltinOptimizationLowering into codegen so that appropriate debug info (and a NOP) can be inserted. Change-Id: Ia11af05ad8b4251946bd3e685fb7c3319f0f433f
This commit is contained in:
committed by
max-kammerer
parent
6bbb0269b1
commit
013ad4b8e4
19
compiler/testData/codegen/bytecodeText/controlStructures/ifConsts.kt
vendored
Normal file
19
compiler/testData/codegen/bytecodeText/controlStructures/ifConsts.kt
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
fun foo(b: Boolean): Int {
|
||||
return if (b) {
|
||||
100
|
||||
} else if (false) {
|
||||
101
|
||||
} else if (true) {
|
||||
102
|
||||
} else if (true) {
|
||||
103
|
||||
} else if (b) {
|
||||
104
|
||||
} else {
|
||||
105
|
||||
}
|
||||
}
|
||||
|
||||
// 2 BIPUSH
|
||||
// 1 BIPUSH 100
|
||||
// 1 BIPUSH 102
|
||||
Reference in New Issue
Block a user