The current implementation of copy propagation at word_copy doesn't optimize away multiple Gets from the same stores before a Set as shown in this example
(17 <- HeapLength)
(inst (Arith (Shift Lsl 21 17 1)))
(25 := CurrHeap Add 21)
(inst (Mem Load 29 (Addr 25 0xFFFFFFFFFFFFFFF8)))
(inst (Arith (Binop Add 33 29 (Imm 0x1))))
(37 <- HeapLength)
(inst (Arith (Shift Lsl 41 37 1)))
(45 := CurrHeap Add 41)
(inst (Mem Load 49 (Addr 45 0xFFFFFFFFFFFFFFF8)))
(inst (Arith (Shift Lsl 53 49 2)))
(57 <- HeapLength)
The current implementation allows multiple loads from HeapLength to persist, while these can be changed to Move instead.
The current implementation of copy propagation at
word_copydoesn't optimize away multipleGets from the same stores before aSetas shown in this exampleThe current implementation allows multiple loads from
HeapLengthto persist, while these can be changed toMoveinstead.