From ee0dbdad35a547d5e2ed05c4dead4ce2b9fe8912 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Fri, 30 Dec 2022 16:45:08 +0100 Subject: [PATCH] don't reshuffle 'start' routine to the top. Fixes zsound examples. --- .../prog8/compiler/astprocessing/StatementReorderer.kt | 9 --------- docs/source/todo.rst | 4 +--- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/compiler/src/prog8/compiler/astprocessing/StatementReorderer.kt b/compiler/src/prog8/compiler/astprocessing/StatementReorderer.kt index 6c850d2e9..32c435428 100644 --- a/compiler/src/prog8/compiler/astprocessing/StatementReorderer.kt +++ b/compiler/src/prog8/compiler/astprocessing/StatementReorderer.kt @@ -127,15 +127,6 @@ internal class StatementReorderer(val program: Program, } override fun before(subroutine: Subroutine, parent: Node): Iterable { - if(subroutine.name=="start" && parent is Block) { - if(parent.statements.asSequence().filterIsInstance().first().name!="start") { - return listOf( - IAstModification.Remove(subroutine, parent), - IAstModification.InsertFirst(subroutine, parent) - ) - } - } - val modifications = mutableListOf() val subs = subroutine.statements.filterIsInstance() diff --git a/docs/source/todo.rst b/docs/source/todo.rst index 8c2196058..3c46b7546 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -3,8 +3,6 @@ TODO For next release ^^^^^^^^^^^^^^^^ -- fix the X16 zsound examples that are broken since 8.8 - ... @@ -26,7 +24,7 @@ Compiler: - ir: mechanism to determine for chunks which registers are getting input values from "outside" - ir: mechanism to determine for chunks which registers are passing values out? (i.e. are used again in another chunk) - ir: peephole opt: renumber registers in chunks to start with 1 again every time (but keep entry values in mind!) -- ir peephole opt: reuse registers in chunks (but keep result registers in mind that pass values out!) +- ir: peephole opt: reuse registers in chunks (but keep result registers in mind that pass values out! and don't renumber registers above SyscallRegisterBase!) - ir: add more optimizations in IRPeepholeOptimizer - vm: somehow be able to load a label address as value? (VmProgramLoader) - 6502 codegen: see if we can let for loops skip the loop if startvar>endvar, without adding a lot of code size/duplicating the loop condition.