From be18a84d98bd79f3b8d847f34ad204b73e43c0b1 Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Wed, 22 Aug 2018 01:42:00 +0200 Subject: [PATCH] Working loop unrolling! There are probably still a lot of non-working cases - and the lack of loop unroll limit will definitely cause infinite loops. --- .../java/dk/camelot64/kickc/CompileLog.java | 13 +- .../java/dk/camelot64/kickc/Compiler.java | 72 +- .../kickc/model/statements/Statement.java | 6 +- .../kickc/model/statements/StatementBase.java | 5 + .../camelot64/kickc/model/symbols/Scope.java | 2 +- .../passes/Pass2EliminateUnusedBlocks.java | 8 + .../kickc/passes/Pass2LoopAnalysis.java | 4 +- .../kickc/passes/Pass2LoopUnroll.java | 364 ++- .../passes/Pass2LoopUnrollPhiPrepare.java | 92 +- .../passes/Pass3BlockSequencePlanner.java | 5 +- .../dk/camelot64/kickc/test/TestPrograms.java | 14 +- .../kickc/test/kc/unroll-loop-modifyvar.kc | 13 + .../kickc/test/kc/unroll-screenfill-for.kc | 13 + .../kickc/test/kc/unroll-screenfill-while.kc | 13 + .../kickc/test/kc/unroll-screenfill.kc | 35 - .../dk/camelot64/kickc/test/ref/loop100.asm | 12 + .../dk/camelot64/kickc/test/ref/loop100.cfg | 20 + .../dk/camelot64/kickc/test/ref/loop100.log | 346 +++ .../dk/camelot64/kickc/test/ref/loop100.sym | 11 + .../kickc/test/ref/unroll-loop-modifyvar.asm | 32 + .../kickc/test/ref/unroll-loop-modifyvar.cfg | 51 + .../kickc/test/ref/unroll-loop-modifyvar.log | 920 +++++++ .../kickc/test/ref/unroll-loop-modifyvar.sym | 21 + .../kickc/test/ref/unroll-screenfill-for.asm | 63 + .../kickc/test/ref/unroll-screenfill-for.cfg | 97 + .../kickc/test/ref/unroll-screenfill-for.log | 2061 ++++++++++++++++ .../kickc/test/ref/unroll-screenfill-for.sym | 40 + .../test/ref/unroll-screenfill-while.asm | 63 + .../test/ref/unroll-screenfill-while.cfg | 97 + .../test/ref/unroll-screenfill-while.log | 2158 +++++++++++++++++ .../test/ref/unroll-screenfill-while.sym | 40 + .../kickc/test/ref/unusedblockproblem.asm | 10 + .../kickc/test/ref/unusedblockproblem.cfg | 15 + .../kickc/test/ref/unusedblockproblem.log | 357 +++ .../kickc/test/ref/unusedblockproblem.sym | 9 + 35 files changed, 6887 insertions(+), 195 deletions(-) create mode 100644 src/test/java/dk/camelot64/kickc/test/kc/unroll-loop-modifyvar.kc create mode 100644 src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill-for.kc create mode 100644 src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill-while.kc delete mode 100644 src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill.kc create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/loop100.asm create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/loop100.cfg create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/loop100.log create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/loop100.sym create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.asm create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.cfg create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.log create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.sym create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.asm create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.cfg create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.log create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.sym create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.asm create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.cfg create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.log create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.sym create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.asm create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.cfg create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.log create mode 100644 src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.sym diff --git a/src/main/java/dk/camelot64/kickc/CompileLog.java b/src/main/java/dk/camelot64/kickc/CompileLog.java index 93d70fcdf..ce7564b07 100644 --- a/src/main/java/dk/camelot64/kickc/CompileLog.java +++ b/src/main/java/dk/camelot64/kickc/CompileLog.java @@ -30,12 +30,17 @@ public class CompileLog { /** * Should SSA optimization be verbose. */ - private boolean verboseSSAOptimize = true; + private boolean verboseSSAOptimize = false; + + /** + * Should SSA optimization be verbose. + */ + private boolean verboseLoopUnroll = false; /** * Should the log be output to System.out while being built */ - private boolean sysOut = true; + private boolean sysOut = false; public CompileLog() { this.log = new StringBuilder(); @@ -93,6 +98,10 @@ public class CompileLog { this.verboseSSAOptimize = verboseSSAOptimize; } + public boolean isVerboseLoopUnroll() { + return verboseLoopUnroll; + } + public boolean isSysOut() { return sysOut; } diff --git a/src/main/java/dk/camelot64/kickc/Compiler.java b/src/main/java/dk/camelot64/kickc/Compiler.java index 2f38a8dfe..97fe39bd1 100644 --- a/src/main/java/dk/camelot64/kickc/Compiler.java +++ b/src/main/java/dk/camelot64/kickc/Compiler.java @@ -1,6 +1,8 @@ package dk.camelot64.kickc; -import dk.camelot64.kickc.model.*; +import dk.camelot64.kickc.model.CompileError; +import dk.camelot64.kickc.model.Program; +import dk.camelot64.kickc.model.StatementSequence; import dk.camelot64.kickc.model.statements.StatementCall; import dk.camelot64.kickc.model.statements.StatementSource; import dk.camelot64.kickc.model.symbols.Variable; @@ -37,7 +39,7 @@ public class Compiler { } final CharStream fileStream = CharStreams.fromPath(file.toPath()); imported.add(file.getAbsolutePath()); - program.getLog().append("PARSING " + file.getPath().replace("\\","/")); + program.getLog().append("PARSING " + file.getPath().replace("\\", "/")); program.getLog().append(fileStream.toString()); KickCLexer lexer = new KickCLexer(fileStream); KickCParser parser = new KickCParser(new CommonTokenStream(lexer)); @@ -93,7 +95,7 @@ public class Compiler { program.setStatementSequence(sequence); pass1GenerateSSA(); - pass2OptimizeSSA(); + pass2Optimize(); pass2UnrollLoops(); pass2InlineConstants(); pass3Analysis(); @@ -184,7 +186,7 @@ public class Compiler { } } - private void pass2OptimizeSSA() { + private void pass2Optimize() { List optimizations = new ArrayList<>(); optimizations.add(new Pass2CullEmptyBlocks(program)); optimizations.add(new Pass2UnaryNotSimplification(program)); @@ -203,19 +205,10 @@ public class Compiler { optimizations.add(new Pass2NopCastElimination(program)); optimizations.add(new Pass2EliminateUnusedBlocks(program)); optimizations.add(new Pass2RangeResolving(program)); - pass2OptimizeSSA(optimizations); - + pass2Execute(optimizations); } private void pass2UnrollLoops() { - getLog().append("CONTROL FLOW GRAPH BEFORE UNROLLING"); - getLog().append(program.getGraph().toString(program)); - - new Pass2DominatorsAnalysis(program).step(); - getLog().append("NATURAL LOOPS"); - new Pass2LoopAnalysis(program).step(); - getLog().append(program.getLoopSet().toString()); - List loopUnrolling = new ArrayList<>(); loopUnrolling.add(new PassNStatementIndices(program)); loopUnrolling.add(new PassNVariableReferenceInfos(program)); @@ -224,7 +217,21 @@ public class Compiler { loopUnrolling.add(new Pass2LoopAnalysis(program)); loopUnrolling.add(new Pass2LoopUnrollPhiPrepare(program)); loopUnrolling.add(new Pass2LoopUnroll(program)); - pass2OptimizeSSA(loopUnrolling); + + boolean unrolled; + do { + unrolled = pass2ExecuteOnce(loopUnrolling); + if(unrolled) { + + if(getLog().isVerboseLoopUnroll()) { + getLog().append("UNROLLED CONTROL FLOW GRAPH"); + getLog().append(program.getGraph().toString(program)); + } + pass2Optimize(); + new Pass3BlockSequencePlanner(program).plan(); + } + } while(unrolled); + } private void pass2InlineConstants() { @@ -235,10 +242,15 @@ public class Compiler { constantOptimizations.add(new Pass2ConstantIdentification(program)); constantOptimizations.add(new Pass2ConstantAdditionElimination(program)); constantOptimizations.add(new Pass2ConstantIfs(program)); - pass2OptimizeSSA(constantOptimizations); + pass2Execute(constantOptimizations); } - private void pass2OptimizeSSA(List optimizations) { + /** + * Execute optimization steps repeatedly until none of them performs an optimization anymore + * + * @param optimizations The optimizations to repeat + */ + private void pass2Execute(List optimizations) { getLog().append("OPTIMIZING CONTROL FLOW GRAPH"); boolean ssaOptimized = true; while(ssaOptimized) { @@ -261,6 +273,29 @@ public class Compiler { } } + /** + * Repeat a set of optimizations steps once each. + * + * @param optimizations The optimizations + * @return true if any step performed an optimization + */ + private boolean pass2ExecuteOnce(List optimizations) { + boolean ssaOptimized = false; + for(Pass2SsaOptimization optimization : optimizations) { + pass2AssertSSA(); + boolean stepOptimized = optimization.step(); + if(stepOptimized) { + getLog().append("Successful SSA optimization " + optimization.getClass().getSimpleName() + ""); + ssaOptimized = true; + if(getLog().isVerboseSSAOptimize()) { + getLog().append("CONTROL FLOW GRAPH"); + getLog().append(program.getGraph().toString(program)); + } + } + } + return ssaOptimized; + } + private void pass3Analysis() { new Pass3AssertRValues(program).check(); @@ -321,7 +356,10 @@ public class Compiler { getLog().append(program.getDominators().toString()); getLog().append("NATURAL LOOPS"); + boolean wasVerbose = getLog().isVerboseSSAOptimize(); + getLog().setVerboseSSAOptimize(true); new Pass2LoopAnalysis(program).step(); + getLog().setVerboseSSAOptimize(wasVerbose); getLog().append(program.getLoopSet().toString()); getLog().append("NATURAL LOOPS WITH DEPTH"); diff --git a/src/main/java/dk/camelot64/kickc/model/statements/Statement.java b/src/main/java/dk/camelot64/kickc/model/statements/Statement.java index 6c1f74c79..6bf5d4dc0 100644 --- a/src/main/java/dk/camelot64/kickc/model/statements/Statement.java +++ b/src/main/java/dk/camelot64/kickc/model/statements/Statement.java @@ -18,8 +18,12 @@ public interface Statement { void setIndex(Integer idx); /** - * Get the source for the statement* + * Get the source for the statement */ StatementSource getSource(); + /** + * Set the source for the statement + */ + void setSource(StatementSource source); } diff --git a/src/main/java/dk/camelot64/kickc/model/statements/StatementBase.java b/src/main/java/dk/camelot64/kickc/model/statements/StatementBase.java index cc88eeb9c..5aaebc66d 100644 --- a/src/main/java/dk/camelot64/kickc/model/statements/StatementBase.java +++ b/src/main/java/dk/camelot64/kickc/model/statements/StatementBase.java @@ -26,6 +26,11 @@ public abstract class StatementBase implements Statement { return source; } + @Override + public void setSource(StatementSource source) { + this.source = source; + } + @Override public Integer getIndex() { return index; diff --git a/src/main/java/dk/camelot64/kickc/model/symbols/Scope.java b/src/main/java/dk/camelot64/kickc/model/symbols/Scope.java index c1f03d8b9..268d42561 100644 --- a/src/main/java/dk/camelot64/kickc/model/symbols/Scope.java +++ b/src/main/java/dk/camelot64/kickc/model/symbols/Scope.java @@ -263,7 +263,7 @@ public abstract class Scope implements Symbol { } public Label getLabel(String name) { - return (Label) symbols.get(name); + return (Label) getSymbol(name); } public Label getLabel(LabelRef labelRef) { diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass2EliminateUnusedBlocks.java b/src/main/java/dk/camelot64/kickc/passes/Pass2EliminateUnusedBlocks.java index d55f623e2..da8058146 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass2EliminateUnusedBlocks.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass2EliminateUnusedBlocks.java @@ -41,6 +41,14 @@ public class Pass2EliminateUnusedBlocks extends Pass2SsaOptimization { Variable variable = getScope().getVariable((VariableRef) lValue); variable.getScope().remove(variable); } + } else if(stmt instanceof StatementPhiBlock) { + for(StatementPhiBlock.PhiVariable phiVariable : ((StatementPhiBlock) stmt).getPhiVariables()) { + VariableRef phiVar = phiVariable.getVariable(); + getLog().append("Eliminating variable " + phiVar.toString(getProgram()) + " from unused block " + block.getLabel()); + Variable variable = getScope().getVariable(phiVar); + variable.getScope().remove(variable); + + } } } } diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass2LoopAnalysis.java b/src/main/java/dk/camelot64/kickc/passes/Pass2LoopAnalysis.java index 0a9b012a9..bdaab9ab5 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass2LoopAnalysis.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass2LoopAnalysis.java @@ -99,7 +99,9 @@ public class Pass2LoopAnalysis extends Pass2SsaOptimization { loop.addTails(other.getTails()); loop.addBlocks(other.getBlocks()); loopSet.remove(other); - getLog().append("Coalesced: " + loop.toString()); + if(getLog().isVerboseSSAOptimize()) { + getLog().append("Coalesced: " + loop.toString()); + } return true; } } diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass2LoopUnroll.java b/src/main/java/dk/camelot64/kickc/passes/Pass2LoopUnroll.java index 58d80d9d8..68fd8d858 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass2LoopUnroll.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass2LoopUnroll.java @@ -1,15 +1,14 @@ package dk.camelot64.kickc.passes; import dk.camelot64.kickc.model.*; -import dk.camelot64.kickc.model.statements.Statement; -import dk.camelot64.kickc.model.statements.StatementConditionalJump; -import dk.camelot64.kickc.model.statements.StatementPhiBlock; +import dk.camelot64.kickc.model.iterator.ProgramValue; +import dk.camelot64.kickc.model.iterator.ProgramValueIterator; +import dk.camelot64.kickc.model.statements.*; import dk.camelot64.kickc.model.symbols.Label; +import dk.camelot64.kickc.model.symbols.Scope; import dk.camelot64.kickc.model.symbols.Variable; import dk.camelot64.kickc.model.symbols.VariableVersion; -import dk.camelot64.kickc.model.values.LabelRef; -import dk.camelot64.kickc.model.values.RValue; -import dk.camelot64.kickc.model.values.VariableRef; +import dk.camelot64.kickc.model.values.*; import java.util.*; @@ -23,80 +22,295 @@ public class Pass2LoopUnroll extends Pass2SsaOptimization { @Override public boolean step() { // Look for loops to unroll - NaturalLoopSet loops = getProgram().getLoopSet(); - List unrollLoopCandidates = findUnrollLoopCandidates(getProgram(), loops); + List unrollLoops = findUnrollLoops(getProgram()); // Is there any unrolling to do? - if(unrollLoopCandidates.isEmpty()) { + if(unrollLoops.isEmpty()) { return false; } // Choose the candidate loop with the fewest blocks (and if several have the same number of blocks the first one encountered) - NaturalLoop unrollLoop = chooseUnrollLoop(unrollLoopCandidates); + NaturalLoop unrollLoop = chooseUnrollLoop(unrollLoops); getLog().append("Unrolling loop " + unrollLoop); // Unroll the first iteration of the loop // 0. Unroll Symbols // - Create new versions of all symbols assigned inside the loop - Map definedToNewVar = new LinkedHashMap<>(); - for(VariableRef definedVarRef : getVarsDefinedInLoop(getProgram(), unrollLoop)) { - Variable definedVar = getScope().getVariable(definedVarRef); - Variable newVar; - if(definedVarRef.isIntermediate()) { - newVar = definedVar.getScope().addVariableIntermediate(); - } else if(definedVarRef.isVersion()) { - newVar = ((VariableVersion) definedVar).getVersionOf().createVersion(); - } else { - throw new RuntimeException("Error! Variable is not versioned or intermediate " + definedVar.toString(getProgram())); - } - definedToNewVar.put(definedVarRef, newVar.getRef()); - getLog().append("Defined in loop: " + definedVarRef.getFullName() + " -> " + newVar.getRef().getFullName()); - } + Map definedToNewVar = copyVarsDefinedInLoop(unrollLoop); + + // - Create new labels for all blocks in the loop + Map blockToNewBlock = copyBlocksInLoop(unrollLoop); // 1. Copy all loop blocks to create the "rest of the loop" and modifying the existing loop to only be the first iteration) // - Unroll Statements (copy all statements, replace symbols properly (with the new versions / the versions assigned in the existing loop) // - Includes unrolling PHI-statements properly // - Unroll Successors (loop-exit successors should point to the same exit, loop-internal successors should point to the new loop-internal block) for(ControlFlowBlock block : unrollLoop.getBlocks(getGraph())) { - // Find the serial number - int unrollSerial = 1; - String unrollLabelName = block.getLabel() + "_" + unrollSerial; - while(getScope().getLabel(unrollLabelName) != null) { - unrollSerial++; - } - // Create a label - Label unrollLabel = getScope().getScope(block.getScope()).addLabel(unrollLabelName); // Create the new block - ControlFlowBlock unrollBlock = new ControlFlowBlock(unrollLabel.getRef(), block.getScope()); - getProgram().getGraph().addBlock(unrollBlock); + LabelRef newBlockLabel = unrollLabel(block.getLabel(), blockToNewBlock); + ControlFlowBlock newBlock = new ControlFlowBlock(newBlockLabel, block.getScope()); + getProgram().getGraph().addBlock(newBlock); + for(Statement statement : block.getStatements()) { + Statement newStatement = unrollStatement(statement, unrollLoop, blockToNewBlock, definedToNewVar); + newBlock.addStatement(newStatement); + if(newStatement instanceof StatementConditionalJump) { + newBlock.setConditionalSuccessor(((StatementConditionalJump) newStatement).getDestination()); + } + } + newBlock.setDefaultSuccessor(unrollLabel(block.getDefaultSuccessor(), blockToNewBlock)); + } + + // Patch the "old loop" to only contain the first iteration + for(ControlFlowBlock block : unrollLoop.getBlocks(getGraph())) { + // - All successors in the old loop to the loop head should point to the new loop head instead. + + // If the successor is the loop head then update to the new copied loop head instead + block.setDefaultSuccessor(fixSuccessor(block.getDefaultSuccessor(), blockToNewBlock, unrollLoop)); + for(Statement statement : block.getStatements()) { if(statement instanceof StatementPhiBlock) { - StatementPhiBlock phiBlock = (StatementPhiBlock) statement; - StatementPhiBlock unrollPhiBlock = new StatementPhiBlock(); - for(StatementPhiBlock.PhiVariable phiVariable : phiBlock.getPhiVariables()) { - VariableRef phiVar = phiVariable.getVariable(); - VariableRef newVar = definedToNewVar.get(phiVar); - StatementPhiBlock.PhiVariable unrollPhiVariable = unrollPhiBlock.addPhiVariable(newVar); - for(StatementPhiBlock.PhiRValue phiRValue : phiVariable.getValues()) { - /* FIX */ - LabelRef predecessor = phiRValue.getPredecessor(); - /* FIX */ - RValue rValue = phiRValue.getrValue(); - unrollPhiVariable.setrValue(predecessor, rValue); + // - Remove phi-variables in the old head from looping. (as this predecessor now no longer exists) + for(StatementPhiBlock.PhiVariable phiVariable : ((StatementPhiBlock) statement).getPhiVariables()) { + List phiVariableValues = phiVariable.getValues(); + ListIterator phiRValueListIterator = phiVariableValues.listIterator(); + while(phiRValueListIterator.hasNext()) { + StatementPhiBlock.PhiRValue phiRValue = phiRValueListIterator.next(); + if(unrollLoop.getBlocks().contains(phiRValue.getPredecessor())) { + // Found predecessor inside the same loop - remove it! + phiRValueListIterator.remove(); + } } } - } else { - throw new RuntimeException("Statement not handled by unroll " + statement); + } else if(statement instanceof StatementConditionalJump) { + // - Remove the "unroll" directive on the condition in the old loop (as it is already unrolled). + // TODO: Only remove "unroll" from the conditional that represents the loop we are unrolling + StatementConditionalJump conditionalJump = (StatementConditionalJump) statement; + conditionalJump.setDeclaredUnroll(false); + // Fix the destination (if needed)! + LabelRef fixedDestination = fixSuccessor(conditionalJump.getDestination(), blockToNewBlock, unrollLoop); + conditionalJump.setDestination(fixedDestination); + block.setConditionalSuccessor(fixedDestination); } } } - // Patch the "old loop" to only contain the first iteration - // - All successors in the old loop to the loop head should point to the new loop head instead. - // - Remove phi-variables in the old head from looping. (as this predecessor now no longer exists) - // - Remove the "unroll" directive on the condition in the old loop (as it is already unrolled). + // Update phi-blocks in loop successors to also include the new unrolled "rest" loop + List loopSuccessorBlocks = getLoopSuccessorBlocks(unrollLoop, getGraph()); + for(LoopSuccessorBlock loopSuccessorBlock : loopSuccessorBlocks) { + ControlFlowBlock successorBlock = getGraph().getBlock(loopSuccessorBlock.successor); + StatementPhiBlock phiBlock = successorBlock.getPhiBlock(); + for(StatementPhiBlock.PhiVariable phiVariable : phiBlock.getPhiVariables()) { + for(StatementPhiBlock.PhiRValue phiRValue : phiVariable.getValues()) { + if(unrollLoop.getBlocks().contains(phiRValue.getPredecessor())) { + // Found a phi variable with values from the poriginal loop in a loop successor block + // Add another value when entering from the unrolled loop + phiVariable.setrValue(unrollLabel(phiRValue.getPredecessor(), blockToNewBlock), unrollValue(phiRValue.getrValue(), definedToNewVar)); + break; + } + } + } + } - return false; + return true; + } + /** + * Fix a successor block in the original loop (that is now only the first iteration). + * + * @param successor The successor + * @param blockToNewBlock The map from loop blocks to the corresponding unrolled "rest" loop blocks. + * @param unrollLoop The loop being unrolled + * @return The fixed successor label + */ + private LabelRef fixSuccessor(LabelRef successor, Map blockToNewBlock, NaturalLoop unrollLoop) { + LabelRef fixed; + if(unrollLoop.getHead().equals(successor)) { + fixed = blockToNewBlock.get(successor); + } else { + fixed = successor; + } + return fixed; + } + + /** + * Unroll a single statement inside a loop. + * Copy the statement, replace symbols properly (with the new versions if needed). This includes unrolling loop PHI-statements properly + * Unroll Successors (loop-exit successors should point to the same exit, loop-internal successors should point to the new loop-internal block) + * + * @param statement The statement to unroll + * @param unrollLoop The loop being unrolled + * @param blockToNewBlock Map from loop block label to the label of the copied block in the new (rest) loop + * @param definedToNewVar Map from variables defined in the loop to the copied variable in the new (rest) loop + * @return The copied & unrolled statement + */ + private Statement unrollStatement(Statement statement, NaturalLoop unrollLoop, Map blockToNewBlock, Map definedToNewVar) { + if(statement instanceof StatementPhiBlock) { + StatementPhiBlock phiBlock = (StatementPhiBlock) statement; + StatementPhiBlock newPhiBlock = new StatementPhiBlock(); + for(StatementPhiBlock.PhiVariable phiVariable : phiBlock.getPhiVariables()) { + VariableRef phiVar = phiVariable.getVariable(); + VariableRef newVar = definedToNewVar.get(phiVar); + StatementPhiBlock.PhiVariable newPhiVariable = newPhiBlock.addPhiVariable(newVar); + for(StatementPhiBlock.PhiRValue phiRValue : phiVariable.getValues()) { + LabelRef predecessor = phiRValue.getPredecessor(); + if(unrollLoop.getBlocks().contains(predecessor)) { + // Predecessor inside the loop - create two copies (one from the original loop block and onw from the new copy) + // Entering from iteration 1 use the original value from iteration 1 + RValue rValue = copyValue(phiRValue.getrValue()); + newPhiVariable.setrValue(predecessor, rValue); + // Entering from the new rest-of-loop block perform a mapping replacing all references to variables inside the loop to the new versions. + RValue rValueNew = unrollValue(phiRValue.getrValue(), definedToNewVar); + newPhiVariable.setrValue(unrollLabel(predecessor, blockToNewBlock), rValueNew); + } else { + // Predecessor outside loop - do not copy since all entry to the copy of the loop will be through the first iteration + } + } + } + return newPhiBlock; + } else if(statement instanceof StatementAssignment) { + StatementAssignment assignment = (StatementAssignment) statement; + return new StatementAssignment( + (LValue) unrollValue(assignment.getlValue(), definedToNewVar), + unrollValue(assignment.getrValue1(), definedToNewVar), + assignment.getOperator(), + unrollValue(assignment.getrValue2(), definedToNewVar), + assignment.getSource() + ); + } else if(statement instanceof StatementConditionalJump) { + StatementConditionalJump conditional = (StatementConditionalJump) statement; + LabelRef labelRef = conditional.getDestination(); + StatementConditionalJump newConditional = new StatementConditionalJump( + unrollValue(conditional.getrValue1(), definedToNewVar), + conditional.getOperator(), + unrollValue(conditional.getrValue2(), definedToNewVar), + unrollLabel(labelRef, blockToNewBlock), + conditional.getSource() + ); + newConditional.setDeclaredUnroll(conditional.isDeclaredUnroll()); + return newConditional; + } else { + throw new RuntimeException("Statement not handled by unroll " + statement); + } + } + + /** + * If the passed label is from the original loop return the corresponding label from the unrolled "rest" loop + * Otherwise the passed label is returned. + * + * @param labelRef The label + * @param blockToNewBlock Maps labels from the original loop to the new labels in the unrolled "rest" loop. + * @return The label to use in the unrolled loop + */ + private LabelRef unrollLabel(LabelRef labelRef, Map blockToNewBlock) { + LabelRef unrolledLabel = blockToNewBlock.get(labelRef); + if(unrolledLabel == null) { + return labelRef; + } else { + return unrolledLabel; + } + } + + /** + * Update all variable references in an RValue that point to variables inside the loop to the new unrolled "rest" loop. + * + * @param rValue The rValue to update + * @param definedToNewVar Map from variables defined in the original loop to the variables in the new unrolled "rest" loop + * @return A copy of the RValue with all relevant variable sreferences updated + */ + private RValue unrollValue(RValue rValue, Map definedToNewVar) { + if(rValue == null) return null; + RValue rValueCopy = copyValue(rValue); + ProgramValue.GenericValue genericValue = new ProgramValue.GenericValue(rValueCopy); + ProgramValueIterator.execute(genericValue, (programValue, currentStmt, stmtIt, currentBlock) -> { + RValue rVal = programValue.get(); + if(rVal instanceof VariableRef) { + if(definedToNewVar.get(rVal) != null) { + programValue.set(definedToNewVar.get(rVal)); + } + } + }, null, null, null); + return genericValue.get(); + } + + /** + * Create a copy of the passed value object (to avoid that two parts of the model points to the same object). + * + * @param rValue The value to copy + * @return An exact copy of the value + */ + private RValue copyValue(RValue rValue) { + if(rValue == null) return null; + ProgramValue.GenericValue genericValue = new ProgramValue.GenericValue(rValue); + ProgramValueIterator.execute(genericValue, (programValue, currentStmt, stmtIt, currentBlock) -> { + RValue rVal = programValue.get(); + if(rVal instanceof PointerDereferenceSimple) { + programValue.set(new PointerDereferenceSimple(((PointerDereferenceSimple) rVal).getPointer())); + } else if(rVal instanceof PointerDereferenceIndexed) { + programValue.set(new PointerDereferenceIndexed(((PointerDereferenceIndexed) rVal).getPointer(), ((PointerDereferenceIndexed) rVal).getIndex())); + } else if(rVal instanceof CastValue) { + programValue.set(new CastValue(((CastValue) rVal).getToType(), ((CastValue) rVal).getValue())); + } else if(rVal instanceof ValueList) { + programValue.set(new ValueList(new ArrayList<>(((ValueList) rVal).getList()))); + } + }, null, null, null); + return genericValue.get(); + } + + /** + * Copy all blocks in a loop. The new copies are named from the original name plus an integer suffix. + * + * @param unrollLoop The loop being copied + * @return A map from each block label (from the loop) to the new copied labels + */ + private Map copyBlocksInLoop(NaturalLoop unrollLoop) { + LinkedHashMap blockToNewBlock = new LinkedHashMap<>(); + for(ControlFlowBlock block : unrollLoop.getBlocks(getGraph())) { + Scope blockScope = getScope().getScope(block.getScope()); + // Find the serial number + int unrollSerial = 1; + String localName = block.getLabel().getLocalName(); + int serialPos = localName.lastIndexOf("_"); + if(serialPos>=0) { + localName = localName.substring(0, serialPos); + } + + String unrollLabelName; + do { + unrollLabelName = localName + "_" + unrollSerial++; + } while(blockScope.getLabel(unrollLabelName) != null); + // Create a label + Label unrollLabel = blockScope.addLabel(unrollLabelName); + blockToNewBlock.put(block.getLabel(), unrollLabel.getRef()); + } + return blockToNewBlock; + } + + /** + * Create new versions of all symbols assigned inside the loop + * + * @param unrollLoop The loop being unrolled + * @return A map from variables assigned inside the loop to the new copy of the variable + */ + private Map copyVarsDefinedInLoop(NaturalLoop unrollLoop) { + Map definedToNewVar = new LinkedHashMap<>(); + for(VariableRef definedVarRef : getVarsDefinedInLoop(unrollLoop, getProgram())) { + Variable definedVar = getScope().getVariable(definedVarRef); + Variable newVar; + if(definedVarRef.isIntermediate()) { + newVar = definedVar.getScope().addVariableIntermediate(); + newVar.setType(definedVar.getType()); + newVar.setDeclaredRegister(definedVar.getDeclaredRegister()); + newVar.setDeclaredVolatile(definedVar.isDeclaredVolatile()); + newVar.setDeclaredAlignment(definedVar.getDeclaredAlignment()); + newVar.setInferredType(definedVar.isInferredType()); + } else if(definedVarRef.isVersion()) { + newVar = ((VariableVersion) definedVar).getVersionOf().createVersion(); + } else { + throw new RuntimeException("Error! Variable is not versioned or intermediate " + definedVar.toString(getProgram())); + } + definedToNewVar.put(definedVarRef, newVar.getRef()); + //getLog().append("Defined in loop: " + definedVarRef.getFullName() + " -> " + newVar.getRef().getFullName()); + } + return definedToNewVar; } /** @@ -104,10 +318,10 @@ public class Pass2LoopUnroll extends Pass2SsaOptimization { * The smallest loop (fewest control flow blocks) is chosen. * If multiple loops have the same size the first one is chosen. * - * @param unrollLoopCandidates All loops that are decalred to be unrolled + * @param unrollLoopCandidates All loops that are declared to be unrolled * @return The loop to unroll first. */ - private NaturalLoop chooseUnrollLoop(List unrollLoopCandidates) { + private static NaturalLoop chooseUnrollLoop(List unrollLoopCandidates) { NaturalLoop unrollLoop = null; for(NaturalLoop unrollLoopCandidate : unrollLoopCandidates) { if(unrollLoop == null) { @@ -121,14 +335,14 @@ public class Pass2LoopUnroll extends Pass2SsaOptimization { return unrollLoop; } - /** * Find all loops declared for unrolling. This is done by examining all conditional jumps, which hold the loop unroll declaration. * - * @param loops All loops identified in the program + * @param program The program * @return All loops declared to be unrolled */ - static List findUnrollLoopCandidates(Program program, NaturalLoopSet loops) { + static List findUnrollLoops(Program program) { + NaturalLoopSet loops = program.getLoopSet(); List unrollLoopCandidates = new ArrayList<>(); for(ControlFlowBlock block : program.getGraph().getAllBlocks()) { for(Statement statement : block.getStatements()) { @@ -155,11 +369,12 @@ public class Pass2LoopUnroll extends Pass2SsaOptimization { /** * Get all variables defined inside a loop - * @param program The program + * * @param loop The loop + * @param program The program * @return All variables defined inside the blocks of the loop */ - static List getVarsDefinedInLoop(Program program, NaturalLoop loop) { + static List getVarsDefinedInLoop(NaturalLoop loop, Program program) { VariableReferenceInfos variableReferenceInfos = program.getVariableReferenceInfos(); List definedInLoop = new ArrayList<>(); for(ControlFlowBlock block : loop.getBlocks(program.getGraph())) { @@ -173,23 +388,24 @@ public class Pass2LoopUnroll extends Pass2SsaOptimization { return definedInLoop; } - /** Information about a block successing a loop - ie. a place where the flow of control leaves a loop. */ + /** Information about a block succeeding a loop - ie. a place where the flow of control leaves a loop. */ public static class LoopSuccessorBlock { - /** A block that is the sucessor to a block inside the loop. */ - LabelRef sucessor; - /** The block inside the loop that is the predecessor of the loop sucessor block. */ + /** A block that is the successor to a block inside the loop. */ + LabelRef successor; + /** The block inside the loop that is the predecessor of the loop successor block. */ LabelRef predecessor; - public LoopSuccessorBlock(LabelRef sucessor, LabelRef predecessor) { - this.sucessor = sucessor; + public LoopSuccessorBlock(LabelRef successor, LabelRef predecessor) { + this.successor = successor; this.predecessor = predecessor; } } /** * Find all transitions where the flow of control leaves a loop + * * @param loop The loop to examine - * @param graph The control flow graph + * @param graph The control flow graph * @return */ static List getLoopSuccessorBlocks(NaturalLoop loop, ControlFlowGraph graph) { @@ -207,5 +423,19 @@ public class Pass2LoopUnroll extends Pass2SsaOptimization { return loopSuccessors; } + static boolean isReferencedOutsideLoop(VariableRef definedVarRef, NaturalLoop unrollLoop, Program program) { + boolean referencedOutsideLoop = false; + VariableReferenceInfos variableReferenceInfos = program.getVariableReferenceInfos(); + Collection varRefStatements = variableReferenceInfos.getVarRefStatements(definedVarRef); + for(Integer varRefStatement : varRefStatements) { + StatementInfos statementInfos = program.getStatementInfos(); + ControlFlowBlock refBlock = statementInfos.getBlock(varRefStatement); + if(!unrollLoop.getBlocks().contains(refBlock.getLabel())) { + referencedOutsideLoop = true; + break; + } + } + return referencedOutsideLoop; + } } diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass2LoopUnrollPhiPrepare.java b/src/main/java/dk/camelot64/kickc/passes/Pass2LoopUnrollPhiPrepare.java index 0ce84db18..79a21e799 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass2LoopUnrollPhiPrepare.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass2LoopUnrollPhiPrepare.java @@ -1,8 +1,9 @@ package dk.camelot64.kickc.passes; -import dk.camelot64.kickc.model.*; +import dk.camelot64.kickc.model.ControlFlowBlock; +import dk.camelot64.kickc.model.NaturalLoop; +import dk.camelot64.kickc.model.Program; import dk.camelot64.kickc.model.iterator.ProgramValueIterator; -import dk.camelot64.kickc.model.statements.StatementInfos; import dk.camelot64.kickc.model.statements.StatementPhiBlock; import dk.camelot64.kickc.model.symbols.Variable; import dk.camelot64.kickc.model.symbols.VariableVersion; @@ -11,13 +12,11 @@ import dk.camelot64.kickc.model.values.RValue; import dk.camelot64.kickc.model.values.SymbolRef; import dk.camelot64.kickc.model.values.VariableRef; -import java.util.Collection; import java.util.LinkedHashMap; -import java.util.List; /** * Prepare for unrolling loops declared as inline. - * This is done byensuring that all variables defined inside the loops and used outside the loop is passed through a PHI-functions + * This is done by ensuring that all variables defined inside the loops and used outside the loop is passed through a PHI-functions * upon loop exit thus ensuring that these variables are only used inside the loop and in the PHI-function. * This makes it much easier to perform the unrolling as only a few parts of the program must be modified. */ @@ -30,82 +29,45 @@ public class Pass2LoopUnrollPhiPrepare extends Pass2SsaOptimization { @Override public boolean step() { // Look for loops to unroll - NaturalLoopSet loops = getProgram().getLoopSet(); - List unrollLoopCandidates = Pass2LoopUnroll.findUnrollLoopCandidates(getProgram(), loops); - // Is there any unrolling to do? - if(unrollLoopCandidates.isEmpty()) { - return false; - } - - - for(NaturalLoop unrollLoop : unrollLoopCandidates) { - - List definedInLoop = Pass2LoopUnroll.getVarsDefinedInLoop(getProgram(), unrollLoop); + for(NaturalLoop unrollLoop : Pass2LoopUnroll.findUnrollLoops(getProgram())) { // - Ensure that all variables assigned inside the loop has a PHI in successor blocks to the loop - // - Find loop successor blocks - List loopSuccessors = Pass2LoopUnroll.getLoopSuccessorBlocks(unrollLoop, getGraph()); - // - Add any needed PHI-statements to the successors - for(VariableRef definedVarRef : definedInLoop) { + for(VariableRef definedVarRef : Pass2LoopUnroll.getVarsDefinedInLoop(unrollLoop, getProgram())) { // Find out if the variable is ever referenced outside the loop - if(isReferencedOutsideLoop(definedVarRef, unrollLoop, getProgram())) { - for(Pass2LoopUnroll.LoopSuccessorBlock loopSuccessor : loopSuccessors) { - LabelRef successorBlockRef = loopSuccessor.sucessor; + if(Pass2LoopUnroll.isReferencedOutsideLoop(definedVarRef, unrollLoop, getProgram())) { + // - Add any needed PHI-statements to the successors + for(Pass2LoopUnroll.LoopSuccessorBlock loopSuccessor : Pass2LoopUnroll.getLoopSuccessorBlocks(unrollLoop, getGraph())) { + + LabelRef successorBlockRef = loopSuccessor.successor; LabelRef successorPredecessorRef = loopSuccessor.predecessor; ControlFlowBlock successorBlock = getGraph().getBlock(successorBlockRef); StatementPhiBlock phiBlock = successorBlock.getPhiBlock(); - // Look for a phi-variable - boolean phiFound = false; - for(StatementPhiBlock.PhiVariable phiVariable : phiBlock.getPhiVariables()) { - if(phiVariable.getVariable().isVersion() && definedVarRef.isVersion()) { - if(phiVariable.getVariable().getFullNameUnversioned().equals(definedVarRef.getFullNameUnversioned())) { - phiFound = true; + // Create a new version of the variable + Variable definedVar = getScope().getVariable(definedVarRef); + Variable newVar = ((VariableVersion) definedVar).getVersionOf().createVersion(); + + // Replace all references outside the loop to the new version! + LinkedHashMap aliases = new LinkedHashMap<>(); + aliases.put(definedVarRef, newVar.getRef()); + ProgramValueIterator.execute(getProgram(), (programValue, currentStmt, stmtIt, currentBlock) -> { + if(currentBlock != null) { + if(!unrollLoop.getBlocks().contains(currentBlock.getLabel())) { + new AliasReplacer(aliases).execute(programValue, currentStmt, stmtIt, currentBlock); } } - } - if(!phiFound) { - Variable definedVar = getScope().getVariable(definedVarRef); - Variable newVar = ((VariableVersion) definedVar).getVersionOf().createVersion(); + }); - // Replace all references to definedVarRef outside loop to newVar! - LinkedHashMap aliases = new LinkedHashMap<>(); - aliases.put(definedVarRef, newVar.getRef()); - ProgramValueIterator.execute(getProgram(), (programValue, currentStmt, stmtIt, currentBlock) -> { - if(currentBlock != null) { - if(!unrollLoop.getBlocks().contains(currentBlock.getLabel())) { - new AliasReplacer(aliases).execute(programValue, currentStmt, stmtIt, currentBlock); - } - } - }); + // Create the new phi-variable in the successor phi block + StatementPhiBlock.PhiVariable newPhiVar = phiBlock.addPhiVariable(newVar.getRef()); + newPhiVar.setrValue(successorPredecessorRef, definedVarRef); + getLog().append("Creating PHI for " + definedVarRef.getFullName() + " in block " + successorBlock.getLabel() + " - " + phiBlock.toString(getProgram(), false)); - // Create the new phi-variable - StatementPhiBlock.PhiVariable newPhiVar = phiBlock.addPhiVariable(newVar.getRef()); - newPhiVar.setrValue(successorPredecessorRef, definedVarRef); - getLog().append("Creating PHI for " + definedVarRef.getFullName() + " in block " + successorBlock.getLabel() + " - " + phiBlock.toString(getProgram(), false)); - - } } } } } - getLog().append(getGraph().toString(getProgram())); return false; } - private static boolean isReferencedOutsideLoop(VariableRef definedVarRef, NaturalLoop unrollLoop, Program program) { - boolean referencedOutsideLoop = false; - VariableReferenceInfos variableReferenceInfos = program.getVariableReferenceInfos(); - Collection varRefStatements = variableReferenceInfos.getVarRefStatements(definedVarRef); - for(Integer varRefStatement : varRefStatements) { - StatementInfos statementInfos = program.getStatementInfos(); - ControlFlowBlock refBlock = statementInfos.getBlock(varRefStatement); - if(!unrollLoop.getBlocks().contains(refBlock.getLabel())) { - referencedOutsideLoop = true; - break; - } - } - return referencedOutsideLoop; - } - } diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass3BlockSequencePlanner.java b/src/main/java/dk/camelot64/kickc/passes/Pass3BlockSequencePlanner.java index 8436ecc35..9a2626c25 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass3BlockSequencePlanner.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass3BlockSequencePlanner.java @@ -1,18 +1,15 @@ package dk.camelot64.kickc.passes; import dk.camelot64.kickc.model.ControlFlowBlock; -import dk.camelot64.kickc.model.symbols.Label; -import dk.camelot64.kickc.model.symbols.Procedure; -import dk.camelot64.kickc.model.values.LabelRef; import dk.camelot64.kickc.model.Program; import dk.camelot64.kickc.model.symbols.Scope; +import dk.camelot64.kickc.model.values.LabelRef; import java.util.*; /** Plan the optimal sequence for the blocks of the control flow graph */ public class Pass3BlockSequencePlanner extends Pass2Base { - Deque todoScopes = new ArrayDeque<>(); public Pass3BlockSequencePlanner(Program program) { diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index 2c4db87ae..734f88ee2 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -52,8 +52,18 @@ public class TestPrograms { } @Test - public void testUnrollScreenFill() throws IOException, URISyntaxException { - compileAndCompare("unroll-screenfill"); + public void testUnrollScreenFillFor() throws IOException, URISyntaxException { + compileAndCompare("unroll-screenfill-for"); + } + + @Test + public void testUnrollScreenFillWhile() throws IOException, URISyntaxException { + compileAndCompare("unroll-screenfill-while"); + } + + @Test + public void testUnrollModifyVar() throws IOException, URISyntaxException { + compileAndCompare("unroll-loop-modifyvar"); } @Test diff --git a/src/test/java/dk/camelot64/kickc/test/kc/unroll-loop-modifyvar.kc b/src/test/java/dk/camelot64/kickc/test/kc/unroll-loop-modifyvar.kc new file mode 100644 index 000000000..65458cba4 --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/kc/unroll-loop-modifyvar.kc @@ -0,0 +1,13 @@ +// An unrolled loop modifying a var used later + +void main() { + byte* SCREEN = $400; + + byte a=3; + inline do { + SCREEN[a]=a; + a++; + } while(a<14); + SCREEN[a]=a; + +} \ No newline at end of file diff --git a/src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill-for.kc b/src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill-for.kc new file mode 100644 index 000000000..2a8b0b32d --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill-for.kc @@ -0,0 +1,13 @@ +// Fills the screen using an unrolled inner ranged for()-loop + +void main() { + byte* SCREEN = $400; + + for(byte x: 0..39) { + inline for(byte line: 0..24) { + (SCREEN+line*40)[x] = x; + } + + } + +} \ No newline at end of file diff --git a/src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill-while.kc b/src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill-while.kc new file mode 100644 index 000000000..b860a5e6b --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill-while.kc @@ -0,0 +1,13 @@ +// Fills the screen using an unrolled inner while()-loop + +void main() { + byte* SCREEN = $400; + for(byte x: 0..39) { + byte line = 0; + inline while(line!=25) { + (SCREEN+line*40)[x] = x; + line++; + } + } + +} \ No newline at end of file diff --git a/src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill.kc b/src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill.kc deleted file mode 100644 index 6acb5333c..000000000 --- a/src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill.kc +++ /dev/null @@ -1,35 +0,0 @@ -// Fills the screen using an unrolled inner loop - -void main() { - byte* SCREEN = $400; - - byte a=3; - inline do { - SCREEN[a]=a; - a++; - } while(a<14); - SCREEN[a]=a; - - - -/* - for(byte x: 0..39) { - - inline for(byte line: 0..24) { - (SCREEN+line*40)[x] = x; - } - - } - */ - -/* - for(byte x: 0..39) { - byte line = 0; - inline while(line!=25 || x<10) { - (SCREEN+line*40)[x] = x; - line++; - } - } - */ - -} \ No newline at end of file diff --git a/src/test/java/dk/camelot64/kickc/test/ref/loop100.asm b/src/test/java/dk/camelot64/kickc/test/ref/loop100.asm new file mode 100644 index 000000000..33ca02a8b --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/loop100.asm @@ -0,0 +1,12 @@ +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + jsr main +main: { + ldx #0 + b1: + inx + cpx #$64 + bcc b1 + rts +} diff --git a/src/test/java/dk/camelot64/kickc/test/ref/loop100.cfg b/src/test/java/dk/camelot64/kickc/test/ref/loop100.cfg new file mode 100644 index 000000000..45ce2ac86 --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/loop100.cfg @@ -0,0 +1,20 @@ +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@1 +@1: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main [ ] ( ) + to:@end +@end: scope:[] from @1 + [3] phi() [ ] ( ) +main: scope:[main] from @1 + [4] phi() [ ] ( main:2 [ ] ) + to:main::@1 +main::@1: scope:[main] from main main::@1 + [5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte) main::i#1 ) [ main::i#2 ] ( main:2 [ main::i#2 ] ) + [6] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] ) + [7] if((byte) main::i#1<(byte/signed byte/word/signed word/dword/signed dword) 100) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) + to:main::@return +main::@return: scope:[main] from main::@1 + [8] return [ ] ( main:2 [ ] ) + to:@return diff --git a/src/test/java/dk/camelot64/kickc/test/ref/loop100.log b/src/test/java/dk/camelot64/kickc/test/ref/loop100.log new file mode 100644 index 000000000..022174d77 --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/loop100.log @@ -0,0 +1,346 @@ +PARSING src/test/java/dk/camelot64/kickc/test/kc/loop100.kc + +void main() { + for(byte i=0; i<100; i++) { } +} +Adding pre/post-modifier (byte) main::i ← ++ (byte) main::i +SYMBOLS +(label) @1 +(label) @begin +(label) @end +(void()) main() +(bool~) main::$0 +(label) main::@1 +(label) main::@2 +(label) main::@return +(byte) main::i + +INITIAL CONTROL FLOW GRAPH +@begin: scope:[] from + to:@1 +main: scope:[main] from + (byte) main::i ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:main::@1 +main::@1: scope:[main] from main main::@1 + (byte) main::i ← ++ (byte) main::i + (bool~) main::$0 ← (byte) main::i < (byte/signed byte/word/signed word/dword/signed dword) 100 + if((bool~) main::$0) goto main::@1 + to:main::@2 +main::@2: scope:[main] from main::@1 + to:main::@return +main::@return: scope:[main] from main::@2 + return + to:@return +@1: scope:[] from @begin + call main + to:@end +@end: scope:[] from @1 + +Removing empty block main::@2 +PROCEDURE MODIFY VARIABLE ANALYSIS + +Completing Phi functions... + +CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN +@begin: scope:[] from + to:@1 +main: scope:[main] from @1 + (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:main::@1 +main::@1: scope:[main] from main main::@1 + (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) + (byte) main::i#1 ← ++ (byte) main::i#2 + (bool~) main::$0 ← (byte) main::i#1 < (byte/signed byte/word/signed word/dword/signed dword) 100 + if((bool~) main::$0) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@1 + return + to:@return +@1: scope:[] from @begin + call main + to:@2 +@2: scope:[] from @1 + to:@end +@end: scope:[] from @2 + +SYMBOL TABLE SSA +(label) @1 +(label) @2 +(label) @begin +(label) @end +(void()) main() +(bool~) main::$0 +(label) main::@1 +(label) main::@return +(byte) main::i +(byte) main::i#0 +(byte) main::i#1 +(byte) main::i#2 + +OPTIMIZING CONTROL FLOW GRAPH +Culled Empty Block (label) @2 +Succesful SSA optimization Pass2CullEmptyBlocks +Simple Condition (bool~) main::$0 if((byte) main::i#1<(byte/signed byte/word/signed word/dword/signed dword) 100) goto main::@1 +Succesful SSA optimization Pass2ConditionalJumpSimplification +Constant (const byte) main::i#0 = 0 +Succesful SSA optimization Pass2ConstantIdentification +OPTIMIZING CONTROL FLOW GRAPH +Inlining constant with var siblings (const byte) main::i#0 +Inlining constant with var siblings (const byte) main::i#0 +Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 +Succesful SSA optimization Pass2ConstantInlining +Block Sequence Planned @begin @1 @end main main::@1 main::@return +Added new block during phi lifting main::@3(between main::@1 and main::@1) +Block Sequence Planned @begin @1 @end main main::@1 main::@return main::@3 +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @1 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +CALL GRAPH +Calls in [] to main:2 + +Propagating live ranges... +Propagating live ranges... +Created 1 initial phi equivalence classes +Coalesced [9] main::i#3 ← main::i#1 +Coalesced down to 1 phi equivalence classes +Culled Empty Block (label) main::@3 +Block Sequence Planned @begin @1 @end main main::@1 main::@return +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @1 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Propagating live ranges... +Propagating live ranges... + +FINAL CONTROL FLOW GRAPH +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@1 +@1: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main [ ] ( ) + to:@end +@end: scope:[] from @1 + [3] phi() [ ] ( ) +main: scope:[main] from @1 + [4] phi() [ ] ( main:2 [ ] ) + to:main::@1 +main::@1: scope:[main] from main main::@1 + [5] (byte) main::i#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@1/(byte) main::i#1 ) [ main::i#2 ] ( main:2 [ main::i#2 ] ) + [6] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] ) + [7] if((byte) main::i#1<(byte/signed byte/word/signed word/dword/signed dword) 100) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) + to:main::@return +main::@return: scope:[main] from main::@1 + [8] return [ ] ( main:2 [ ] ) + to:@return + +DOMINATORS +@begin dominated by @begin +@1 dominated by @1 @begin +@end dominated by @1 @begin @end +main dominated by @1 @begin main +main::@1 dominated by @1 @begin main::@1 main +main::@return dominated by main::@return @1 @begin main::@1 main + +NATURAL LOOPS +Found back edge: Loop head: main::@1 tails: main::@1 blocks: null +Populated: Loop head: main::@1 tails: main::@1 blocks: main::@1 +Loop head: main::@1 tails: main::@1 blocks: main::@1 + +NATURAL LOOPS WITH DEPTH +Found 0 loops in scope [] +Found 1 loops in scope [main] + Loop head: main::@1 tails: main::@1 blocks: main::@1 +Loop head: main::@1 tails: main::@1 blocks: main::@1 depth: 1 + + +VARIABLE REGISTER WEIGHTS +(void()) main() +(byte) main::i +(byte) main::i#1 16.5 +(byte) main::i#2 22.0 + +Initial phi equivalence classes +[ main::i#2 main::i#1 ] +Complete equivalence classes +[ main::i#2 main::i#1 ] +Allocated zp ZP_BYTE:2 [ main::i#2 main::i#1 ] + +INITIAL ASM +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 +//SEG4 @1 +b1: +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend +//SEG8 @end +bend: +//SEG9 main +main: { + .label i = 2 + //SEG10 [5] phi from main to main::@1 [phi:main->main::@1] + b1_from_main: + //SEG11 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + lda #0 + sta i + jmp b1 + //SEG12 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1] + b1_from_b1: + //SEG13 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy + jmp b1 + //SEG14 main::@1 + b1: + //SEG15 [6] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuz1=_inc_vbuz1 + inc i + //SEG16 [7] if((byte) main::i#1<(byte/signed byte/word/signed word/dword/signed dword) 100) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuz1_lt_vbuc1_then_la1 + lda i + cmp #$64 + bcc b1_from_b1 + jmp breturn + //SEG17 main::@return + breturn: + //SEG18 [8] return [ ] ( main:2 [ ] ) + rts +} + +REGISTER UPLIFT POTENTIAL REGISTERS +Potential registers zp ZP_BYTE:2 [ main::i#2 main::i#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , + +REGISTER UPLIFT SCOPES +Uplift Scope [main] 38.5: zp ZP_BYTE:2 [ main::i#2 main::i#1 ] +Uplift Scope [] + +Uplifting [main] best 193 combination reg byte x [ main::i#2 main::i#1 ] +Uplifting [] best 193 combination + +ASSEMBLER BEFORE OPTIMIZATION +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 +//SEG4 @1 +b1: +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend +//SEG8 @end +bend: +//SEG9 main +main: { + //SEG10 [5] phi from main to main::@1 [phi:main->main::@1] + b1_from_main: + //SEG11 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 + ldx #0 + jmp b1 + //SEG12 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1] + b1_from_b1: + //SEG13 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy + jmp b1 + //SEG14 main::@1 + b1: + //SEG15 [6] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuxx=_inc_vbuxx + inx + //SEG16 [7] if((byte) main::i#1<(byte/signed byte/word/signed word/dword/signed dword) 100) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuxx_lt_vbuc1_then_la1 + cpx #$64 + bcc b1_from_b1 + jmp breturn + //SEG17 main::@return + breturn: + //SEG18 [8] return [ ] ( main:2 [ ] ) + rts +} + +ASSEMBLER OPTIMIZATIONS +Removing instruction jmp b1 +Removing instruction jmp bend +Removing instruction jmp b1 +Removing instruction jmp breturn +Succesful ASM optimization Pass5NextJumpElimination +Replacing label b1_from_b1 with b1 +Removing instruction bbegin: +Removing instruction b1_from_bbegin: +Removing instruction main_from_b1: +Removing instruction bend_from_b1: +Removing instruction b1_from_b1: +Succesful ASM optimization Pass5RedundantLabelElimination +Removing instruction b1: +Removing instruction bend: +Removing instruction b1_from_main: +Removing instruction breturn: +Succesful ASM optimization Pass5UnusedLabelElimination +Removing instruction jmp b1 +Succesful ASM optimization Pass5NextJumpElimination + +FINAL SYMBOL TABLE +(label) @1 +(label) @begin +(label) @end +(void()) main() +(label) main::@1 +(label) main::@return +(byte) main::i +(byte) main::i#1 reg byte x 16.5 +(byte) main::i#2 reg byte x 22.0 + +reg byte x [ main::i#2 main::i#1 ] + + +FINAL ASSEMBLER +Score: 97 + +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +//SEG4 @1 +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +//SEG8 @end +//SEG9 main +main: { + //SEG10 [5] phi from main to main::@1 [phi:main->main::@1] + //SEG11 [5] phi (byte) main::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 + ldx #0 + //SEG12 [5] phi from main::@1 to main::@1 [phi:main::@1->main::@1] + //SEG13 [5] phi (byte) main::i#2 = (byte) main::i#1 [phi:main::@1->main::@1#0] -- register_copy + //SEG14 main::@1 + b1: + //SEG15 [6] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuxx=_inc_vbuxx + inx + //SEG16 [7] if((byte) main::i#1<(byte/signed byte/word/signed word/dword/signed dword) 100) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) -- vbuxx_lt_vbuc1_then_la1 + cpx #$64 + bcc b1 + //SEG17 main::@return + //SEG18 [8] return [ ] ( main:2 [ ] ) + rts +} + diff --git a/src/test/java/dk/camelot64/kickc/test/ref/loop100.sym b/src/test/java/dk/camelot64/kickc/test/ref/loop100.sym new file mode 100644 index 000000000..a7283824c --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/loop100.sym @@ -0,0 +1,11 @@ +(label) @1 +(label) @begin +(label) @end +(void()) main() +(label) main::@1 +(label) main::@return +(byte) main::i +(byte) main::i#1 reg byte x 16.5 +(byte) main::i#2 reg byte x 22.0 + +reg byte x [ main::i#2 main::i#1 ] diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.asm b/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.asm new file mode 100644 index 000000000..12585de29 --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.asm @@ -0,0 +1,32 @@ +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + jsr main +main: { + .label SCREEN = $400 + lda #3 + sta SCREEN+3 + lda #3+1 + sta SCREEN+3+1 + lda #3+1+1 + sta SCREEN+3+1+1 + lda #3+1+1+1 + sta SCREEN+3+1+1+1 + lda #3+1+1+1+1 + sta SCREEN+3+1+1+1+1 + lda #3+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1 + lda #3+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1 + lda #3+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1 + lda #3+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1 + lda #3+1+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1+1 + lda #3+1+1+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1+1+1 + lda #3+1+1+1+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1+1+1+1 + rts +} diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.cfg b/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.cfg new file mode 100644 index 000000000..ce83339be --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.cfg @@ -0,0 +1,51 @@ +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@1 +@1: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main [ ] ( ) + to:@end +@end: scope:[] from @1 + [3] phi() [ ] ( ) +main: scope:[main] from @1 + [4] phi() [ ] ( main:2 [ ] ) + to:main::@1 +main::@1: scope:[main] from main + [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_1 +main::@1_1: scope:[main] from main::@1 + [6] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_2 +main::@1_2: scope:[main] from main::@1_1 + [7] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_3 +main::@1_3: scope:[main] from main::@1_2 + [8] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_4 +main::@1_4: scope:[main] from main::@1_3 + [9] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_5 +main::@1_5: scope:[main] from main::@1_4 + [10] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_6 +main::@1_6: scope:[main] from main::@1_5 + [11] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_7 +main::@1_7: scope:[main] from main::@1_6 + [12] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_8 +main::@1_8: scope:[main] from main::@1_7 + [13] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_9 +main::@1_9: scope:[main] from main::@1_8 + [14] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_10 +main::@1_10: scope:[main] from main::@1_9 + [15] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@2 +main::@2: scope:[main] from main::@1_10 + [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@return +main::@return: scope:[main] from main::@2 + [17] return [ ] ( main:2 [ ] ) + to:@return diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.log b/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.log new file mode 100644 index 000000000..086256af4 --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.log @@ -0,0 +1,920 @@ +PARSING src/test/java/dk/camelot64/kickc/test/kc/unroll-loop-modifyvar.kc +// An unrolled loop modifying a var used later + +void main() { + byte* SCREEN = $400; + + byte a=3; + inline do { + SCREEN[a]=a; + a++; + } while(a<14); + SCREEN[a]=a; + +} +Adding pre/post-modifier (byte) main::a ← ++ (byte) main::a +SYMBOLS +(label) @1 +(label) @begin +(label) @end +(void()) main() +(bool~) main::$0 +(label) main::@1 +(label) main::@2 +(label) main::@return +(byte*) main::SCREEN +(byte) main::a + +Promoting word/signed word/dword/signed dword to byte* in main::SCREEN ← ((byte*)) 1024 +INITIAL CONTROL FLOW GRAPH +@begin: scope:[] from + to:@1 +main: scope:[main] from + (byte*) main::SCREEN ← ((byte*)) (word/signed word/dword/signed dword) 1024 + (byte) main::a ← (byte/signed byte/word/signed word/dword/signed dword) 3 + to:main::@1 +main::@1: scope:[main] from main main::@1 + *((byte*) main::SCREEN + (byte) main::a) ← (byte) main::a + (byte) main::a ← ++ (byte) main::a + (bool~) main::$0 ← (byte) main::a < (byte/signed byte/word/signed word/dword/signed dword) 14 + unroll if((bool~) main::$0) goto main::@1 + to:main::@2 +main::@2: scope:[main] from main::@1 + *((byte*) main::SCREEN + (byte) main::a) ← (byte) main::a + to:main::@return +main::@return: scope:[main] from main::@2 + return + to:@return +@1: scope:[] from @begin + call main + to:@end +@end: scope:[] from @1 + +PROCEDURE MODIFY VARIABLE ANALYSIS + +Completing Phi functions... + +CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN +@begin: scope:[] from + to:@1 +main: scope:[main] from @1 + (byte*) main::SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024 + (byte) main::a#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3 + to:main::@1 +main::@1: scope:[main] from main main::@1 + (byte*) main::SCREEN#1 ← phi( main/(byte*) main::SCREEN#0 main::@1/(byte*) main::SCREEN#1 ) + (byte) main::a#2 ← phi( main/(byte) main::a#0 main::@1/(byte) main::a#1 ) + *((byte*) main::SCREEN#1 + (byte) main::a#2) ← (byte) main::a#2 + (byte) main::a#1 ← ++ (byte) main::a#2 + (bool~) main::$0 ← (byte) main::a#1 < (byte/signed byte/word/signed word/dword/signed dword) 14 + unroll if((bool~) main::$0) goto main::@1 + to:main::@2 +main::@2: scope:[main] from main::@1 + (byte*) main::SCREEN#2 ← phi( main::@1/(byte*) main::SCREEN#1 ) + (byte) main::a#3 ← phi( main::@1/(byte) main::a#1 ) + *((byte*) main::SCREEN#2 + (byte) main::a#3) ← (byte) main::a#3 + to:main::@return +main::@return: scope:[main] from main::@2 + return + to:@return +@1: scope:[] from @begin + call main + to:@2 +@2: scope:[] from @1 + to:@end +@end: scope:[] from @2 + +SYMBOL TABLE SSA +(label) @1 +(label) @2 +(label) @begin +(label) @end +(void()) main() +(bool~) main::$0 +(label) main::@1 +(label) main::@2 +(label) main::@return +(byte*) main::SCREEN +(byte*) main::SCREEN#0 +(byte*) main::SCREEN#1 +(byte*) main::SCREEN#2 +(byte) main::a +(byte) main::a#0 +(byte) main::a#1 +(byte) main::a#2 +(byte) main::a#3 + +OPTIMIZING CONTROL FLOW GRAPH +Culled Empty Block (label) @2 +Succesful SSA optimization Pass2CullEmptyBlocks +Alias (byte) main::a#1 = (byte) main::a#3 +Alias (byte*) main::SCREEN#1 = (byte*) main::SCREEN#2 +Succesful SSA optimization Pass2AliasElimination +Self Phi Eliminated (byte*) main::SCREEN#1 +Succesful SSA optimization Pass2SelfPhiElimination +Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#0 +Succesful SSA optimization Pass2RedundantPhiElimination +Simple Condition (bool~) main::$0 unroll if((byte) main::a#1<(byte/signed byte/word/signed word/dword/signed dword) 14) goto main::@1 +Succesful SSA optimization Pass2ConditionalJumpSimplification +Constant (const byte*) main::SCREEN#0 = ((byte*))1024 +Constant (const byte) main::a#0 = 3 +Succesful SSA optimization Pass2ConstantIdentification +Creating PHI for main::a#1 in block main::@2 - (byte) main::a#4 ← phi( main::@1/(byte) main::a#1 ) +Unrolling loop Loop head: main::@1 tails: main::@1 blocks: main::@1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::a#2 (const byte) main::a#0 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte) main::a#1 = ++main::a#0 +Succesful SSA optimization Pass2ConstantIdentification +Consolidated array index constant in *(main::SCREEN#0+main::a#0) +Succesful SSA optimization Pass2ConstantAdditionElimination +Removing PHI-reference to removed block (main::@1) in block main::@2 +if() condition always true - replacing block destination [3] if((const byte) main::a#1<(byte/signed byte/word/signed word/dword/signed dword) 14) goto main::@1_1 +Succesful SSA optimization Pass2ConstantIfs +Alias (byte) main::a#4 = (byte) main::a#6 +Succesful SSA optimization Pass2AliasElimination +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@2 main::@return +Creating PHI for main::a#4 in block main::@2 - (byte) main::a#7 ← phi( main::@1_1/(byte) main::a#4 ) +Unrolling loop Loop head: main::@1_1 tails: main::@1_1 blocks: main::@1_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::a#5 (const byte) main::a#1 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte) main::a#4 = ++main::a#1 +Succesful SSA optimization Pass2ConstantIdentification +Consolidated array index constant in *(main::SCREEN#0+main::a#1) +Succesful SSA optimization Pass2ConstantAdditionElimination +Removing PHI-reference to removed block (main::@1_1) in block main::@2 +if() condition always true - replacing block destination [5] if((const byte) main::a#4<(byte/signed byte/word/signed word/dword/signed dword) 14) goto main::@1_2 +Succesful SSA optimization Pass2ConstantIfs +Alias (byte) main::a#7 = (byte) main::a#9 +Succesful SSA optimization Pass2AliasElimination +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@2 main::@return +Creating PHI for main::a#7 in block main::@2 - (byte) main::a#10 ← phi( main::@1_2/(byte) main::a#7 ) +Unrolling loop Loop head: main::@1_2 tails: main::@1_2 blocks: main::@1_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::a#8 (const byte) main::a#4 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte) main::a#7 = ++main::a#4 +Succesful SSA optimization Pass2ConstantIdentification +Consolidated array index constant in *(main::SCREEN#0+main::a#4) +Succesful SSA optimization Pass2ConstantAdditionElimination +Removing PHI-reference to removed block (main::@1_2) in block main::@2 +if() condition always true - replacing block destination [6] if((const byte) main::a#7<(byte/signed byte/word/signed word/dword/signed dword) 14) goto main::@1_3 +Succesful SSA optimization Pass2ConstantIfs +Alias (byte) main::a#10 = (byte) main::a#12 +Succesful SSA optimization Pass2AliasElimination +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@2 main::@return +Creating PHI for main::a#10 in block main::@2 - (byte) main::a#13 ← phi( main::@1_3/(byte) main::a#10 ) +Unrolling loop Loop head: main::@1_3 tails: main::@1_3 blocks: main::@1_3 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::a#11 (const byte) main::a#7 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte) main::a#10 = ++main::a#7 +Succesful SSA optimization Pass2ConstantIdentification +Consolidated array index constant in *(main::SCREEN#0+main::a#7) +Succesful SSA optimization Pass2ConstantAdditionElimination +Removing PHI-reference to removed block (main::@1_3) in block main::@2 +if() condition always true - replacing block destination [7] if((const byte) main::a#10<(byte/signed byte/word/signed word/dword/signed dword) 14) goto main::@1_4 +Succesful SSA optimization Pass2ConstantIfs +Alias (byte) main::a#13 = (byte) main::a#15 +Succesful SSA optimization Pass2AliasElimination +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 main::@2 main::@return +Creating PHI for main::a#13 in block main::@2 - (byte) main::a#16 ← phi( main::@1_4/(byte) main::a#13 ) +Unrolling loop Loop head: main::@1_4 tails: main::@1_4 blocks: main::@1_4 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::a#14 (const byte) main::a#10 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte) main::a#13 = ++main::a#10 +Succesful SSA optimization Pass2ConstantIdentification +Consolidated array index constant in *(main::SCREEN#0+main::a#10) +Succesful SSA optimization Pass2ConstantAdditionElimination +Removing PHI-reference to removed block (main::@1_4) in block main::@2 +if() condition always true - replacing block destination [8] if((const byte) main::a#13<(byte/signed byte/word/signed word/dword/signed dword) 14) goto main::@1_5 +Succesful SSA optimization Pass2ConstantIfs +Alias (byte) main::a#16 = (byte) main::a#18 +Succesful SSA optimization Pass2AliasElimination +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 main::@1_5 main::@2 main::@return +Creating PHI for main::a#16 in block main::@2 - (byte) main::a#19 ← phi( main::@1_5/(byte) main::a#16 ) +Unrolling loop Loop head: main::@1_5 tails: main::@1_5 blocks: main::@1_5 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::a#17 (const byte) main::a#13 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte) main::a#16 = ++main::a#13 +Succesful SSA optimization Pass2ConstantIdentification +Consolidated array index constant in *(main::SCREEN#0+main::a#13) +Succesful SSA optimization Pass2ConstantAdditionElimination +Removing PHI-reference to removed block (main::@1_5) in block main::@2 +if() condition always true - replacing block destination [9] if((const byte) main::a#16<(byte/signed byte/word/signed word/dword/signed dword) 14) goto main::@1_6 +Succesful SSA optimization Pass2ConstantIfs +Alias (byte) main::a#19 = (byte) main::a#21 +Succesful SSA optimization Pass2AliasElimination +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 main::@1_5 main::@1_6 main::@2 main::@return +Creating PHI for main::a#19 in block main::@2 - (byte) main::a#22 ← phi( main::@1_6/(byte) main::a#19 ) +Unrolling loop Loop head: main::@1_6 tails: main::@1_6 blocks: main::@1_6 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::a#20 (const byte) main::a#16 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte) main::a#19 = ++main::a#16 +Succesful SSA optimization Pass2ConstantIdentification +Consolidated array index constant in *(main::SCREEN#0+main::a#16) +Succesful SSA optimization Pass2ConstantAdditionElimination +Removing PHI-reference to removed block (main::@1_6) in block main::@2 +if() condition always true - replacing block destination [10] if((const byte) main::a#19<(byte/signed byte/word/signed word/dword/signed dword) 14) goto main::@1_7 +Succesful SSA optimization Pass2ConstantIfs +Alias (byte) main::a#22 = (byte) main::a#24 +Succesful SSA optimization Pass2AliasElimination +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 main::@1_5 main::@1_6 main::@1_7 main::@2 main::@return +Creating PHI for main::a#22 in block main::@2 - (byte) main::a#25 ← phi( main::@1_7/(byte) main::a#22 ) +Unrolling loop Loop head: main::@1_7 tails: main::@1_7 blocks: main::@1_7 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::a#23 (const byte) main::a#19 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte) main::a#22 = ++main::a#19 +Succesful SSA optimization Pass2ConstantIdentification +Consolidated array index constant in *(main::SCREEN#0+main::a#19) +Succesful SSA optimization Pass2ConstantAdditionElimination +Removing PHI-reference to removed block (main::@1_7) in block main::@2 +if() condition always true - replacing block destination [11] if((const byte) main::a#22<(byte/signed byte/word/signed word/dword/signed dword) 14) goto main::@1_8 +Succesful SSA optimization Pass2ConstantIfs +Alias (byte) main::a#25 = (byte) main::a#27 +Succesful SSA optimization Pass2AliasElimination +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 main::@1_5 main::@1_6 main::@1_7 main::@1_8 main::@2 main::@return +Creating PHI for main::a#25 in block main::@2 - (byte) main::a#28 ← phi( main::@1_8/(byte) main::a#25 ) +Unrolling loop Loop head: main::@1_8 tails: main::@1_8 blocks: main::@1_8 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::a#26 (const byte) main::a#22 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte) main::a#25 = ++main::a#22 +Succesful SSA optimization Pass2ConstantIdentification +Consolidated array index constant in *(main::SCREEN#0+main::a#22) +Succesful SSA optimization Pass2ConstantAdditionElimination +Removing PHI-reference to removed block (main::@1_8) in block main::@2 +if() condition always true - replacing block destination [12] if((const byte) main::a#25<(byte/signed byte/word/signed word/dword/signed dword) 14) goto main::@1_9 +Succesful SSA optimization Pass2ConstantIfs +Alias (byte) main::a#28 = (byte) main::a#30 +Succesful SSA optimization Pass2AliasElimination +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 main::@1_5 main::@1_6 main::@1_7 main::@1_8 main::@1_9 main::@2 main::@return +Creating PHI for main::a#28 in block main::@2 - (byte) main::a#31 ← phi( main::@1_9/(byte) main::a#28 ) +Unrolling loop Loop head: main::@1_9 tails: main::@1_9 blocks: main::@1_9 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::a#29 (const byte) main::a#25 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte) main::a#28 = ++main::a#25 +Succesful SSA optimization Pass2ConstantIdentification +Consolidated array index constant in *(main::SCREEN#0+main::a#25) +Succesful SSA optimization Pass2ConstantAdditionElimination +Removing PHI-reference to removed block (main::@1_9) in block main::@2 +if() condition always true - replacing block destination [13] if((const byte) main::a#28<(byte/signed byte/word/signed word/dword/signed dword) 14) goto main::@1_10 +Succesful SSA optimization Pass2ConstantIfs +Alias (byte) main::a#31 = (byte) main::a#33 +Succesful SSA optimization Pass2AliasElimination +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 main::@1_5 main::@1_6 main::@1_7 main::@1_8 main::@1_9 main::@1_10 main::@2 main::@return +Creating PHI for main::a#31 in block main::@2 - (byte) main::a#34 ← phi( main::@1_10/(byte) main::a#31 ) +Unrolling loop Loop head: main::@1_10 tails: main::@1_10 blocks: main::@1_10 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::a#32 (const byte) main::a#28 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte) main::a#31 = ++main::a#28 +Succesful SSA optimization Pass2ConstantIdentification +Consolidated array index constant in *(main::SCREEN#0+main::a#28) +Succesful SSA optimization Pass2ConstantAdditionElimination +Removing PHI-reference to removed block (main::@1_10) in block main::@1_11 +if() condition always false - eliminating [14] if((const byte) main::a#31<(byte/signed byte/word/signed word/dword/signed dword) 14) goto main::@1_11 +Succesful SSA optimization Pass2ConstantIfs +Eliminating variable (byte) main::a#35 from unused block main::@1_11 +Eliminating variable (byte) main::a#36 and from unused block main::@1_11 +Removing PHI-reference to removed block (main::@1_11) in block main::@2 +Removing unused block main::@1_11 +Succesful SSA optimization Pass2EliminateUnusedBlocks +Redundant Phi (byte) main::a#34 (const byte) main::a#31 +Succesful SSA optimization Pass2RedundantPhiElimination +Consolidated array index constant in *(main::SCREEN#0+main::a#31) +Succesful SSA optimization Pass2ConstantAdditionElimination +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 main::@1_5 main::@1_6 main::@1_7 main::@1_8 main::@1_9 main::@1_10 main::@2 main::@return +OPTIMIZING CONTROL FLOW GRAPH +Inlining constant with different constant siblings (const byte) main::a#0 +Inlining constant with different constant siblings (const byte) main::a#0 +Inlining constant with different constant siblings (const byte) main::a#0 +Inlining constant with different constant siblings (const byte) main::a#0 +Inlining constant with different constant siblings (const byte) main::a#0 +Inlining constant with different constant siblings (const byte) main::a#0 +Inlining constant with different constant siblings (const byte) main::a#0 +Inlining constant with different constant siblings (const byte) main::a#0 +Inlining constant with different constant siblings (const byte) main::a#0 +Inlining constant with different constant siblings (const byte) main::a#0 +Inlining constant with different constant siblings (const byte) main::a#0 +Inlining constant with different constant siblings (const byte) main::a#1 +Inlining constant with different constant siblings (const byte) main::a#1 +Inlining constant with different constant siblings (const byte) main::a#1 +Inlining constant with different constant siblings (const byte) main::a#1 +Inlining constant with different constant siblings (const byte) main::a#1 +Inlining constant with different constant siblings (const byte) main::a#1 +Inlining constant with different constant siblings (const byte) main::a#1 +Inlining constant with different constant siblings (const byte) main::a#1 +Inlining constant with different constant siblings (const byte) main::a#1 +Inlining constant with different constant siblings (const byte) main::a#1 +Inlining constant with different constant siblings (const byte) main::a#1 +Inlining constant with different constant siblings (const byte) main::a#4 +Inlining constant with different constant siblings (const byte) main::a#4 +Inlining constant with different constant siblings (const byte) main::a#4 +Inlining constant with different constant siblings (const byte) main::a#4 +Inlining constant with different constant siblings (const byte) main::a#4 +Inlining constant with different constant siblings (const byte) main::a#4 +Inlining constant with different constant siblings (const byte) main::a#4 +Inlining constant with different constant siblings (const byte) main::a#4 +Inlining constant with different constant siblings (const byte) main::a#4 +Inlining constant with different constant siblings (const byte) main::a#4 +Inlining constant with different constant siblings (const byte) main::a#4 +Inlining constant with different constant siblings (const byte) main::a#7 +Inlining constant with different constant siblings (const byte) main::a#7 +Inlining constant with different constant siblings (const byte) main::a#7 +Inlining constant with different constant siblings (const byte) main::a#7 +Inlining constant with different constant siblings (const byte) main::a#7 +Inlining constant with different constant siblings (const byte) main::a#7 +Inlining constant with different constant siblings (const byte) main::a#7 +Inlining constant with different constant siblings (const byte) main::a#7 +Inlining constant with different constant siblings (const byte) main::a#7 +Inlining constant with different constant siblings (const byte) main::a#7 +Inlining constant with different constant siblings (const byte) main::a#7 +Inlining constant with different constant siblings (const byte) main::a#10 +Inlining constant with different constant siblings (const byte) main::a#10 +Inlining constant with different constant siblings (const byte) main::a#10 +Inlining constant with different constant siblings (const byte) main::a#10 +Inlining constant with different constant siblings (const byte) main::a#10 +Inlining constant with different constant siblings (const byte) main::a#10 +Inlining constant with different constant siblings (const byte) main::a#10 +Inlining constant with different constant siblings (const byte) main::a#10 +Inlining constant with different constant siblings (const byte) main::a#10 +Inlining constant with different constant siblings (const byte) main::a#10 +Inlining constant with different constant siblings (const byte) main::a#10 +Inlining constant with different constant siblings (const byte) main::a#13 +Inlining constant with different constant siblings (const byte) main::a#13 +Inlining constant with different constant siblings (const byte) main::a#13 +Inlining constant with different constant siblings (const byte) main::a#13 +Inlining constant with different constant siblings (const byte) main::a#13 +Inlining constant with different constant siblings (const byte) main::a#13 +Inlining constant with different constant siblings (const byte) main::a#13 +Inlining constant with different constant siblings (const byte) main::a#13 +Inlining constant with different constant siblings (const byte) main::a#13 +Inlining constant with different constant siblings (const byte) main::a#13 +Inlining constant with different constant siblings (const byte) main::a#13 +Inlining constant with different constant siblings (const byte) main::a#16 +Inlining constant with different constant siblings (const byte) main::a#16 +Inlining constant with different constant siblings (const byte) main::a#16 +Inlining constant with different constant siblings (const byte) main::a#16 +Inlining constant with different constant siblings (const byte) main::a#16 +Inlining constant with different constant siblings (const byte) main::a#16 +Inlining constant with different constant siblings (const byte) main::a#16 +Inlining constant with different constant siblings (const byte) main::a#16 +Inlining constant with different constant siblings (const byte) main::a#16 +Inlining constant with different constant siblings (const byte) main::a#16 +Inlining constant with different constant siblings (const byte) main::a#16 +Inlining constant with different constant siblings (const byte) main::a#19 +Inlining constant with different constant siblings (const byte) main::a#19 +Inlining constant with different constant siblings (const byte) main::a#19 +Inlining constant with different constant siblings (const byte) main::a#19 +Inlining constant with different constant siblings (const byte) main::a#19 +Inlining constant with different constant siblings (const byte) main::a#19 +Inlining constant with different constant siblings (const byte) main::a#19 +Inlining constant with different constant siblings (const byte) main::a#19 +Inlining constant with different constant siblings (const byte) main::a#19 +Inlining constant with different constant siblings (const byte) main::a#19 +Inlining constant with different constant siblings (const byte) main::a#19 +Inlining constant with different constant siblings (const byte) main::a#22 +Inlining constant with different constant siblings (const byte) main::a#22 +Inlining constant with different constant siblings (const byte) main::a#22 +Inlining constant with different constant siblings (const byte) main::a#22 +Inlining constant with different constant siblings (const byte) main::a#22 +Inlining constant with different constant siblings (const byte) main::a#22 +Inlining constant with different constant siblings (const byte) main::a#22 +Inlining constant with different constant siblings (const byte) main::a#22 +Inlining constant with different constant siblings (const byte) main::a#22 +Inlining constant with different constant siblings (const byte) main::a#22 +Inlining constant with different constant siblings (const byte) main::a#22 +Inlining constant with different constant siblings (const byte) main::a#25 +Inlining constant with different constant siblings (const byte) main::a#25 +Inlining constant with different constant siblings (const byte) main::a#25 +Inlining constant with different constant siblings (const byte) main::a#25 +Inlining constant with different constant siblings (const byte) main::a#25 +Inlining constant with different constant siblings (const byte) main::a#25 +Inlining constant with different constant siblings (const byte) main::a#25 +Inlining constant with different constant siblings (const byte) main::a#25 +Inlining constant with different constant siblings (const byte) main::a#25 +Inlining constant with different constant siblings (const byte) main::a#25 +Inlining constant with different constant siblings (const byte) main::a#25 +Inlining constant with different constant siblings (const byte) main::a#28 +Inlining constant with different constant siblings (const byte) main::a#28 +Inlining constant with different constant siblings (const byte) main::a#28 +Inlining constant with different constant siblings (const byte) main::a#28 +Inlining constant with different constant siblings (const byte) main::a#28 +Inlining constant with different constant siblings (const byte) main::a#28 +Inlining constant with different constant siblings (const byte) main::a#28 +Inlining constant with different constant siblings (const byte) main::a#28 +Inlining constant with different constant siblings (const byte) main::a#28 +Inlining constant with different constant siblings (const byte) main::a#28 +Inlining constant with different constant siblings (const byte) main::a#28 +Inlining constant with different constant siblings (const byte) main::a#31 +Inlining constant with different constant siblings (const byte) main::a#31 +Inlining constant with different constant siblings (const byte) main::a#31 +Inlining constant with different constant siblings (const byte) main::a#31 +Inlining constant with different constant siblings (const byte) main::a#31 +Inlining constant with different constant siblings (const byte) main::a#31 +Inlining constant with different constant siblings (const byte) main::a#31 +Inlining constant with different constant siblings (const byte) main::a#31 +Inlining constant with different constant siblings (const byte) main::a#31 +Inlining constant with different constant siblings (const byte) main::a#31 +Inlining constant with different constant siblings (const byte) main::a#31 +Constant inlined main::a#22 = ++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 +Constant inlined main::a#10 = ++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 +Constant inlined main::a#31 = ++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 +Constant inlined main::a#25 = ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 +Constant inlined main::a#13 = ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 +Constant inlined main::a#0 = (byte/signed byte/word/signed word/dword/signed dword) 3 +Constant inlined main::a#19 = ++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 +Constant inlined main::a#28 = ++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 +Constant inlined main::a#1 = ++(byte/signed byte/word/signed word/dword/signed dword) 3 +Constant inlined main::a#16 = ++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 +Constant inlined main::a#7 = ++++++(byte/signed byte/word/signed word/dword/signed dword) 3 +Constant inlined main::a#4 = ++++(byte/signed byte/word/signed word/dword/signed dword) 3 +Succesful SSA optimization Pass2ConstantInlining +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 main::@1_5 main::@1_6 main::@1_7 main::@1_8 main::@1_9 main::@1_10 main::@2 main::@return +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 main::@1_5 main::@1_6 main::@1_7 main::@1_8 main::@1_9 main::@1_10 main::@2 main::@return +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @1 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +CALL GRAPH +Calls in [] to main:2 + +Propagating live ranges... +Created 0 initial phi equivalence classes +Coalesced down to 0 phi equivalence classes +Block Sequence Planned @begin @1 @end main main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 main::@1_5 main::@1_6 main::@1_7 main::@1_8 main::@1_9 main::@1_10 main::@2 main::@return +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @1 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Propagating live ranges... + +FINAL CONTROL FLOW GRAPH +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@1 +@1: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main [ ] ( ) + to:@end +@end: scope:[] from @1 + [3] phi() [ ] ( ) +main: scope:[main] from @1 + [4] phi() [ ] ( main:2 [ ] ) + to:main::@1 +main::@1: scope:[main] from main + [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_1 +main::@1_1: scope:[main] from main::@1 + [6] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_2 +main::@1_2: scope:[main] from main::@1_1 + [7] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_3 +main::@1_3: scope:[main] from main::@1_2 + [8] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_4 +main::@1_4: scope:[main] from main::@1_3 + [9] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_5 +main::@1_5: scope:[main] from main::@1_4 + [10] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_6 +main::@1_6: scope:[main] from main::@1_5 + [11] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_7 +main::@1_7: scope:[main] from main::@1_6 + [12] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_8 +main::@1_8: scope:[main] from main::@1_7 + [13] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_9 +main::@1_9: scope:[main] from main::@1_8 + [14] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@1_10 +main::@1_10: scope:[main] from main::@1_9 + [15] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@2 +main::@2: scope:[main] from main::@1_10 + [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) + to:main::@return +main::@return: scope:[main] from main::@2 + [17] return [ ] ( main:2 [ ] ) + to:@return + +DOMINATORS +@begin dominated by @begin +@1 dominated by @begin @1 +@end dominated by @begin @end @1 +main dominated by @begin main @1 +main::@1 dominated by @begin main @1 main::@1 +main::@1_1 dominated by @begin main @1 main::@1 main::@1_1 +main::@1_2 dominated by @begin main @1 main::@1 main::@1_1 main::@1_2 +main::@1_3 dominated by @begin main @1 main::@1 main::@1_1 main::@1_2 main::@1_3 +main::@1_4 dominated by @begin main @1 main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 +main::@1_5 dominated by @begin main::@1_5 main @1 main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 +main::@1_6 dominated by @begin main::@1_5 main::@1_6 main @1 main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 +main::@1_7 dominated by @begin main::@1_5 main::@1_6 main::@1_7 main @1 main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 +main::@1_8 dominated by @begin main::@1_5 main::@1_6 main::@1_7 main::@1_8 main @1 main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 +main::@1_9 dominated by main::@1_9 @begin main::@1_5 main::@1_6 main::@1_7 main::@1_8 main @1 main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 +main::@1_10 dominated by main::@1_9 @begin main::@1_5 main::@1_6 main::@1_7 main::@1_8 main @1 main::@1_10 main::@1 main::@1_1 main::@1_2 main::@1_3 main::@1_4 +main::@2 dominated by main::@1_9 @begin main::@1_5 main::@1_6 main::@1_7 main::@1_8 main @1 main::@1_10 main::@1 main::@1_1 main::@1_2 main::@2 main::@1_3 main::@1_4 +main::@return dominated by main::@1_9 main::@return @begin main::@1_5 main::@1_6 main::@1_7 main::@1_8 main @1 main::@1_10 main::@1 main::@1_1 main::@1_2 main::@2 main::@1_3 main::@1_4 + +NATURAL LOOPS + +NATURAL LOOPS WITH DEPTH +Found 0 loops in scope [] +Found 0 loops in scope [main] + + +VARIABLE REGISTER WEIGHTS +(void()) main() +(byte*) main::SCREEN +(byte) main::a + +Initial phi equivalence classes +Complete equivalence classes + +INITIAL ASM +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 +//SEG4 @1 +b1: +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend +//SEG8 @end +bend: +//SEG9 main +main: { + .label SCREEN = $400 + jmp b1 + //SEG10 main::@1 + b1: + //SEG11 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3 + sta SCREEN+3 + jmp b1_1 + //SEG12 main::@1_1 + b1_1: + //SEG13 [6] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1 + sta SCREEN+3+1 + jmp b1_2 + //SEG14 main::@1_2 + b1_2: + //SEG15 [7] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1 + sta SCREEN+3+1+1 + jmp b1_3 + //SEG16 main::@1_3 + b1_3: + //SEG17 [8] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1 + sta SCREEN+3+1+1+1 + jmp b1_4 + //SEG18 main::@1_4 + b1_4: + //SEG19 [9] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1 + sta SCREEN+3+1+1+1+1 + jmp b1_5 + //SEG20 main::@1_5 + b1_5: + //SEG21 [10] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1 + jmp b1_6 + //SEG22 main::@1_6 + b1_6: + //SEG23 [11] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1 + jmp b1_7 + //SEG24 main::@1_7 + b1_7: + //SEG25 [12] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1 + jmp b1_8 + //SEG26 main::@1_8 + b1_8: + //SEG27 [13] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1 + jmp b1_9 + //SEG28 main::@1_9 + b1_9: + //SEG29 [14] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1+1 + jmp b1_10 + //SEG30 main::@1_10 + b1_10: + //SEG31 [15] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1+1+1 + jmp b2 + //SEG32 main::@2 + b2: + //SEG33 [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1+1+1+1 + jmp breturn + //SEG34 main::@return + breturn: + //SEG35 [17] return [ ] ( main:2 [ ] ) + rts +} + +REGISTER UPLIFT POTENTIAL REGISTERS +Statement [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [6] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [7] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [8] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [9] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [10] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [11] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [12] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [13] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [14] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [15] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a +Statement [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) always clobbers reg byte a + +REGISTER UPLIFT SCOPES +Uplift Scope [main] +Uplift Scope [] + +Uplifting [main] best 156 combination +Uplifting [] best 156 combination + +ASSEMBLER BEFORE OPTIMIZATION +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 +//SEG4 @1 +b1: +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend +//SEG8 @end +bend: +//SEG9 main +main: { + .label SCREEN = $400 + jmp b1 + //SEG10 main::@1 + b1: + //SEG11 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3 + sta SCREEN+3 + jmp b1_1 + //SEG12 main::@1_1 + b1_1: + //SEG13 [6] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1 + sta SCREEN+3+1 + jmp b1_2 + //SEG14 main::@1_2 + b1_2: + //SEG15 [7] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1 + sta SCREEN+3+1+1 + jmp b1_3 + //SEG16 main::@1_3 + b1_3: + //SEG17 [8] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1 + sta SCREEN+3+1+1+1 + jmp b1_4 + //SEG18 main::@1_4 + b1_4: + //SEG19 [9] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1 + sta SCREEN+3+1+1+1+1 + jmp b1_5 + //SEG20 main::@1_5 + b1_5: + //SEG21 [10] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1 + jmp b1_6 + //SEG22 main::@1_6 + b1_6: + //SEG23 [11] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1 + jmp b1_7 + //SEG24 main::@1_7 + b1_7: + //SEG25 [12] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1 + jmp b1_8 + //SEG26 main::@1_8 + b1_8: + //SEG27 [13] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1 + jmp b1_9 + //SEG28 main::@1_9 + b1_9: + //SEG29 [14] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1+1 + jmp b1_10 + //SEG30 main::@1_10 + b1_10: + //SEG31 [15] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1+1+1 + jmp b2 + //SEG32 main::@2 + b2: + //SEG33 [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1+1+1+1 + jmp breturn + //SEG34 main::@return + breturn: + //SEG35 [17] return [ ] ( main:2 [ ] ) + rts +} + +ASSEMBLER OPTIMIZATIONS +Removing instruction jmp b1 +Removing instruction jmp bend +Removing instruction jmp b1 +Removing instruction jmp b1_1 +Removing instruction jmp b1_2 +Removing instruction jmp b1_3 +Removing instruction jmp b1_4 +Removing instruction jmp b1_5 +Removing instruction jmp b1_6 +Removing instruction jmp b1_7 +Removing instruction jmp b1_8 +Removing instruction jmp b1_9 +Removing instruction jmp b1_10 +Removing instruction jmp b2 +Removing instruction jmp breturn +Succesful ASM optimization Pass5NextJumpElimination +Removing instruction bbegin: +Removing instruction b1_from_bbegin: +Removing instruction main_from_b1: +Removing instruction bend_from_b1: +Succesful ASM optimization Pass5RedundantLabelElimination +Removing instruction b1: +Removing instruction bend: +Removing instruction b1: +Removing instruction b1_1: +Removing instruction b1_2: +Removing instruction b1_3: +Removing instruction b1_4: +Removing instruction b1_5: +Removing instruction b1_6: +Removing instruction b1_7: +Removing instruction b1_8: +Removing instruction b1_9: +Removing instruction b1_10: +Removing instruction b2: +Removing instruction breturn: +Succesful ASM optimization Pass5UnusedLabelElimination + +FINAL SYMBOL TABLE +(label) @1 +(label) @begin +(label) @end +(void()) main() +(label) main::@1 +(label) main::@1_1 +(label) main::@1_10 +(label) main::@1_2 +(label) main::@1_3 +(label) main::@1_4 +(label) main::@1_5 +(label) main::@1_6 +(label) main::@1_7 +(label) main::@1_8 +(label) main::@1_9 +(label) main::@2 +(label) main::@return +(byte*) main::SCREEN +(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024 +(byte) main::a + + + +FINAL ASSEMBLER +Score: 84 + +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +//SEG4 @1 +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +//SEG8 @end +//SEG9 main +main: { + .label SCREEN = $400 + //SEG10 main::@1 + //SEG11 [5] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3 + sta SCREEN+3 + //SEG12 main::@1_1 + //SEG13 [6] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1 + sta SCREEN+3+1 + //SEG14 main::@1_2 + //SEG15 [7] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1 + sta SCREEN+3+1+1 + //SEG16 main::@1_3 + //SEG17 [8] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1 + sta SCREEN+3+1+1+1 + //SEG18 main::@1_4 + //SEG19 [9] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1 + sta SCREEN+3+1+1+1+1 + //SEG20 main::@1_5 + //SEG21 [10] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1 + //SEG22 main::@1_6 + //SEG23 [11] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1 + //SEG24 main::@1_7 + //SEG25 [12] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1 + //SEG26 main::@1_8 + //SEG27 [13] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1 + //SEG28 main::@1_9 + //SEG29 [14] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1+1 + //SEG30 main::@1_10 + //SEG31 [15] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1+1+1 + //SEG32 main::@2 + //SEG33 [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3) ← ++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 3 [ ] ( main:2 [ ] ) -- _deref_pbuc1=vbuc2 + lda #3+1+1+1+1+1+1+1+1+1+1+1 + sta SCREEN+3+1+1+1+1+1+1+1+1+1+1+1 + //SEG34 main::@return + //SEG35 [17] return [ ] ( main:2 [ ] ) + rts +} + diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.sym b/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.sym new file mode 100644 index 000000000..9e947aa2a --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-loop-modifyvar.sym @@ -0,0 +1,21 @@ +(label) @1 +(label) @begin +(label) @end +(void()) main() +(label) main::@1 +(label) main::@1_1 +(label) main::@1_10 +(label) main::@1_2 +(label) main::@1_3 +(label) main::@1_4 +(label) main::@1_5 +(label) main::@1_6 +(label) main::@1_7 +(label) main::@1_8 +(label) main::@1_9 +(label) main::@2 +(label) main::@return +(byte*) main::SCREEN +(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024 +(byte) main::a + diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.asm b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.asm new file mode 100644 index 000000000..a514f4fb9 --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.asm @@ -0,0 +1,63 @@ +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + jsr main +main: { + .label SCREEN = $400 + ldx #0 + b2: + txa + sta SCREEN+0*$28,x + txa + sta SCREEN+(0+1)*$28,x + txa + sta SCREEN+(0+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + inx + cpx #$28 + bne b2 + rts +} diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.cfg b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.cfg new file mode 100644 index 000000000..39250ad2c --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.cfg @@ -0,0 +1,97 @@ +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@1 +@1: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main [ ] ( ) + to:@end +@end: scope:[] from @1 + [3] phi() [ ] ( ) +main: scope:[main] from @1 + [4] phi() [ ] ( main:2 [ ] ) + to:main::@1 +main::@1: scope:[main] from main main::@3 + [5] (byte) main::x#4 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::x#1 ) [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2 +main::@2: scope:[main] from main::@1 + [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_1 +main::@2_1: scope:[main] from main::@2 + [7] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_2 +main::@2_2: scope:[main] from main::@2_1 + [8] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_3 +main::@2_3: scope:[main] from main::@2_2 + [9] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_4 +main::@2_4: scope:[main] from main::@2_3 + [10] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_5 +main::@2_5: scope:[main] from main::@2_4 + [11] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_6 +main::@2_6: scope:[main] from main::@2_5 + [12] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_7 +main::@2_7: scope:[main] from main::@2_6 + [13] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_8 +main::@2_8: scope:[main] from main::@2_7 + [14] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_9 +main::@2_9: scope:[main] from main::@2_8 + [15] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_10 +main::@2_10: scope:[main] from main::@2_9 + [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_11 +main::@2_11: scope:[main] from main::@2_10 + [17] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_12 +main::@2_12: scope:[main] from main::@2_11 + [18] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_13 +main::@2_13: scope:[main] from main::@2_12 + [19] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_14 +main::@2_14: scope:[main] from main::@2_13 + [20] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_15 +main::@2_15: scope:[main] from main::@2_14 + [21] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_16 +main::@2_16: scope:[main] from main::@2_15 + [22] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_17 +main::@2_17: scope:[main] from main::@2_16 + [23] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_18 +main::@2_18: scope:[main] from main::@2_17 + [24] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_19 +main::@2_19: scope:[main] from main::@2_18 + [25] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_20 +main::@2_20: scope:[main] from main::@2_19 + [26] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_21 +main::@2_21: scope:[main] from main::@2_20 + [27] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_22 +main::@2_22: scope:[main] from main::@2_21 + [28] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_23 +main::@2_23: scope:[main] from main::@2_22 + [29] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_24 +main::@2_24: scope:[main] from main::@2_23 + [30] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@3 +main::@3: scope:[main] from main::@2_24 + [31] (byte) main::x#1 ← ++ (byte) main::x#4 [ main::x#1 ] ( main:2 [ main::x#1 ] ) + [32] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) + to:main::@return +main::@return: scope:[main] from main::@3 + [33] return [ ] ( main:2 [ ] ) + to:@return diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.log b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.log new file mode 100644 index 000000000..561b3a8e3 --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.log @@ -0,0 +1,2061 @@ +PARSING src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill-for.kc +// Fills the screen using an unrolled inner ranged for()-loop + +void main() { + byte* SCREEN = $400; + + for(byte x: 0..39) { + inline for(byte line: 0..24) { + (SCREEN+line*40)[x] = x; + } + + } + +} +SYMBOLS +(label) @1 +(label) @begin +(label) @end +(void()) main() +(byte/signed word/word/dword/signed dword~) main::$0 +(byte*~) main::$1 +(bool~) main::$2 +(bool~) main::$3 +(label) main::@1 +(label) main::@2 +(label) main::@3 +(label) main::@4 +(label) main::@return +(byte*) main::SCREEN +(byte) main::line +(byte) main::x + +Promoting word/signed word/dword/signed dword to byte* in main::SCREEN ← ((byte*)) 1024 +INITIAL CONTROL FLOW GRAPH +@begin: scope:[] from + to:@1 +main: scope:[main] from + (byte*) main::SCREEN ← ((byte*)) (word/signed word/dword/signed dword) 1024 + (byte) main::x ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:main::@1 +main::@1: scope:[main] from main main::@3 + (byte) main::line ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:main::@2 +main::@2: scope:[main] from main::@1 main::@2 + (byte/signed word/word/dword/signed dword~) main::$0 ← (byte) main::line * (byte/signed byte/word/signed word/dword/signed dword) 40 + (byte*~) main::$1 ← (byte*) main::SCREEN + (byte/signed word/word/dword/signed dword~) main::$0 + *((byte*~) main::$1 + (byte) main::x) ← (byte) main::x + (byte) main::line ← (byte) main::line + rangenext(0,24) + (bool~) main::$2 ← (byte) main::line != rangelast(0,24) + unroll if((bool~) main::$2) goto main::@2 + to:main::@3 +main::@3: scope:[main] from main::@2 + (byte) main::x ← (byte) main::x + rangenext(0,39) + (bool~) main::$3 ← (byte) main::x != rangelast(0,39) + if((bool~) main::$3) goto main::@1 + to:main::@4 +main::@4: scope:[main] from main::@3 + to:main::@return +main::@return: scope:[main] from main::@4 + return + to:@return +@1: scope:[] from @begin + call main + to:@end +@end: scope:[] from @1 + +Removing empty block main::@4 +PROCEDURE MODIFY VARIABLE ANALYSIS + +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... + +CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN +@begin: scope:[] from + to:@1 +main: scope:[main] from @1 + (byte*) main::SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024 + (byte) main::x#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:main::@1 +main::@1: scope:[main] from main main::@3 + (byte) main::x#4 ← phi( main/(byte) main::x#0 main::@3/(byte) main::x#1 ) + (byte*) main::SCREEN#2 ← phi( main/(byte*) main::SCREEN#0 main::@3/(byte*) main::SCREEN#3 ) + (byte) main::line#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:main::@2 +main::@2: scope:[main] from main::@1 main::@2 + (byte) main::x#2 ← phi( main::@1/(byte) main::x#4 main::@2/(byte) main::x#2 ) + (byte*) main::SCREEN#1 ← phi( main::@1/(byte*) main::SCREEN#2 main::@2/(byte*) main::SCREEN#1 ) + (byte) main::line#2 ← phi( main::@1/(byte) main::line#0 main::@2/(byte) main::line#1 ) + (byte/signed word/word/dword/signed dword~) main::$0 ← (byte) main::line#2 * (byte/signed byte/word/signed word/dword/signed dword) 40 + (byte*~) main::$1 ← (byte*) main::SCREEN#1 + (byte/signed word/word/dword/signed dword~) main::$0 + *((byte*~) main::$1 + (byte) main::x#2) ← (byte) main::x#2 + (byte) main::line#1 ← (byte) main::line#2 + rangenext(0,24) + (bool~) main::$2 ← (byte) main::line#1 != rangelast(0,24) + unroll if((bool~) main::$2) goto main::@2 + to:main::@3 +main::@3: scope:[main] from main::@2 + (byte*) main::SCREEN#3 ← phi( main::@2/(byte*) main::SCREEN#1 ) + (byte) main::x#3 ← phi( main::@2/(byte) main::x#2 ) + (byte) main::x#1 ← (byte) main::x#3 + rangenext(0,39) + (bool~) main::$3 ← (byte) main::x#1 != rangelast(0,39) + if((bool~) main::$3) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@3 + return + to:@return +@1: scope:[] from @begin + call main + to:@2 +@2: scope:[] from @1 + to:@end +@end: scope:[] from @2 + +SYMBOL TABLE SSA +(label) @1 +(label) @2 +(label) @begin +(label) @end +(void()) main() +(byte/signed word/word/dword/signed dword~) main::$0 +(byte*~) main::$1 +(bool~) main::$2 +(bool~) main::$3 +(label) main::@1 +(label) main::@2 +(label) main::@3 +(label) main::@return +(byte*) main::SCREEN +(byte*) main::SCREEN#0 +(byte*) main::SCREEN#1 +(byte*) main::SCREEN#2 +(byte*) main::SCREEN#3 +(byte) main::line +(byte) main::line#0 +(byte) main::line#1 +(byte) main::line#2 +(byte) main::x +(byte) main::x#0 +(byte) main::x#1 +(byte) main::x#2 +(byte) main::x#3 +(byte) main::x#4 + +OPTIMIZING CONTROL FLOW GRAPH +Culled Empty Block (label) @2 +Succesful SSA optimization Pass2CullEmptyBlocks +Alias (byte) main::x#2 = (byte) main::x#3 +Alias (byte*) main::SCREEN#1 = (byte*) main::SCREEN#3 +Succesful SSA optimization Pass2AliasElimination +Self Phi Eliminated (byte*) main::SCREEN#1 +Self Phi Eliminated (byte) main::x#2 +Succesful SSA optimization Pass2SelfPhiElimination +Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#2 +Redundant Phi (byte) main::x#2 (byte) main::x#4 +Succesful SSA optimization Pass2RedundantPhiElimination +Simple Condition (bool~) main::$2 unroll if((byte) main::line#1!=rangelast(0,24)) goto main::@2 +Simple Condition (bool~) main::$3 if((byte) main::x#1!=rangelast(0,39)) goto main::@1 +Succesful SSA optimization Pass2ConditionalJumpSimplification +Constant (const byte*) main::SCREEN#0 = ((byte*))1024 +Constant (const byte) main::x#0 = 0 +Constant (const byte) main::line#0 = 0 +Succesful SSA optimization Pass2ConstantIdentification +Resolved ranged next value main::line#1 ← ++ main::line#2 to ++ +Resolved ranged comparison value unroll if(main::line#1!=rangelast(0,24)) goto main::@2 to (byte/signed byte/word/signed word/dword/signed dword) 25 +Resolved ranged next value main::x#1 ← ++ main::x#4 to ++ +Resolved ranged comparison value if(main::x#1!=rangelast(0,39)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 40 +Self Phi Eliminated (byte*) main::SCREEN#2 +Succesful SSA optimization Pass2SelfPhiElimination +Redundant Phi (byte*) main::SCREEN#2 (const byte*) main::SCREEN#0 +Succesful SSA optimization Pass2RedundantPhiElimination +Unrolling loop Loop head: main::@2 tails: main::@2 blocks: main::@2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#2 (const byte) main::line#0 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$0 = main::line#0*40 +Constant (const byte) main::line#1 = ++main::line#0 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$1 = main::SCREEN#0+main::$0 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [6] if((const byte) main::line#1!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_1 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@3 main::@return +Unrolling loop Loop head: main::@2_1 tails: main::@2_1 blocks: main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#3 (const byte) main::line#1 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$4 = main::line#1*40 +Constant (const byte) main::line#4 = ++main::line#1 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$5 = main::SCREEN#0+main::$4 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [8] if((const byte) main::line#4!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_2 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@3 main::@return +Unrolling loop Loop head: main::@2_2 tails: main::@2_2 blocks: main::@2_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#5 (const byte) main::line#4 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$6 = main::line#4*40 +Constant (const byte) main::line#6 = ++main::line#4 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$7 = main::SCREEN#0+main::$6 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [9] if((const byte) main::line#6!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_3 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@3 main::@return +Unrolling loop Loop head: main::@2_3 tails: main::@2_3 blocks: main::@2_3 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#7 (const byte) main::line#6 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$8 = main::line#6*40 +Constant (const byte) main::line#8 = ++main::line#6 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$9 = main::SCREEN#0+main::$8 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [10] if((const byte) main::line#8!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_4 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@3 main::@return +Unrolling loop Loop head: main::@2_4 tails: main::@2_4 blocks: main::@2_4 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#9 (const byte) main::line#8 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$10 = main::line#8*40 +Constant (const byte) main::line#10 = ++main::line#8 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$11 = main::SCREEN#0+main::$10 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [11] if((const byte) main::line#10!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_5 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@3 main::@return +Unrolling loop Loop head: main::@2_5 tails: main::@2_5 blocks: main::@2_5 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#11 (const byte) main::line#10 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$12 = main::line#10*40 +Constant (const byte) main::line#12 = ++main::line#10 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$13 = main::SCREEN#0+main::$12 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [12] if((const byte) main::line#12!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_6 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@3 main::@return +Unrolling loop Loop head: main::@2_6 tails: main::@2_6 blocks: main::@2_6 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#13 (const byte) main::line#12 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$14 = main::line#12*40 +Constant (const byte) main::line#14 = ++main::line#12 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$15 = main::SCREEN#0+main::$14 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [13] if((const byte) main::line#14!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_7 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@3 main::@return +Unrolling loop Loop head: main::@2_7 tails: main::@2_7 blocks: main::@2_7 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#15 (const byte) main::line#14 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$16 = main::line#14*40 +Constant (const byte) main::line#16 = ++main::line#14 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$17 = main::SCREEN#0+main::$16 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [14] if((const byte) main::line#16!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_8 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@3 main::@return +Unrolling loop Loop head: main::@2_8 tails: main::@2_8 blocks: main::@2_8 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#17 (const byte) main::line#16 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$18 = main::line#16*40 +Constant (const byte) main::line#18 = ++main::line#16 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$19 = main::SCREEN#0+main::$18 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [15] if((const byte) main::line#18!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_9 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@3 main::@return +Unrolling loop Loop head: main::@2_9 tails: main::@2_9 blocks: main::@2_9 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#19 (const byte) main::line#18 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$20 = main::line#18*40 +Constant (const byte) main::line#20 = ++main::line#18 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$21 = main::SCREEN#0+main::$20 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [16] if((const byte) main::line#20!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_10 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@3 main::@return +Unrolling loop Loop head: main::@2_10 tails: main::@2_10 blocks: main::@2_10 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#21 (const byte) main::line#20 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$22 = main::line#20*40 +Constant (const byte) main::line#22 = ++main::line#20 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$23 = main::SCREEN#0+main::$22 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [17] if((const byte) main::line#22!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_11 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@3 main::@return +Unrolling loop Loop head: main::@2_11 tails: main::@2_11 blocks: main::@2_11 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#23 (const byte) main::line#22 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$24 = main::line#22*40 +Constant (const byte) main::line#24 = ++main::line#22 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$25 = main::SCREEN#0+main::$24 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [18] if((const byte) main::line#24!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_12 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@3 main::@return +Unrolling loop Loop head: main::@2_12 tails: main::@2_12 blocks: main::@2_12 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#25 (const byte) main::line#24 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$26 = main::line#24*40 +Constant (const byte) main::line#26 = ++main::line#24 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$27 = main::SCREEN#0+main::$26 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [19] if((const byte) main::line#26!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_13 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@3 main::@return +Unrolling loop Loop head: main::@2_13 tails: main::@2_13 blocks: main::@2_13 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#27 (const byte) main::line#26 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$28 = main::line#26*40 +Constant (const byte) main::line#28 = ++main::line#26 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$29 = main::SCREEN#0+main::$28 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [20] if((const byte) main::line#28!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_14 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@3 main::@return +Unrolling loop Loop head: main::@2_14 tails: main::@2_14 blocks: main::@2_14 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#29 (const byte) main::line#28 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$30 = main::line#28*40 +Constant (const byte) main::line#30 = ++main::line#28 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$31 = main::SCREEN#0+main::$30 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [21] if((const byte) main::line#30!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_15 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@3 main::@return +Unrolling loop Loop head: main::@2_15 tails: main::@2_15 blocks: main::@2_15 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#31 (const byte) main::line#30 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$32 = main::line#30*40 +Constant (const byte) main::line#32 = ++main::line#30 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$33 = main::SCREEN#0+main::$32 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [22] if((const byte) main::line#32!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_16 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@3 main::@return +Unrolling loop Loop head: main::@2_16 tails: main::@2_16 blocks: main::@2_16 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#33 (const byte) main::line#32 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$34 = main::line#32*40 +Constant (const byte) main::line#34 = ++main::line#32 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$35 = main::SCREEN#0+main::$34 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [23] if((const byte) main::line#34!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_17 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@3 main::@return +Unrolling loop Loop head: main::@2_17 tails: main::@2_17 blocks: main::@2_17 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#35 (const byte) main::line#34 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$36 = main::line#34*40 +Constant (const byte) main::line#36 = ++main::line#34 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$37 = main::SCREEN#0+main::$36 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [24] if((const byte) main::line#36!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_18 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@3 main::@return +Unrolling loop Loop head: main::@2_18 tails: main::@2_18 blocks: main::@2_18 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#37 (const byte) main::line#36 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$38 = main::line#36*40 +Constant (const byte) main::line#38 = ++main::line#36 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$39 = main::SCREEN#0+main::$38 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [25] if((const byte) main::line#38!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_19 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@3 main::@return +Unrolling loop Loop head: main::@2_19 tails: main::@2_19 blocks: main::@2_19 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#39 (const byte) main::line#38 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$40 = main::line#38*40 +Constant (const byte) main::line#40 = ++main::line#38 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$41 = main::SCREEN#0+main::$40 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [26] if((const byte) main::line#40!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_20 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@2_20 main::@3 main::@return +Unrolling loop Loop head: main::@2_20 tails: main::@2_20 blocks: main::@2_20 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#41 (const byte) main::line#40 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$42 = main::line#40*40 +Constant (const byte) main::line#42 = ++main::line#40 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$43 = main::SCREEN#0+main::$42 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [27] if((const byte) main::line#42!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_21 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@2_20 main::@2_21 main::@3 main::@return +Unrolling loop Loop head: main::@2_21 tails: main::@2_21 blocks: main::@2_21 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#43 (const byte) main::line#42 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$44 = main::line#42*40 +Constant (const byte) main::line#44 = ++main::line#42 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$45 = main::SCREEN#0+main::$44 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [28] if((const byte) main::line#44!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_22 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@2_20 main::@2_21 main::@2_22 main::@3 main::@return +Unrolling loop Loop head: main::@2_22 tails: main::@2_22 blocks: main::@2_22 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#45 (const byte) main::line#44 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$46 = main::line#44*40 +Constant (const byte) main::line#46 = ++main::line#44 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$47 = main::SCREEN#0+main::$46 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [29] if((const byte) main::line#46!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_23 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@2_20 main::@2_21 main::@2_22 main::@2_23 main::@3 main::@return +Unrolling loop Loop head: main::@2_23 tails: main::@2_23 blocks: main::@2_23 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#47 (const byte) main::line#46 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$48 = main::line#46*40 +Constant (const byte) main::line#48 = ++main::line#46 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$49 = main::SCREEN#0+main::$48 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [30] if((const byte) main::line#48!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_24 +Succesful SSA optimization Pass2ConstantIfs +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@2_20 main::@2_21 main::@2_22 main::@2_23 main::@2_24 main::@3 main::@return +Unrolling loop Loop head: main::@2_24 tails: main::@2_24 blocks: main::@2_24 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#49 (const byte) main::line#48 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$50 = main::line#48*40 +Constant (const byte) main::line#50 = ++main::line#48 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$51 = main::SCREEN#0+main::$50 +Succesful SSA optimization Pass2ConstantIdentification +Removing PHI-reference to removed block (main::@2_24) in block main::@2_25 +if() condition always false - eliminating [31] if((const byte) main::line#50!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@2_25 +Succesful SSA optimization Pass2ConstantIfs +Eliminating unused constant (const byte) main::line#50 +Succesful SSA optimization PassNEliminateUnusedVars +Eliminating variable (byte) main::line#51 from unused block main::@2_25 +Eliminating variable (byte/signed word/word/dword/signed dword~) main::$52 and from unused block main::@2_25 +Eliminating variable (byte*~) main::$53 and from unused block main::@2_25 +Eliminating variable (byte) main::line#52 and from unused block main::@2_25 +Removing unused block main::@2_25 +Succesful SSA optimization Pass2EliminateUnusedBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@2_20 main::@2_21 main::@2_22 main::@2_23 main::@2_24 main::@3 main::@return +OPTIMIZING CONTROL FLOW GRAPH +Inlining constant with var siblings (const byte) main::x#0 +Inlining constant with var siblings (const byte) main::x#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#4 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#6 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#8 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#10 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#12 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#14 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#16 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#18 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#20 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#22 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#24 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#26 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#28 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#30 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#32 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#34 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#36 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#38 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#40 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#42 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#44 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#46 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Inlining constant with different constant siblings (const byte) main::line#48 +Constant inlined main::$50 = ++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$51 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$12 = ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$13 = (const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$14 = ++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$15 = (const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$10 = ++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$11 = (const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#42 = ++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#44 = ++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$16 = ++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$17 = (const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$18 = ++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$19 = (const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#40 = ++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#4 = ++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#1 = ++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#46 = ++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#48 = ++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$40 = ++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#8 = ++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#6 = ++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$45 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$46 = ++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$47 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$48 = ++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$41 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$42 = ++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$43 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$44 = ++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#10 = ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#12 = ++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$49 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#18 = ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#14 = ++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#16 = ++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$34 = ++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$35 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$36 = ++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$37 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$30 = ++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$31 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$32 = ++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$33 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#20 = ++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#22 = ++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$38 = ++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$39 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#28 = ++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#24 = ++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#26 = ++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$23 = (const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$24 = ++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$25 = (const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$26 = ++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$20 = ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$21 = (const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$22 = ++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#32 = ++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#34 = ++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$1 = (const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$27 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$28 = ++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$29 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#30 = ++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$0 = (byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$5 = (const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$6 = ++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$4 = ++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$9 = (const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#36 = ++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$7 = (const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#38 = ++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$8 = ++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Succesful SSA optimization Pass2ConstantInlining +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@2_20 main::@2_21 main::@2_22 main::@2_23 main::@2_24 main::@3 main::@return +Added new block during phi lifting main::@5(between main::@3 and main::@1) +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@2_20 main::@2_21 main::@2_22 main::@2_23 main::@2_24 main::@3 main::@return main::@5 +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @1 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +CALL GRAPH +Calls in [] to main:2 + +Propagating live ranges... +Propagating live ranges... +Created 1 initial phi equivalence classes +Coalesced [34] main::x#5 ← main::x#1 +Coalesced down to 1 phi equivalence classes +Culled Empty Block (label) main::@5 +Block Sequence Planned @begin @1 @end main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_8 main::@2_9 main::@2_10 main::@2_11 main::@2_12 main::@2_13 main::@2_14 main::@2_15 main::@2_16 main::@2_17 main::@2_18 main::@2_19 main::@2_20 main::@2_21 main::@2_22 main::@2_23 main::@2_24 main::@3 main::@return +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @1 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Propagating live ranges... +Propagating live ranges... + +FINAL CONTROL FLOW GRAPH +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@1 +@1: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main [ ] ( ) + to:@end +@end: scope:[] from @1 + [3] phi() [ ] ( ) +main: scope:[main] from @1 + [4] phi() [ ] ( main:2 [ ] ) + to:main::@1 +main::@1: scope:[main] from main main::@3 + [5] (byte) main::x#4 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@3/(byte) main::x#1 ) [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2 +main::@2: scope:[main] from main::@1 + [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_1 +main::@2_1: scope:[main] from main::@2 + [7] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_2 +main::@2_2: scope:[main] from main::@2_1 + [8] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_3 +main::@2_3: scope:[main] from main::@2_2 + [9] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_4 +main::@2_4: scope:[main] from main::@2_3 + [10] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_5 +main::@2_5: scope:[main] from main::@2_4 + [11] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_6 +main::@2_6: scope:[main] from main::@2_5 + [12] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_7 +main::@2_7: scope:[main] from main::@2_6 + [13] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_8 +main::@2_8: scope:[main] from main::@2_7 + [14] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_9 +main::@2_9: scope:[main] from main::@2_8 + [15] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_10 +main::@2_10: scope:[main] from main::@2_9 + [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_11 +main::@2_11: scope:[main] from main::@2_10 + [17] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_12 +main::@2_12: scope:[main] from main::@2_11 + [18] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_13 +main::@2_13: scope:[main] from main::@2_12 + [19] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_14 +main::@2_14: scope:[main] from main::@2_13 + [20] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_15 +main::@2_15: scope:[main] from main::@2_14 + [21] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_16 +main::@2_16: scope:[main] from main::@2_15 + [22] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_17 +main::@2_17: scope:[main] from main::@2_16 + [23] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_18 +main::@2_18: scope:[main] from main::@2_17 + [24] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_19 +main::@2_19: scope:[main] from main::@2_18 + [25] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_20 +main::@2_20: scope:[main] from main::@2_19 + [26] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_21 +main::@2_21: scope:[main] from main::@2_20 + [27] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_22 +main::@2_22: scope:[main] from main::@2_21 + [28] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_23 +main::@2_23: scope:[main] from main::@2_22 + [29] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@2_24 +main::@2_24: scope:[main] from main::@2_23 + [30] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) + to:main::@3 +main::@3: scope:[main] from main::@2_24 + [31] (byte) main::x#1 ← ++ (byte) main::x#4 [ main::x#1 ] ( main:2 [ main::x#1 ] ) + [32] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) + to:main::@return +main::@return: scope:[main] from main::@3 + [33] return [ ] ( main:2 [ ] ) + to:@return + +DOMINATORS +@begin dominated by @begin +@1 dominated by @begin @1 +@end dominated by @end @begin @1 +main dominated by main @begin @1 +main::@1 dominated by main main::@1 @begin @1 +main::@2 dominated by main main::@1 main::@2 @begin @1 +main::@2_1 dominated by main main::@1 main::@2 main::@2_1 @begin @1 +main::@2_2 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 @begin @1 +main::@2_3 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 @begin @1 +main::@2_4 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 @begin main::@2_4 @1 +main::@2_5 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 @begin main::@2_4 main::@2_5 @1 +main::@2_6 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 @begin main::@2_4 main::@2_5 main::@2_6 @1 +main::@2_7 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 @1 +main::@2_8 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 @1 +main::@2_9 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 @1 +main::@2_10 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 @1 main::@2_10 +main::@2_11 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 @1 main::@2_11 main::@2_10 +main::@2_12 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 @1 main::@2_12 main::@2_11 main::@2_10 +main::@2_13 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 +main::@2_14 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_14 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 +main::@2_15 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_14 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_15 +main::@2_16 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_14 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_16 main::@2_15 +main::@2_17 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_14 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_17 main::@2_16 main::@2_15 +main::@2_18 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_14 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_18 main::@2_17 main::@2_16 main::@2_15 +main::@2_19 dominated by main main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_14 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_19 main::@2_18 main::@2_17 main::@2_16 main::@2_15 +main::@2_20 dominated by main main::@2_20 main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_14 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_19 main::@2_18 main::@2_17 main::@2_16 main::@2_15 +main::@2_21 dominated by main main::@2_21 main::@2_20 main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_14 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_19 main::@2_18 main::@2_17 main::@2_16 main::@2_15 +main::@2_22 dominated by main main::@2_22 main::@2_21 main::@2_20 main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_14 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_19 main::@2_18 main::@2_17 main::@2_16 main::@2_15 +main::@2_23 dominated by main main::@2_23 main::@2_22 main::@2_21 main::@2_20 main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_14 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_19 main::@2_18 main::@2_17 main::@2_16 main::@2_15 +main::@2_24 dominated by main main::@2_24 main::@2_23 main::@2_22 main::@2_21 main::@2_20 main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_14 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_19 main::@2_18 main::@2_17 main::@2_16 main::@2_15 +main::@3 dominated by main main::@2_24 main::@2_23 main::@2_22 main::@2_21 main::@2_20 main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_14 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_19 main::@2_18 main::@2_17 main::@2_16 main::@2_15 +main::@return dominated by main::@return main main::@2_24 main::@2_23 main::@2_22 main::@2_21 main::@2_20 main::@1 main::@2 main::@2_1 main::@2_2 main::@2_3 main::@3 main::@2_8 main::@2_9 @begin main::@2_4 main::@2_5 main::@2_6 main::@2_7 main::@2_14 @1 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_19 main::@2_18 main::@2_17 main::@2_16 main::@2_15 + +NATURAL LOOPS +Found back edge: Loop head: main::@1 tails: main::@3 blocks: null +Populated: Loop head: main::@1 tails: main::@3 blocks: main::@3 main::@2_24 main::@2_23 main::@2_22 main::@2_21 main::@2_20 main::@2_19 main::@2_18 main::@2_17 main::@2_16 main::@2_15 main::@2_14 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_9 main::@2_8 main::@2_7 main::@2_6 main::@2_5 main::@2_4 main::@2_3 main::@2_2 main::@2_1 main::@2 main::@1 +Loop head: main::@1 tails: main::@3 blocks: main::@3 main::@2_24 main::@2_23 main::@2_22 main::@2_21 main::@2_20 main::@2_19 main::@2_18 main::@2_17 main::@2_16 main::@2_15 main::@2_14 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_9 main::@2_8 main::@2_7 main::@2_6 main::@2_5 main::@2_4 main::@2_3 main::@2_2 main::@2_1 main::@2 main::@1 + +NATURAL LOOPS WITH DEPTH +Found 0 loops in scope [] +Found 1 loops in scope [main] + Loop head: main::@1 tails: main::@3 blocks: main::@3 main::@2_24 main::@2_23 main::@2_22 main::@2_21 main::@2_20 main::@2_19 main::@2_18 main::@2_17 main::@2_16 main::@2_15 main::@2_14 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_9 main::@2_8 main::@2_7 main::@2_6 main::@2_5 main::@2_4 main::@2_3 main::@2_2 main::@2_1 main::@2 main::@1 +Loop head: main::@1 tails: main::@3 blocks: main::@3 main::@2_24 main::@2_23 main::@2_22 main::@2_21 main::@2_20 main::@2_19 main::@2_18 main::@2_17 main::@2_16 main::@2_15 main::@2_14 main::@2_13 main::@2_12 main::@2_11 main::@2_10 main::@2_9 main::@2_8 main::@2_7 main::@2_6 main::@2_5 main::@2_4 main::@2_3 main::@2_2 main::@2_1 main::@2 main::@1 depth: 1 + + +VARIABLE REGISTER WEIGHTS +(void()) main() +(byte*) main::SCREEN +(byte) main::line +(byte) main::x +(byte) main::x#1 16.5 +(byte) main::x#4 22.00000000000001 + +Initial phi equivalence classes +[ main::x#4 main::x#1 ] +Complete equivalence classes +[ main::x#4 main::x#1 ] +Allocated zp ZP_BYTE:2 [ main::x#4 main::x#1 ] + +INITIAL ASM +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 +//SEG4 @1 +b1: +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend +//SEG8 @end +bend: +//SEG9 main +main: { + .label SCREEN = $400 + .label x = 2 + //SEG10 [5] phi from main to main::@1 [phi:main->main::@1] + b1_from_main: + //SEG11 [5] phi (byte) main::x#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + lda #0 + sta x + jmp b1 + //SEG12 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1] + b1_from_b3: + //SEG13 [5] phi (byte) main::x#4 = (byte) main::x#1 [phi:main::@3->main::@1#0] -- register_copy + jmp b1 + //SEG14 main::@1 + b1: + jmp b2 + //SEG15 main::@2 + b2: + //SEG16 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+0*$28,y + jmp b2_1 + //SEG17 main::@2_1 + b2_1: + //SEG18 [7] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1)*$28,y + jmp b2_2 + //SEG19 main::@2_2 + b2_2: + //SEG20 [8] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1)*$28,y + jmp b2_3 + //SEG21 main::@2_3 + b2_3: + //SEG22 [9] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1)*$28,y + jmp b2_4 + //SEG23 main::@2_4 + b2_4: + //SEG24 [10] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1)*$28,y + jmp b2_5 + //SEG25 main::@2_5 + b2_5: + //SEG26 [11] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1)*$28,y + jmp b2_6 + //SEG27 main::@2_6 + b2_6: + //SEG28 [12] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1)*$28,y + jmp b2_7 + //SEG29 main::@2_7 + b2_7: + //SEG30 [13] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1)*$28,y + jmp b2_8 + //SEG31 main::@2_8 + b2_8: + //SEG32 [14] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1)*$28,y + jmp b2_9 + //SEG33 main::@2_9 + b2_9: + //SEG34 [15] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_10 + //SEG35 main::@2_10 + b2_10: + //SEG36 [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_11 + //SEG37 main::@2_11 + b2_11: + //SEG38 [17] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_12 + //SEG39 main::@2_12 + b2_12: + //SEG40 [18] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_13 + //SEG41 main::@2_13 + b2_13: + //SEG42 [19] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_14 + //SEG43 main::@2_14 + b2_14: + //SEG44 [20] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_15 + //SEG45 main::@2_15 + b2_15: + //SEG46 [21] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_16 + //SEG47 main::@2_16 + b2_16: + //SEG48 [22] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_17 + //SEG49 main::@2_17 + b2_17: + //SEG50 [23] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_18 + //SEG51 main::@2_18 + b2_18: + //SEG52 [24] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_19 + //SEG53 main::@2_19 + b2_19: + //SEG54 [25] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_20 + //SEG55 main::@2_20 + b2_20: + //SEG56 [26] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_21 + //SEG57 main::@2_21 + b2_21: + //SEG58 [27] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_22 + //SEG59 main::@2_22 + b2_22: + //SEG60 [28] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_23 + //SEG61 main::@2_23 + b2_23: + //SEG62 [29] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b2_24 + //SEG63 main::@2_24 + b2_24: + //SEG64 [30] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3 + //SEG65 main::@3 + b3: + //SEG66 [31] (byte) main::x#1 ← ++ (byte) main::x#4 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1=_inc_vbuz1 + inc x + //SEG67 [32] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1_neq_vbuc1_then_la1 + lda x + cmp #$28 + bne b1_from_b3 + jmp breturn + //SEG68 main::@return + breturn: + //SEG69 [33] return [ ] ( main:2 [ ] ) + rts +} + +REGISTER UPLIFT POTENTIAL REGISTERS +Potential registers zp ZP_BYTE:2 [ main::x#4 main::x#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , + +REGISTER UPLIFT SCOPES +Uplift Scope [main] 38.5: zp ZP_BYTE:2 [ main::x#4 main::x#1 ] +Uplift Scope [] + +Uplifting [main] best 2723 combination reg byte x [ main::x#4 main::x#1 ] +Uplifting [] best 2723 combination + +ASSEMBLER BEFORE OPTIMIZATION +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 +//SEG4 @1 +b1: +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend +//SEG8 @end +bend: +//SEG9 main +main: { + .label SCREEN = $400 + //SEG10 [5] phi from main to main::@1 [phi:main->main::@1] + b1_from_main: + //SEG11 [5] phi (byte) main::x#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 + ldx #0 + jmp b1 + //SEG12 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1] + b1_from_b3: + //SEG13 [5] phi (byte) main::x#4 = (byte) main::x#1 [phi:main::@3->main::@1#0] -- register_copy + jmp b1 + //SEG14 main::@1 + b1: + jmp b2 + //SEG15 main::@2 + b2: + //SEG16 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+0*$28,x + jmp b2_1 + //SEG17 main::@2_1 + b2_1: + //SEG18 [7] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1)*$28,x + jmp b2_2 + //SEG19 main::@2_2 + b2_2: + //SEG20 [8] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1)*$28,x + jmp b2_3 + //SEG21 main::@2_3 + b2_3: + //SEG22 [9] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1)*$28,x + jmp b2_4 + //SEG23 main::@2_4 + b2_4: + //SEG24 [10] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1)*$28,x + jmp b2_5 + //SEG25 main::@2_5 + b2_5: + //SEG26 [11] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1)*$28,x + jmp b2_6 + //SEG27 main::@2_6 + b2_6: + //SEG28 [12] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1)*$28,x + jmp b2_7 + //SEG29 main::@2_7 + b2_7: + //SEG30 [13] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1)*$28,x + jmp b2_8 + //SEG31 main::@2_8 + b2_8: + //SEG32 [14] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1)*$28,x + jmp b2_9 + //SEG33 main::@2_9 + b2_9: + //SEG34 [15] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_10 + //SEG35 main::@2_10 + b2_10: + //SEG36 [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_11 + //SEG37 main::@2_11 + b2_11: + //SEG38 [17] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_12 + //SEG39 main::@2_12 + b2_12: + //SEG40 [18] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_13 + //SEG41 main::@2_13 + b2_13: + //SEG42 [19] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_14 + //SEG43 main::@2_14 + b2_14: + //SEG44 [20] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_15 + //SEG45 main::@2_15 + b2_15: + //SEG46 [21] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_16 + //SEG47 main::@2_16 + b2_16: + //SEG48 [22] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_17 + //SEG49 main::@2_17 + b2_17: + //SEG50 [23] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_18 + //SEG51 main::@2_18 + b2_18: + //SEG52 [24] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_19 + //SEG53 main::@2_19 + b2_19: + //SEG54 [25] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_20 + //SEG55 main::@2_20 + b2_20: + //SEG56 [26] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_21 + //SEG57 main::@2_21 + b2_21: + //SEG58 [27] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_22 + //SEG59 main::@2_22 + b2_22: + //SEG60 [28] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_23 + //SEG61 main::@2_23 + b2_23: + //SEG62 [29] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b2_24 + //SEG63 main::@2_24 + b2_24: + //SEG64 [30] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3 + //SEG65 main::@3 + b3: + //SEG66 [31] (byte) main::x#1 ← ++ (byte) main::x#4 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuxx=_inc_vbuxx + inx + //SEG67 [32] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuxx_neq_vbuc1_then_la1 + cpx #$28 + bne b1_from_b3 + jmp breturn + //SEG68 main::@return + breturn: + //SEG69 [33] return [ ] ( main:2 [ ] ) + rts +} + +ASSEMBLER OPTIMIZATIONS +Removing instruction jmp b1 +Removing instruction jmp bend +Removing instruction jmp b1 +Removing instruction jmp b2 +Removing instruction jmp b2_1 +Removing instruction jmp b2_2 +Removing instruction jmp b2_3 +Removing instruction jmp b2_4 +Removing instruction jmp b2_5 +Removing instruction jmp b2_6 +Removing instruction jmp b2_7 +Removing instruction jmp b2_8 +Removing instruction jmp b2_9 +Removing instruction jmp b2_10 +Removing instruction jmp b2_11 +Removing instruction jmp b2_12 +Removing instruction jmp b2_13 +Removing instruction jmp b2_14 +Removing instruction jmp b2_15 +Removing instruction jmp b2_16 +Removing instruction jmp b2_17 +Removing instruction jmp b2_18 +Removing instruction jmp b2_19 +Removing instruction jmp b2_20 +Removing instruction jmp b2_21 +Removing instruction jmp b2_22 +Removing instruction jmp b2_23 +Removing instruction jmp b2_24 +Removing instruction jmp b3 +Removing instruction jmp breturn +Succesful ASM optimization Pass5NextJumpElimination +Replacing label b1 with b2 +Replacing label b1_from_b3 with b2 +Removing instruction bbegin: +Removing instruction b1_from_bbegin: +Removing instruction main_from_b1: +Removing instruction bend_from_b1: +Removing instruction b1_from_b3: +Removing instruction b1: +Succesful ASM optimization Pass5RedundantLabelElimination +Removing instruction b1: +Removing instruction bend: +Removing instruction b1_from_main: +Removing instruction b2_1: +Removing instruction b2_2: +Removing instruction b2_3: +Removing instruction b2_4: +Removing instruction b2_5: +Removing instruction b2_6: +Removing instruction b2_7: +Removing instruction b2_8: +Removing instruction b2_9: +Removing instruction b2_10: +Removing instruction b2_11: +Removing instruction b2_12: +Removing instruction b2_13: +Removing instruction b2_14: +Removing instruction b2_15: +Removing instruction b2_16: +Removing instruction b2_17: +Removing instruction b2_18: +Removing instruction b2_19: +Removing instruction b2_20: +Removing instruction b2_21: +Removing instruction b2_22: +Removing instruction b2_23: +Removing instruction b2_24: +Removing instruction b3: +Removing instruction breturn: +Succesful ASM optimization Pass5UnusedLabelElimination +Removing instruction jmp b2 +Succesful ASM optimization Pass5NextJumpElimination + +FINAL SYMBOL TABLE +(label) @1 +(label) @begin +(label) @end +(void()) main() +(label) main::@1 +(label) main::@2 +(label) main::@2_1 +(label) main::@2_10 +(label) main::@2_11 +(label) main::@2_12 +(label) main::@2_13 +(label) main::@2_14 +(label) main::@2_15 +(label) main::@2_16 +(label) main::@2_17 +(label) main::@2_18 +(label) main::@2_19 +(label) main::@2_2 +(label) main::@2_20 +(label) main::@2_21 +(label) main::@2_22 +(label) main::@2_23 +(label) main::@2_24 +(label) main::@2_3 +(label) main::@2_4 +(label) main::@2_5 +(label) main::@2_6 +(label) main::@2_7 +(label) main::@2_8 +(label) main::@2_9 +(label) main::@3 +(label) main::@return +(byte*) main::SCREEN +(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024 +(byte) main::line +(byte) main::x +(byte) main::x#1 reg byte x 16.5 +(byte) main::x#4 reg byte x 22.00000000000001 + +reg byte x [ main::x#4 main::x#1 ] + + +FINAL ASSEMBLER +Score: 1847 + +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +//SEG4 @1 +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +//SEG8 @end +//SEG9 main +main: { + .label SCREEN = $400 + //SEG10 [5] phi from main to main::@1 [phi:main->main::@1] + //SEG11 [5] phi (byte) main::x#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 + ldx #0 + //SEG12 [5] phi from main::@3 to main::@1 [phi:main::@3->main::@1] + //SEG13 [5] phi (byte) main::x#4 = (byte) main::x#1 [phi:main::@3->main::@1#0] -- register_copy + //SEG14 main::@1 + //SEG15 main::@2 + b2: + //SEG16 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+0*$28,x + //SEG17 main::@2_1 + //SEG18 [7] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1)*$28,x + //SEG19 main::@2_2 + //SEG20 [8] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1)*$28,x + //SEG21 main::@2_3 + //SEG22 [9] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1)*$28,x + //SEG23 main::@2_4 + //SEG24 [10] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1)*$28,x + //SEG25 main::@2_5 + //SEG26 [11] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1)*$28,x + //SEG27 main::@2_6 + //SEG28 [12] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1)*$28,x + //SEG29 main::@2_7 + //SEG30 [13] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1)*$28,x + //SEG31 main::@2_8 + //SEG32 [14] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1)*$28,x + //SEG33 main::@2_9 + //SEG34 [15] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1)*$28,x + //SEG35 main::@2_10 + //SEG36 [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG37 main::@2_11 + //SEG38 [17] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG39 main::@2_12 + //SEG40 [18] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG41 main::@2_13 + //SEG42 [19] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG43 main::@2_14 + //SEG44 [20] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG45 main::@2_15 + //SEG46 [21] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG47 main::@2_16 + //SEG48 [22] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG49 main::@2_17 + //SEG50 [23] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG51 main::@2_18 + //SEG52 [24] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG53 main::@2_19 + //SEG54 [25] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG55 main::@2_20 + //SEG56 [26] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG57 main::@2_21 + //SEG58 [27] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG59 main::@2_22 + //SEG60 [28] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG61 main::@2_23 + //SEG62 [29] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG63 main::@2_24 + //SEG64 [30] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#4) ← (byte) main::x#4 [ main::x#4 ] ( main:2 [ main::x#4 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG65 main::@3 + //SEG66 [31] (byte) main::x#1 ← ++ (byte) main::x#4 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuxx=_inc_vbuxx + inx + //SEG67 [32] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuxx_neq_vbuc1_then_la1 + cpx #$28 + bne b2 + //SEG68 main::@return + //SEG69 [33] return [ ] ( main:2 [ ] ) + rts +} + diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.sym b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.sym new file mode 100644 index 000000000..72c659a80 --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-for.sym @@ -0,0 +1,40 @@ +(label) @1 +(label) @begin +(label) @end +(void()) main() +(label) main::@1 +(label) main::@2 +(label) main::@2_1 +(label) main::@2_10 +(label) main::@2_11 +(label) main::@2_12 +(label) main::@2_13 +(label) main::@2_14 +(label) main::@2_15 +(label) main::@2_16 +(label) main::@2_17 +(label) main::@2_18 +(label) main::@2_19 +(label) main::@2_2 +(label) main::@2_20 +(label) main::@2_21 +(label) main::@2_22 +(label) main::@2_23 +(label) main::@2_24 +(label) main::@2_3 +(label) main::@2_4 +(label) main::@2_5 +(label) main::@2_6 +(label) main::@2_7 +(label) main::@2_8 +(label) main::@2_9 +(label) main::@3 +(label) main::@return +(byte*) main::SCREEN +(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024 +(byte) main::line +(byte) main::x +(byte) main::x#1 reg byte x 16.5 +(byte) main::x#4 reg byte x 22.00000000000001 + +reg byte x [ main::x#4 main::x#1 ] diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.asm b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.asm new file mode 100644 index 000000000..79f263318 --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.asm @@ -0,0 +1,63 @@ +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + jsr main +main: { + .label SCREEN = $400 + ldx #0 + b3: + txa + sta SCREEN+0*$28,x + txa + sta SCREEN+(0+1)*$28,x + txa + sta SCREEN+(0+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + inx + cpx #$28 + bne b3 + rts +} diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.cfg b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.cfg new file mode 100644 index 000000000..6412efdbc --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.cfg @@ -0,0 +1,97 @@ +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@1 +@1: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main [ ] ( ) + to:@end +@end: scope:[] from @1 + [3] phi() [ ] ( ) +main: scope:[main] from @1 + [4] phi() [ ] ( main:2 [ ] ) + to:main::@1 +main::@1: scope:[main] from main main::@4 + [5] (byte) main::x#5 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@4/(byte) main::x#1 ) [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3 +main::@3: scope:[main] from main::@1 + [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_1 +main::@3_1: scope:[main] from main::@3 + [7] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_2 +main::@3_2: scope:[main] from main::@3_1 + [8] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_3 +main::@3_3: scope:[main] from main::@3_2 + [9] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_4 +main::@3_4: scope:[main] from main::@3_3 + [10] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_5 +main::@3_5: scope:[main] from main::@3_4 + [11] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_6 +main::@3_6: scope:[main] from main::@3_5 + [12] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_7 +main::@3_7: scope:[main] from main::@3_6 + [13] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_8 +main::@3_8: scope:[main] from main::@3_7 + [14] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_9 +main::@3_9: scope:[main] from main::@3_8 + [15] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_10 +main::@3_10: scope:[main] from main::@3_9 + [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_11 +main::@3_11: scope:[main] from main::@3_10 + [17] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_12 +main::@3_12: scope:[main] from main::@3_11 + [18] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_13 +main::@3_13: scope:[main] from main::@3_12 + [19] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_14 +main::@3_14: scope:[main] from main::@3_13 + [20] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_15 +main::@3_15: scope:[main] from main::@3_14 + [21] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_16 +main::@3_16: scope:[main] from main::@3_15 + [22] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_17 +main::@3_17: scope:[main] from main::@3_16 + [23] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_18 +main::@3_18: scope:[main] from main::@3_17 + [24] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_19 +main::@3_19: scope:[main] from main::@3_18 + [25] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_20 +main::@3_20: scope:[main] from main::@3_19 + [26] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_21 +main::@3_21: scope:[main] from main::@3_20 + [27] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_22 +main::@3_22: scope:[main] from main::@3_21 + [28] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_23 +main::@3_23: scope:[main] from main::@3_22 + [29] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_24 +main::@3_24: scope:[main] from main::@3_23 + [30] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@4 +main::@4: scope:[main] from main::@3_24 + [31] (byte) main::x#1 ← ++ (byte) main::x#5 [ main::x#1 ] ( main:2 [ main::x#1 ] ) + [32] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) + to:main::@return +main::@return: scope:[main] from main::@4 + [33] return [ ] ( main:2 [ ] ) + to:@return diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.log b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.log new file mode 100644 index 000000000..ef33db45a --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.log @@ -0,0 +1,2158 @@ +PARSING src/test/java/dk/camelot64/kickc/test/kc/unroll-screenfill-while.kc +// Fills the screen using an unrolled inner while()-loop + +void main() { + byte* SCREEN = $400; + for(byte x: 0..39) { + byte line = 0; + inline while(line!=25) { + (SCREEN+line*40)[x] = x; + line++; + } + } + +} +Adding pre/post-modifier (byte) main::line ← ++ (byte) main::line +SYMBOLS +(label) @1 +(label) @begin +(label) @end +(void()) main() +(bool~) main::$0 +(byte/signed word/word/dword/signed dword~) main::$1 +(byte*~) main::$2 +(bool~) main::$3 +(label) main::@1 +(label) main::@2 +(label) main::@3 +(label) main::@4 +(label) main::@5 +(label) main::@6 +(label) main::@7 +(label) main::@8 +(label) main::@return +(byte*) main::SCREEN +(byte) main::line +(byte) main::x + +Promoting word/signed word/dword/signed dword to byte* in main::SCREEN ← ((byte*)) 1024 +INITIAL CONTROL FLOW GRAPH +@begin: scope:[] from + to:@1 +main: scope:[main] from + (byte*) main::SCREEN ← ((byte*)) (word/signed word/dword/signed dword) 1024 + (byte) main::x ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:main::@1 +main::@1: scope:[main] from main main::@4 + (byte) main::line ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:main::@2 +main::@2: scope:[main] from main::@1 main::@3 + (bool~) main::$0 ← (byte) main::line != (byte/signed byte/word/signed word/dword/signed dword) 25 + unroll if((bool~) main::$0) goto main::@3 + to:main::@5 +main::@3: scope:[main] from main::@2 main::@6 + (byte/signed word/word/dword/signed dword~) main::$1 ← (byte) main::line * (byte/signed byte/word/signed word/dword/signed dword) 40 + (byte*~) main::$2 ← (byte*) main::SCREEN + (byte/signed word/word/dword/signed dword~) main::$1 + *((byte*~) main::$2 + (byte) main::x) ← (byte) main::x + (byte) main::line ← ++ (byte) main::line + to:main::@2 +main::@5: scope:[main] from main::@2 + to:main::@4 +main::@4: scope:[main] from main::@5 main::@7 + (byte) main::x ← (byte) main::x + rangenext(0,39) + (bool~) main::$3 ← (byte) main::x != rangelast(0,39) + if((bool~) main::$3) goto main::@1 + to:main::@8 +main::@6: scope:[main] from + to:main::@3 +main::@7: scope:[main] from + to:main::@4 +main::@8: scope:[main] from main::@4 + to:main::@return +main::@return: scope:[main] from main::@8 + return + to:@return +@1: scope:[] from @begin + call main + to:@end +@end: scope:[] from @1 + +Removing empty block main::@5 +Removing empty block main::@6 +Removing empty block main::@7 +Removing empty block main::@8 +PROCEDURE MODIFY VARIABLE ANALYSIS + +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... +Completing Phi functions... + +CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN +@begin: scope:[] from + to:@1 +main: scope:[main] from @1 + (byte*) main::SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024 + (byte) main::x#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:main::@1 +main::@1: scope:[main] from main main::@4 + (byte) main::x#5 ← phi( main/(byte) main::x#0 main::@4/(byte) main::x#1 ) + (byte*) main::SCREEN#3 ← phi( main/(byte*) main::SCREEN#0 main::@4/(byte*) main::SCREEN#4 ) + (byte) main::line#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:main::@2 +main::@2: scope:[main] from main::@1 main::@3 + (byte) main::x#4 ← phi( main::@1/(byte) main::x#5 main::@3/(byte) main::x#2 ) + (byte*) main::SCREEN#2 ← phi( main::@1/(byte*) main::SCREEN#3 main::@3/(byte*) main::SCREEN#1 ) + (byte) main::line#2 ← phi( main::@1/(byte) main::line#0 main::@3/(byte) main::line#1 ) + (bool~) main::$0 ← (byte) main::line#2 != (byte/signed byte/word/signed word/dword/signed dword) 25 + unroll if((bool~) main::$0) goto main::@3 + to:main::@4 +main::@3: scope:[main] from main::@2 + (byte) main::x#2 ← phi( main::@2/(byte) main::x#4 ) + (byte*) main::SCREEN#1 ← phi( main::@2/(byte*) main::SCREEN#2 ) + (byte) main::line#3 ← phi( main::@2/(byte) main::line#2 ) + (byte/signed word/word/dword/signed dword~) main::$1 ← (byte) main::line#3 * (byte/signed byte/word/signed word/dword/signed dword) 40 + (byte*~) main::$2 ← (byte*) main::SCREEN#1 + (byte/signed word/word/dword/signed dword~) main::$1 + *((byte*~) main::$2 + (byte) main::x#2) ← (byte) main::x#2 + (byte) main::line#1 ← ++ (byte) main::line#3 + to:main::@2 +main::@4: scope:[main] from main::@2 + (byte*) main::SCREEN#4 ← phi( main::@2/(byte*) main::SCREEN#2 ) + (byte) main::x#3 ← phi( main::@2/(byte) main::x#4 ) + (byte) main::x#1 ← (byte) main::x#3 + rangenext(0,39) + (bool~) main::$3 ← (byte) main::x#1 != rangelast(0,39) + if((bool~) main::$3) goto main::@1 + to:main::@return +main::@return: scope:[main] from main::@4 + return + to:@return +@1: scope:[] from @begin + call main + to:@2 +@2: scope:[] from @1 + to:@end +@end: scope:[] from @2 + +SYMBOL TABLE SSA +(label) @1 +(label) @2 +(label) @begin +(label) @end +(void()) main() +(bool~) main::$0 +(byte/signed word/word/dword/signed dword~) main::$1 +(byte*~) main::$2 +(bool~) main::$3 +(label) main::@1 +(label) main::@2 +(label) main::@3 +(label) main::@4 +(label) main::@return +(byte*) main::SCREEN +(byte*) main::SCREEN#0 +(byte*) main::SCREEN#1 +(byte*) main::SCREEN#2 +(byte*) main::SCREEN#3 +(byte*) main::SCREEN#4 +(byte) main::line +(byte) main::line#0 +(byte) main::line#1 +(byte) main::line#2 +(byte) main::line#3 +(byte) main::x +(byte) main::x#0 +(byte) main::x#1 +(byte) main::x#2 +(byte) main::x#3 +(byte) main::x#4 +(byte) main::x#5 + +OPTIMIZING CONTROL FLOW GRAPH +Culled Empty Block (label) @2 +Succesful SSA optimization Pass2CullEmptyBlocks +Alias (byte) main::line#2 = (byte) main::line#3 +Alias (byte*) main::SCREEN#1 = (byte*) main::SCREEN#2 (byte*) main::SCREEN#4 +Alias (byte) main::x#2 = (byte) main::x#4 (byte) main::x#3 +Succesful SSA optimization Pass2AliasElimination +Self Phi Eliminated (byte*) main::SCREEN#1 +Self Phi Eliminated (byte) main::x#2 +Succesful SSA optimization Pass2SelfPhiElimination +Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#3 +Redundant Phi (byte) main::x#2 (byte) main::x#5 +Succesful SSA optimization Pass2RedundantPhiElimination +Simple Condition (bool~) main::$0 unroll if((byte) main::line#2!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3 +Simple Condition (bool~) main::$3 if((byte) main::x#1!=rangelast(0,39)) goto main::@1 +Succesful SSA optimization Pass2ConditionalJumpSimplification +Constant (const byte*) main::SCREEN#0 = ((byte*))1024 +Constant (const byte) main::x#0 = 0 +Constant (const byte) main::line#0 = 0 +Succesful SSA optimization Pass2ConstantIdentification +Resolved ranged next value main::x#1 ← ++ main::x#5 to ++ +Resolved ranged comparison value if(main::x#1!=rangelast(0,39)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 40 +Self Phi Eliminated (byte*) main::SCREEN#3 +Succesful SSA optimization Pass2SelfPhiElimination +Redundant Phi (byte*) main::SCREEN#3 (const byte*) main::SCREEN#0 +Succesful SSA optimization Pass2RedundantPhiElimination +Unrolling loop Loop head: main::@2 tails: main::@3 blocks: main::@3 main::@2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#2 (const byte) main::line#0 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$1 = main::line#0*40 +Constant (const byte) main::line#1 = ++main::line#0 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$2 = main::SCREEN#0+main::$1 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [2] if((const byte) main::line#0!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@2_1 main::@4 main::@return main::@3_1 +Unrolling loop Loop head: main::@2_1 tails: main::@3_1 blocks: main::@3_1 main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#4 (const byte) main::line#1 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$4 = main::line#1*40 +Constant (const byte) main::line#5 = ++main::line#1 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$5 = main::SCREEN#0+main::$4 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [4] if((const byte) main::line#1!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_1 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_1 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@2_2 main::@4 main::@return main::@3_2 +Unrolling loop Loop head: main::@2_2 tails: main::@3_2 blocks: main::@3_2 main::@2_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#6 (const byte) main::line#5 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$6 = main::line#5*40 +Constant (const byte) main::line#7 = ++main::line#5 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$7 = main::SCREEN#0+main::$6 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [5] if((const byte) main::line#5!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_2 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_2 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@2_1 main::@4 main::@return main::@3_3 +Unrolling loop Loop head: main::@2_1 tails: main::@3_3 blocks: main::@3_3 main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#8 (const byte) main::line#7 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$8 = main::line#7*40 +Constant (const byte) main::line#9 = ++main::line#7 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$9 = main::SCREEN#0+main::$8 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [6] if((const byte) main::line#7!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_3 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_1 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@2_2 main::@4 main::@return main::@3_4 +Unrolling loop Loop head: main::@2_2 tails: main::@3_4 blocks: main::@3_4 main::@2_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#10 (const byte) main::line#9 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$10 = main::line#9*40 +Constant (const byte) main::line#11 = ++main::line#9 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$11 = main::SCREEN#0+main::$10 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [7] if((const byte) main::line#9!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_4 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_2 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@2_1 main::@4 main::@return main::@3_5 +Unrolling loop Loop head: main::@2_1 tails: main::@3_5 blocks: main::@3_5 main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#12 (const byte) main::line#11 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$12 = main::line#11*40 +Constant (const byte) main::line#13 = ++main::line#11 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$13 = main::SCREEN#0+main::$12 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [8] if((const byte) main::line#11!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_5 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_1 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@2_2 main::@4 main::@return main::@3_6 +Unrolling loop Loop head: main::@2_2 tails: main::@3_6 blocks: main::@3_6 main::@2_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#14 (const byte) main::line#13 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const byte/signed word/word/dword/signed dword) main::$14 = main::line#13*40 +Constant (const byte) main::line#15 = ++main::line#13 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$15 = main::SCREEN#0+main::$14 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [9] if((const byte) main::line#13!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_6 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_2 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@2_1 main::@4 main::@return main::@3_7 +Unrolling loop Loop head: main::@2_1 tails: main::@3_7 blocks: main::@3_7 main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#16 (const byte) main::line#15 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$16 = main::line#15*40 +Constant (const byte) main::line#17 = ++main::line#15 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$17 = main::SCREEN#0+main::$16 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [10] if((const byte) main::line#15!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_7 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_1 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@2_2 main::@4 main::@return main::@3_8 +Unrolling loop Loop head: main::@2_2 tails: main::@3_8 blocks: main::@3_8 main::@2_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#18 (const byte) main::line#17 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$18 = main::line#17*40 +Constant (const byte) main::line#19 = ++main::line#17 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$19 = main::SCREEN#0+main::$18 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [11] if((const byte) main::line#17!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_8 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_2 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@2_1 main::@4 main::@return main::@3_9 +Unrolling loop Loop head: main::@2_1 tails: main::@3_9 blocks: main::@3_9 main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#20 (const byte) main::line#19 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$20 = main::line#19*40 +Constant (const byte) main::line#21 = ++main::line#19 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$21 = main::SCREEN#0+main::$20 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [12] if((const byte) main::line#19!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_9 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_1 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@2_2 main::@4 main::@return main::@3_10 +Unrolling loop Loop head: main::@2_2 tails: main::@3_10 blocks: main::@3_10 main::@2_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#22 (const byte) main::line#21 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$22 = main::line#21*40 +Constant (const byte) main::line#23 = ++main::line#21 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$23 = main::SCREEN#0+main::$22 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [13] if((const byte) main::line#21!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_10 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_2 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@2_1 main::@4 main::@return main::@3_11 +Unrolling loop Loop head: main::@2_1 tails: main::@3_11 blocks: main::@3_11 main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#24 (const byte) main::line#23 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$24 = main::line#23*40 +Constant (const byte) main::line#25 = ++main::line#23 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$25 = main::SCREEN#0+main::$24 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [14] if((const byte) main::line#23!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_11 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_1 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@2_2 main::@4 main::@return main::@3_12 +Unrolling loop Loop head: main::@2_2 tails: main::@3_12 blocks: main::@3_12 main::@2_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#26 (const byte) main::line#25 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$26 = main::line#25*40 +Constant (const byte) main::line#27 = ++main::line#25 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$27 = main::SCREEN#0+main::$26 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [15] if((const byte) main::line#25!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_12 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_2 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@2_1 main::@4 main::@return main::@3_13 +Unrolling loop Loop head: main::@2_1 tails: main::@3_13 blocks: main::@3_13 main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#28 (const byte) main::line#27 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$28 = main::line#27*40 +Constant (const byte) main::line#29 = ++main::line#27 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$29 = main::SCREEN#0+main::$28 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [16] if((const byte) main::line#27!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_13 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_1 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@2_2 main::@4 main::@return main::@3_14 +Unrolling loop Loop head: main::@2_2 tails: main::@3_14 blocks: main::@3_14 main::@2_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#30 (const byte) main::line#29 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$30 = main::line#29*40 +Constant (const byte) main::line#31 = ++main::line#29 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$31 = main::SCREEN#0+main::$30 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [17] if((const byte) main::line#29!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_14 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_2 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@2_1 main::@4 main::@return main::@3_15 +Unrolling loop Loop head: main::@2_1 tails: main::@3_15 blocks: main::@3_15 main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#32 (const byte) main::line#31 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$32 = main::line#31*40 +Constant (const byte) main::line#33 = ++main::line#31 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$33 = main::SCREEN#0+main::$32 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [18] if((const byte) main::line#31!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_15 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_1 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@2_2 main::@4 main::@return main::@3_16 +Unrolling loop Loop head: main::@2_2 tails: main::@3_16 blocks: main::@3_16 main::@2_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#34 (const byte) main::line#33 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$34 = main::line#33*40 +Constant (const byte) main::line#35 = ++main::line#33 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$35 = main::SCREEN#0+main::$34 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [19] if((const byte) main::line#33!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_16 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_2 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@2_1 main::@4 main::@return main::@3_17 +Unrolling loop Loop head: main::@2_1 tails: main::@3_17 blocks: main::@3_17 main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#36 (const byte) main::line#35 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$36 = main::line#35*40 +Constant (const byte) main::line#37 = ++main::line#35 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$37 = main::SCREEN#0+main::$36 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [20] if((const byte) main::line#35!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_17 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_1 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@2_2 main::@4 main::@return main::@3_18 +Unrolling loop Loop head: main::@2_2 tails: main::@3_18 blocks: main::@3_18 main::@2_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#38 (const byte) main::line#37 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$38 = main::line#37*40 +Constant (const byte) main::line#39 = ++main::line#37 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$39 = main::SCREEN#0+main::$38 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [21] if((const byte) main::line#37!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_18 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_2 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@3_18 main::@2_1 main::@4 main::@return main::@3_19 +Unrolling loop Loop head: main::@2_1 tails: main::@3_19 blocks: main::@3_19 main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#40 (const byte) main::line#39 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$40 = main::line#39*40 +Constant (const byte) main::line#41 = ++main::line#39 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$41 = main::SCREEN#0+main::$40 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [22] if((const byte) main::line#39!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_19 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_1 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@3_18 main::@3_19 main::@2_2 main::@4 main::@return main::@3_20 +Unrolling loop Loop head: main::@2_2 tails: main::@3_20 blocks: main::@3_20 main::@2_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#42 (const byte) main::line#41 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$42 = main::line#41*40 +Constant (const byte) main::line#43 = ++main::line#41 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$43 = main::SCREEN#0+main::$42 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [23] if((const byte) main::line#41!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_20 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_2 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@3_18 main::@3_19 main::@3_20 main::@2_1 main::@4 main::@return main::@3_21 +Unrolling loop Loop head: main::@2_1 tails: main::@3_21 blocks: main::@3_21 main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#44 (const byte) main::line#43 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$44 = main::line#43*40 +Constant (const byte) main::line#45 = ++main::line#43 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$45 = main::SCREEN#0+main::$44 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [24] if((const byte) main::line#43!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_21 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_1 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@3_18 main::@3_19 main::@3_20 main::@3_21 main::@2_2 main::@4 main::@return main::@3_22 +Unrolling loop Loop head: main::@2_2 tails: main::@3_22 blocks: main::@3_22 main::@2_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#46 (const byte) main::line#45 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$46 = main::line#45*40 +Constant (const byte) main::line#47 = ++main::line#45 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$47 = main::SCREEN#0+main::$46 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [25] if((const byte) main::line#45!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_22 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_2 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@3_18 main::@3_19 main::@3_20 main::@3_21 main::@3_22 main::@2_1 main::@4 main::@return main::@3_23 +Unrolling loop Loop head: main::@2_1 tails: main::@3_23 blocks: main::@3_23 main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#48 (const byte) main::line#47 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$48 = main::line#47*40 +Constant (const byte) main::line#49 = ++main::line#47 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$49 = main::SCREEN#0+main::$48 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [26] if((const byte) main::line#47!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_23 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_1 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@3_18 main::@3_19 main::@3_20 main::@3_21 main::@3_22 main::@3_23 main::@2_2 main::@4 main::@return main::@3_24 +Unrolling loop Loop head: main::@2_2 tails: main::@3_24 blocks: main::@3_24 main::@2_2 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#50 (const byte) main::line#49 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$50 = main::line#49*40 +Constant (const byte) main::line#51 = ++main::line#49 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$51 = main::SCREEN#0+main::$50 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [27] if((const byte) main::line#49!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_24 +Succesful SSA optimization Pass2ConstantIfs +Culled Empty Block (label) main::@2_2 +Succesful SSA optimization Pass2CullEmptyBlocks +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@3_18 main::@3_19 main::@3_20 main::@3_21 main::@3_22 main::@3_23 main::@3_24 main::@2_1 main::@4 main::@return main::@3_25 +Unrolling loop Loop head: main::@2_1 tails: main::@3_25 blocks: main::@3_25 main::@2_1 +Successful SSA optimization Pass2LoopUnroll +OPTIMIZING CONTROL FLOW GRAPH +Redundant Phi (byte) main::line#52 (const byte) main::line#51 +Succesful SSA optimization Pass2RedundantPhiElimination +Constant (const word/signed word/dword/signed dword) main::$52 = main::line#51*40 +Constant (const byte) main::line#53 = ++main::line#51 +Succesful SSA optimization Pass2ConstantIdentification +Constant (const byte*) main::$53 = main::SCREEN#0+main::$52 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always false - eliminating [28] if((const byte) main::line#51!=(byte/signed byte/word/signed word/dword/signed dword) 25) goto main::@3_25 +Succesful SSA optimization Pass2ConstantIfs +Eliminating variable (byte) main::line#54 from unused block main::@2_2 +Eliminating variable (byte/signed word/word/dword/signed dword~) main::$54 and from unused block main::@3_26 +Eliminating variable (byte*~) main::$55 and from unused block main::@3_26 +Eliminating variable (byte) main::line#55 and from unused block main::@3_26 +Removing PHI-reference to removed block (main::@3_25) in block main::@2_2 +Removing unused block main::@3_25 +Removing unused block main::@2_2 +Removing unused block main::@3_26 +Succesful SSA optimization Pass2EliminateUnusedBlocks +Culled Empty Block (label) main::@2_1 +Succesful SSA optimization Pass2CullEmptyBlocks +Eliminating unused constant (const byte) main::line#53 +Eliminating unused constant (const byte*) main::$53 +Succesful SSA optimization PassNEliminateUnusedVars +Eliminating unused constant (const word/signed word/dword/signed dword) main::$52 +Succesful SSA optimization PassNEliminateUnusedVars +Eliminating unused constant (const byte) main::line#51 +Succesful SSA optimization PassNEliminateUnusedVars +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@3_18 main::@3_19 main::@3_20 main::@3_21 main::@3_22 main::@3_23 main::@3_24 main::@4 main::@return +OPTIMIZING CONTROL FLOW GRAPH +Inlining constant with var siblings (const byte) main::x#0 +Inlining constant with var siblings (const byte) main::x#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#0 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#1 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#5 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#7 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#9 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#11 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#13 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#15 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#17 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#19 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#21 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#23 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#25 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#27 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#29 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#31 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#33 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#35 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#37 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#39 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#41 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#43 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#45 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#47 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Inlining constant with different constant siblings (const byte) main::line#49 +Constant inlined main::$50 = ++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$51 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$12 = ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$13 = (const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$14 = ++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$15 = (const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$10 = ++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$11 = (const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#43 = ++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#45 = ++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$16 = ++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$17 = (const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$18 = ++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#41 = ++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$19 = (const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#5 = ++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#47 = ++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#1 = ++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#49 = ++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$40 = ++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#9 = ++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#7 = ++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$45 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$46 = ++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$47 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$48 = ++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$41 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$42 = ++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$43 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$44 = ++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#11 = ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$49 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#17 = ++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#19 = ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#13 = ++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#15 = ++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$34 = ++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$35 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$36 = ++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$37 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$30 = ++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$31 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$32 = ++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$33 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#21 = ++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#23 = ++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$38 = ++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$39 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#29 = ++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#25 = ++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#27 = ++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$23 = (const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$24 = ++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$25 = (const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$26 = ++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$20 = ++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$21 = (const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$22 = ++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#31 = ++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::line#33 = ++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$1 = (byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$27 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$2 = (const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$28 = ++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$29 = (const byte*) main::SCREEN#0+++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$5 = (const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$6 = ++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#39 = ++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$4 = ++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$9 = (const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#35 = ++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$7 = (const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::$8 = ++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 +Constant inlined main::line#37 = ++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 +Succesful SSA optimization Pass2ConstantInlining +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@3_18 main::@3_19 main::@3_20 main::@3_21 main::@3_22 main::@3_23 main::@3_24 main::@4 main::@return +Added new block during phi lifting main::@9(between main::@4 and main::@1) +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@3_18 main::@3_19 main::@3_20 main::@3_21 main::@3_22 main::@3_23 main::@3_24 main::@4 main::@return main::@9 +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @1 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +CALL GRAPH +Calls in [] to main:2 + +Propagating live ranges... +Propagating live ranges... +Created 1 initial phi equivalence classes +Coalesced [34] main::x#6 ← main::x#1 +Coalesced down to 1 phi equivalence classes +Culled Empty Block (label) main::@9 +Block Sequence Planned @begin @1 @end main main::@1 main::@3 main::@3_1 main::@3_2 main::@3_3 main::@3_4 main::@3_5 main::@3_6 main::@3_7 main::@3_8 main::@3_9 main::@3_10 main::@3_11 main::@3_12 main::@3_13 main::@3_14 main::@3_15 main::@3_16 main::@3_17 main::@3_18 main::@3_19 main::@3_20 main::@3_21 main::@3_22 main::@3_23 main::@3_24 main::@4 main::@return +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @1 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Propagating live ranges... +Propagating live ranges... + +FINAL CONTROL FLOW GRAPH +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@1 +@1: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main [ ] ( ) + to:@end +@end: scope:[] from @1 + [3] phi() [ ] ( ) +main: scope:[main] from @1 + [4] phi() [ ] ( main:2 [ ] ) + to:main::@1 +main::@1: scope:[main] from main main::@4 + [5] (byte) main::x#5 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@4/(byte) main::x#1 ) [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3 +main::@3: scope:[main] from main::@1 + [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_1 +main::@3_1: scope:[main] from main::@3 + [7] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_2 +main::@3_2: scope:[main] from main::@3_1 + [8] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_3 +main::@3_3: scope:[main] from main::@3_2 + [9] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_4 +main::@3_4: scope:[main] from main::@3_3 + [10] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_5 +main::@3_5: scope:[main] from main::@3_4 + [11] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_6 +main::@3_6: scope:[main] from main::@3_5 + [12] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_7 +main::@3_7: scope:[main] from main::@3_6 + [13] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_8 +main::@3_8: scope:[main] from main::@3_7 + [14] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_9 +main::@3_9: scope:[main] from main::@3_8 + [15] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_10 +main::@3_10: scope:[main] from main::@3_9 + [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_11 +main::@3_11: scope:[main] from main::@3_10 + [17] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_12 +main::@3_12: scope:[main] from main::@3_11 + [18] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_13 +main::@3_13: scope:[main] from main::@3_12 + [19] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_14 +main::@3_14: scope:[main] from main::@3_13 + [20] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_15 +main::@3_15: scope:[main] from main::@3_14 + [21] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_16 +main::@3_16: scope:[main] from main::@3_15 + [22] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_17 +main::@3_17: scope:[main] from main::@3_16 + [23] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_18 +main::@3_18: scope:[main] from main::@3_17 + [24] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_19 +main::@3_19: scope:[main] from main::@3_18 + [25] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_20 +main::@3_20: scope:[main] from main::@3_19 + [26] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_21 +main::@3_21: scope:[main] from main::@3_20 + [27] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_22 +main::@3_22: scope:[main] from main::@3_21 + [28] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_23 +main::@3_23: scope:[main] from main::@3_22 + [29] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@3_24 +main::@3_24: scope:[main] from main::@3_23 + [30] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) + to:main::@4 +main::@4: scope:[main] from main::@3_24 + [31] (byte) main::x#1 ← ++ (byte) main::x#5 [ main::x#1 ] ( main:2 [ main::x#1 ] ) + [32] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) + to:main::@return +main::@return: scope:[main] from main::@4 + [33] return [ ] ( main:2 [ ] ) + to:@return + +DOMINATORS +@begin dominated by @begin +@1 dominated by @begin @1 +@end dominated by @end @begin @1 +main dominated by main @begin @1 +main::@1 dominated by main main::@1 @begin @1 +main::@3 dominated by main main::@1 main::@3 @begin @1 +main::@3_1 dominated by main main::@1 main::@3_1 main::@3 @begin @1 +main::@3_2 dominated by main main::@1 main::@3_1 main::@3_2 main::@3 @begin @1 +main::@3_3 dominated by main main::@1 main::@3_1 main::@3_2 main::@3 @begin main::@3_3 @1 +main::@3_4 dominated by main main::@1 main::@3_1 main::@3_2 main::@3 @begin main::@3_3 main::@3_4 @1 +main::@3_5 dominated by main main::@1 main::@3_1 main::@3_2 main::@3 @begin main::@3_3 main::@3_4 main::@3_5 @1 +main::@3_6 dominated by main main::@1 main::@3_1 main::@3_2 main::@3 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_7 dominated by main main::@1 main::@3_1 main::@3_2 main::@3 main::@3_7 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_8 dominated by main main::@1 main::@3_1 main::@3_2 main::@3 main::@3_7 main::@3_8 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_9 dominated by main main::@1 main::@3_1 main::@3_2 main::@3 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_10 dominated by main main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_11 dominated by main main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_12 dominated by main main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_13 dominated by main main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_14 dominated by main main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_15 dominated by main main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_16 dominated by main main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3 main::@3_16 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_17 dominated by main main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3 main::@3_17 main::@3_16 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_18 dominated by main main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3_18 main::@3 main::@3_17 main::@3_16 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_19 dominated by main main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3_19 main::@3_18 main::@3 main::@3_17 main::@3_16 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 +main::@3_20 dominated by main main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3_19 main::@3_18 main::@3 main::@3_17 main::@3_16 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 main::@3_20 +main::@3_21 dominated by main main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3_19 main::@3_18 main::@3 main::@3_17 main::@3_16 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 main::@3_21 main::@3_20 +main::@3_22 dominated by main main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3_19 main::@3_18 main::@3 main::@3_17 main::@3_16 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 main::@3_22 main::@3_21 main::@3_20 +main::@3_23 dominated by main main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3_19 main::@3_18 main::@3 main::@3_17 main::@3_16 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 main::@3_23 main::@3_22 main::@3_21 main::@3_20 +main::@3_24 dominated by main main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3_19 main::@3_18 main::@3 main::@3_17 main::@3_16 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 main::@3_24 main::@3_23 main::@3_22 main::@3_21 main::@3_20 +main::@4 dominated by main main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3_19 main::@3_18 main::@3 main::@3_17 main::@3_16 main::@4 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 main::@3_24 main::@3_23 main::@3_22 main::@3_21 main::@3_20 +main::@return dominated by main::@return main main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@1 main::@3_1 main::@3_2 main::@3_19 main::@3_18 main::@3 main::@3_17 main::@3_16 main::@4 main::@3_7 main::@3_8 main::@3_9 @begin main::@3_3 main::@3_4 main::@3_5 main::@3_6 @1 main::@3_24 main::@3_23 main::@3_22 main::@3_21 main::@3_20 + +NATURAL LOOPS +Found back edge: Loop head: main::@1 tails: main::@4 blocks: null +Populated: Loop head: main::@1 tails: main::@4 blocks: main::@4 main::@3_24 main::@3_23 main::@3_22 main::@3_21 main::@3_20 main::@3_19 main::@3_18 main::@3_17 main::@3_16 main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@3_9 main::@3_8 main::@3_7 main::@3_6 main::@3_5 main::@3_4 main::@3_3 main::@3_2 main::@3_1 main::@3 main::@1 +Loop head: main::@1 tails: main::@4 blocks: main::@4 main::@3_24 main::@3_23 main::@3_22 main::@3_21 main::@3_20 main::@3_19 main::@3_18 main::@3_17 main::@3_16 main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@3_9 main::@3_8 main::@3_7 main::@3_6 main::@3_5 main::@3_4 main::@3_3 main::@3_2 main::@3_1 main::@3 main::@1 + +NATURAL LOOPS WITH DEPTH +Found 0 loops in scope [] +Found 1 loops in scope [main] + Loop head: main::@1 tails: main::@4 blocks: main::@4 main::@3_24 main::@3_23 main::@3_22 main::@3_21 main::@3_20 main::@3_19 main::@3_18 main::@3_17 main::@3_16 main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@3_9 main::@3_8 main::@3_7 main::@3_6 main::@3_5 main::@3_4 main::@3_3 main::@3_2 main::@3_1 main::@3 main::@1 +Loop head: main::@1 tails: main::@4 blocks: main::@4 main::@3_24 main::@3_23 main::@3_22 main::@3_21 main::@3_20 main::@3_19 main::@3_18 main::@3_17 main::@3_16 main::@3_15 main::@3_14 main::@3_13 main::@3_12 main::@3_11 main::@3_10 main::@3_9 main::@3_8 main::@3_7 main::@3_6 main::@3_5 main::@3_4 main::@3_3 main::@3_2 main::@3_1 main::@3 main::@1 depth: 1 + + +VARIABLE REGISTER WEIGHTS +(void()) main() +(byte*) main::SCREEN +(byte) main::line +(byte) main::x +(byte) main::x#1 16.5 +(byte) main::x#5 22.00000000000001 + +Initial phi equivalence classes +[ main::x#5 main::x#1 ] +Complete equivalence classes +[ main::x#5 main::x#1 ] +Allocated zp ZP_BYTE:2 [ main::x#5 main::x#1 ] + +INITIAL ASM +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 +//SEG4 @1 +b1: +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend +//SEG8 @end +bend: +//SEG9 main +main: { + .label SCREEN = $400 + .label x = 2 + //SEG10 [5] phi from main to main::@1 [phi:main->main::@1] + b1_from_main: + //SEG11 [5] phi (byte) main::x#5 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + lda #0 + sta x + jmp b1 + //SEG12 [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1] + b1_from_b4: + //SEG13 [5] phi (byte) main::x#5 = (byte) main::x#1 [phi:main::@4->main::@1#0] -- register_copy + jmp b1 + //SEG14 main::@1 + b1: + jmp b3 + //SEG15 main::@3 + b3: + //SEG16 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+0*$28,y + jmp b3_1 + //SEG17 main::@3_1 + b3_1: + //SEG18 [7] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1)*$28,y + jmp b3_2 + //SEG19 main::@3_2 + b3_2: + //SEG20 [8] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1)*$28,y + jmp b3_3 + //SEG21 main::@3_3 + b3_3: + //SEG22 [9] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1)*$28,y + jmp b3_4 + //SEG23 main::@3_4 + b3_4: + //SEG24 [10] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1)*$28,y + jmp b3_5 + //SEG25 main::@3_5 + b3_5: + //SEG26 [11] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1)*$28,y + jmp b3_6 + //SEG27 main::@3_6 + b3_6: + //SEG28 [12] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1)*$28,y + jmp b3_7 + //SEG29 main::@3_7 + b3_7: + //SEG30 [13] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1)*$28,y + jmp b3_8 + //SEG31 main::@3_8 + b3_8: + //SEG32 [14] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1)*$28,y + jmp b3_9 + //SEG33 main::@3_9 + b3_9: + //SEG34 [15] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_10 + //SEG35 main::@3_10 + b3_10: + //SEG36 [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_11 + //SEG37 main::@3_11 + b3_11: + //SEG38 [17] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_12 + //SEG39 main::@3_12 + b3_12: + //SEG40 [18] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_13 + //SEG41 main::@3_13 + b3_13: + //SEG42 [19] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_14 + //SEG43 main::@3_14 + b3_14: + //SEG44 [20] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_15 + //SEG45 main::@3_15 + b3_15: + //SEG46 [21] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_16 + //SEG47 main::@3_16 + b3_16: + //SEG48 [22] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_17 + //SEG49 main::@3_17 + b3_17: + //SEG50 [23] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_18 + //SEG51 main::@3_18 + b3_18: + //SEG52 [24] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_19 + //SEG53 main::@3_19 + b3_19: + //SEG54 [25] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_20 + //SEG55 main::@3_20 + b3_20: + //SEG56 [26] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_21 + //SEG57 main::@3_21 + b3_21: + //SEG58 [27] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_22 + //SEG59 main::@3_22 + b3_22: + //SEG60 [28] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_23 + //SEG61 main::@3_23 + b3_23: + //SEG62 [29] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b3_24 + //SEG63 main::@3_24 + b3_24: + //SEG64 [30] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuz1=vbuz1 + ldy x + tya + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,y + jmp b4 + //SEG65 main::@4 + b4: + //SEG66 [31] (byte) main::x#1 ← ++ (byte) main::x#5 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1=_inc_vbuz1 + inc x + //SEG67 [32] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuz1_neq_vbuc1_then_la1 + lda x + cmp #$28 + bne b1_from_b4 + jmp breturn + //SEG68 main::@return + breturn: + //SEG69 [33] return [ ] ( main:2 [ ] ) + rts +} + +REGISTER UPLIFT POTENTIAL REGISTERS +Potential registers zp ZP_BYTE:2 [ main::x#5 main::x#1 ] : zp ZP_BYTE:2 , reg byte a , reg byte x , reg byte y , + +REGISTER UPLIFT SCOPES +Uplift Scope [main] 38.5: zp ZP_BYTE:2 [ main::x#5 main::x#1 ] +Uplift Scope [] + +Uplifting [main] best 2723 combination reg byte x [ main::x#5 main::x#1 ] +Uplifting [] best 2723 combination + +ASSEMBLER BEFORE OPTIMIZATION +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 +//SEG4 @1 +b1: +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend +//SEG8 @end +bend: +//SEG9 main +main: { + .label SCREEN = $400 + //SEG10 [5] phi from main to main::@1 [phi:main->main::@1] + b1_from_main: + //SEG11 [5] phi (byte) main::x#5 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 + ldx #0 + jmp b1 + //SEG12 [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1] + b1_from_b4: + //SEG13 [5] phi (byte) main::x#5 = (byte) main::x#1 [phi:main::@4->main::@1#0] -- register_copy + jmp b1 + //SEG14 main::@1 + b1: + jmp b3 + //SEG15 main::@3 + b3: + //SEG16 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+0*$28,x + jmp b3_1 + //SEG17 main::@3_1 + b3_1: + //SEG18 [7] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1)*$28,x + jmp b3_2 + //SEG19 main::@3_2 + b3_2: + //SEG20 [8] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1)*$28,x + jmp b3_3 + //SEG21 main::@3_3 + b3_3: + //SEG22 [9] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1)*$28,x + jmp b3_4 + //SEG23 main::@3_4 + b3_4: + //SEG24 [10] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1)*$28,x + jmp b3_5 + //SEG25 main::@3_5 + b3_5: + //SEG26 [11] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1)*$28,x + jmp b3_6 + //SEG27 main::@3_6 + b3_6: + //SEG28 [12] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1)*$28,x + jmp b3_7 + //SEG29 main::@3_7 + b3_7: + //SEG30 [13] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1)*$28,x + jmp b3_8 + //SEG31 main::@3_8 + b3_8: + //SEG32 [14] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1)*$28,x + jmp b3_9 + //SEG33 main::@3_9 + b3_9: + //SEG34 [15] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_10 + //SEG35 main::@3_10 + b3_10: + //SEG36 [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_11 + //SEG37 main::@3_11 + b3_11: + //SEG38 [17] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_12 + //SEG39 main::@3_12 + b3_12: + //SEG40 [18] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_13 + //SEG41 main::@3_13 + b3_13: + //SEG42 [19] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_14 + //SEG43 main::@3_14 + b3_14: + //SEG44 [20] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_15 + //SEG45 main::@3_15 + b3_15: + //SEG46 [21] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_16 + //SEG47 main::@3_16 + b3_16: + //SEG48 [22] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_17 + //SEG49 main::@3_17 + b3_17: + //SEG50 [23] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_18 + //SEG51 main::@3_18 + b3_18: + //SEG52 [24] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_19 + //SEG53 main::@3_19 + b3_19: + //SEG54 [25] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_20 + //SEG55 main::@3_20 + b3_20: + //SEG56 [26] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_21 + //SEG57 main::@3_21 + b3_21: + //SEG58 [27] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_22 + //SEG59 main::@3_22 + b3_22: + //SEG60 [28] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_23 + //SEG61 main::@3_23 + b3_23: + //SEG62 [29] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b3_24 + //SEG63 main::@3_24 + b3_24: + //SEG64 [30] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + jmp b4 + //SEG65 main::@4 + b4: + //SEG66 [31] (byte) main::x#1 ← ++ (byte) main::x#5 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuxx=_inc_vbuxx + inx + //SEG67 [32] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuxx_neq_vbuc1_then_la1 + cpx #$28 + bne b1_from_b4 + jmp breturn + //SEG68 main::@return + breturn: + //SEG69 [33] return [ ] ( main:2 [ ] ) + rts +} + +ASSEMBLER OPTIMIZATIONS +Removing instruction jmp b1 +Removing instruction jmp bend +Removing instruction jmp b1 +Removing instruction jmp b3 +Removing instruction jmp b3_1 +Removing instruction jmp b3_2 +Removing instruction jmp b3_3 +Removing instruction jmp b3_4 +Removing instruction jmp b3_5 +Removing instruction jmp b3_6 +Removing instruction jmp b3_7 +Removing instruction jmp b3_8 +Removing instruction jmp b3_9 +Removing instruction jmp b3_10 +Removing instruction jmp b3_11 +Removing instruction jmp b3_12 +Removing instruction jmp b3_13 +Removing instruction jmp b3_14 +Removing instruction jmp b3_15 +Removing instruction jmp b3_16 +Removing instruction jmp b3_17 +Removing instruction jmp b3_18 +Removing instruction jmp b3_19 +Removing instruction jmp b3_20 +Removing instruction jmp b3_21 +Removing instruction jmp b3_22 +Removing instruction jmp b3_23 +Removing instruction jmp b3_24 +Removing instruction jmp b4 +Removing instruction jmp breturn +Succesful ASM optimization Pass5NextJumpElimination +Replacing label b1 with b3 +Replacing label b1_from_b4 with b3 +Removing instruction bbegin: +Removing instruction b1_from_bbegin: +Removing instruction main_from_b1: +Removing instruction bend_from_b1: +Removing instruction b1_from_b4: +Removing instruction b1: +Succesful ASM optimization Pass5RedundantLabelElimination +Removing instruction b1: +Removing instruction bend: +Removing instruction b1_from_main: +Removing instruction b3_1: +Removing instruction b3_2: +Removing instruction b3_3: +Removing instruction b3_4: +Removing instruction b3_5: +Removing instruction b3_6: +Removing instruction b3_7: +Removing instruction b3_8: +Removing instruction b3_9: +Removing instruction b3_10: +Removing instruction b3_11: +Removing instruction b3_12: +Removing instruction b3_13: +Removing instruction b3_14: +Removing instruction b3_15: +Removing instruction b3_16: +Removing instruction b3_17: +Removing instruction b3_18: +Removing instruction b3_19: +Removing instruction b3_20: +Removing instruction b3_21: +Removing instruction b3_22: +Removing instruction b3_23: +Removing instruction b3_24: +Removing instruction b4: +Removing instruction breturn: +Succesful ASM optimization Pass5UnusedLabelElimination +Removing instruction jmp b3 +Succesful ASM optimization Pass5NextJumpElimination + +FINAL SYMBOL TABLE +(label) @1 +(label) @begin +(label) @end +(void()) main() +(label) main::@1 +(label) main::@3 +(label) main::@3_1 +(label) main::@3_10 +(label) main::@3_11 +(label) main::@3_12 +(label) main::@3_13 +(label) main::@3_14 +(label) main::@3_15 +(label) main::@3_16 +(label) main::@3_17 +(label) main::@3_18 +(label) main::@3_19 +(label) main::@3_2 +(label) main::@3_20 +(label) main::@3_21 +(label) main::@3_22 +(label) main::@3_23 +(label) main::@3_24 +(label) main::@3_3 +(label) main::@3_4 +(label) main::@3_5 +(label) main::@3_6 +(label) main::@3_7 +(label) main::@3_8 +(label) main::@3_9 +(label) main::@4 +(label) main::@return +(byte*) main::SCREEN +(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024 +(byte) main::line +(byte) main::x +(byte) main::x#1 reg byte x 16.5 +(byte) main::x#5 reg byte x 22.00000000000001 + +reg byte x [ main::x#5 main::x#1 ] + + +FINAL ASSEMBLER +Score: 1847 + +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +//SEG4 @1 +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +//SEG8 @end +//SEG9 main +main: { + .label SCREEN = $400 + //SEG10 [5] phi from main to main::@1 [phi:main->main::@1] + //SEG11 [5] phi (byte) main::x#5 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuxx=vbuc1 + ldx #0 + //SEG12 [5] phi from main::@4 to main::@1 [phi:main::@4->main::@1] + //SEG13 [5] phi (byte) main::x#5 = (byte) main::x#1 [phi:main::@4->main::@1#0] -- register_copy + //SEG14 main::@1 + //SEG15 main::@3 + b3: + //SEG16 [6] *((const byte*) main::SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+0*$28,x + //SEG17 main::@3_1 + //SEG18 [7] *((const byte*) main::SCREEN#0+++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1)*$28,x + //SEG19 main::@3_2 + //SEG20 [8] *((const byte*) main::SCREEN#0+++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1)*$28,x + //SEG21 main::@3_3 + //SEG22 [9] *((const byte*) main::SCREEN#0+++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1)*$28,x + //SEG23 main::@3_4 + //SEG24 [10] *((const byte*) main::SCREEN#0+++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1)*$28,x + //SEG25 main::@3_5 + //SEG26 [11] *((const byte*) main::SCREEN#0+++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1)*$28,x + //SEG27 main::@3_6 + //SEG28 [12] *((const byte*) main::SCREEN#0+++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1)*$28,x + //SEG29 main::@3_7 + //SEG30 [13] *((const byte*) main::SCREEN#0+++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1)*$28,x + //SEG31 main::@3_8 + //SEG32 [14] *((const byte*) main::SCREEN#0+++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1)*$28,x + //SEG33 main::@3_9 + //SEG34 [15] *((const byte*) main::SCREEN#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1)*$28,x + //SEG35 main::@3_10 + //SEG36 [16] *((const byte*) main::SCREEN#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG37 main::@3_11 + //SEG38 [17] *((const byte*) main::SCREEN#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG39 main::@3_12 + //SEG40 [18] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG41 main::@3_13 + //SEG42 [19] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG43 main::@3_14 + //SEG44 [20] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG45 main::@3_15 + //SEG46 [21] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG47 main::@3_16 + //SEG48 [22] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG49 main::@3_17 + //SEG50 [23] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG51 main::@3_18 + //SEG52 [24] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG53 main::@3_19 + //SEG54 [25] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG55 main::@3_20 + //SEG56 [26] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG57 main::@3_21 + //SEG58 [27] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG59 main::@3_22 + //SEG60 [28] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG61 main::@3_23 + //SEG62 [29] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG63 main::@3_24 + //SEG64 [30] *((const byte*) main::SCREEN#0+++++++++++++++++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) 40 + (byte) main::x#5) ← (byte) main::x#5 [ main::x#5 ] ( main:2 [ main::x#5 ] ) -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta SCREEN+(0+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)*$28,x + //SEG65 main::@4 + //SEG66 [31] (byte) main::x#1 ← ++ (byte) main::x#5 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuxx=_inc_vbuxx + inx + //SEG67 [32] if((byte) main::x#1!=(byte/signed byte/word/signed word/dword/signed dword) 40) goto main::@1 [ main::x#1 ] ( main:2 [ main::x#1 ] ) -- vbuxx_neq_vbuc1_then_la1 + cpx #$28 + bne b3 + //SEG68 main::@return + //SEG69 [33] return [ ] ( main:2 [ ] ) + rts +} + diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.sym b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.sym new file mode 100644 index 000000000..54f1c0214 --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unroll-screenfill-while.sym @@ -0,0 +1,40 @@ +(label) @1 +(label) @begin +(label) @end +(void()) main() +(label) main::@1 +(label) main::@3 +(label) main::@3_1 +(label) main::@3_10 +(label) main::@3_11 +(label) main::@3_12 +(label) main::@3_13 +(label) main::@3_14 +(label) main::@3_15 +(label) main::@3_16 +(label) main::@3_17 +(label) main::@3_18 +(label) main::@3_19 +(label) main::@3_2 +(label) main::@3_20 +(label) main::@3_21 +(label) main::@3_22 +(label) main::@3_23 +(label) main::@3_24 +(label) main::@3_3 +(label) main::@3_4 +(label) main::@3_5 +(label) main::@3_6 +(label) main::@3_7 +(label) main::@3_8 +(label) main::@3_9 +(label) main::@4 +(label) main::@return +(byte*) main::SCREEN +(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024 +(byte) main::line +(byte) main::x +(byte) main::x#1 reg byte x 16.5 +(byte) main::x#5 reg byte x 22.00000000000001 + +reg byte x [ main::x#5 main::x#1 ] diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.asm b/src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.asm new file mode 100644 index 000000000..2eec3a2ca --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.asm @@ -0,0 +1,10 @@ +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" + jsr main +main: { + .label SCREEN = $400 + b2: + inc SCREEN + jmp b2 +} diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.cfg b/src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.cfg new file mode 100644 index 000000000..10ad5a5c2 --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.cfg @@ -0,0 +1,15 @@ +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@1 +@1: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main [ ] ( ) + to:@end +@end: scope:[] from @1 + [3] phi() [ ] ( ) +main: scope:[main] from @1 + [4] phi() [ ] ( main:2 [ ] ) + to:main::@2 +main::@2: scope:[main] from main main::@2 + [5] *((const byte*) main::SCREEN#0) ← ++ *((const byte*) main::SCREEN#0) [ ] ( main:2 [ ] ) + to:main::@2 diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.log b/src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.log new file mode 100644 index 000000000..6435f374b --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.log @@ -0,0 +1,357 @@ +PARSING src/test/java/dk/camelot64/kickc/test/kc/unusedblockproblem.kc +// Problem with eliminating unused blocks/vars after the infinite loop (symbol line#2 not removed from symbol table) + +void main() { + byte* SCREEN = $400; + while(true) { + (*SCREEN)++; + } + for(byte line: 0..24) { + SCREEN[line] = line; + } +} +Adding pre/post-modifier *((byte*) main::SCREEN) ← ++ *((byte*) main::SCREEN) +SYMBOLS +(label) @1 +(label) @begin +(label) @end +(void()) main() +(bool~) main::$0 +(label) main::@1 +(label) main::@2 +(label) main::@3 +(label) main::@4 +(label) main::@5 +(label) main::@6 +(label) main::@7 +(label) main::@8 +(label) main::@return +(byte*) main::SCREEN +(byte) main::line + +Promoting word/signed word/dword/signed dword to byte* in main::SCREEN ← ((byte*)) 1024 +INITIAL CONTROL FLOW GRAPH +@begin: scope:[] from + to:@1 +main: scope:[main] from + (byte*) main::SCREEN ← ((byte*)) (word/signed word/dword/signed dword) 1024 + to:main::@1 +main::@1: scope:[main] from main main::@2 + if(true) goto main::@2 + to:main::@5 +main::@2: scope:[main] from main::@1 main::@6 + *((byte*) main::SCREEN) ← ++ *((byte*) main::SCREEN) + to:main::@1 +main::@5: scope:[main] from main::@1 + to:main::@3 +main::@3: scope:[main] from main::@5 main::@7 + (byte) main::line ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:main::@4 +main::@6: scope:[main] from + to:main::@2 +main::@7: scope:[main] from + to:main::@3 +main::@4: scope:[main] from main::@3 main::@4 + *((byte*) main::SCREEN + (byte) main::line) ← (byte) main::line + (byte) main::line ← (byte) main::line + rangenext(0,24) + (bool~) main::$0 ← (byte) main::line != rangelast(0,24) + if((bool~) main::$0) goto main::@4 + to:main::@8 +main::@8: scope:[main] from main::@4 + to:main::@return +main::@return: scope:[main] from main::@8 + return + to:@return +@1: scope:[] from @begin + call main + to:@end +@end: scope:[] from @1 + +Removing empty block main::@5 +Removing empty block main::@6 +Removing empty block main::@7 +Removing empty block main::@8 +PROCEDURE MODIFY VARIABLE ANALYSIS + +Completing Phi functions... +Completing Phi functions... + +CONTROL FLOW GRAPH SSA WITH ASSIGNMENT CALL & RETURN +@begin: scope:[] from + to:@1 +main: scope:[main] from @1 + (byte*) main::SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024 + to:main::@1 +main::@1: scope:[main] from main main::@2 + (byte*) main::SCREEN#3 ← phi( main/(byte*) main::SCREEN#0 main::@2/(byte*) main::SCREEN#1 ) + if(true) goto main::@2 + to:main::@3 +main::@2: scope:[main] from main::@1 + (byte*) main::SCREEN#1 ← phi( main::@1/(byte*) main::SCREEN#3 ) + *((byte*) main::SCREEN#1) ← ++ *((byte*) main::SCREEN#1) + to:main::@1 +main::@3: scope:[main] from main::@1 + (byte*) main::SCREEN#4 ← phi( main::@1/(byte*) main::SCREEN#3 ) + (byte) main::line#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 + to:main::@4 +main::@4: scope:[main] from main::@3 main::@4 + (byte*) main::SCREEN#2 ← phi( main::@3/(byte*) main::SCREEN#4 main::@4/(byte*) main::SCREEN#2 ) + (byte) main::line#2 ← phi( main::@3/(byte) main::line#0 main::@4/(byte) main::line#1 ) + *((byte*) main::SCREEN#2 + (byte) main::line#2) ← (byte) main::line#2 + (byte) main::line#1 ← (byte) main::line#2 + rangenext(0,24) + (bool~) main::$0 ← (byte) main::line#1 != rangelast(0,24) + if((bool~) main::$0) goto main::@4 + to:main::@return +main::@return: scope:[main] from main::@4 + return + to:@return +@1: scope:[] from @begin + call main + to:@2 +@2: scope:[] from @1 + to:@end +@end: scope:[] from @2 + +SYMBOL TABLE SSA +(label) @1 +(label) @2 +(label) @begin +(label) @end +(void()) main() +(bool~) main::$0 +(label) main::@1 +(label) main::@2 +(label) main::@3 +(label) main::@4 +(label) main::@return +(byte*) main::SCREEN +(byte*) main::SCREEN#0 +(byte*) main::SCREEN#1 +(byte*) main::SCREEN#2 +(byte*) main::SCREEN#3 +(byte*) main::SCREEN#4 +(byte) main::line +(byte) main::line#0 +(byte) main::line#1 +(byte) main::line#2 + +OPTIMIZING CONTROL FLOW GRAPH +Culled Empty Block (label) @2 +Succesful SSA optimization Pass2CullEmptyBlocks +Alias (byte*) main::SCREEN#1 = (byte*) main::SCREEN#3 (byte*) main::SCREEN#4 +Succesful SSA optimization Pass2AliasElimination +Self Phi Eliminated (byte*) main::SCREEN#1 +Self Phi Eliminated (byte*) main::SCREEN#2 +Succesful SSA optimization Pass2SelfPhiElimination +Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#0 +Redundant Phi (byte*) main::SCREEN#2 (byte*) main::SCREEN#1 +Succesful SSA optimization Pass2RedundantPhiElimination +Simple Condition (bool~) main::$0 if((byte) main::line#1!=rangelast(0,24)) goto main::@4 +Succesful SSA optimization Pass2ConditionalJumpSimplification +Constant (const byte*) main::SCREEN#0 = ((byte*))1024 +Constant (const byte) main::line#0 = 0 +Succesful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination if(true) goto main::@2 +Succesful SSA optimization Pass2ConstantIfs +Eliminating variable (byte) main::line#2 from unused block main::@4 +Eliminating variable (byte) main::line#1 and from unused block main::@4 +Removing PHI-reference to removed block (main::@3) in block main::@4 +Removing unused block main::@3 +Removing unused block main::@4 +Removing unused block main::@return +Succesful SSA optimization Pass2EliminateUnusedBlocks +Culled Empty Block (label) main::@1 +Succesful SSA optimization Pass2CullEmptyBlocks +Eliminating unused constant (const byte) main::line#0 +Succesful SSA optimization PassNEliminateUnusedVars +OPTIMIZING CONTROL FLOW GRAPH +Block Sequence Planned @begin @1 @end main main::@2 +Block Sequence Planned @begin @1 @end main main::@2 +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @1 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +CALL GRAPH +Calls in [] to main:2 + +Propagating live ranges... +Created 0 initial phi equivalence classes +Coalesced down to 0 phi equivalence classes +Block Sequence Planned @begin @1 @end main main::@2 +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @1 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main +Propagating live ranges... + +FINAL CONTROL FLOW GRAPH +@begin: scope:[] from + [0] phi() [ ] ( ) + to:@1 +@1: scope:[] from @begin + [1] phi() [ ] ( ) + [2] call main [ ] ( ) + to:@end +@end: scope:[] from @1 + [3] phi() [ ] ( ) +main: scope:[main] from @1 + [4] phi() [ ] ( main:2 [ ] ) + to:main::@2 +main::@2: scope:[main] from main main::@2 + [5] *((const byte*) main::SCREEN#0) ← ++ *((const byte*) main::SCREEN#0) [ ] ( main:2 [ ] ) + to:main::@2 + +DOMINATORS +@begin dominated by @begin +@1 dominated by @1 @begin +@end dominated by @1 @begin @end +main dominated by @1 @begin main +main::@2 dominated by @1 @begin main::@2 main + +NATURAL LOOPS +Found back edge: Loop head: main::@2 tails: main::@2 blocks: null +Populated: Loop head: main::@2 tails: main::@2 blocks: main::@2 +Loop head: main::@2 tails: main::@2 blocks: main::@2 + +NATURAL LOOPS WITH DEPTH +Found 0 loops in scope [] +Found 1 loops in scope [main] + Loop head: main::@2 tails: main::@2 blocks: main::@2 +Loop head: main::@2 tails: main::@2 blocks: main::@2 depth: 1 + + +VARIABLE REGISTER WEIGHTS +(void()) main() +(byte*) main::SCREEN +(byte) main::line + +Initial phi equivalence classes +Complete equivalence classes + +INITIAL ASM +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 +//SEG4 @1 +b1: +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend +//SEG8 @end +bend: +//SEG9 main +main: { + .label SCREEN = $400 + jmp b2 + //SEG10 main::@2 + b2: + //SEG11 [5] *((const byte*) main::SCREEN#0) ← ++ *((const byte*) main::SCREEN#0) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_inc__deref_pbuc1 + inc SCREEN + jmp b2 +} + +REGISTER UPLIFT POTENTIAL REGISTERS + +REGISTER UPLIFT SCOPES +Uplift Scope [main] +Uplift Scope [] + +Uplifting [main] best 132 combination +Uplifting [] best 132 combination + +ASSEMBLER BEFORE OPTIMIZATION +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +bbegin: +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +b1_from_bbegin: + jmp b1 +//SEG4 @1 +b1: +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] +main_from_b1: + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +bend_from_b1: + jmp bend +//SEG8 @end +bend: +//SEG9 main +main: { + .label SCREEN = $400 + jmp b2 + //SEG10 main::@2 + b2: + //SEG11 [5] *((const byte*) main::SCREEN#0) ← ++ *((const byte*) main::SCREEN#0) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_inc__deref_pbuc1 + inc SCREEN + jmp b2 +} + +ASSEMBLER OPTIMIZATIONS +Removing instruction jmp b1 +Removing instruction jmp bend +Removing instruction jmp b2 +Succesful ASM optimization Pass5NextJumpElimination +Removing instruction bbegin: +Removing instruction b1_from_bbegin: +Removing instruction main_from_b1: +Removing instruction bend_from_b1: +Succesful ASM optimization Pass5RedundantLabelElimination +Removing instruction b1: +Removing instruction bend: +Succesful ASM optimization Pass5UnusedLabelElimination + +FINAL SYMBOL TABLE +(label) @1 +(label) @begin +(label) @end +(void()) main() +(label) main::@2 +(byte*) main::SCREEN +(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024 +(byte) main::line + + + +FINAL ASSEMBLER +Score: 96 + +//SEG0 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(main) +.pc = $80d "Program" +//SEG1 Global Constants & labels +//SEG2 @begin +//SEG3 [1] phi from @begin to @1 [phi:@begin->@1] +//SEG4 @1 +//SEG5 [2] call main [ ] ( ) +//SEG6 [4] phi from @1 to main [phi:@1->main] + jsr main +//SEG7 [3] phi from @1 to @end [phi:@1->@end] +//SEG8 @end +//SEG9 main +main: { + .label SCREEN = $400 + //SEG10 main::@2 + b2: + //SEG11 [5] *((const byte*) main::SCREEN#0) ← ++ *((const byte*) main::SCREEN#0) [ ] ( main:2 [ ] ) -- _deref_pbuc1=_inc__deref_pbuc1 + inc SCREEN + jmp b2 +} + diff --git a/src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.sym b/src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.sym new file mode 100644 index 000000000..de328ff6a --- /dev/null +++ b/src/test/java/dk/camelot64/kickc/test/ref/unusedblockproblem.sym @@ -0,0 +1,9 @@ +(label) @1 +(label) @begin +(label) @end +(void()) main() +(label) main::@2 +(byte*) main::SCREEN +(const byte*) main::SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) 1024 +(byte) main::line +