mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 00:21:26 +00:00
Simplify some basic instructions using peephole optimization
DUP_X1; POP = SWAP p1_a; p1_b; SWAP = p1_b; p1_a where p1_a, p1_b are instructions without side effects pushing value of size 1 on stack. E.g.: ACONST_NULL; ALOAD 0; SWAP = ALOAD 0; ACONST_NULL NOP; NOP = NOP
This commit is contained in:
@@ -3,8 +3,5 @@
|
||||
fun testPrimitiveArray(ints: IntArray) =
|
||||
10 in ints.indices
|
||||
|
||||
// We currently fail to optimize this method because of DUP_X1 instruction generated for range check.
|
||||
// TODO either don't generate DUP_X1/DUP2_X2 instructions for range checks (extra local variable + extra instructions),
|
||||
// or support DUPn_Xm instructions in PopBackwardPropagationTransformer
|
||||
// - 0 DUP
|
||||
// - 0 POP
|
||||
// 0 DUP
|
||||
// 0 POP
|
||||
Reference in New Issue
Block a user