1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-08-12 11:29:20 +00:00

Fix for common index subexpression elimination optimization

This commit is contained in:
Karol Stasiak 2018-02-22 13:36:56 +01:00
parent 9f54a4d111
commit ca6534c3a7

View File

@ -1269,7 +1269,7 @@ object AlwaysGoodOptimizations {
HasOpcodeIn(Set(ADC, ORA, EOR, AND, SBC)) & HasAddrModeIn(Set(Absolute, ZeroPage, Immediate))
val firstFiller = fillerLine.*
val secondFiller = (Elidable & fillerLine).*
val betweenLines = (Linear & Not(secondLoad)).+
val betweenLines = (Linear & Not(secondLoad) & Not(if (targetY) ChangesY else ChangesX)).+
(firstLoad ~ firstFiller ~ firstTransfer).capture(91) ~ betweenLines.capture(95) ~ (secondLoad ~ secondFiller ~ secondTransfer).capture(92) ~ Where(ctx => {
val first = ctx.get[List[AssemblyLine]](91)
val second = ctx.get[List[AssemblyLine]](92)