mirror of
https://github.com/KarolS/millfork.git
synced 2024-09-13 15:56:42 +00:00
6502: Fix local variable read optimization
This commit is contained in:
parent
492300d298
commit
42ecc574f3
@ -120,7 +120,7 @@ object LocalVariableReadOptimization extends AssemblyOptimization[AssemblyLine]
|
|||||||
|
|
||||||
// TODO: consider handling some more opcodes
|
// TODO: consider handling some more opcodes
|
||||||
case (x@AssemblyLine0(op, Absolute | ZeroPage, MemoryAddressConstant(th)), _) :: xs
|
case (x@AssemblyLine0(op, Absolute | ZeroPage, MemoryAddressConstant(th)), _) :: xs
|
||||||
if OpcodeClasses.ChangesMemoryAlways(op) && map.contains(th.name) =>
|
if (OpcodeClasses.ChangesMemoryAlways(op) || OpcodeClasses.ChangesMemoryIfNotImplied(op)) && map.contains(th.name) =>
|
||||||
x :: optimizeImpl(xs, variables, map - th.name)
|
x :: optimizeImpl(xs, variables, map - th.name)
|
||||||
|
|
||||||
case (x@AssemblyLine0(LABEL, _, _), _) :: xs => x :: optimizeImpl(xs, variables, Map())
|
case (x@AssemblyLine0(LABEL, _, _), _) :: xs => x :: optimizeImpl(xs, variables, Map())
|
||||||
|
Loading…
Reference in New Issue
Block a user