diff --git a/src/main/java/dk/camelot64/kickc/Compiler.java b/src/main/java/dk/camelot64/kickc/Compiler.java index a109a2b9c..fd38092ab 100644 --- a/src/main/java/dk/camelot64/kickc/Compiler.java +++ b/src/main/java/dk/camelot64/kickc/Compiler.java @@ -158,8 +158,11 @@ public class Compiler { new Pass1FixLValuesLoHi(program).execute(); new Pass1AssertNoLValueIntermediate(program).execute(); + new Pass1AddTypePromotions(program).execute(); + new Pass1EarlyConstantIdentification(program).execute(); + new PassNStatementIndices(program).step(); new PassNCallGraphAnalysis(program).step(); diff --git a/src/main/java/dk/camelot64/kickc/model/ControlFlowGraph.java b/src/main/java/dk/camelot64/kickc/model/ControlFlowGraph.java index a24bd706f..6bd2d96b0 100644 --- a/src/main/java/dk/camelot64/kickc/model/ControlFlowGraph.java +++ b/src/main/java/dk/camelot64/kickc/model/ControlFlowGraph.java @@ -2,6 +2,7 @@ package dk.camelot64.kickc.model; import dk.camelot64.kickc.model.statements.Statement; import dk.camelot64.kickc.model.statements.StatementAssignment; +import dk.camelot64.kickc.model.statements.StatementLValue; import dk.camelot64.kickc.model.statements.StatementPhiBlock; import dk.camelot64.kickc.model.symbols.Label; import dk.camelot64.kickc.model.symbols.Procedure; @@ -69,12 +70,12 @@ public class ControlFlowGraph { * @param variable The variable to find the assignment for * @return The assignment. null if the variable is not assigned. The variable is assigned by a Phi-statement instead. */ - public StatementAssignment getAssignment(VariableRef variable) { + public StatementLValue getAssignment(VariableRef variable) { for(ControlFlowBlock block : getAllBlocks()) { for(Statement statement : block.getStatements()) { - if(statement instanceof StatementAssignment) { - StatementAssignment assignment = (StatementAssignment) statement; - if(assignment.getlValue().equals(variable)) { + if(statement instanceof StatementLValue) { + StatementLValue assignment = (StatementLValue) statement; + if(variable.equals(assignment.getlValue())) { return assignment; } } diff --git a/src/main/java/dk/camelot64/kickc/model/Program.java b/src/main/java/dk/camelot64/kickc/model/Program.java index 06aa74f5d..8a110494b 100644 --- a/src/main/java/dk/camelot64/kickc/model/Program.java +++ b/src/main/java/dk/camelot64/kickc/model/Program.java @@ -4,9 +4,11 @@ import dk.camelot64.kickc.CompileLog; import dk.camelot64.kickc.asm.AsmProgram; import dk.camelot64.kickc.model.statements.StatementInfos; import dk.camelot64.kickc.model.symbols.ProgramScope; +import dk.camelot64.kickc.model.values.VariableRef; import java.nio.file.Path; import java.util.ArrayList; +import java.util.Collection; import java.util.List; /** A KickC Intermediate Compiler Language (ICL) Program */ @@ -62,6 +64,9 @@ public class Program { /** Separation of live range equivalence classes into scopes - used for register uplift */ private RegisterUpliftProgram registerUpliftProgram; + /** Constants identified during pass 1. */ + private Collection earlyIdentifiedConstants; + public Program() { this.scope = new ProgramScope(); this.log = new CompileLog(); @@ -230,6 +235,14 @@ public class Program { this.registerUpliftProgram = registerUpliftProgram; } + public Collection getEarlyIdentifiedConstants() { + return earlyIdentifiedConstants; + } + + public void setEarlyIdentifiedConstants(Collection earlyIdentifiedConstants) { + this.earlyIdentifiedConstants = earlyIdentifiedConstants; + } + public CompileLog getLog() { return log; } diff --git a/src/main/java/dk/camelot64/kickc/model/statements/StatementLValue.java b/src/main/java/dk/camelot64/kickc/model/statements/StatementLValue.java index c991dcefe..f0a4711bc 100644 --- a/src/main/java/dk/camelot64/kickc/model/statements/StatementLValue.java +++ b/src/main/java/dk/camelot64/kickc/model/statements/StatementLValue.java @@ -3,7 +3,7 @@ package dk.camelot64.kickc.model.statements; import dk.camelot64.kickc.model.values.LValue; /** - * Single Static Assignment Form Statement with an LValuie - that is a statement assigning a value to a variable. + * Single Static Assignment Form Statement with an LValue - that is a statement assigning a value to a variable. */ public interface StatementLValue extends Statement { diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1AssertNoLValueIntermediate.java b/src/main/java/dk/camelot64/kickc/passes/Pass1AssertNoLValueIntermediate.java index bd03225ea..e294f9a19 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass1AssertNoLValueIntermediate.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1AssertNoLValueIntermediate.java @@ -25,7 +25,7 @@ public class Pass1AssertNoLValueIntermediate extends Pass1Base { LValue lValue = ((StatementLValue) statement).getlValue(); if(lValue instanceof LvalueIntermediate) { VariableRef intermediateVar = ((LvalueIntermediate) lValue).getVariable(); - StatementAssignment assignment = getGraph().getAssignment(intermediateVar); + StatementLValue assignment = getGraph().getAssignment(intermediateVar); throw new CompileError("Error! LValue is illegal. " + statement + " - definition of lValue " + assignment, assignment.getSource()); } } diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1EarlyConstantIdentification.java b/src/main/java/dk/camelot64/kickc/passes/Pass1EarlyConstantIdentification.java new file mode 100644 index 000000000..faceeca37 --- /dev/null +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1EarlyConstantIdentification.java @@ -0,0 +1,71 @@ +package dk.camelot64.kickc.passes; + +import dk.camelot64.kickc.model.ControlFlowBlock; +import dk.camelot64.kickc.model.Program; +import dk.camelot64.kickc.model.operators.OperatorCastPtr; +import dk.camelot64.kickc.model.statements.Statement; +import dk.camelot64.kickc.model.statements.StatementAssignment; +import dk.camelot64.kickc.model.statements.StatementLValue; +import dk.camelot64.kickc.model.symbols.Variable; +import dk.camelot64.kickc.model.values.ConstantValue; +import dk.camelot64.kickc.model.values.VariableRef; + +import java.util.ArrayList; +import java.util.Collection; + +/** Identify any variable that are clearly constant. */ +public class Pass1EarlyConstantIdentification extends Pass1Base { + + public Pass1EarlyConstantIdentification(Program program) { + super(program); + } + + @Override + public boolean step() { + Collection earlyConstants = new ArrayList<>(); + for(Variable variable : getProgram().getScope().getAllVariables(true)) { + VariableRef variableRef = variable.getRef(); + if(!variable.isDeclaredConstant() && !variable.isDeclaredVolatile() && !variableRef.isIntermediate()) { + Collection assignments = getAssignments(variable); + if(assignments.size() == 1) { + if(!Pass2ConstantIdentification.isAddressOfUsed(variableRef, getProgram())) { + StatementLValue assignment = assignments.iterator().next(); + if(assignment instanceof StatementAssignment) { + StatementAssignment assign = (StatementAssignment) assignment; + if(assign.getrValue1() == null && assign.getOperator() == null && assign.getrValue2() instanceof ConstantValue) { + getLog().append("Identified constant variable " + variable.toString(getProgram())); + earlyConstants.add(variableRef); + } else if(assign.getrValue1() == null && assign.getOperator() instanceof OperatorCastPtr && assign.getrValue2() instanceof ConstantValue) { + getLog().append("Identified constant variable " + variable.toString(getProgram())); + earlyConstants.add(variableRef); + } + } + } + } + } + } + getProgram().setEarlyIdentifiedConstants(earlyConstants); + return false; + } + + /** + * Find all assignments of a variable. + * + * @param variable The variable + * @return all assignments + */ + private Collection getAssignments(Variable variable) { + Collection assignments = new ArrayList<>(); + for(ControlFlowBlock block : getGraph().getAllBlocks()) { + for(Statement statement : block.getStatements()) { + if(statement instanceof StatementLValue) { + StatementLValue assignment = (StatementLValue) statement; + if(variable.getRef().equals(assignment.getlValue())) { + assignments.add(assignment); + } + } + } + } + return assignments; + } +} diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1FixLValuesLoHi.java b/src/main/java/dk/camelot64/kickc/passes/Pass1FixLValuesLoHi.java index 8bde669d1..1b2f990e8 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass1FixLValuesLoHi.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1FixLValuesLoHi.java @@ -42,15 +42,18 @@ public class Pass1FixLValuesLoHi extends Pass1Base { if(statement instanceof StatementLValue && ((StatementLValue) statement).getlValue() instanceof LvalueIntermediate) { StatementLValue statementLValue = (StatementLValue) statement; LvalueIntermediate intermediate = (LvalueIntermediate) statementLValue.getlValue(); - StatementAssignment intermediateAssignment = getProgram().getGraph().getAssignment(intermediate.getVariable()); - if(Operators.LOWBYTE.equals(intermediateAssignment.getOperator()) && intermediateAssignment.getrValue1() == null) { - // Found assignment to an intermediate low byte lValue x = ... - fixLoHiLValue(programScope, statementsIt, statementLValue, intermediate, intermediateAssignment, Operators.SET_HIBYTE); - intermediates.add(intermediate.getVariable()); + StatementLValue intermediateStmtLValue = getProgram().getGraph().getAssignment(intermediate.getVariable()); + if(intermediateStmtLValue instanceof StatementAssignment) { + StatementAssignment intermediateAssignment = (StatementAssignment) intermediateStmtLValue; + if(Operators.LOWBYTE.equals(intermediateAssignment.getOperator()) && intermediateAssignment.getrValue1() == null) { + // Found assignment to an intermediate low byte lValue x = ... + fixLoHiLValue(programScope, statementsIt, statementLValue, intermediate, intermediateAssignment, Operators.SET_HIBYTE); + intermediates.add(intermediate.getVariable()); + } } } } diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass1GenerateSingleStaticAssignmentForm.java b/src/main/java/dk/camelot64/kickc/passes/Pass1GenerateSingleStaticAssignmentForm.java index e77b4e90a..ca7f089cd 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass1GenerateSingleStaticAssignmentForm.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass1GenerateSingleStaticAssignmentForm.java @@ -49,6 +49,7 @@ public class Pass1GenerateSingleStaticAssignmentForm extends Pass1Base { * Version all non-versioned non-intermediary being assigned a value. */ private void versionAllAssignments() { + Collection earlyIdentifiedConstants = getProgram().getEarlyIdentifiedConstants(); for(ControlFlowBlock block : getGraph().getAllBlocks()) { for(Statement statement : block.getStatements()) { if(statement instanceof StatementLValue) { @@ -61,7 +62,7 @@ public class Pass1GenerateSingleStaticAssignmentForm extends Pass1Base { // Assignment to a non-versioned non-intermediary variable VariableUnversioned assignedSymbol = (VariableUnversioned) assignedVar; VariableVersion version; - if(assignedSymbol.isDeclaredConstant()) { + if(assignedSymbol.isDeclaredConstant() || earlyIdentifiedConstants.contains(assignedSymbol.getRef())) { Collection versions = assignedVar.getScope().getVersions(assignedSymbol); if(versions.size() != 0) { throw new CompileError("Error! Constants can not be modified " + statement, statement.getSource()); @@ -144,13 +145,14 @@ public class Pass1GenerateSingleStaticAssignmentForm extends Pass1Base { RValue rValue, Map blockVersions, Map blockNewPhis) { + Collection earlyIdentifiedConstants = getProgram().getEarlyIdentifiedConstants(); VariableVersion version = null; if(rValue instanceof VariableRef) { Variable rValueVar = getScope().getVariable((VariableRef) rValue); if(rValueVar instanceof VariableUnversioned) { // rValue needs versioning - look for version in statements VariableUnversioned rSymbol = (VariableUnversioned) rValueVar; - if(rSymbol.isDeclaredConstant()) { + if(rSymbol.isDeclaredConstant() || earlyIdentifiedConstants.contains(rSymbol.getRef())) { // A constant - find the single created version Scope scope = rSymbol.getScope(); Collection versions = scope.getVersions(rSymbol); diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantAdditionElimination.java b/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantAdditionElimination.java index 693f72fbb..6ccb5f0b2 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantAdditionElimination.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass2ConstantAdditionElimination.java @@ -9,7 +9,7 @@ import dk.camelot64.kickc.model.operators.Operator; import dk.camelot64.kickc.model.operators.Operators; import dk.camelot64.kickc.model.statements.Statement; import dk.camelot64.kickc.model.statements.StatementAssignment; -import dk.camelot64.kickc.model.statements.StatementConditionalJump; +import dk.camelot64.kickc.model.statements.StatementLValue; import dk.camelot64.kickc.model.values.*; import java.util.Collection; @@ -41,7 +41,7 @@ public class Pass2ConstantAdditionElimination extends Pass2SsaOptimization { public boolean step() { final boolean[] optimized = {false}; - this.variableReferenceInfos = getProgram().getVariableReferenceInfos(); + this.variableReferenceInfos = getProgram().getVariableReferenceInfos(); ProgramValueIterator.execute(getProgram(), (programValue, currentStmt, stmtIt, currentBlock) -> { if(programValue.get() instanceof PointerDereferenceIndexed) { @@ -156,66 +156,69 @@ public class Pass2ConstantAdditionElimination extends Pass2SsaOptimization { //getLog().append("Multiple usages for variable. Not optimizing sub-constant " + variable.toString(getProgram())); return null; } - StatementAssignment assignment = getGraph().getAssignment(variable); - if(assignment != null && assignment.getOperator() != null && "+".equals(assignment.getOperator().getOperator())) { - if(assignment.getrValue1() instanceof ConstantValue) { - ConstantValue constant = (ConstantValue) assignment.getrValue1(); - assignment.setrValue1(null); - assignment.setOperator(null); - return constant; - } else if(assignment.getrValue2() instanceof ConstantValue) { - ConstantValue constant = (ConstantValue) assignment.getrValue2(); - assignment.setrValue2(assignment.getrValue1()); - assignment.setOperator(null); - assignment.setrValue1(null); - return constant; - } else { - ConstantValue const1 = null; - if(assignment.getrValue1() instanceof VariableRef) { - const1 = consolidateSubConstants((VariableRef) assignment.getrValue1()); - } - ConstantValue const2 = null; - if(assignment.getrValue2() instanceof VariableRef) { - const2 = consolidateSubConstants((VariableRef) assignment.getrValue2()); - } - ConstantValue result = null; - if(const1 != null) { - result = const1; - if(const2 != null) { - result = new ConstantBinary(const1, Operators.PLUS, const2); + StatementLValue statementLValue = getGraph().getAssignment(variable); + if(statementLValue instanceof StatementAssignment) { + StatementAssignment assignment = (StatementAssignment) statementLValue; + if(assignment.getOperator() != null && "+".equals(assignment.getOperator().getOperator())) { + if(assignment.getrValue1() instanceof ConstantValue) { + ConstantValue constant = (ConstantValue) assignment.getrValue1(); + assignment.setrValue1(null); + assignment.setOperator(null); + return constant; + } else if(assignment.getrValue2() instanceof ConstantValue) { + ConstantValue constant = (ConstantValue) assignment.getrValue2(); + assignment.setrValue2(assignment.getrValue1()); + assignment.setOperator(null); + assignment.setrValue1(null); + return constant; + } else { + ConstantValue const1 = null; + if(assignment.getrValue1() instanceof VariableRef) { + const1 = consolidateSubConstants((VariableRef) assignment.getrValue1()); } - } else if(const2 != null) { - result = const2; + ConstantValue const2 = null; + if(assignment.getrValue2() instanceof VariableRef) { + const2 = consolidateSubConstants((VariableRef) assignment.getrValue2()); + } + ConstantValue result = null; + if(const1 != null) { + result = const1; + if(const2 != null) { + result = new ConstantBinary(const1, Operators.PLUS, const2); + } + } else if(const2 != null) { + result = const2; + } + return result; } - return result; } - } - if(assignment != null && assignment.getOperator() != null && "-".equals(assignment.getOperator().getOperator())) { - if(assignment.getrValue2() instanceof ConstantValue) { - ConstantValue constant = (ConstantValue) assignment.getrValue2(); - assignment.setrValue2(assignment.getrValue1()); - assignment.setOperator(null); - assignment.setrValue1(null); - return new ConstantUnary(Operators.NEG, constant); - } else { - ConstantValue const1 = null; - if(assignment.getrValue1() instanceof VariableRef) { - const1 = consolidateSubConstants((VariableRef) assignment.getrValue1()); - } - ConstantValue const2 = null; - if(assignment.getrValue2() instanceof VariableRef) { - const2 = consolidateSubConstants((VariableRef) assignment.getrValue2()); - } - ConstantValue result = null; - if(const1 != null) { - result = const1; - if(const2 != null) { - result = new ConstantBinary(const1, Operators.MINUS, const2); + if(assignment != null && assignment.getOperator() != null && "-".equals(assignment.getOperator().getOperator())) { + if(assignment.getrValue2() instanceof ConstantValue) { + ConstantValue constant = (ConstantValue) assignment.getrValue2(); + assignment.setrValue2(assignment.getrValue1()); + assignment.setOperator(null); + assignment.setrValue1(null); + return new ConstantUnary(Operators.NEG, constant); + } else { + ConstantValue const1 = null; + if(assignment.getrValue1() instanceof VariableRef) { + const1 = consolidateSubConstants((VariableRef) assignment.getrValue1()); } - } else if(const2 != null) { - result = const2; + ConstantValue const2 = null; + if(assignment.getrValue2() instanceof VariableRef) { + const2 = consolidateSubConstants((VariableRef) assignment.getrValue2()); + } + ConstantValue result = null; + if(const1 != null) { + result = const1; + if(const2 != null) { + result = new ConstantBinary(const1, Operators.MINUS, const2); + } + } else if(const2 != null) { + result = const2; + } + return result; } - return result; } } return null; diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index 342aaf732..a9e3a1fb9 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -32,6 +32,11 @@ public class TestPrograms { public TestPrograms() { } + @Test + public void testConstEarlyIdentification() throws IOException, URISyntaxException { + compileAndCompare("const-early-identification"); + } + @Test public void testBoolNullPointerException() throws IOException, URISyntaxException { compileAndCompare("bool-nullpointer-exception"); diff --git a/src/test/kc/const-early-identification.kc b/src/test/kc/const-early-identification.kc new file mode 100644 index 000000000..af9e79a8e --- /dev/null +++ b/src/test/kc/const-early-identification.kc @@ -0,0 +1,23 @@ +// Tests that constants are identified early + +byte* SCREEN = $400; +// Not an early constant (address-of is used) +byte A = 'a'; + +void main(){ + SCREEN[0] = A; + byte B = 'b'; + SCREEN[1] = B; + byte* addrA = &A; + SCREEN[2] = *addrA; + sub(); + +} + +void sub() { + byte C = 'c'; + SCREEN[3] = C; + // Not an early constant (expression) + byte D = A+1; + SCREEN[4] = D; +} \ No newline at end of file diff --git a/src/test/ref/array-length-symbolic-min.log b/src/test/ref/array-length-symbolic-min.log index 342a3b8ac..bc3d2dc10 100644 --- a/src/test/ref/array-length-symbolic-min.log +++ b/src/test/ref/array-length-symbolic-min.log @@ -1,3 +1,4 @@ +Identified constant variable (byte) SZ CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -5,24 +6,21 @@ CONTROL FLOW GRAPH SSA (byte[SZ#0]) items#0 ← { fill( SZ#0, 0) } to:@1 main: scope:[main] from @1 - (byte) SZ#2 ← phi( @1/(byte) SZ#3 ) (byte*) main::cur_item#0 ← (byte[SZ#0]) items#0 (byte) main::sub#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@1 - (byte) SZ#1 ← phi( main/(byte) SZ#2 main::@1/(byte) SZ#1 ) (byte*) main::cur_item#1 ← phi( main/(byte*) main::cur_item#0 main::@1/(byte*) main::cur_item#1 ) (byte) main::sub#2 ← phi( main/(byte) main::sub#0 main::@1/(byte) main::sub#1 ) *((byte*) main::cur_item#1 + (byte) main::sub#2) ← (byte) main::sub#2 - (byte) main::sub#1 ← (byte) main::sub#2 + rangenext(0,SZ#1) - (bool~) main::$0 ← (byte) main::sub#1 != rangelast(0,SZ#1) + (byte) main::sub#1 ← (byte) main::sub#2 + rangenext(0,SZ#0) + (bool~) main::$0 ← (byte) main::sub#1 != rangelast(0,SZ#0) if((bool~) main::$0) goto main::@1 to:main::@return main::@return: scope:[main] from main::@1 return to:@return @1: scope:[] from @begin - (byte) SZ#3 ← phi( @begin/(byte) SZ#0 ) call main to:@2 @2: scope:[] from @1 @@ -36,9 +34,6 @@ SYMBOL TABLE SSA (label) @end (byte) SZ (byte) SZ#0 -(byte) SZ#1 -(byte) SZ#2 -(byte) SZ#3 (byte[SZ#0]) items (byte[SZ#0]) items#0 (void()) main() @@ -55,16 +50,11 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte) SZ#0 = (byte) SZ#3 -Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (byte*) main::cur_item#1 -Self Phi Eliminated (byte) SZ#1 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte) SZ#2 (byte) SZ#0 Redundant Phi (byte*) main::cur_item#1 (byte*) main::cur_item#0 -Redundant Phi (byte) SZ#1 (byte) SZ#2 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$0 [9] if((byte) main::sub#1!=rangelast(0,SZ#0)) goto main::@1 +Simple Condition (bool~) main::$0 [8] if((byte) main::sub#1!=rangelast(0,SZ#0)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte) SZ#0 = $f Constant (const byte) main::sub#0 = 0 diff --git a/src/test/ref/array-length-symbolic.log b/src/test/ref/array-length-symbolic.log index aa9e698c4..c83b5a555 100644 --- a/src/test/ref/array-length-symbolic.log +++ b/src/test/ref/array-length-symbolic.log @@ -1,3 +1,5 @@ +Identified constant variable (byte) ITEM_COUNT +Identified constant variable (byte) ITEM_SIZE CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -7,21 +9,17 @@ CONTROL FLOW GRAPH SSA (byte[$0]) items#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0 } to:@1 main: scope:[main] from @1 - (byte) ITEM_SIZE#3 ← phi( @1/(byte) ITEM_SIZE#5 ) - (byte) ITEM_COUNT#1 ← phi( @1/(byte) ITEM_COUNT#2 ) (byte*) main::cur_item#0 ← (byte[$0]) items#0 - (byte/signed word/word/dword/signed dword~) main::$0 ← (byte) ITEM_COUNT#1 - (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte/signed word/word/dword/signed dword~) main::$0 ← (byte) ITEM_COUNT#0 - (byte/signed byte/word/signed word/dword/signed dword) 1 (byte) main::item#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@3 (byte*) main::cur_item#4 ← phi( main/(byte*) main::cur_item#0 main::@3/(byte*) main::cur_item#1 ) (byte) main::item#4 ← phi( main/(byte) main::item#0 main::@3/(byte) main::item#1 ) - (byte) ITEM_SIZE#1 ← phi( main/(byte) ITEM_SIZE#3 main::@3/(byte) ITEM_SIZE#2 ) - (byte/signed word/word/dword/signed dword~) main::$1 ← (byte) ITEM_SIZE#1 - (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte/signed word/word/dword/signed dword~) main::$1 ← (byte) ITEM_SIZE#0 - (byte/signed byte/word/signed word/dword/signed dword) 1 (byte) main::sub#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@2 main::@2: scope:[main] from main::@1 main::@2 - (byte) ITEM_SIZE#4 ← phi( main::@1/(byte) ITEM_SIZE#1 main::@2/(byte) ITEM_SIZE#4 ) (byte*) main::cur_item#2 ← phi( main::@1/(byte*) main::cur_item#4 main::@2/(byte*) main::cur_item#2 ) (byte) main::sub#2 ← phi( main::@1/(byte) main::sub#0 main::@2/(byte) main::sub#1 ) (byte) main::item#2 ← phi( main::@1/(byte) main::item#4 main::@2/(byte) main::item#2 ) @@ -34,9 +32,8 @@ main::@2: scope:[main] from main::@1 main::@2 to:main::@3 main::@3: scope:[main] from main::@2 (byte) main::item#3 ← phi( main::@2/(byte) main::item#2 ) - (byte) ITEM_SIZE#2 ← phi( main::@2/(byte) ITEM_SIZE#4 ) (byte*) main::cur_item#3 ← phi( main::@2/(byte*) main::cur_item#2 ) - (byte*) main::cur_item#1 ← (byte*) main::cur_item#3 + (byte) ITEM_SIZE#2 + (byte*) main::cur_item#1 ← (byte*) main::cur_item#3 + (byte) ITEM_SIZE#0 (byte) main::item#1 ← (byte) main::item#3 + rangenext(0,main::$0) (bool~) main::$5 ← (byte) main::item#1 != rangelast(0,main::$0) if((bool~) main::$5) goto main::@1 @@ -45,8 +42,6 @@ main::@return: scope:[main] from main::@3 return to:@return @1: scope:[] from @begin - (byte) ITEM_SIZE#5 ← phi( @begin/(byte) ITEM_SIZE#0 ) - (byte) ITEM_COUNT#2 ← phi( @begin/(byte) ITEM_COUNT#0 ) call main to:@2 @2: scope:[] from @1 @@ -61,15 +56,8 @@ SYMBOL TABLE SSA (label) @end (byte) ITEM_COUNT (byte) ITEM_COUNT#0 -(byte) ITEM_COUNT#1 -(byte) ITEM_COUNT#2 (byte) ITEM_SIZE (byte) ITEM_SIZE#0 -(byte) ITEM_SIZE#1 -(byte) ITEM_SIZE#2 -(byte) ITEM_SIZE#3 -(byte) ITEM_SIZE#4 -(byte) ITEM_SIZE#5 (byte[$0]) items (byte[$0]) items#0 (void()) main() @@ -103,23 +91,16 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte*) main::cur_item#2 = (byte*) main::cur_item#3 -Alias (byte) ITEM_SIZE#2 = (byte) ITEM_SIZE#4 Alias (byte) main::item#2 = (byte) main::item#3 -Alias (byte) ITEM_COUNT#0 = (byte) ITEM_COUNT#2 -Alias (byte) ITEM_SIZE#0 = (byte) ITEM_SIZE#5 Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (byte) main::item#2 Self Phi Eliminated (byte*) main::cur_item#2 -Self Phi Eliminated (byte) ITEM_SIZE#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte) ITEM_COUNT#1 (byte) ITEM_COUNT#0 -Redundant Phi (byte) ITEM_SIZE#3 (byte) ITEM_SIZE#0 Redundant Phi (byte) main::item#2 (byte) main::item#4 Redundant Phi (byte*) main::cur_item#2 (byte*) main::cur_item#4 -Redundant Phi (byte) ITEM_SIZE#2 (byte) ITEM_SIZE#1 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$4 [17] if((byte) main::sub#1!=rangelast(0,main::$1)) goto main::@2 -Simple Condition (bool~) main::$5 [22] if((byte) main::item#1!=rangelast(0,main::$0)) goto main::@1 +Simple Condition (bool~) main::$4 [16] if((byte) main::sub#1!=rangelast(0,main::$1)) goto main::@2 +Simple Condition (bool~) main::$5 [21] if((byte) main::item#1!=rangelast(0,main::$0)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte) ITEM_COUNT#0 = 3 Constant (const byte) ITEM_SIZE#0 = 5 @@ -130,17 +111,12 @@ Successful SSA optimization Pass2ConstantIdentification Constant (const byte) $0 = ITEM_COUNT#0*ITEM_SIZE#0 Constant (const byte*) main::cur_item#0 = items#0 Constant (const byte/signed word/word/dword/signed dword) main::$0 = ITEM_COUNT#0-1 -Successful SSA optimization Pass2ConstantIdentification -Resolved ranged next value main::item#1 ← ++ main::item#4 to ++ -Resolved ranged comparison value if(main::item#1!=rangelast(0,main::$0)) goto main::@1 to (const byte/signed word/word/dword/signed dword) main::$0+(byte/signed byte/word/signed word/dword/signed dword) 1 -Self Phi Eliminated (byte) ITEM_SIZE#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte) ITEM_SIZE#1 (const byte) ITEM_SIZE#0 -Successful SSA optimization Pass2RedundantPhiElimination Constant (const byte/signed word/word/dword/signed dword) main::$1 = ITEM_SIZE#0-1 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value main::sub#1 ← ++ main::sub#2 to ++ Resolved ranged comparison value if(main::sub#1!=rangelast(0,main::$1)) goto main::@2 to (const byte/signed word/word/dword/signed dword) main::$1+(byte/signed byte/word/signed word/dword/signed dword) 1 +Resolved ranged next value main::item#1 ← ++ main::item#4 to ++ +Resolved ranged comparison value if(main::item#1!=rangelast(0,main::$0)) goto main::@1 to (const byte/signed word/word/dword/signed dword) main::$0+(byte/signed byte/word/signed word/dword/signed dword) 1 Inlining constant with var siblings (const byte) main::item#0 Inlining constant with var siblings (const byte) main::sub#0 Inlining constant with var siblings (const byte*) main::cur_item#0 diff --git a/src/test/ref/arrays-init.log b/src/test/ref/arrays-init.log index e06e052f8..14de5615f 100644 --- a/src/test/ref/arrays-init.log +++ b/src/test/ref/arrays-init.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -7,19 +8,17 @@ CONTROL FLOW GRAPH SSA (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@1 main: scope:[main] from @1 - (byte*) SCREEN#1 ← phi( @1/(byte*) SCREEN#2 ) *((byte[3]) b#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'c' - *((byte*) SCREEN#1) ← *((byte[3]) b#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) - (byte*~) main::$0 ← (byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 1 + *((byte*) SCREEN#0) ← *((byte[3]) b#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) + (byte*~) main::$0 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1 *((byte*~) main::$0) ← *((byte[]) c#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) - (byte*~) main::$1 ← (byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 2 + (byte*~) main::$1 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2 *((byte*~) main::$1) ← *((byte[]) d#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) to:main::@return main::@return: scope:[main] from main return to:@return @1: scope:[] from @begin - (byte*) SCREEN#2 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -34,8 +33,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 (byte[3]) b (byte[3]) b#0 (byte[]) c @@ -49,10 +46,6 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) SCREEN#0 = (byte*) SCREEN#2 -Successful SSA optimization Pass2AliasElimination -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Constant (const byte[3]) b#0 = { fill( 3, 0) } Constant (const byte[]) c#0 = { 'c', 'm', 'l' } Constant (const byte[]) d#0 = $0 diff --git a/src/test/ref/assignment-chained.log b/src/test/ref/assignment-chained.log index b4c8f2b63..a4fe91fdc 100644 --- a/src/test/ref/assignment-chained.log +++ b/src/test/ref/assignment-chained.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/assignment-compound.log b/src/test/ref/assignment-compound.log index 0b01a33a0..7043ae4d8 100644 --- a/src/test/ref/assignment-compound.log +++ b/src/test/ref/assignment-compound.log @@ -1,3 +1,7 @@ +Identified constant variable (byte*) screen1 +Identified constant variable (byte*) cols +Identified constant variable (byte) GREEN +Identified constant variable (byte) RED CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -10,11 +14,7 @@ CONTROL FLOW GRAPH SSA (byte) RED#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2 to:@2 main: scope:[main] from @2 - (byte) RED#3 ← phi( @2/(byte) RED#14 ) - (byte*) cols#4 ← phi( @2/(byte*) cols#15 ) - (byte) GREEN#3 ← phi( @2/(byte) GREEN#14 ) (byte*) screen2#2 ← phi( @2/(byte*) screen2#13 ) - (byte*) screen1#2 ← phi( @2/(byte*) screen1#13 ) (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::a#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3 (byte) test::i#0 ← (byte) main::i#0 @@ -22,11 +22,7 @@ main: scope:[main] from @2 call test to:main::@1 main::@1: scope:[main] from main - (byte) RED#4 ← phi( main/(byte) RED#3 ) - (byte*) cols#5 ← phi( main/(byte*) cols#4 ) - (byte) GREEN#4 ← phi( main/(byte) GREEN#3 ) (byte*) screen2#3 ← phi( main/(byte*) screen2#2 ) - (byte*) screen1#3 ← phi( main/(byte*) screen1#2 ) (byte) main::a#11 ← phi( main/(byte) main::a#0 ) (byte) main::i#12 ← phi( main/(byte) main::i#0 ) (byte) main::i#1 ← ++ (byte) main::i#12 @@ -36,11 +32,7 @@ main::@1: scope:[main] from main call test to:main::@2 main::@2: scope:[main] from main::@1 - (byte) RED#6 ← phi( main::@1/(byte) RED#4 ) - (byte*) cols#7 ← phi( main::@1/(byte*) cols#5 ) - (byte) GREEN#6 ← phi( main::@1/(byte) GREEN#4 ) (byte*) screen2#5 ← phi( main::@1/(byte*) screen2#3 ) - (byte*) screen1#5 ← phi( main::@1/(byte*) screen1#3 ) (byte) main::a#12 ← phi( main::@1/(byte) main::a#1 ) (byte) main::i#13 ← phi( main::@1/(byte) main::i#1 ) (byte) main::i#2 ← ++ (byte) main::i#13 @@ -50,11 +42,7 @@ main::@2: scope:[main] from main::@1 call test to:main::@3 main::@3: scope:[main] from main::@2 - (byte) RED#7 ← phi( main::@2/(byte) RED#6 ) - (byte*) cols#8 ← phi( main::@2/(byte*) cols#7 ) - (byte) GREEN#7 ← phi( main::@2/(byte) GREEN#6 ) (byte*) screen2#6 ← phi( main::@2/(byte*) screen2#5 ) - (byte*) screen1#6 ← phi( main::@2/(byte*) screen1#5 ) (byte) main::a#13 ← phi( main::@2/(byte) main::a#2 ) (byte) main::i#14 ← phi( main::@2/(byte) main::i#2 ) (byte) main::i#3 ← ++ (byte) main::i#14 @@ -64,11 +52,7 @@ main::@3: scope:[main] from main::@2 call test to:main::@4 main::@4: scope:[main] from main::@3 - (byte) RED#8 ← phi( main::@3/(byte) RED#7 ) - (byte*) cols#9 ← phi( main::@3/(byte*) cols#8 ) - (byte) GREEN#8 ← phi( main::@3/(byte) GREEN#7 ) (byte*) screen2#7 ← phi( main::@3/(byte*) screen2#6 ) - (byte*) screen1#7 ← phi( main::@3/(byte*) screen1#6 ) (byte) main::a#14 ← phi( main::@3/(byte) main::a#3 ) (byte) main::i#15 ← phi( main::@3/(byte) main::i#3 ) (byte) main::i#4 ← ++ (byte) main::i#15 @@ -78,11 +62,7 @@ main::@4: scope:[main] from main::@3 call test to:main::@5 main::@5: scope:[main] from main::@4 - (byte) RED#9 ← phi( main::@4/(byte) RED#8 ) - (byte*) cols#10 ← phi( main::@4/(byte*) cols#9 ) - (byte) GREEN#9 ← phi( main::@4/(byte) GREEN#8 ) (byte*) screen2#8 ← phi( main::@4/(byte*) screen2#7 ) - (byte*) screen1#8 ← phi( main::@4/(byte*) screen1#7 ) (byte) main::a#15 ← phi( main::@4/(byte) main::a#4 ) (byte) main::i#16 ← phi( main::@4/(byte) main::i#4 ) (byte) main::i#5 ← ++ (byte) main::i#16 @@ -92,11 +72,7 @@ main::@5: scope:[main] from main::@4 call test to:main::@6 main::@6: scope:[main] from main::@5 - (byte) RED#10 ← phi( main::@5/(byte) RED#9 ) - (byte*) cols#11 ← phi( main::@5/(byte*) cols#10 ) - (byte) GREEN#10 ← phi( main::@5/(byte) GREEN#9 ) (byte*) screen2#9 ← phi( main::@5/(byte*) screen2#8 ) - (byte*) screen1#9 ← phi( main::@5/(byte*) screen1#8 ) (byte) main::a#16 ← phi( main::@5/(byte) main::a#5 ) (byte) main::i#17 ← phi( main::@5/(byte) main::i#5 ) (byte) main::i#6 ← ++ (byte) main::i#17 @@ -106,11 +82,7 @@ main::@6: scope:[main] from main::@5 call test to:main::@7 main::@7: scope:[main] from main::@6 - (byte) RED#11 ← phi( main::@6/(byte) RED#10 ) - (byte*) cols#12 ← phi( main::@6/(byte*) cols#11 ) - (byte) GREEN#11 ← phi( main::@6/(byte) GREEN#10 ) (byte*) screen2#10 ← phi( main::@6/(byte*) screen2#9 ) - (byte*) screen1#10 ← phi( main::@6/(byte*) screen1#9 ) (byte) main::a#17 ← phi( main::@6/(byte) main::a#6 ) (byte) main::i#18 ← phi( main::@6/(byte) main::i#6 ) (byte) main::i#7 ← ++ (byte) main::i#18 @@ -120,11 +92,7 @@ main::@7: scope:[main] from main::@6 call test to:main::@8 main::@8: scope:[main] from main::@7 - (byte) RED#12 ← phi( main::@7/(byte) RED#11 ) - (byte*) cols#13 ← phi( main::@7/(byte*) cols#12 ) - (byte) GREEN#12 ← phi( main::@7/(byte) GREEN#11 ) (byte*) screen2#11 ← phi( main::@7/(byte*) screen2#10 ) - (byte*) screen1#11 ← phi( main::@7/(byte*) screen1#10 ) (byte) main::a#18 ← phi( main::@7/(byte) main::a#7 ) (byte) main::i#19 ← phi( main::@7/(byte) main::i#7 ) (byte) main::i#8 ← ++ (byte) main::i#19 @@ -134,11 +102,7 @@ main::@8: scope:[main] from main::@7 call test to:main::@9 main::@9: scope:[main] from main::@8 - (byte) RED#13 ← phi( main::@8/(byte) RED#12 ) - (byte*) cols#14 ← phi( main::@8/(byte*) cols#13 ) - (byte) GREEN#13 ← phi( main::@8/(byte) GREEN#12 ) (byte*) screen2#12 ← phi( main::@8/(byte*) screen2#11 ) - (byte*) screen1#12 ← phi( main::@8/(byte*) screen1#11 ) (byte) main::a#19 ← phi( main::@8/(byte) main::a#8 ) (byte) main::i#20 ← phi( main::@8/(byte) main::i#8 ) (byte) main::i#9 ← ++ (byte) main::i#20 @@ -148,11 +112,7 @@ main::@9: scope:[main] from main::@8 call test to:main::@10 main::@10: scope:[main] from main::@9 - (byte) RED#5 ← phi( main::@9/(byte) RED#13 ) - (byte*) cols#6 ← phi( main::@9/(byte*) cols#14 ) - (byte) GREEN#5 ← phi( main::@9/(byte) GREEN#13 ) (byte*) screen2#4 ← phi( main::@9/(byte*) screen2#12 ) - (byte*) screen1#4 ← phi( main::@9/(byte*) screen1#12 ) (byte) main::a#20 ← phi( main::@9/(byte) main::a#9 ) (byte) main::i#21 ← phi( main::@9/(byte) main::i#9 ) (byte) main::i#10 ← ++ (byte) main::i#21 @@ -169,39 +129,27 @@ main::@return: scope:[main] from main::@11 return to:@return test: scope:[test] from main main::@1 main::@10 main::@2 main::@3 main::@4 main::@5 main::@6 main::@7 main::@8 main::@9 - (byte) RED#2 ← phi( main/(byte) RED#3 main::@1/(byte) RED#4 main::@10/(byte) RED#5 main::@2/(byte) RED#6 main::@3/(byte) RED#7 main::@4/(byte) RED#8 main::@5/(byte) RED#9 main::@6/(byte) RED#10 main::@7/(byte) RED#11 main::@8/(byte) RED#12 main::@9/(byte) RED#13 ) - (byte*) cols#3 ← phi( main/(byte*) cols#4 main::@1/(byte*) cols#5 main::@10/(byte*) cols#6 main::@2/(byte*) cols#7 main::@3/(byte*) cols#8 main::@4/(byte*) cols#9 main::@5/(byte*) cols#10 main::@6/(byte*) cols#11 main::@7/(byte*) cols#12 main::@8/(byte*) cols#13 main::@9/(byte*) cols#14 ) - (byte) GREEN#2 ← phi( main/(byte) GREEN#3 main::@1/(byte) GREEN#4 main::@10/(byte) GREEN#5 main::@2/(byte) GREEN#6 main::@3/(byte) GREEN#7 main::@4/(byte) GREEN#8 main::@5/(byte) GREEN#9 main::@6/(byte) GREEN#10 main::@7/(byte) GREEN#11 main::@8/(byte) GREEN#12 main::@9/(byte) GREEN#13 ) (byte*) screen2#1 ← phi( main/(byte*) screen2#2 main::@1/(byte*) screen2#3 main::@10/(byte*) screen2#4 main::@2/(byte*) screen2#5 main::@3/(byte*) screen2#6 main::@4/(byte*) screen2#7 main::@5/(byte*) screen2#8 main::@6/(byte*) screen2#9 main::@7/(byte*) screen2#10 main::@8/(byte*) screen2#11 main::@9/(byte*) screen2#12 ) (byte) test::i#11 ← phi( main/(byte) test::i#0 main::@1/(byte) test::i#1 main::@10/(byte) test::i#10 main::@2/(byte) test::i#2 main::@3/(byte) test::i#3 main::@4/(byte) test::i#4 main::@5/(byte) test::i#5 main::@6/(byte) test::i#6 main::@7/(byte) test::i#7 main::@8/(byte) test::i#8 main::@9/(byte) test::i#9 ) - (byte*) screen1#1 ← phi( main/(byte*) screen1#2 main::@1/(byte*) screen1#3 main::@10/(byte*) screen1#4 main::@2/(byte*) screen1#5 main::@3/(byte*) screen1#6 main::@4/(byte*) screen1#7 main::@5/(byte*) screen1#8 main::@6/(byte*) screen1#9 main::@7/(byte*) screen1#10 main::@8/(byte*) screen1#11 main::@9/(byte*) screen1#12 ) (byte) test::a#11 ← phi( main/(byte) test::a#0 main::@1/(byte) test::a#1 main::@10/(byte) test::a#10 main::@2/(byte) test::a#2 main::@3/(byte) test::a#3 main::@4/(byte) test::a#4 main::@5/(byte) test::a#5 main::@6/(byte) test::a#6 main::@7/(byte) test::a#7 main::@8/(byte) test::a#8 main::@9/(byte) test::a#9 ) - *((byte*) screen1#1 + (byte) test::i#11) ← (byte) test::a#11 + *((byte*) screen1#0 + (byte) test::i#11) ← (byte) test::a#11 *((byte*) screen2#1 + (byte) test::i#11) ← *((byte[]) ref#0 + (byte) test::i#11) (bool~) test::$0 ← *((byte[]) ref#0 + (byte) test::i#11) == (byte) test::a#11 if((bool~) test::$0) goto test::@1 to:test::@3 test::@1: scope:[test] from test (byte) test::i#12 ← phi( test/(byte) test::i#11 ) - (byte*) cols#1 ← phi( test/(byte*) cols#3 ) - (byte) GREEN#1 ← phi( test/(byte) GREEN#2 ) - *((byte*) cols#1 + (byte) test::i#12) ← (byte) GREEN#1 + *((byte*) cols#0 + (byte) test::i#12) ← (byte) GREEN#0 to:test::@return test::@3: scope:[test] from test (byte) test::i#13 ← phi( test/(byte) test::i#11 ) - (byte*) cols#2 ← phi( test/(byte*) cols#3 ) - (byte) RED#1 ← phi( test/(byte) RED#2 ) - *((byte*) cols#2 + (byte) test::i#13) ← (byte) RED#1 + *((byte*) cols#0 + (byte) test::i#13) ← (byte) RED#0 to:test::@return test::@return: scope:[test] from test::@1 test::@3 return to:@return @2: scope:[] from @begin - (byte) RED#14 ← phi( @begin/(byte) RED#0 ) - (byte*) cols#15 ← phi( @begin/(byte*) cols#0 ) - (byte) GREEN#14 ← phi( @begin/(byte) GREEN#0 ) (byte*) screen2#13 ← phi( @begin/(byte*) screen2#0 ) - (byte*) screen1#13 ← phi( @begin/(byte*) screen1#0 ) call main to:@3 @3: scope:[] from @2 @@ -216,53 +164,10 @@ SYMBOL TABLE SSA (label) @end (byte) GREEN (byte) GREEN#0 -(byte) GREEN#1 -(byte) GREEN#10 -(byte) GREEN#11 -(byte) GREEN#12 -(byte) GREEN#13 -(byte) GREEN#14 -(byte) GREEN#2 -(byte) GREEN#3 -(byte) GREEN#4 -(byte) GREEN#5 -(byte) GREEN#6 -(byte) GREEN#7 -(byte) GREEN#8 -(byte) GREEN#9 (byte) RED (byte) RED#0 -(byte) RED#1 -(byte) RED#10 -(byte) RED#11 -(byte) RED#12 -(byte) RED#13 -(byte) RED#14 -(byte) RED#2 -(byte) RED#3 -(byte) RED#4 -(byte) RED#5 -(byte) RED#6 -(byte) RED#7 -(byte) RED#8 -(byte) RED#9 (byte*) cols (byte*) cols#0 -(byte*) cols#1 -(byte*) cols#10 -(byte*) cols#11 -(byte*) cols#12 -(byte*) cols#13 -(byte*) cols#14 -(byte*) cols#15 -(byte*) cols#2 -(byte*) cols#3 -(byte*) cols#4 -(byte*) cols#5 -(byte*) cols#6 -(byte*) cols#7 -(byte*) cols#8 -(byte*) cols#9 (void()) main() (label) main::@1 (label) main::@10 @@ -326,19 +231,6 @@ SYMBOL TABLE SSA (byte[]) ref#0 (byte*) screen1 (byte*) screen1#0 -(byte*) screen1#1 -(byte*) screen1#10 -(byte*) screen1#11 -(byte*) screen1#12 -(byte*) screen1#13 -(byte*) screen1#2 -(byte*) screen1#3 -(byte*) screen1#4 -(byte*) screen1#5 -(byte*) screen1#6 -(byte*) screen1#7 -(byte*) screen1#8 -(byte*) screen1#9 (byte*) screen2 (byte*) screen2#0 (byte*) screen2#1 @@ -393,11 +285,7 @@ Successful SSA optimization Pass2CullEmptyBlocks Alias (byte*) screen2#0 = (byte*~) $0 (byte*) screen2#13 Alias (byte) main::i#0 = (byte) main::i#12 Alias (byte) main::a#0 = (byte) main::a#11 -Alias (byte*) screen1#10 = (byte*) screen1#3 (byte*) screen1#2 (byte*) screen1#5 (byte*) screen1#6 (byte*) screen1#7 (byte*) screen1#8 (byte*) screen1#9 (byte*) screen1#11 (byte*) screen1#12 (byte*) screen1#4 Alias (byte*) screen2#10 = (byte*) screen2#3 (byte*) screen2#2 (byte*) screen2#5 (byte*) screen2#6 (byte*) screen2#7 (byte*) screen2#8 (byte*) screen2#9 (byte*) screen2#11 (byte*) screen2#12 (byte*) screen2#4 -Alias (byte) GREEN#10 = (byte) GREEN#4 (byte) GREEN#3 (byte) GREEN#6 (byte) GREEN#7 (byte) GREEN#8 (byte) GREEN#9 (byte) GREEN#11 (byte) GREEN#12 (byte) GREEN#13 (byte) GREEN#5 -Alias (byte*) cols#10 = (byte*) cols#5 (byte*) cols#4 (byte*) cols#7 (byte*) cols#8 (byte*) cols#9 (byte*) cols#11 (byte*) cols#12 (byte*) cols#13 (byte*) cols#14 (byte*) cols#6 -Alias (byte) RED#10 = (byte) RED#4 (byte) RED#3 (byte) RED#6 (byte) RED#7 (byte) RED#8 (byte) RED#9 (byte) RED#11 (byte) RED#12 (byte) RED#13 (byte) RED#5 Alias (byte) main::i#1 = (byte) main::i#13 Alias (byte) main::a#1 = (byte) main::a#12 Alias (byte) main::i#14 = (byte) main::i#2 @@ -417,25 +305,10 @@ Alias (byte) main::a#19 = (byte) main::a#8 Alias (byte) main::i#21 = (byte) main::i#9 Alias (byte) main::a#20 = (byte) main::a#9 Alias (byte) main::i#10 = (byte) main::i#22 -Alias (byte) GREEN#1 = (byte) GREEN#2 -Alias (byte*) cols#1 = (byte*) cols#3 (byte*) cols#2 Alias (byte) test::i#11 = (byte) test::i#12 (byte) test::i#13 -Alias (byte) RED#1 = (byte) RED#2 -Alias (byte*) screen1#0 = (byte*) screen1#13 -Alias (byte) GREEN#0 = (byte) GREEN#14 -Alias (byte*) cols#0 = (byte*) cols#15 -Alias (byte) RED#0 = (byte) RED#14 Successful SSA optimization Pass2AliasElimination -Redundant Phi (byte*) screen1#10 (byte*) screen1#0 Redundant Phi (byte*) screen2#10 (byte*) screen2#0 -Redundant Phi (byte) GREEN#10 (byte) GREEN#0 -Redundant Phi (byte*) cols#10 (byte*) cols#0 -Redundant Phi (byte) RED#10 (byte) RED#0 -Redundant Phi (byte*) screen1#1 (byte*) screen1#10 Redundant Phi (byte*) screen2#1 (byte*) screen2#10 -Redundant Phi (byte) GREEN#1 (byte) GREEN#10 -Redundant Phi (byte*) cols#1 (byte*) cols#10 -Redundant Phi (byte) RED#1 (byte) RED#10 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) test::$0 [80] if(*((byte[]) ref#0 + (byte) test::i#11)==(byte) test::a#11) goto test::@1 Successful SSA optimization Pass2ConditionalJumpSimplification diff --git a/src/test/ref/bitmap-plotter.log b/src/test/ref/bitmap-plotter.log index 3d5ae71a6..90a5dd1be 100644 --- a/src/test/ref/bitmap-plotter.log +++ b/src/test/ref/bitmap-plotter.log @@ -1,3 +1,19 @@ +Identified constant variable (byte*) D011 +Identified constant variable (byte) RST8 +Identified constant variable (byte) ECM +Identified constant variable (byte) BMM +Identified constant variable (byte) DEN +Identified constant variable (byte) RSEL +Identified constant variable (byte*) RASTER +Identified constant variable (byte*) D016 +Identified constant variable (byte) MCM +Identified constant variable (byte) CSEL +Identified constant variable (byte*) D018 +Identified constant variable (byte*) BGCOL +Identified constant variable (byte*) FGCOL +Identified constant variable (byte*) COLS +Identified constant variable (byte*) SCREEN +Identified constant variable (byte) plots_cnt CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -19,117 +35,67 @@ CONTROL FLOW GRAPH SSA (byte*) BITMAP#0 ← ((byte*)) (word/signed word/dword/signed dword) $2000 to:@1 main: scope:[main] from @5 - (byte) plots_cnt#10 ← phi( @5/(byte) plots_cnt#11 ) - (byte*) RASTER#6 ← phi( @5/(byte*) RASTER#8 ) - (byte*) D018#1 ← phi( @5/(byte*) D018#2 ) - (byte*) SCREEN#1 ← phi( @5/(byte*) SCREEN#4 ) - (byte*) D011#1 ← phi( @5/(byte*) D011#2 ) - (byte) RSEL#1 ← phi( @5/(byte) RSEL#2 ) - (byte) DEN#1 ← phi( @5/(byte) DEN#2 ) - (byte) BMM#1 ← phi( @5/(byte) BMM#2 ) - (byte*) FGCOL#1 ← phi( @5/(byte*) FGCOL#2 ) - (byte*) BGCOL#1 ← phi( @5/(byte*) BGCOL#4 ) - *((byte*) BGCOL#1) ← (byte/signed byte/word/signed word/dword/signed dword) 0 - *((byte*) FGCOL#1) ← (byte/signed byte/word/signed word/dword/signed dword) 0 - (byte~) main::$0 ← (byte) BMM#1 | (byte) DEN#1 - (byte~) main::$1 ← (byte~) main::$0 | (byte) RSEL#1 + *((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 + *((byte*) FGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 + (byte~) main::$0 ← (byte) BMM#0 | (byte) DEN#0 + (byte~) main::$1 ← (byte~) main::$0 | (byte) RSEL#0 (byte/word/dword~) main::$2 ← (byte~) main::$1 | (byte/signed byte/word/signed word/dword/signed dword) 3 - *((byte*) D011#1) ← (byte/word/dword~) main::$2 - (word~) main::$3 ← ((word)) (byte*) SCREEN#1 + *((byte*) D011#0) ← (byte/word/dword~) main::$2 + (word~) main::$3 ← ((word)) (byte*) SCREEN#0 (word/signed dword/dword~) main::$4 ← (word~) main::$3 / (byte/signed byte/word/signed word/dword/signed dword) $40 (word~) main::$5 ← ((word)) (byte*) BITMAP#0 (word/signed dword/dword~) main::$6 ← (word~) main::$5 / (word/signed word/dword/signed dword) $400 (word/dword~) main::$7 ← (word/signed dword/dword~) main::$4 | (word/signed dword/dword~) main::$6 (byte~) main::$8 ← ((byte)) (word/dword~) main::$7 - *((byte*) D018#1) ← (byte~) main::$8 + *((byte*) D018#0) ← (byte~) main::$8 call init_screen to:main::@5 main::@5: scope:[main] from main - (byte) plots_cnt#8 ← phi( main/(byte) plots_cnt#10 ) - (byte*) BGCOL#9 ← phi( main/(byte*) BGCOL#1 ) - (byte*) RASTER#4 ← phi( main/(byte*) RASTER#6 ) call init_plot_tables to:main::@6 main::@6: scope:[main] from main::@5 - (byte) plots_cnt#7 ← phi( main::@5/(byte) plots_cnt#8 ) - (byte*) BGCOL#7 ← phi( main::@5/(byte*) BGCOL#9 ) - (byte*) RASTER#3 ← phi( main::@5/(byte*) RASTER#4 ) to:main::@2 main::@1: scope:[main] from main::@7 - (byte) plots_cnt#6 ← phi( main::@7/(byte) plots_cnt#9 ) - (byte*) BGCOL#6 ← phi( main::@7/(byte*) BGCOL#3 ) - (byte*) RASTER#2 ← phi( main::@7/(byte*) RASTER#5 ) to:main::@2 main::@2: scope:[main] from main::@1 main::@2 main::@6 - (byte) plots_cnt#5 ← phi( main::@1/(byte) plots_cnt#6 main::@2/(byte) plots_cnt#5 main::@6/(byte) plots_cnt#7 ) - (byte*) BGCOL#5 ← phi( main::@1/(byte*) BGCOL#6 main::@2/(byte*) BGCOL#5 main::@6/(byte*) BGCOL#7 ) - (byte*) RASTER#1 ← phi( main::@1/(byte*) RASTER#2 main::@2/(byte*) RASTER#1 main::@6/(byte*) RASTER#3 ) - (bool~) main::$11 ← *((byte*) RASTER#1) != (byte/word/signed word/dword/signed dword) $ff + (bool~) main::$11 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $ff if((bool~) main::$11) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@2 - (byte) plots_cnt#4 ← phi( main::@2/(byte) plots_cnt#5 ) - (byte*) RASTER#7 ← phi( main::@2/(byte*) RASTER#1 ) - (byte*) BGCOL#2 ← phi( main::@2/(byte*) BGCOL#5 ) - *((byte*) BGCOL#2) ← ++ *((byte*) BGCOL#2) + *((byte*) BGCOL#0) ← ++ *((byte*) BGCOL#0) call plots to:main::@7 main::@7: scope:[main] from main::@3 - (byte) plots_cnt#9 ← phi( main::@3/(byte) plots_cnt#4 ) - (byte*) RASTER#5 ← phi( main::@3/(byte*) RASTER#7 ) - (byte*) BGCOL#3 ← phi( main::@3/(byte*) BGCOL#2 ) - *((byte*) BGCOL#3) ← -- *((byte*) BGCOL#3) + *((byte*) BGCOL#0) ← -- *((byte*) BGCOL#0) if(true) goto main::@1 to:main::@return main::@return: scope:[main] from main::@7 return to:@return @1: scope:[] from @begin - (byte*) RASTER#10 ← phi( @begin/(byte*) RASTER#0 ) - (byte*) D018#4 ← phi( @begin/(byte*) D018#0 ) - (byte*) SCREEN#8 ← phi( @begin/(byte*) SCREEN#0 ) - (byte*) D011#4 ← phi( @begin/(byte*) D011#0 ) - (byte) RSEL#4 ← phi( @begin/(byte) RSEL#0 ) - (byte) DEN#4 ← phi( @begin/(byte) DEN#0 ) - (byte) BMM#4 ← phi( @begin/(byte) BMM#0 ) - (byte*) FGCOL#4 ← phi( @begin/(byte*) FGCOL#0 ) - (byte*) BGCOL#10 ← phi( @begin/(byte*) BGCOL#0 ) (byte[]) plots_x#0 ← { (byte/signed byte/word/signed word/dword/signed dword) $3c, (byte/signed byte/word/signed word/dword/signed dword) $50, (byte/signed byte/word/signed word/dword/signed dword) $6e, (byte/signed byte/word/signed word/dword/signed dword) $50, (byte/signed byte/word/signed word/dword/signed dword) $3c, (byte/signed byte/word/signed word/dword/signed dword) $28, (byte/signed byte/word/signed word/dword/signed dword) $a, (byte/signed byte/word/signed word/dword/signed dword) $28 } (byte[]) plots_y#0 ← { (byte/signed byte/word/signed word/dword/signed dword) $a, (byte/signed byte/word/signed word/dword/signed dword) $28, (byte/signed byte/word/signed word/dword/signed dword) $3c, (byte/signed byte/word/signed word/dword/signed dword) $50, (byte/signed byte/word/signed word/dword/signed dword) $6e, (byte/signed byte/word/signed word/dword/signed dword) $50, (byte/signed byte/word/signed word/dword/signed dword) $3c, (byte/signed byte/word/signed word/dword/signed dword) $28 } (byte) plots_cnt#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8 to:@2 plots: scope:[plots] from main::@3 - (byte) plots_cnt#3 ← phi( main::@3/(byte) plots_cnt#4 ) (byte) plots::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:plots::@1 plots::@1: scope:[plots] from plots plots::@3 - (byte) plots_cnt#2 ← phi( plots/(byte) plots_cnt#3 plots::@3/(byte) plots_cnt#1 ) (byte) plots::i#2 ← phi( plots/(byte) plots::i#0 plots::@3/(byte) plots::i#1 ) (byte) plot::x#0 ← *((byte[]) plots_x#0 + (byte) plots::i#2) (byte) plot::y#0 ← *((byte[]) plots_y#0 + (byte) plots::i#2) call plot to:plots::@3 plots::@3: scope:[plots] from plots::@1 - (byte) plots_cnt#1 ← phi( plots::@1/(byte) plots_cnt#2 ) (byte) plots::i#3 ← phi( plots::@1/(byte) plots::i#2 ) (byte) plots::i#1 ← ++ (byte) plots::i#3 - (bool~) plots::$1 ← (byte) plots::i#1 < (byte) plots_cnt#1 + (bool~) plots::$1 ← (byte) plots::i#1 < (byte) plots_cnt#0 if((bool~) plots::$1) goto plots::@1 to:plots::@return plots::@return: scope:[plots] from plots::@3 return to:@return @2: scope:[] from @1 - (byte) plots_cnt#12 ← phi( @1/(byte) plots_cnt#0 ) - (byte*) RASTER#9 ← phi( @1/(byte*) RASTER#10 ) - (byte*) D018#3 ← phi( @1/(byte*) D018#4 ) - (byte*) SCREEN#7 ← phi( @1/(byte*) SCREEN#8 ) - (byte*) D011#3 ← phi( @1/(byte*) D011#4 ) - (byte) RSEL#3 ← phi( @1/(byte) RSEL#4 ) - (byte) DEN#3 ← phi( @1/(byte) DEN#4 ) - (byte) BMM#3 ← phi( @1/(byte) BMM#4 ) - (byte*) FGCOL#3 ← phi( @1/(byte*) FGCOL#4 ) - (byte*) BGCOL#8 ← phi( @1/(byte*) BGCOL#10 ) (byte[$100]) plot_xlo#0 ← { fill( $100, 0) } (byte[$100]) plot_xhi#0 ← { fill( $100, 0) } (byte[$100]) plot_ylo#0 ← { fill( $100, 0) } @@ -222,11 +188,9 @@ init_plot_tables::@return: scope:[init_plot_tables] from init_plot_tables::@4 return to:@return init_screen: scope:[init_screen] from main - (byte*) SCREEN#6 ← phi( main/(byte*) SCREEN#1 ) (byte*) init_screen::b#0 ← (byte*) BITMAP#0 to:init_screen::@1 init_screen::@1: scope:[init_screen] from init_screen init_screen::@1 - (byte*) SCREEN#5 ← phi( init_screen/(byte*) SCREEN#6 init_screen::@1/(byte*) SCREEN#5 ) (byte*) init_screen::b#2 ← phi( init_screen/(byte*) init_screen::b#0 init_screen::@1/(byte*) init_screen::b#1 ) *((byte*) init_screen::b#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte*) init_screen::b#1 ← ++ (byte*) init_screen::b#2 @@ -235,15 +199,13 @@ init_screen::@1: scope:[init_screen] from init_screen init_screen::@1 if((bool~) init_screen::$1) goto init_screen::@1 to:init_screen::@3 init_screen::@3: scope:[init_screen] from init_screen::@1 - (byte*) SCREEN#2 ← phi( init_screen::@1/(byte*) SCREEN#5 ) - (byte*) init_screen::c#0 ← (byte*) SCREEN#2 + (byte*) init_screen::c#0 ← (byte*) SCREEN#0 to:init_screen::@2 init_screen::@2: scope:[init_screen] from init_screen::@2 init_screen::@3 - (byte*) SCREEN#3 ← phi( init_screen::@2/(byte*) SCREEN#3 init_screen::@3/(byte*) SCREEN#2 ) (byte*) init_screen::c#2 ← phi( init_screen::@2/(byte*) init_screen::c#1 init_screen::@3/(byte*) init_screen::c#0 ) *((byte*) init_screen::c#2) ← (byte/signed byte/word/signed word/dword/signed dword) $14 (byte*) init_screen::c#1 ← ++ (byte*) init_screen::c#2 - (byte*~) init_screen::$2 ← (byte*) SCREEN#3 + (word/signed word/dword/signed dword) $400 + (byte*~) init_screen::$2 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) $400 (bool~) init_screen::$3 ← (byte*) init_screen::c#1 != (byte*~) init_screen::$2 if((bool~) init_screen::$3) goto init_screen::@2 to:init_screen::@return @@ -251,16 +213,6 @@ init_screen::@return: scope:[init_screen] from init_screen::@2 return to:@return @5: scope:[] from @2 - (byte) plots_cnt#11 ← phi( @2/(byte) plots_cnt#12 ) - (byte*) RASTER#8 ← phi( @2/(byte*) RASTER#9 ) - (byte*) D018#2 ← phi( @2/(byte*) D018#3 ) - (byte*) SCREEN#4 ← phi( @2/(byte*) SCREEN#7 ) - (byte*) D011#2 ← phi( @2/(byte*) D011#3 ) - (byte) RSEL#2 ← phi( @2/(byte) RSEL#3 ) - (byte) DEN#2 ← phi( @2/(byte) DEN#3 ) - (byte) BMM#2 ← phi( @2/(byte) BMM#3 ) - (byte*) FGCOL#2 ← phi( @2/(byte*) FGCOL#3 ) - (byte*) BGCOL#4 ← phi( @2/(byte*) BGCOL#8 ) call main to:@6 @6: scope:[] from @5 @@ -276,88 +228,36 @@ SYMBOL TABLE SSA (label) @end (byte*) BGCOL (byte*) BGCOL#0 -(byte*) BGCOL#1 -(byte*) BGCOL#10 -(byte*) BGCOL#2 -(byte*) BGCOL#3 -(byte*) BGCOL#4 -(byte*) BGCOL#5 -(byte*) BGCOL#6 -(byte*) BGCOL#7 -(byte*) BGCOL#8 -(byte*) BGCOL#9 (byte*) BITMAP (byte*) BITMAP#0 (byte) BMM (byte) BMM#0 -(byte) BMM#1 -(byte) BMM#2 -(byte) BMM#3 -(byte) BMM#4 (byte*) COLS (byte*) COLS#0 (byte) CSEL (byte) CSEL#0 (byte*) D011 (byte*) D011#0 -(byte*) D011#1 -(byte*) D011#2 -(byte*) D011#3 -(byte*) D011#4 (byte*) D016 (byte*) D016#0 (byte*) D018 (byte*) D018#0 -(byte*) D018#1 -(byte*) D018#2 -(byte*) D018#3 -(byte*) D018#4 (byte) DEN (byte) DEN#0 -(byte) DEN#1 -(byte) DEN#2 -(byte) DEN#3 -(byte) DEN#4 (byte) ECM (byte) ECM#0 (byte*) FGCOL (byte*) FGCOL#0 -(byte*) FGCOL#1 -(byte*) FGCOL#2 -(byte*) FGCOL#3 -(byte*) FGCOL#4 (byte) MCM (byte) MCM#0 (byte*) RASTER (byte*) RASTER#0 -(byte*) RASTER#1 -(byte*) RASTER#10 -(byte*) RASTER#2 -(byte*) RASTER#3 -(byte*) RASTER#4 -(byte*) RASTER#5 -(byte*) RASTER#6 -(byte*) RASTER#7 -(byte*) RASTER#8 -(byte*) RASTER#9 (byte) RSEL (byte) RSEL#0 -(byte) RSEL#1 -(byte) RSEL#2 -(byte) RSEL#3 -(byte) RSEL#4 (byte) RST8 (byte) RST8#0 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 (void()) init_plot_tables() (byte~) init_plot_tables::$0 (byte~) init_plot_tables::$1 @@ -488,96 +388,40 @@ SYMBOL TABLE SSA (byte) plots::i#3 (byte) plots_cnt (byte) plots_cnt#0 -(byte) plots_cnt#1 -(byte) plots_cnt#10 -(byte) plots_cnt#11 -(byte) plots_cnt#12 -(byte) plots_cnt#2 -(byte) plots_cnt#3 -(byte) plots_cnt#4 -(byte) plots_cnt#5 -(byte) plots_cnt#6 -(byte) plots_cnt#7 -(byte) plots_cnt#8 -(byte) plots_cnt#9 (byte[]) plots_x (byte[]) plots_x#0 (byte[]) plots_y (byte[]) plots_y#0 +Culled Empty Block (label) main::@6 +Culled Empty Block (label) main::@1 Culled Empty Block (label) @6 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [93] (bool~) init_plot_tables::$4 ← (byte) init_plot_tables::bits#1 != (byte/signed byte/word/signed word/dword/signed dword) 0 from [92] (bool~) init_plot_tables::$3 ← (byte) init_plot_tables::bits#1 == (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [112] (bool~) init_plot_tables::$12 ← (byte~) init_plot_tables::$10 != (byte/signed byte/word/signed word/dword/signed dword) 7 from [111] (bool~) init_plot_tables::$11 ← (byte~) init_plot_tables::$10 == (byte/signed byte/word/signed word/dword/signed dword) 7 +Inversing boolean not [83] (bool~) init_plot_tables::$4 ← (byte) init_plot_tables::bits#1 != (byte/signed byte/word/signed word/dword/signed dword) 0 from [82] (bool~) init_plot_tables::$3 ← (byte) init_plot_tables::bits#1 == (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [102] (bool~) init_plot_tables::$12 ← (byte~) init_plot_tables::$10 != (byte/signed byte/word/signed word/dword/signed dword) 7 from [101] (bool~) init_plot_tables::$11 ← (byte~) init_plot_tables::$10 == (byte/signed byte/word/signed word/dword/signed dword) 7 Successful SSA optimization Pass2UnaryNotSimplification -Alias (byte*) RASTER#3 = (byte*) RASTER#4 (byte*) RASTER#6 -Alias (byte*) BGCOL#1 = (byte*) BGCOL#9 (byte*) BGCOL#7 -Alias (byte) plots_cnt#10 = (byte) plots_cnt#8 (byte) plots_cnt#7 -Alias (byte*) RASTER#1 = (byte*) RASTER#2 (byte*) RASTER#5 (byte*) RASTER#7 -Alias (byte*) BGCOL#2 = (byte*) BGCOL#6 (byte*) BGCOL#3 (byte*) BGCOL#5 -Alias (byte) plots_cnt#4 = (byte) plots_cnt#6 (byte) plots_cnt#9 (byte) plots_cnt#5 -Alias (byte*) BGCOL#0 = (byte*) BGCOL#10 (byte*) BGCOL#8 (byte*) BGCOL#4 -Alias (byte*) FGCOL#0 = (byte*) FGCOL#4 (byte*) FGCOL#3 (byte*) FGCOL#2 -Alias (byte) BMM#0 = (byte) BMM#4 (byte) BMM#3 (byte) BMM#2 -Alias (byte) DEN#0 = (byte) DEN#4 (byte) DEN#3 (byte) DEN#2 -Alias (byte) RSEL#0 = (byte) RSEL#4 (byte) RSEL#3 (byte) RSEL#2 -Alias (byte*) D011#0 = (byte*) D011#4 (byte*) D011#3 (byte*) D011#2 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#8 (byte*) SCREEN#7 (byte*) SCREEN#4 -Alias (byte*) D018#0 = (byte*) D018#4 (byte*) D018#3 (byte*) D018#2 -Alias (byte*) RASTER#0 = (byte*) RASTER#10 (byte*) RASTER#9 (byte*) RASTER#8 Alias (byte) plots::i#2 = (byte) plots::i#3 -Alias (byte) plots_cnt#1 = (byte) plots_cnt#2 -Alias (byte) plots_cnt#0 = (byte) plots_cnt#12 (byte) plots_cnt#11 Alias (byte*) plot::plotter#0 = (byte*~) plot::$4 Alias (byte) init_plot_tables::bits#1 = (byte~) init_plot_tables::$2 Alias (byte) init_plot_tables::x#2 = (byte) init_plot_tables::x#4 Alias (byte*) init_plot_tables::yoffs#2 = (byte*) init_plot_tables::yoffs#3 Alias (byte) init_plot_tables::y#2 = (byte) init_plot_tables::y#4 Alias (byte*) init_plot_tables::yoffs#1 = (byte*~) init_plot_tables::$14 -Alias (byte*) SCREEN#2 = (byte*) SCREEN#5 Successful SSA optimization Pass2AliasElimination Alias (byte) init_plot_tables::x#2 = (byte) init_plot_tables::x#3 Alias (byte) init_plot_tables::y#2 = (byte) init_plot_tables::y#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) RASTER#1 -Self Phi Eliminated (byte*) RASTER#1 -Self Phi Eliminated (byte*) BGCOL#2 -Self Phi Eliminated (byte*) BGCOL#2 -Self Phi Eliminated (byte) plots_cnt#4 -Self Phi Eliminated (byte) plots_cnt#4 -Self Phi Eliminated (byte) plots_cnt#1 -Self Phi Eliminated (byte*) SCREEN#2 -Self Phi Eliminated (byte*) SCREEN#3 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) BGCOL#1 (byte*) BGCOL#0 -Redundant Phi (byte*) FGCOL#1 (byte*) FGCOL#0 -Redundant Phi (byte) BMM#1 (byte) BMM#0 -Redundant Phi (byte) DEN#1 (byte) DEN#0 -Redundant Phi (byte) RSEL#1 (byte) RSEL#0 -Redundant Phi (byte*) D011#1 (byte*) D011#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte*) D018#1 (byte*) D018#0 -Redundant Phi (byte*) RASTER#3 (byte*) RASTER#0 -Redundant Phi (byte) plots_cnt#10 (byte) plots_cnt#0 -Redundant Phi (byte*) RASTER#1 (byte*) RASTER#3 -Redundant Phi (byte*) BGCOL#2 (byte*) BGCOL#1 -Redundant Phi (byte) plots_cnt#4 (byte) plots_cnt#10 -Redundant Phi (byte) plots_cnt#3 (byte) plots_cnt#4 -Redundant Phi (byte) plots_cnt#1 (byte) plots_cnt#3 Redundant Phi (byte) plot::x#1 (byte) plot::x#0 Redundant Phi (byte) plot::y#1 (byte) plot::y#0 -Redundant Phi (byte*) SCREEN#6 (byte*) SCREEN#1 -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#6 -Redundant Phi (byte*) SCREEN#3 (byte*) SCREEN#2 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$11 [37] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@2 -Simple Condition (bool~) plots::$1 [58] if((byte) plots::i#1<(byte) plots_cnt#0) goto plots::@1 -Simple Condition (bool~) init_plot_tables::$4 [94] if((byte) init_plot_tables::bits#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto init_plot_tables::@2 -Simple Condition (bool~) init_plot_tables::$5 [98] if((byte) init_plot_tables::x#1!=rangelast(0,$ff)) goto init_plot_tables::@1 -Simple Condition (bool~) init_plot_tables::$12 [113] if((byte~) init_plot_tables::$10!=(byte/signed byte/word/signed word/dword/signed dword) 7) goto init_plot_tables::@4 -Simple Condition (bool~) init_plot_tables::$15 [117] if((byte) init_plot_tables::y#1!=rangelast(0,$ff)) goto init_plot_tables::@3 -Simple Condition (bool~) init_screen::$1 [130] if((byte*) init_screen::b#1!=(byte*~) init_screen::$0) goto init_screen::@1 -Simple Condition (bool~) init_screen::$3 [138] if((byte*) init_screen::c#1!=(byte*~) init_screen::$2) goto init_screen::@2 +Simple Condition (bool~) main::$11 [32] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@2 +Simple Condition (bool~) plots::$1 [49] if((byte) plots::i#1<(byte) plots_cnt#0) goto plots::@1 +Simple Condition (bool~) init_plot_tables::$4 [84] if((byte) init_plot_tables::bits#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto init_plot_tables::@2 +Simple Condition (bool~) init_plot_tables::$5 [88] if((byte) init_plot_tables::x#1!=rangelast(0,$ff)) goto init_plot_tables::@1 +Simple Condition (bool~) init_plot_tables::$12 [103] if((byte~) init_plot_tables::$10!=(byte/signed byte/word/signed word/dword/signed dword) 7) goto init_plot_tables::@4 +Simple Condition (bool~) init_plot_tables::$15 [107] if((byte) init_plot_tables::y#1!=rangelast(0,$ff)) goto init_plot_tables::@3 +Simple Condition (bool~) init_screen::$1 [119] if((byte*) init_screen::b#1!=(byte*~) init_screen::$0) goto init_screen::@1 +Simple Condition (bool~) init_screen::$3 [126] if((byte*) init_screen::c#1!=(byte*~) init_screen::$2) goto init_screen::@2 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) D011#0 = ((byte*))$d011 Constant (const byte) RST8#0 = $80 @@ -631,7 +475,7 @@ Constant (const word/dword) main::$7 = main::$4|main::$6 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::$8 = ((byte))main::$7 Successful SSA optimization Pass2ConstantIdentification -if() condition always true - replacing block destination [10] if(true) goto main::@1 +if() condition always true - replacing block destination [10] if(true) goto main::@2 Successful SSA optimization Pass2ConstantIfs Successful SSA optimization PassNEliminateUnusedVars Removing unused block main::@return @@ -640,8 +484,6 @@ Resolved ranged next value init_plot_tables::x#1 ← ++ init_plot_tables::x#2 to Resolved ranged comparison value if(init_plot_tables::x#1!=rangelast(0,$ff)) goto init_plot_tables::@1 to (byte/signed byte/word/signed word/dword/signed dword) 0 Resolved ranged next value init_plot_tables::y#1 ← ++ init_plot_tables::y#2 to ++ Resolved ranged comparison value if(init_plot_tables::y#1!=rangelast(0,$ff)) goto init_plot_tables::@3 to (byte/signed byte/word/signed word/dword/signed dword) 0 -Culled Empty Block (label) main::@6 -Culled Empty Block (label) main::@1 Culled Empty Block (label) @1 Culled Empty Block (label) @2 Culled Empty Block (label) init_plot_tables::@6 diff --git a/src/test/ref/bitwise-not.log b/src/test/ref/bitwise-not.log index 21d3ae484..c5a0ddff0 100644 --- a/src/test/ref/bitwise-not.log +++ b/src/test/ref/bitwise-not.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -9,10 +10,9 @@ main: scope:[main] from @1 (byte) main::c#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1 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::c#2 ← phi( main/(byte) main::c#0 main::@1/(byte) main::c#1 ) (byte~) main::$1 ← ~ (byte) main::c#2 - *((byte*) main::SCREEN#1 + (byte) main::c#2) ← (byte~) main::$1 + *((byte*) main::SCREEN#0 + (byte) main::c#2) ← (byte~) main::$1 (byte) main::c#1 ← (byte) main::c#2 + rangenext(1,$1a) (bool~) main::$2 ← (byte) main::c#1 != rangelast(1,$1a) if((bool~) main::$2) goto main::@1 @@ -40,7 +40,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::SCREEN (byte*) main::SCREEN#0 -(byte*) main::SCREEN#1 (byte) main::c (byte) main::c#0 (byte) main::c#1 @@ -48,10 +47,6 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte*) main::SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$2 [9] if((byte) main::c#1!=rangelast(1,$1a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) main::SCREEN#0 = ((byte*))$400 diff --git a/src/test/ref/bool-const.log b/src/test/ref/bool-const.log index 04e6385bb..eecc7b58f 100644 --- a/src/test/ref/bool-const.log +++ b/src/test/ref/bool-const.log @@ -1,3 +1,6 @@ +Identified constant variable (bool) bool_const_if::b +Identified constant variable (byte) bool_const_vars::a +Identified constant variable (byte) bool_const_inline::a CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/bool-function.log b/src/test/ref/bool-function.log index 34396d330..5630457c8 100644 --- a/src/test/ref/bool-function.log +++ b/src/test/ref/bool-function.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -7,7 +8,6 @@ main: scope:[main] from @2 (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@3 - (byte*) main::screen#4 ← phi( main/(byte*) main::screen#0 main::@3/(byte*) main::screen#5 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@3/(byte) main::i#1 ) (byte~) main::$0 ← (byte) main::i#2 & (byte/signed byte/word/signed word/dword/signed dword) 1 (bool~) main::$1 ← (byte~) main::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -18,23 +18,19 @@ main::@1: scope:[main] from main main::@3 to:main::@7 main::@7: scope:[main] from main::@1 (byte) main::i#6 ← phi( main::@1/(byte) main::i#2 ) - (byte*) main::screen#3 ← phi( main::@1/(byte*) main::screen#4 ) (bool) isSet::return#3 ← phi( main::@1/(bool) isSet::return#0 ) (bool~) main::$2 ← (bool) isSet::return#3 if((bool~) main::$2) goto main::@2 to:main::@4 main::@2: scope:[main] from main::@7 (byte) main::i#3 ← phi( main::@7/(byte) main::i#6 ) - (byte*) main::screen#1 ← phi( main::@7/(byte*) main::screen#3 ) - *((byte*) main::screen#1 + (byte) main::i#3) ← (byte) '*' + *((byte*) main::screen#0 + (byte) main::i#3) ← (byte) '*' to:main::@3 main::@4: scope:[main] from main::@7 (byte) main::i#4 ← phi( main::@7/(byte) main::i#6 ) - (byte*) main::screen#2 ← phi( main::@7/(byte*) main::screen#3 ) - *((byte*) main::screen#2 + (byte) main::i#4) ← (byte) ' ' + *((byte*) main::screen#0 + (byte) main::i#4) ← (byte) ' ' to:main::@3 main::@3: scope:[main] from main::@2 main::@4 - (byte*) main::screen#5 ← phi( main::@2/(byte*) main::screen#1 main::@4/(byte*) main::screen#2 ) (byte) main::i#5 ← phi( main::@2/(byte) main::i#3 main::@4/(byte) main::i#4 ) (byte) main::i#1 ← (byte) main::i#5 + rangenext(0,$64) (bool~) main::$3 ← (byte) main::i#1 != rangelast(0,$64) @@ -106,26 +102,16 @@ SYMBOL TABLE SSA (byte) main::i#6 (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::screen#5 Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks Alias (bool) isSet::b#0 = (bool~) main::$1 Alias (bool) isSet::return#0 = (bool) isSet::return#3 -Alias (byte*) main::screen#1 = (byte*) main::screen#3 (byte*) main::screen#4 (byte*) main::screen#2 Alias (byte) main::i#2 = (byte) main::i#6 (byte) main::i#3 (byte) main::i#4 Alias (bool) isSet::return#1 = (bool~) isSet::$2 (bool) isSet::return#4 (bool) isSet::return#2 Successful SSA optimization Pass2AliasElimination Alias (byte) main::i#2 = (byte) main::i#5 -Alias (byte*) main::screen#1 = (byte*) main::screen#5 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::screen#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::screen#1 (byte*) main::screen#0 Redundant Phi (byte) isSet::i#1 (byte) isSet::i#0 Redundant Phi (bool) isSet::b#1 (bool) isSet::b#0 Successful SSA optimization Pass2RedundantPhiElimination diff --git a/src/test/ref/bresenham.asm b/src/test/ref/bresenham.asm index a8f361ba0..427ad4c65 100644 --- a/src/test/ref/bresenham.asm +++ b/src/test/ref/bresenham.asm @@ -4,20 +4,23 @@ .const STAR = $51 .label SCREEN = $400 main: { + .const x0 = 4 + .const y0 = 4 .const x1 = $27 .const y1 = $18 - .const xd = x1-4 - .const yd = y1-4 + .const xd = x1-x0 + .const yd = y1-y0 .label x = 4 .label cursor = 2 .label y = 5 - lda #4 + lda #y0 sta y ldx #yd/2 + lda #x0 sta x - lda #SCREEN+4*$28+4 + lda #>SCREEN+y0*$28+x0 sta cursor+1 b1: lda #STAR diff --git a/src/test/ref/bresenham.cfg b/src/test/ref/bresenham.cfg index a63e2b128..62d4a1f34 100644 --- a/src/test/ref/bresenham.cfg +++ b/src/test/ref/bresenham.cfg @@ -11,10 +11,10 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@2 - [5] (byte) main::y#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 4 main::@2/(byte) main::y#4 ) + [5] (byte) main::y#2 ← phi( main/(const byte) main::y0#0 main::@2/(byte) main::y#4 ) [5] (byte) main::e#3 ← phi( main/(const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@2/(byte) main::e#5 ) - [5] (byte) main::x#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 4 main::@2/(byte) main::x#1 ) - [5] (byte*) main::cursor#3 ← phi( main/(const byte[$28*$19]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) $28+(byte/signed byte/word/signed word/dword/signed dword) 4 main::@2/(byte*) main::cursor#5 ) + [5] (byte) main::x#2 ← phi( main/(const byte) main::x0#0 main::@2/(byte) main::x#1 ) + [5] (byte*) main::cursor#3 ← phi( main/(const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28+(const byte) main::x0#0 main::@2/(byte*) main::cursor#5 ) [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 [8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 diff --git a/src/test/ref/bresenham.log b/src/test/ref/bresenham.log index e997afc89..2250e9faf 100644 --- a/src/test/ref/bresenham.log +++ b/src/test/ref/bresenham.log @@ -1,3 +1,8 @@ +Identified constant variable (byte) STAR +Identified constant variable (byte) main::x0 +Identified constant variable (byte) main::y0 +Identified constant variable (byte) main::x1 +Identified constant variable (byte) main::y1 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -6,7 +11,6 @@ CONTROL FLOW GRAPH SSA (byte[$0]) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@1 main: scope:[main] from @1 - (byte) STAR#2 ← phi( @1/(byte) STAR#4 ) (byte) main::x0#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4 (byte) main::y0#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4 (byte) main::x1#0 ← (byte/signed byte/word/signed word/dword/signed dword) $27 @@ -26,14 +30,12 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@2 (byte) main::y#3 ← phi( main/(byte) main::y#0 main::@2/(byte) main::y#4 ) - (byte) main::x1#2 ← phi( main/(byte) main::x1#0 main::@2/(byte) main::x1#1 ) (byte) main::xd#1 ← phi( main/(byte) main::xd#0 main::@2/(byte) main::xd#3 ) (byte) main::yd#1 ← phi( main/(byte) main::yd#0 main::@2/(byte) main::yd#2 ) (byte) main::e#3 ← phi( main/(byte) main::e#0 main::@2/(byte) main::e#5 ) (byte) main::x#2 ← phi( main/(byte) main::x#0 main::@2/(byte) main::x#3 ) (byte*) main::cursor#3 ← phi( main/(byte*) main::cursor#0 main::@2/(byte*) main::cursor#5 ) - (byte) STAR#1 ← phi( main/(byte) STAR#2 main::@2/(byte) STAR#3 ) - *((byte*) main::cursor#3) ← (byte) STAR#1 + *((byte*) main::cursor#3) ← (byte) STAR#0 (byte/signed word/word/dword/signed dword~) main::$6 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 (byte) main::x#1 ← (byte/signed word/word/dword/signed dword~) main::$6 (byte*~) main::$7 ← (byte*) main::cursor#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 @@ -50,18 +52,14 @@ main::@2: scope:[main] from main::@1 main::@3 (byte) main::yd#2 ← phi( main::@1/(byte) main::yd#1 main::@3/(byte) main::yd#3 ) (byte) main::e#5 ← phi( main::@1/(byte) main::e#1 main::@3/(byte) main::e#2 ) (byte*) main::cursor#5 ← phi( main::@1/(byte*) main::cursor#1 main::@3/(byte*) main::cursor#2 ) - (byte) STAR#3 ← phi( main::@1/(byte) STAR#1 main::@3/(byte) STAR#5 ) (byte) main::x#3 ← phi( main::@1/(byte) main::x#1 main::@3/(byte) main::x#4 ) - (byte) main::x1#1 ← phi( main::@1/(byte) main::x1#2 main::@3/(byte) main::x1#3 ) - (byte/signed word/word/dword/signed dword~) main::$14 ← (byte) main::x1#1 + (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte/signed word/word/dword/signed dword~) main::$14 ← (byte) main::x1#0 + (byte/signed byte/word/signed word/dword/signed dword) 1 (bool~) main::$15 ← (byte) main::x#3 < (byte/signed word/word/dword/signed dword~) main::$14 if((bool~) main::$15) goto main::@1 to:main::@return main::@3: scope:[main] from main::@1 (byte) main::yd#3 ← phi( main::@1/(byte) main::yd#1 ) - (byte) STAR#5 ← phi( main::@1/(byte) STAR#1 ) (byte) main::x#4 ← phi( main::@1/(byte) main::x#1 ) - (byte) main::x1#3 ← phi( main::@1/(byte) main::x1#2 ) (byte) main::xd#2 ← phi( main::@1/(byte) main::xd#1 ) (byte) main::e#4 ← phi( main::@1/(byte) main::e#1 ) (byte*) main::cursor#4 ← phi( main::@1/(byte*) main::cursor#1 ) @@ -77,7 +75,6 @@ main::@return: scope:[main] from main::@2 return to:@return @1: scope:[] from @begin - (byte) STAR#4 ← phi( @begin/(byte) STAR#0 ) call main to:@2 @2: scope:[] from @1 @@ -94,11 +91,6 @@ SYMBOL TABLE SSA (byte[$0]) SCREEN#0 (byte) STAR (byte) STAR#0 -(byte) STAR#1 -(byte) STAR#2 -(byte) STAR#3 -(byte) STAR#4 -(byte) STAR#5 (void()) main() (byte~) main::$0 (byte~) main::$1 @@ -144,9 +136,6 @@ SYMBOL TABLE SSA (byte) main::x0#0 (byte) main::x1 (byte) main::x1#0 -(byte) main::x1#1 -(byte) main::x1#2 -(byte) main::x1#3 (byte) main::xd (byte) main::xd#0 (byte) main::xd#1 @@ -170,12 +159,12 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [29] (bool~) main::$10 ← (byte) main::xd#1 > (byte) main::e#1 from [28] (bool~) main::$9 ← (byte) main::xd#1 <= (byte) main::e#1 +Inversing boolean not [28] (bool~) main::$10 ← (byte) main::xd#1 > (byte) main::e#1 from [27] (bool~) main::$9 ← (byte) main::xd#1 <= (byte) main::e#1 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) main::xd#0 = (byte~) main::$0 Alias (byte) main::yd#0 = (byte~) main::$1 -Alias (byte) main::x#0 = (byte) main::x0#0 -Alias (byte) main::y#0 = (byte) main::y0#0 +Alias (byte) main::x0#0 = (byte) main::x#0 +Alias (byte) main::y0#0 = (byte) main::y#0 Alias (byte) main::e#0 = (byte/signed word/word/dword/signed dword~) main::$2 Alias (byte*) main::cursor#0 = (byte*~) main::$5 Alias (byte) main::x#1 = (byte/signed word/word/dword/signed dword~) main::$6 (byte) main::x#4 @@ -183,64 +172,50 @@ Alias (byte*) main::cursor#1 = (byte*~) main::$7 (byte*) main::cursor#4 Alias (byte) main::e#1 = (byte~) main::$8 (byte) main::e#4 Alias (byte) main::y#2 = (byte) main::y#3 Alias (byte) main::xd#1 = (byte) main::xd#2 -Alias (byte) main::x1#2 = (byte) main::x1#3 -Alias (byte) STAR#1 = (byte) STAR#5 Alias (byte) main::yd#1 = (byte) main::yd#3 Alias (byte) main::y#1 = (byte/signed word/word/dword/signed dword~) main::$11 Alias (byte*) main::cursor#2 = (byte*~) main::$12 Alias (byte) main::e#2 = (byte~) main::$13 -Alias (byte) STAR#0 = (byte) STAR#4 Successful SSA optimization Pass2AliasElimination -Alias (byte) main::x1#1 = (byte) main::x1#2 Alias (byte) main::x#1 = (byte) main::x#3 -Alias (byte) STAR#1 = (byte) STAR#3 Alias (byte) main::yd#1 = (byte) main::yd#2 Alias (byte) main::xd#1 = (byte) main::xd#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte) STAR#1 Self Phi Eliminated (byte) main::yd#1 Self Phi Eliminated (byte) main::xd#1 -Self Phi Eliminated (byte) main::x1#1 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte) STAR#2 (byte) STAR#0 -Redundant Phi (byte) STAR#1 (byte) STAR#2 Redundant Phi (byte) main::yd#1 (byte) main::yd#0 Redundant Phi (byte) main::xd#1 (byte) main::xd#0 -Redundant Phi (byte) main::x1#1 (byte) main::x1#0 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$10 [30] if((byte) main::xd#0>(byte) main::e#1) goto main::@2 -Simple Condition (bool~) main::$15 [34] if((byte) main::x#1<(byte/signed word/word/dword/signed dword~) main::$14) goto main::@1 +Simple Condition (bool~) main::$10 [29] if((byte) main::xd#0>(byte) main::e#1) goto main::@2 +Simple Condition (bool~) main::$15 [33] if((byte) main::x#1<(byte/signed word/word/dword/signed dword~) main::$14) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte) STAR#0 = $51 Constant (const word/signed word/dword/signed dword) $0 = $28*$19 Constant (const byte[$0]) SCREEN#0 = ((byte*))$400 -Constant (const byte) main::x#0 = 4 -Constant (const byte) main::y#0 = 4 +Constant (const byte) main::x0#0 = 4 +Constant (const byte) main::y0#0 = 4 Constant (const byte) main::x1#0 = $27 Constant (const byte) main::y1#0 = $18 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) main::xd#0 = main::x1#0-main::x#0 -Constant (const byte) main::yd#0 = main::y1#0-main::y#0 -Constant (const byte/signed word/word/dword/signed dword) main::$3 = main::y#0*$28 +Constant (const byte) main::xd#0 = main::x1#0-main::x0#0 +Constant (const byte) main::yd#0 = main::y1#0-main::y0#0 +Constant (const byte/signed word/word/dword/signed dword) main::$3 = main::y0#0*$28 Constant (const byte/signed word/word/dword/signed dword) main::$14 = main::x1#0+1 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::e#0 = main::yd#0/2 Constant (const byte*) main::$4 = SCREEN#0+main::$3 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) main::cursor#0 = main::$4+main::x#0 +Constant (const byte*) main::cursor#0 = main::$4+main::x0#0 Successful SSA optimization Pass2ConstantIdentification -Inlining constant with var siblings (const byte) main::x#0 -Inlining constant with var siblings (const byte) main::y#0 Inlining constant with var siblings (const byte) main::e#0 Inlining constant with var siblings (const byte*) main::cursor#0 -Constant inlined main::cursor#0 = (const byte[$28*$19]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) $28+(byte/signed byte/word/signed word/dword/signed dword) 4 -Constant inlined main::$3 = (byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) $28 +Constant inlined main::$3 = (const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined main::$14 = (const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1 -Constant inlined main::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 4 -Constant inlined main::$4 = (const byte[$28*$19]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) $28 -Constant inlined main::y#0 = (byte/signed byte/word/signed word/dword/signed dword) 4 +Constant inlined main::$4 = (const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined $0 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $19 Constant inlined main::e#0 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::cursor#0 = (const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28+(const byte) main::x0#0 Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@5(between main::@2 and main::@1) Added new block during phi lifting main::@6(between main::@1 and main::@2) @@ -284,10 +259,10 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@2 - [5] (byte) main::y#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 4 main::@2/(byte) main::y#4 ) + [5] (byte) main::y#2 ← phi( main/(const byte) main::y0#0 main::@2/(byte) main::y#4 ) [5] (byte) main::e#3 ← phi( main/(const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@2/(byte) main::e#5 ) - [5] (byte) main::x#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 4 main::@2/(byte) main::x#1 ) - [5] (byte*) main::cursor#3 ← phi( main/(const byte[$28*$19]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) $28+(byte/signed byte/word/signed word/dword/signed dword) 4 main::@2/(byte*) main::cursor#5 ) + [5] (byte) main::x#2 ← phi( main/(const byte) main::x0#0 main::@2/(byte) main::x#1 ) + [5] (byte*) main::cursor#3 ← phi( main/(const byte[$28*$19]) SCREEN#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28+(const byte) main::x0#0 main::@2/(byte*) main::cursor#5 ) [6] *((byte*) main::cursor#3) ← (const byte) STAR#0 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 [8] (byte*) main::cursor#1 ← (byte*) main::cursor#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 @@ -380,29 +355,31 @@ bend_from_b1: bend: //SEG10 main main: { + .const x0 = 4 + .const y0 = 4 .const x1 = $27 .const y1 = $18 - .const xd = x1-4 - .const yd = y1-4 + .const xd = x1-x0 + .const yd = y1-y0 .label x = 4 .label cursor = 2 .label e = 5 .label y = 6 //SEG11 [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - //SEG12 [5] phi (byte) main::y#2 = (byte/signed byte/word/signed word/dword/signed dword) 4 [phi:main->main::@1#0] -- vbuz1=vbuc1 - lda #4 + //SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + lda #y0 sta y //SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuz1=vbuc1 lda #yd/2 sta e - //SEG14 [5] phi (byte) main::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 4 [phi:main->main::@1#2] -- vbuz1=vbuc1 - lda #4 + //SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1 + lda #x0 sta x - //SEG15 [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) $28+(byte/signed byte/word/signed word/dword/signed dword) 4 [phi:main->main::@1#3] -- pbuz1=pbuc1 - lda #main::@1#3] -- pbuz1=pbuc1 + lda #SCREEN+4*$28+4 + lda #>SCREEN+y0*$28+x0 sta cursor+1 jmp b1 //SEG16 [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1] @@ -531,27 +508,29 @@ bend_from_b1: bend: //SEG10 main main: { + .const x0 = 4 + .const y0 = 4 .const x1 = $27 .const y1 = $18 - .const xd = x1-4 - .const yd = y1-4 + .const xd = x1-x0 + .const yd = y1-y0 .label x = 4 .label cursor = 2 .label y = 5 //SEG11 [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - //SEG12 [5] phi (byte) main::y#2 = (byte/signed byte/word/signed word/dword/signed dword) 4 [phi:main->main::@1#0] -- vbuz1=vbuc1 - lda #4 + //SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + lda #y0 sta y //SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1 ldx #yd/2 - //SEG14 [5] phi (byte) main::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 4 [phi:main->main::@1#2] -- vbuz1=vbuc1 - lda #4 + //SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1 + lda #x0 sta x - //SEG15 [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) $28+(byte/signed byte/word/signed word/dword/signed dword) 4 [phi:main->main::@1#3] -- pbuz1=pbuc1 - lda #main::@1#3] -- pbuz1=pbuc1 + lda #SCREEN+4*$28+4 + lda #>SCREEN+y0*$28+x0 sta cursor+1 jmp b1 //SEG16 [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1] @@ -628,8 +607,6 @@ Removing instruction jmp b3 Removing instruction jmp b2 Removing instruction jmp breturn Succesful ASM optimization Pass5NextJumpElimination -Removing instruction lda #4 -Succesful ASM optimization Pass5UnnecesaryLoadElimination Replacing label b2_from_b1 with b2 Replacing label b1_from_b2 with b1 Removing instruction b1_from_bbegin: @@ -680,19 +657,21 @@ FINAL SYMBOL TABLE (byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667 (byte) main::x#2 x zp ZP_BYTE:4 11.0 (byte) main::x0 +(const byte) main::x0#0 x0 = (byte/signed byte/word/signed word/dword/signed dword) 4 (byte) main::x1 (const byte) main::x1#0 x1 = (byte/signed byte/word/signed word/dword/signed dword) $27 (byte) main::xd -(const byte) main::xd#0 xd = (const byte) main::x1#0-(byte/signed byte/word/signed word/dword/signed dword) 4 +(const byte) main::xd#0 xd = (const byte) main::x1#0-(const byte) main::x0#0 (byte) main::y (byte) main::y#1 y zp ZP_BYTE:5 7.333333333333333 (byte) main::y#2 y zp ZP_BYTE:5 5.5 (byte) main::y#4 y zp ZP_BYTE:5 16.5 (byte) main::y0 +(const byte) main::y0#0 y0 = (byte/signed byte/word/signed word/dword/signed dword) 4 (byte) main::y1 (const byte) main::y1#0 y1 = (byte/signed byte/word/signed word/dword/signed dword) $18 (byte) main::yd -(const byte) main::yd#0 yd = (const byte) main::y1#0-(byte/signed byte/word/signed word/dword/signed dword) 4 +(const byte) main::yd#0 yd = (const byte) main::y1#0-(const byte) main::y0#0 zp ZP_WORD:2 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ] zp ZP_BYTE:4 [ main::x#2 main::x#1 ] @@ -701,7 +680,7 @@ zp ZP_BYTE:5 [ main::y#2 main::y#4 main::y#1 ] FINAL ASSEMBLER -Score: 986 +Score: 1006 //SEG0 File Comments //SEG1 Basic Upstart @@ -720,25 +699,28 @@ Score: 986 //SEG9 @end //SEG10 main main: { + .const x0 = 4 + .const y0 = 4 .const x1 = $27 .const y1 = $18 - .const xd = x1-4 - .const yd = y1-4 + .const xd = x1-x0 + .const yd = y1-y0 .label x = 4 .label cursor = 2 .label y = 5 //SEG11 [5] phi from main to main::@1 [phi:main->main::@1] - //SEG12 [5] phi (byte) main::y#2 = (byte/signed byte/word/signed word/dword/signed dword) 4 [phi:main->main::@1#0] -- vbuz1=vbuc1 - lda #4 + //SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + lda #y0 sta y //SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuxx=vbuc1 ldx #yd/2 - //SEG14 [5] phi (byte) main::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 4 [phi:main->main::@1#2] -- vbuz1=vbuc1 + //SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1 + lda #x0 sta x - //SEG15 [5] phi (byte*) main::cursor#3 = (const byte[$28*$19]) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4*(byte/signed byte/word/signed word/dword/signed dword) $28+(byte/signed byte/word/signed word/dword/signed dword) 4 [phi:main->main::@1#3] -- pbuz1=pbuc1 - lda #main::@1#3] -- pbuz1=pbuc1 + lda #SCREEN+4*$28+4 + lda #>SCREEN+y0*$28+x0 sta cursor+1 //SEG16 [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1] //SEG17 [5] phi (byte) main::y#2 = (byte) main::y#4 [phi:main::@2->main::@1#0] -- register_copy diff --git a/src/test/ref/bresenham.sym b/src/test/ref/bresenham.sym index 221ec026c..fb589f7bb 100644 --- a/src/test/ref/bresenham.sym +++ b/src/test/ref/bresenham.sym @@ -24,19 +24,21 @@ (byte) main::x#1 x zp ZP_BYTE:4 3.666666666666667 (byte) main::x#2 x zp ZP_BYTE:4 11.0 (byte) main::x0 +(const byte) main::x0#0 x0 = (byte/signed byte/word/signed word/dword/signed dword) 4 (byte) main::x1 (const byte) main::x1#0 x1 = (byte/signed byte/word/signed word/dword/signed dword) $27 (byte) main::xd -(const byte) main::xd#0 xd = (const byte) main::x1#0-(byte/signed byte/word/signed word/dword/signed dword) 4 +(const byte) main::xd#0 xd = (const byte) main::x1#0-(const byte) main::x0#0 (byte) main::y (byte) main::y#1 y zp ZP_BYTE:5 7.333333333333333 (byte) main::y#2 y zp ZP_BYTE:5 5.5 (byte) main::y#4 y zp ZP_BYTE:5 16.5 (byte) main::y0 +(const byte) main::y0#0 y0 = (byte/signed byte/word/signed word/dword/signed dword) 4 (byte) main::y1 (const byte) main::y1#0 y1 = (byte/signed byte/word/signed word/dword/signed dword) $18 (byte) main::yd -(const byte) main::yd#0 yd = (const byte) main::y1#0-(byte/signed byte/word/signed word/dword/signed dword) 4 +(const byte) main::yd#0 yd = (const byte) main::y1#0-(const byte) main::y0#0 zp ZP_WORD:2 [ main::cursor#3 main::cursor#5 main::cursor#1 main::cursor#2 ] zp ZP_BYTE:4 [ main::x#2 main::x#1 ] diff --git a/src/test/ref/bresenhamarr.asm b/src/test/ref/bresenhamarr.asm index f87a55dbf..f719edfb7 100644 --- a/src/test/ref/bresenhamarr.asm +++ b/src/test/ref/bresenhamarr.asm @@ -4,17 +4,21 @@ main: { .const STAR = $51 .label screen = $400 + .const x0 = 0 + .const y0 = 0 .const x1 = $27 .const y1 = $18 - .const xd = x1-0 - .const yd = y1-0 + .const xd = x1-x0 + .const yd = y1-y0 .label idx = 2 .label y = 4 - lda #0 + lda #y0 sta y ldy #yd/2 - tax + ldx #x0 + lda #x0+y0*$28 sta idx + lda #0 sta idx+1 b1: lda #= (byte) mai Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) main::xd#0 = (byte~) main::$1 Alias (byte) main::yd#0 = (byte~) main::$2 -Alias (byte) main::x#0 = (byte) main::x0#0 -Alias (byte) main::y#0 = (byte) main::y0#0 +Alias (byte) main::x0#0 = (byte) main::x#0 +Alias (byte) main::y0#0 = (byte) main::y#0 Alias (byte) main::e#0 = (byte/signed word/word/dword/signed dword~) main::$3 Alias (word) main::idx#0 = (byte/signed word/word/dword/signed dword~) main::$5 Alias (byte) main::x#1 = (byte/signed word/word/dword/signed dword~) main::$6 (byte) main::x#4 @@ -177,28 +170,20 @@ Alias (word) main::idx#1 = (word/signed dword/dword~) main::$7 (word) main::idx# Alias (byte) main::e#1 = (byte~) main::$8 (byte) main::e#4 Alias (byte) main::y#2 = (byte) main::y#3 Alias (byte) main::xd#1 = (byte) main::xd#2 -Alias (byte) main::x1#2 = (byte) main::x1#3 -Alias (byte) main::STAR#1 = (byte) main::STAR#3 Alias (byte) main::yd#1 = (byte) main::yd#3 Alias (byte) main::y#1 = (byte/signed word/word/dword/signed dword~) main::$11 Alias (word) main::idx#2 = (word/signed dword/dword~) main::$12 Alias (byte) main::e#2 = (byte~) main::$13 Successful SSA optimization Pass2AliasElimination -Alias (byte) main::x1#1 = (byte) main::x1#2 Alias (byte) main::x#1 = (byte) main::x#3 -Alias (byte) main::STAR#1 = (byte) main::STAR#2 Alias (byte) main::yd#1 = (byte) main::yd#2 Alias (byte) main::xd#1 = (byte) main::xd#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte) main::STAR#1 Self Phi Eliminated (byte) main::yd#1 Self Phi Eliminated (byte) main::xd#1 -Self Phi Eliminated (byte) main::x1#1 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte) main::STAR#1 (byte) main::STAR#0 Redundant Phi (byte) main::yd#1 (byte) main::yd#0 Redundant Phi (byte) main::xd#1 (byte) main::xd#0 -Redundant Phi (byte) main::x1#1 (byte) main::x1#0 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$10 [28] if((byte) main::xd#0>=(byte) main::e#1) goto main::@2 Simple Condition (bool~) main::$15 [32] if((byte) main::x#1<(byte/signed word/word/dword/signed dword~) main::$14) goto main::@1 @@ -206,33 +191,27 @@ Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte) main::STAR#0 = $51 Constant (const word/signed word/dword/signed dword) main::$0 = $28*$19 Constant (const byte[main::$0]) main::screen#0 = ((byte*))$400 -Constant (const byte) main::x#0 = 0 -Constant (const byte) main::y#0 = 0 +Constant (const byte) main::x0#0 = 0 +Constant (const byte) main::y0#0 = 0 Constant (const byte) main::x1#0 = $27 Constant (const byte) main::y1#0 = $18 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) main::xd#0 = main::x1#0-main::x#0 -Constant (const byte) main::yd#0 = main::y1#0-main::y#0 -Constant (const byte/signed word/word/dword/signed dword) main::$4 = main::y#0*$28 +Constant (const byte) main::xd#0 = main::x1#0-main::x0#0 +Constant (const byte) main::yd#0 = main::y1#0-main::y0#0 +Constant (const byte/signed word/word/dword/signed dword) main::$4 = main::y0#0*$28 Constant (const byte/signed word/word/dword/signed dword) main::$14 = main::x1#0+1 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::e#0 = main::yd#0/2 -Constant (const word) main::idx#0 = main::x#0+main::$4 +Constant (const word) main::idx#0 = main::x0#0+main::$4 Successful SSA optimization Pass2ConstantIdentification -Inlining constant with var siblings (const byte) main::x#0 -Inlining constant with var siblings (const byte) main::y#0 Inlining constant with var siblings (const byte) main::e#0 Inlining constant with var siblings (const word) main::idx#0 -Constant inlined main::idx#0 = (byte/signed byte/word/signed word/dword/signed dword) 0+(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) $28 -Constant inlined main::$0 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $19 +Constant inlined main::idx#0 = (const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined main::$14 = (const byte) main::x1#0+(byte/signed byte/word/signed word/dword/signed dword) 1 -Constant inlined main::x#0 = (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) $28 -Constant inlined main::y#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined main::$4 = (const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined main::e#0 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::$0 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $19 Successful SSA optimization Pass2ConstantInlining -Simplifying constant plus zero 0+0*$28 -Simplifying constant multiply by zero 0*$28 Added new block during phi lifting main::@5(between main::@2 and main::@1) Added new block during phi lifting main::@6(between main::@1 and main::@2) Adding NOP phi() at start of @begin @@ -275,10 +254,10 @@ main: scope:[main] from @1 [4] phi() to:main::@1 main::@1: scope:[main] from main main::@2 - [5] (byte) main::y#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@2/(byte) main::y#4 ) + [5] (byte) main::y#2 ← phi( main/(const byte) main::y0#0 main::@2/(byte) main::y#4 ) [5] (byte) main::e#3 ← phi( main/(const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 main::@2/(byte) main::e#5 ) - [5] (byte) main::x#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@2/(byte) main::x#1 ) - [5] (word) main::idx#3 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@2/(word) main::idx#5 ) + [5] (byte) main::x#2 ← phi( main/(const byte) main::x0#0 main::@2/(byte) main::x#1 ) + [5] (word) main::idx#3 ← phi( main/(const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 main::@2/(word) main::idx#5 ) [6] *((const byte[$28*$19]) main::screen#0 + (word) main::idx#3) ← (const byte) main::STAR#0 [7] (byte) main::x#1 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 [8] (word) main::idx#1 ← (word) main::idx#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 @@ -371,27 +350,29 @@ bend: main: { .const STAR = $51 .label screen = $400 + .const x0 = 0 + .const y0 = 0 .const x1 = $27 .const y1 = $18 - .const xd = x1-0 - .const yd = y1-0 + .const xd = x1-x0 + .const yd = y1-y0 .label x = 4 .label idx = 2 .label e = 5 .label y = 6 //SEG11 [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - //SEG12 [5] phi (byte) main::y#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 - lda #0 + //SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + lda #y0 sta y //SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuz1=vbuc1 lda #yd/2 sta e - //SEG14 [5] phi (byte) main::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#2] -- vbuz1=vbuc1 - lda #0 + //SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuz1=vbuc1 + lda #x0 sta x - //SEG15 [5] phi (word) main::idx#3 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#3] -- vwuz1=vbuc1 - lda #0 + //SEG15 [5] phi (word) main::idx#3 = (const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 [phi:main->main::@1#3] -- vwuz1=vbuc1 + lda #x0+y0*$28 sta idx lda #0 sta idx+1 @@ -524,23 +505,25 @@ bend: main: { .const STAR = $51 .label screen = $400 + .const x0 = 0 + .const y0 = 0 .const x1 = $27 .const y1 = $18 - .const xd = x1-0 - .const yd = y1-0 + .const xd = x1-x0 + .const yd = y1-y0 .label idx = 2 .label y = 4 //SEG11 [5] phi from main to main::@1 [phi:main->main::@1] b1_from_main: - //SEG12 [5] phi (byte) main::y#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 - lda #0 + //SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + lda #y0 sta y //SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuyy=vbuc1 ldy #yd/2 - //SEG14 [5] phi (byte) main::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#2] -- vbuxx=vbuc1 - ldx #0 - //SEG15 [5] phi (word) main::idx#3 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#3] -- vwuz1=vbuc1 - lda #0 + //SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuxx=vbuc1 + ldx #x0 + //SEG15 [5] phi (word) main::idx#3 = (const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 [phi:main->main::@1#3] -- vwuz1=vbuc1 + lda #x0+y0*$28 sta idx lda #0 sta idx+1 @@ -626,10 +609,6 @@ Removing instruction jmp b3 Removing instruction jmp b2 Removing instruction jmp breturn Succesful ASM optimization Pass5NextJumpElimination -Replacing instruction ldx #0 with TAX -Removing instruction lda #0 -Removing instruction lda #0 -Succesful ASM optimization Pass5UnnecesaryLoadElimination Replacing label b2_from_b1 with b2 Replacing label b2_from_b1 with b2 Replacing label b1_from_b2 with b1 @@ -681,19 +660,21 @@ FINAL SYMBOL TABLE (byte) main::x#1 reg byte x 3.666666666666667 (byte) main::x#2 reg byte x 11.0 (byte) main::x0 +(const byte) main::x0#0 x0 = (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::x1 (const byte) main::x1#0 x1 = (byte/signed byte/word/signed word/dword/signed dword) $27 (byte) main::xd -(const byte) main::xd#0 xd = (const byte) main::x1#0-(byte/signed byte/word/signed word/dword/signed dword) 0 +(const byte) main::xd#0 xd = (const byte) main::x1#0-(const byte) main::x0#0 (byte) main::y (byte) main::y#1 y zp ZP_BYTE:4 7.333333333333333 (byte) main::y#2 y zp ZP_BYTE:4 5.5 (byte) main::y#4 y zp ZP_BYTE:4 16.5 (byte) main::y0 +(const byte) main::y0#0 y0 = (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::y1 (const byte) main::y1#0 y1 = (byte/signed byte/word/signed word/dword/signed dword) $18 (byte) main::yd -(const byte) main::yd#0 yd = (const byte) main::y1#0-(byte/signed byte/word/signed word/dword/signed dword) 0 +(const byte) main::yd#0 yd = (const byte) main::y1#0-(const byte) main::y0#0 zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] reg byte x [ main::x#2 main::x#1 ] @@ -702,7 +683,7 @@ zp ZP_BYTE:4 [ main::y#2 main::y#4 main::y#1 ] FINAL ASSEMBLER -Score: 1061 +Score: 1101 //SEG0 File Comments //SEG1 Basic Upstart @@ -721,22 +702,26 @@ Score: 1061 main: { .const STAR = $51 .label screen = $400 + .const x0 = 0 + .const y0 = 0 .const x1 = $27 .const y1 = $18 - .const xd = x1-0 - .const yd = y1-0 + .const xd = x1-x0 + .const yd = y1-y0 .label idx = 2 .label y = 4 //SEG11 [5] phi from main to main::@1 [phi:main->main::@1] - //SEG12 [5] phi (byte) main::y#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1 - lda #0 + //SEG12 [5] phi (byte) main::y#2 = (const byte) main::y0#0 [phi:main->main::@1#0] -- vbuz1=vbuc1 + lda #y0 sta y //SEG13 [5] phi (byte) main::e#3 = (const byte) main::yd#0/(byte/signed byte/word/signed word/dword/signed dword) 2 [phi:main->main::@1#1] -- vbuyy=vbuc1 ldy #yd/2 - //SEG14 [5] phi (byte) main::x#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#2] -- vbuxx=vbuc1 - tax - //SEG15 [5] phi (word) main::idx#3 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:main->main::@1#3] -- vwuz1=vbuc1 + //SEG14 [5] phi (byte) main::x#2 = (const byte) main::x0#0 [phi:main->main::@1#2] -- vbuxx=vbuc1 + ldx #x0 + //SEG15 [5] phi (word) main::idx#3 = (const byte) main::x0#0+(const byte) main::y0#0*(byte/signed byte/word/signed word/dword/signed dword) $28 [phi:main->main::@1#3] -- vwuz1=vbuc1 + lda #x0+y0*$28 sta idx + lda #0 sta idx+1 //SEG16 [5] phi from main::@2 to main::@1 [phi:main::@2->main::@1] //SEG17 [5] phi (byte) main::y#2 = (byte) main::y#4 [phi:main::@2->main::@1#0] -- register_copy diff --git a/src/test/ref/bresenhamarr.sym b/src/test/ref/bresenhamarr.sym index 59088b12d..af4fe7a29 100644 --- a/src/test/ref/bresenhamarr.sym +++ b/src/test/ref/bresenhamarr.sym @@ -24,19 +24,21 @@ (byte) main::x#1 reg byte x 3.666666666666667 (byte) main::x#2 reg byte x 11.0 (byte) main::x0 +(const byte) main::x0#0 x0 = (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::x1 (const byte) main::x1#0 x1 = (byte/signed byte/word/signed word/dword/signed dword) $27 (byte) main::xd -(const byte) main::xd#0 xd = (const byte) main::x1#0-(byte/signed byte/word/signed word/dword/signed dword) 0 +(const byte) main::xd#0 xd = (const byte) main::x1#0-(const byte) main::x0#0 (byte) main::y (byte) main::y#1 y zp ZP_BYTE:4 7.333333333333333 (byte) main::y#2 y zp ZP_BYTE:4 5.5 (byte) main::y#4 y zp ZP_BYTE:4 16.5 (byte) main::y0 +(const byte) main::y0#0 y0 = (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::y1 (const byte) main::y1#0 y1 = (byte/signed byte/word/signed word/dword/signed dword) $18 (byte) main::yd -(const byte) main::yd#0 yd = (const byte) main::y1#0-(byte/signed byte/word/signed word/dword/signed dword) 0 +(const byte) main::yd#0 yd = (const byte) main::y1#0-(const byte) main::y0#0 zp ZP_WORD:2 [ main::idx#3 main::idx#5 main::idx#1 main::idx#2 ] reg byte x [ main::x#2 main::x#1 ] diff --git a/src/test/ref/c64dtv-8bppcharstretch.log b/src/test/ref/c64dtv-8bppcharstretch.log index 46361bff4..540dec859 100644 --- a/src/test/ref/c64dtv-8bppcharstretch.log +++ b/src/test/ref/c64dtv-8bppcharstretch.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) dtvSetCpuBankSegment1::cpuBank +Identified constant variable (byte*) DTV_BLITTER_ALU Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx CONTROL FLOW GRAPH SSA diff --git a/src/test/ref/c64dtv-8bppchunkystretch.log b/src/test/ref/c64dtv-8bppchunkystretch.log index 6910b1439..819238036 100644 --- a/src/test/ref/c64dtv-8bppchunkystretch.log +++ b/src/test/ref/c64dtv-8bppchunkystretch.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) dtvSetCpuBankSegment1::cpuBank +Identified constant variable (byte*) DTV_BLITTER_ALU Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx CONTROL FLOW GRAPH SSA diff --git a/src/test/ref/c64dtv-blittermin.log b/src/test/ref/c64dtv-blittermin.log index d888b5a76..368a50d65 100644 --- a/src/test/ref/c64dtv-blittermin.log +++ b/src/test/ref/c64dtv-blittermin.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) dtvSetCpuBankSegment1::cpuBank +Identified constant variable (byte*) DTV_BLITTER_ALU Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx CONTROL FLOW GRAPH SSA @@ -186,7 +188,6 @@ CONTROL FLOW GRAPH SSA (byte[]) SRCB#0 ← { (byte/word/signed word/dword/signed dword) $80 } to:@6 main: scope:[main] from @6 - (byte*) DTV_BLITTER_ALU#1 ← phi( @6/(byte*) DTV_BLITTER_ALU#2 ) *((byte*) DTV_FEATURE#0) ← (byte) DTV_FEATURE_ENABLE#0 *((byte*) DTV_BLITTER_CONTROL2#0) ← (byte) DTV_BLIT_CLEAR_IRQ#0 (byte~) main::$0 ← < (byte[]) SRCA#0 @@ -227,7 +228,7 @@ main: scope:[main] from @6 *((byte*) DTV_BLITTER_DEST_STEP#0) ← (byte/signed byte/word/signed word/dword/signed dword) $10 *((byte*) DTV_BLITTER_LEN_LO#0) ← (byte) SRCA_LEN#0 *((byte*) DTV_BLITTER_LEN_HI#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 - *((byte*) DTV_BLITTER_ALU#1) ← (byte) DTV_BLIT_ADD#0 + *((byte*) DTV_BLITTER_ALU#0) ← (byte) DTV_BLIT_ADD#0 *((byte*) DTV_BLITTER_TRANSPARANCY#0) ← (byte) DTV_BLIT_TRANSPARANCY_NONE#0 (byte~) main::$12 ← (byte) DTV_BLIT_FORCE_START#0 | (byte) DTV_BLIT_SRCA_FWD#0 (byte~) main::$13 ← (byte~) main::$12 | (byte) DTV_BLIT_SRCB_FWD#0 @@ -259,7 +260,6 @@ main::@return: scope:[main] from main::@3 return to:@return @6: scope:[] from @5 - (byte*) DTV_BLITTER_ALU#2 ← phi( @5/(byte*) DTV_BLITTER_ALU#0 ) call main to:@7 @7: scope:[] from @6 @@ -331,8 +331,6 @@ SYMBOL TABLE SSA (byte) DTV_BADLINE_OFF#0 (byte*) DTV_BLITTER_ALU (byte*) DTV_BLITTER_ALU#0 -(byte*) DTV_BLITTER_ALU#1 -(byte*) DTV_BLITTER_ALU#2 (byte*) DTV_BLITTER_CONTROL (byte*) DTV_BLITTER_CONTROL#0 (byte*) DTV_BLITTER_CONTROL2 @@ -668,14 +666,11 @@ Culled Empty Block (label) @7 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::r#1 = (byte) main::r#4 Alias (byte) main::r#2 = (byte) main::r#3 -Alias (byte*) DTV_BLITTER_ALU#0 = (byte*) DTV_BLITTER_ALU#2 Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (byte) main::r#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) DTV_BLITTER_ALU#1 (byte*) DTV_BLITTER_ALU#0 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$16 [231] if((byte~) main::$15!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2 -Simple Condition (bool~) main::$20 [239] if((byte) main::r#1!=rangelast(0,7)) goto main::@1 +Simple Condition (bool~) main::$16 [230] if((byte~) main::$15!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2 +Simple Condition (bool~) main::$20 [238] if((byte) main::r#1!=rangelast(0,7)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) PROCPORT_DDR#0 = ((byte*))0 Constant (const byte) PROCPORT_DDR_MEMORY_MASK#0 = 7 diff --git a/src/test/ref/c64dtv-color.log b/src/test/ref/c64dtv-color.log index e2915226d..8ed74afcc 100644 --- a/src/test/ref/c64dtv-color.log +++ b/src/test/ref/c64dtv-color.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) dtvSetCpuBankSegment1::cpuBank +Identified constant variable (byte*) DTV_BLITTER_ALU Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx CONTROL FLOW GRAPH SSA diff --git a/src/test/ref/c64dtv-gfxexplorer.log b/src/test/ref/c64dtv-gfxexplorer.log index 564da7ba5..eac7481f4 100644 --- a/src/test/ref/c64dtv-gfxexplorer.log +++ b/src/test/ref/c64dtv-gfxexplorer.log @@ -1,3 +1,7 @@ +Identified constant variable (byte*) dtvSetCpuBankSegment1::cpuBank +Identified constant variable (byte*) DTV_BLITTER_ALU +Identified constant variable (byte) form_fields_cnt +Identified constant variable (byte) gfx_init_vic_bitmap::lines_cnt Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx CONTROL FLOW GRAPH SSA @@ -1264,7 +1268,6 @@ bitmap_line_ydxd::@return: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@2 return to:@return main: scope:[main] from @68 - (byte) form_fields_cnt#72 ← phi( @68/(byte) form_fields_cnt#73 ) (byte) form_field_idx#55 ← phi( @68/(byte) form_field_idx#36 ) (byte) keyboard_modifiers#94 ← phi( @68/(byte) keyboard_modifiers#53 ) (byte) keyboard_events_size#101 ← phi( @68/(byte) keyboard_events_size#53 ) @@ -1279,7 +1282,6 @@ main: scope:[main] from @68 call keyboard_init to:main::@7 main::@7: scope:[main] from main - (byte) form_fields_cnt#69 ← phi( main/(byte) form_fields_cnt#72 ) (byte) form_field_idx#48 ← phi( main/(byte) form_field_idx#55 ) (byte) keyboard_modifiers#78 ← phi( main/(byte) keyboard_modifiers#94 ) (byte) keyboard_events_size#81 ← phi( main/(byte) keyboard_events_size#101 ) @@ -1290,7 +1292,6 @@ main::@7: scope:[main] from main call gfx_init to:main::@8 main::@8: scope:[main] from main::@7 - (byte) form_fields_cnt#67 ← phi( main::@7/(byte) form_fields_cnt#69 ) (byte) form_field_idx#38 ← phi( main::@7/(byte) form_field_idx#48 ) (byte) keyboard_modifiers#57 ← phi( main::@7/(byte) keyboard_modifiers#78 ) (byte) keyboard_events_size#57 ← phi( main::@7/(byte) keyboard_events_size#81 ) @@ -1300,7 +1301,6 @@ main::@8: scope:[main] from main::@7 (byte*) print_screen#27 ← phi( main::@7/(byte*) print_screen#34 ) to:main::@1 main::@1: scope:[main] from main::@10 main::@8 - (byte) form_fields_cnt#63 ← phi( main::@10/(byte) form_fields_cnt#66 main::@8/(byte) form_fields_cnt#67 ) (byte) form_field_idx#26 ← phi( main::@10/(byte) form_field_idx#37 main::@8/(byte) form_field_idx#38 ) (byte) keyboard_modifiers#40 ← phi( main::@10/(byte) keyboard_modifiers#8 main::@8/(byte) keyboard_modifiers#57 ) (byte) keyboard_events_size#43 ← phi( main::@10/(byte) keyboard_events_size#7 main::@8/(byte) keyboard_events_size#57 ) @@ -1311,7 +1311,6 @@ main::@1: scope:[main] from main::@10 main::@8 if(true) goto main::@2 to:main::@return main::@2: scope:[main] from main::@1 - (byte) form_fields_cnt#59 ← phi( main::@1/(byte) form_fields_cnt#63 ) (byte) form_field_idx#25 ← phi( main::@1/(byte) form_field_idx#26 ) (byte) keyboard_modifiers#39 ← phi( main::@1/(byte) keyboard_modifiers#40 ) (byte) keyboard_events_size#42 ← phi( main::@1/(byte) keyboard_events_size#43 ) @@ -1322,7 +1321,6 @@ main::@2: scope:[main] from main::@1 call form_mode to:main::@9 main::@9: scope:[main] from main::@2 - (byte) form_fields_cnt#70 ← phi( main::@2/(byte) form_fields_cnt#59 ) (byte) form_field_idx#11 ← phi( main::@2/(byte) form_field_idx#3 ) (byte) keyboard_modifiers#22 ← phi( main::@2/(byte) keyboard_modifiers#13 ) (byte) keyboard_events_size#25 ← phi( main::@2/(byte) keyboard_events_size#13 ) @@ -1340,7 +1338,6 @@ main::@9: scope:[main] from main::@2 call gfx_mode to:main::@10 main::@10: scope:[main] from main::@9 - (byte) form_fields_cnt#66 ← phi( main::@9/(byte) form_fields_cnt#70 ) (byte) form_field_idx#37 ← phi( main::@9/(byte) form_field_idx#0 ) (signed byte) form_cursor_count#27 ← phi( main::@9/(signed byte) form_cursor_count#0 ) (byte*) print_char_cursor#50 ← phi( main::@9/(byte*) print_char_cursor#10 ) @@ -1665,132 +1662,107 @@ get_vic_charset::@3: scope:[get_vic_charset] from get_vic_charset::@2 (byte[]) preset_8bpppixelcell#0 ← { (byte/signed byte/word/signed word/dword/signed dword) $a, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) $b, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 0 } to:@45 apply_preset: scope:[apply_preset] from form_mode::@18 - (byte) form_fields_cnt#23 ← phi( form_mode::@18/(byte) form_fields_cnt#37 ) (byte) apply_preset::idx#1 ← phi( form_mode::@18/(byte) apply_preset::idx#0 ) (byte*) apply_preset::preset#0 ← (byte*) 0 (bool~) apply_preset::$0 ← (byte) apply_preset::idx#1 == (byte/signed byte/word/signed word/dword/signed dword) 0 if((bool~) apply_preset::$0) goto apply_preset::@1 to:apply_preset::@24 apply_preset::@1: scope:[apply_preset] from apply_preset - (byte) form_fields_cnt#9 ← phi( apply_preset/(byte) form_fields_cnt#23 ) (byte*) apply_preset::preset#1 ← (byte[]) preset_stdchar#0 to:apply_preset::@22 apply_preset::@24: scope:[apply_preset] from apply_preset - (byte) form_fields_cnt#24 ← phi( apply_preset/(byte) form_fields_cnt#23 ) (byte) apply_preset::idx#2 ← phi( apply_preset/(byte) apply_preset::idx#1 ) (bool~) apply_preset::$1 ← (byte) apply_preset::idx#2 == (byte/signed byte/word/signed word/dword/signed dword) 1 if((bool~) apply_preset::$1) goto apply_preset::@2 to:apply_preset::@25 apply_preset::@2: scope:[apply_preset] from apply_preset::@24 - (byte) form_fields_cnt#12 ← phi( apply_preset::@24/(byte) form_fields_cnt#24 ) (byte*) apply_preset::preset#2 ← (byte[]) preset_ecmchar#0 to:apply_preset::@22 apply_preset::@25: scope:[apply_preset] from apply_preset::@24 - (byte) form_fields_cnt#25 ← phi( apply_preset::@24/(byte) form_fields_cnt#24 ) (byte) apply_preset::idx#3 ← phi( apply_preset::@24/(byte) apply_preset::idx#2 ) (bool~) apply_preset::$2 ← (byte) apply_preset::idx#3 == (byte/signed byte/word/signed word/dword/signed dword) 2 if((bool~) apply_preset::$2) goto apply_preset::@3 to:apply_preset::@26 apply_preset::@3: scope:[apply_preset] from apply_preset::@25 - (byte) form_fields_cnt#13 ← phi( apply_preset::@25/(byte) form_fields_cnt#25 ) (byte*) apply_preset::preset#3 ← (byte[]) preset_stdbm#0 to:apply_preset::@22 apply_preset::@26: scope:[apply_preset] from apply_preset::@25 - (byte) form_fields_cnt#26 ← phi( apply_preset::@25/(byte) form_fields_cnt#25 ) (byte) apply_preset::idx#4 ← phi( apply_preset::@25/(byte) apply_preset::idx#3 ) (bool~) apply_preset::$3 ← (byte) apply_preset::idx#4 == (byte/signed byte/word/signed word/dword/signed dword) 3 if((bool~) apply_preset::$3) goto apply_preset::@4 to:apply_preset::@27 apply_preset::@4: scope:[apply_preset] from apply_preset::@26 - (byte) form_fields_cnt#15 ← phi( apply_preset::@26/(byte) form_fields_cnt#26 ) (byte*) apply_preset::preset#4 ← (byte[]) preset_mcbm#0 to:apply_preset::@22 apply_preset::@27: scope:[apply_preset] from apply_preset::@26 - (byte) form_fields_cnt#27 ← phi( apply_preset::@26/(byte) form_fields_cnt#26 ) (byte) apply_preset::idx#5 ← phi( apply_preset::@26/(byte) apply_preset::idx#4 ) (bool~) apply_preset::$4 ← (byte) apply_preset::idx#5 == (byte/signed byte/word/signed word/dword/signed dword) 4 if((bool~) apply_preset::$4) goto apply_preset::@5 to:apply_preset::@28 apply_preset::@5: scope:[apply_preset] from apply_preset::@27 - (byte) form_fields_cnt#16 ← phi( apply_preset::@27/(byte) form_fields_cnt#27 ) (byte*) apply_preset::preset#5 ← (byte[]) preset_hi_stdchar#0 to:apply_preset::@22 apply_preset::@28: scope:[apply_preset] from apply_preset::@27 - (byte) form_fields_cnt#28 ← phi( apply_preset::@27/(byte) form_fields_cnt#27 ) (byte) apply_preset::idx#6 ← phi( apply_preset::@27/(byte) apply_preset::idx#5 ) (bool~) apply_preset::$5 ← (byte) apply_preset::idx#6 == (byte/signed byte/word/signed word/dword/signed dword) 5 if((bool~) apply_preset::$5) goto apply_preset::@6 to:apply_preset::@29 apply_preset::@6: scope:[apply_preset] from apply_preset::@28 - (byte) form_fields_cnt#17 ← phi( apply_preset::@28/(byte) form_fields_cnt#28 ) (byte*) apply_preset::preset#6 ← (byte[]) preset_hi_ecmchar#0 to:apply_preset::@22 apply_preset::@29: scope:[apply_preset] from apply_preset::@28 - (byte) form_fields_cnt#29 ← phi( apply_preset::@28/(byte) form_fields_cnt#28 ) (byte) apply_preset::idx#7 ← phi( apply_preset::@28/(byte) apply_preset::idx#6 ) (bool~) apply_preset::$6 ← (byte) apply_preset::idx#7 == (byte/signed byte/word/signed word/dword/signed dword) 6 if((bool~) apply_preset::$6) goto apply_preset::@7 to:apply_preset::@30 apply_preset::@7: scope:[apply_preset] from apply_preset::@29 - (byte) form_fields_cnt#18 ← phi( apply_preset::@29/(byte) form_fields_cnt#29 ) (byte*) apply_preset::preset#7 ← (byte[]) preset_twoplane#0 to:apply_preset::@22 apply_preset::@30: scope:[apply_preset] from apply_preset::@29 - (byte) form_fields_cnt#30 ← phi( apply_preset::@29/(byte) form_fields_cnt#29 ) (byte) apply_preset::idx#8 ← phi( apply_preset::@29/(byte) apply_preset::idx#7 ) (bool~) apply_preset::$7 ← (byte) apply_preset::idx#8 == (byte/signed byte/word/signed word/dword/signed dword) 7 if((bool~) apply_preset::$7) goto apply_preset::@8 to:apply_preset::@31 apply_preset::@8: scope:[apply_preset] from apply_preset::@30 - (byte) form_fields_cnt#19 ← phi( apply_preset::@30/(byte) form_fields_cnt#30 ) (byte*) apply_preset::preset#8 ← (byte[]) preset_chunky#0 to:apply_preset::@22 apply_preset::@31: scope:[apply_preset] from apply_preset::@30 - (byte) form_fields_cnt#31 ← phi( apply_preset::@30/(byte) form_fields_cnt#30 ) (byte) apply_preset::idx#9 ← phi( apply_preset::@30/(byte) apply_preset::idx#8 ) (bool~) apply_preset::$8 ← (byte) apply_preset::idx#9 == (byte/signed byte/word/signed word/dword/signed dword) 8 if((bool~) apply_preset::$8) goto apply_preset::@9 to:apply_preset::@32 apply_preset::@9: scope:[apply_preset] from apply_preset::@31 - (byte) form_fields_cnt#20 ← phi( apply_preset::@31/(byte) form_fields_cnt#31 ) (byte*) apply_preset::preset#9 ← (byte[]) preset_sixsfred#0 to:apply_preset::@22 apply_preset::@32: scope:[apply_preset] from apply_preset::@31 - (byte) form_fields_cnt#32 ← phi( apply_preset::@31/(byte) form_fields_cnt#31 ) (byte) apply_preset::idx#10 ← phi( apply_preset::@31/(byte) apply_preset::idx#9 ) (bool~) apply_preset::$9 ← (byte) apply_preset::idx#10 == (byte/signed byte/word/signed word/dword/signed dword) 9 if((bool~) apply_preset::$9) goto apply_preset::@10 to:apply_preset::@33 apply_preset::@10: scope:[apply_preset] from apply_preset::@32 - (byte) form_fields_cnt#10 ← phi( apply_preset::@32/(byte) form_fields_cnt#32 ) (byte*) apply_preset::preset#10 ← (byte[]) preset_sixsfred2#0 to:apply_preset::@22 apply_preset::@33: scope:[apply_preset] from apply_preset::@32 - (byte) form_fields_cnt#33 ← phi( apply_preset::@32/(byte) form_fields_cnt#32 ) (byte) apply_preset::idx#11 ← phi( apply_preset::@32/(byte) apply_preset::idx#10 ) (bool~) apply_preset::$10 ← (byte) apply_preset::idx#11 == (byte/signed byte/word/signed word/dword/signed dword) $a if((bool~) apply_preset::$10) goto apply_preset::@11 to:apply_preset::@34 apply_preset::@11: scope:[apply_preset] from apply_preset::@33 - (byte) form_fields_cnt#11 ← phi( apply_preset::@33/(byte) form_fields_cnt#33 ) (byte*) apply_preset::preset#11 ← (byte[]) preset_8bpppixelcell#0 to:apply_preset::@22 apply_preset::@34: scope:[apply_preset] from apply_preset::@33 - (byte) form_fields_cnt#14 ← phi( apply_preset::@33/(byte) form_fields_cnt#33 ) (byte*) apply_preset::preset#12 ← (byte[]) preset_stdchar#0 to:apply_preset::@22 apply_preset::@22: scope:[apply_preset] from apply_preset::@1 apply_preset::@10 apply_preset::@11 apply_preset::@2 apply_preset::@3 apply_preset::@34 apply_preset::@4 apply_preset::@5 apply_preset::@6 apply_preset::@7 apply_preset::@8 apply_preset::@9 - (byte) form_fields_cnt#5 ← phi( apply_preset::@1/(byte) form_fields_cnt#9 apply_preset::@10/(byte) form_fields_cnt#10 apply_preset::@11/(byte) form_fields_cnt#11 apply_preset::@2/(byte) form_fields_cnt#12 apply_preset::@3/(byte) form_fields_cnt#13 apply_preset::@34/(byte) form_fields_cnt#14 apply_preset::@4/(byte) form_fields_cnt#15 apply_preset::@5/(byte) form_fields_cnt#16 apply_preset::@6/(byte) form_fields_cnt#17 apply_preset::@7/(byte) form_fields_cnt#18 apply_preset::@8/(byte) form_fields_cnt#19 apply_preset::@9/(byte) form_fields_cnt#20 ) (byte*) apply_preset::preset#14 ← phi( apply_preset::@1/(byte*) apply_preset::preset#1 apply_preset::@10/(byte*) apply_preset::preset#10 apply_preset::@11/(byte*) apply_preset::preset#11 apply_preset::@2/(byte*) apply_preset::preset#2 apply_preset::@3/(byte*) apply_preset::preset#3 apply_preset::@34/(byte*) apply_preset::preset#12 apply_preset::@4/(byte*) apply_preset::preset#4 apply_preset::@5/(byte*) apply_preset::preset#5 apply_preset::@6/(byte*) apply_preset::preset#6 apply_preset::@7/(byte*) apply_preset::preset#7 apply_preset::@8/(byte*) apply_preset::preset#8 apply_preset::@9/(byte*) apply_preset::preset#9 ) (byte) apply_preset::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:apply_preset::@23 apply_preset::@23: scope:[apply_preset] from apply_preset::@22 apply_preset::@23 - (byte) form_fields_cnt#1 ← phi( apply_preset::@22/(byte) form_fields_cnt#5 apply_preset::@23/(byte) form_fields_cnt#1 ) (byte) apply_preset::i#2 ← phi( apply_preset::@22/(byte) apply_preset::i#0 apply_preset::@23/(byte) apply_preset::i#1 ) (byte*) apply_preset::preset#13 ← phi( apply_preset::@22/(byte*) apply_preset::preset#14 apply_preset::@23/(byte*) apply_preset::preset#13 ) *((byte[]) form_fields_val#0 + (byte) apply_preset::i#2) ← *((byte*) apply_preset::preset#13 + (byte) apply_preset::i#2) (byte) apply_preset::i#1 ← ++ (byte) apply_preset::i#2 - (bool~) apply_preset::$11 ← (byte) apply_preset::i#1 != (byte) form_fields_cnt#1 + (bool~) apply_preset::$11 ← (byte) apply_preset::i#1 != (byte) form_fields_cnt#0 if((bool~) apply_preset::$11) goto apply_preset::@23 to:apply_preset::@return apply_preset::@return: scope:[apply_preset] from apply_preset::@23 @@ -1903,7 +1875,6 @@ render_preset_name::@return: scope:[render_preset_name] from render_preset_name return to:@return @45: scope:[] from @43 - (byte) form_fields_cnt#75 ← phi( @43/(byte) form_fields_cnt#0 ) (byte) keyboard_modifiers#88 ← phi( @43/(byte) keyboard_modifiers#95 ) (byte) keyboard_events_size#91 ← phi( @43/(byte) keyboard_events_size#102 ) (byte*) print_char_cursor#62 ← phi( @43/(byte*) print_char_cursor#64 ) @@ -2634,7 +2605,6 @@ gfx_init_vic_bitmap::@4: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap:: (byte) gfx_init_vic_bitmap::l#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:gfx_init_vic_bitmap::@1 gfx_init_vic_bitmap::@1: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@4 gfx_init_vic_bitmap::@5 - (byte) gfx_init_vic_bitmap::lines_cnt#2 ← phi( gfx_init_vic_bitmap::@4/(byte) gfx_init_vic_bitmap::lines_cnt#0 gfx_init_vic_bitmap::@5/(byte) gfx_init_vic_bitmap::lines_cnt#1 ) (byte) gfx_init_vic_bitmap::l#2 ← phi( gfx_init_vic_bitmap::@4/(byte) gfx_init_vic_bitmap::l#0 gfx_init_vic_bitmap::@5/(byte) gfx_init_vic_bitmap::l#1 ) (byte/signed word/word/dword/signed dword~) gfx_init_vic_bitmap::$2 ← (byte) gfx_init_vic_bitmap::l#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 (byte/signed word/word/dword/signed dword~) gfx_init_vic_bitmap::$3 ← (byte) gfx_init_vic_bitmap::l#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 @@ -2645,10 +2615,9 @@ gfx_init_vic_bitmap::@1: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap:: call bitmap_line to:gfx_init_vic_bitmap::@5 gfx_init_vic_bitmap::@5: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@1 - (byte) gfx_init_vic_bitmap::lines_cnt#1 ← phi( gfx_init_vic_bitmap::@1/(byte) gfx_init_vic_bitmap::lines_cnt#2 ) (byte) gfx_init_vic_bitmap::l#3 ← phi( gfx_init_vic_bitmap::@1/(byte) gfx_init_vic_bitmap::l#2 ) (byte) gfx_init_vic_bitmap::l#1 ← ++ (byte) gfx_init_vic_bitmap::l#3 - (bool~) gfx_init_vic_bitmap::$5 ← (byte) gfx_init_vic_bitmap::l#1 < (byte) gfx_init_vic_bitmap::lines_cnt#1 + (bool~) gfx_init_vic_bitmap::$5 ← (byte) gfx_init_vic_bitmap::l#1 < (byte) gfx_init_vic_bitmap::lines_cnt#0 if((bool~) gfx_init_vic_bitmap::$5) goto gfx_init_vic_bitmap::@1 to:gfx_init_vic_bitmap::@return gfx_init_vic_bitmap::@return: scope:[gfx_init_vic_bitmap] from gfx_init_vic_bitmap::@5 @@ -3097,7 +3066,6 @@ form_mode: scope:[form_mode] from main::@2 (byte) keyboard_modifiers#122 ← phi( main::@2/(byte) keyboard_modifiers#39 ) (byte) keyboard_events_size#142 ← phi( main::@2/(byte) keyboard_events_size#42 ) (signed byte) form_cursor_count#65 ← phi( main::@2/(signed byte) form_cursor_count#18 ) - (byte) form_fields_cnt#57 ← phi( main::@2/(byte) form_fields_cnt#59 ) (byte*) print_char_cursor#43 ← phi( main::@2/(byte*) print_char_cursor#41 ) (byte*) print_line_cursor#41 ← phi( main::@2/(byte*) print_line_cursor#39 ) (byte*) print_screen#21 ← phi( main::@2/(byte*) print_screen#19 ) @@ -3109,7 +3077,6 @@ form_mode::@21: scope:[form_mode] from form_mode (byte) keyboard_modifiers#120 ← phi( form_mode/(byte) keyboard_modifiers#122 ) (byte) keyboard_events_size#140 ← phi( form_mode/(byte) keyboard_events_size#142 ) (signed byte) form_cursor_count#64 ← phi( form_mode/(signed byte) form_cursor_count#65 ) - (byte) form_fields_cnt#54 ← phi( form_mode/(byte) form_fields_cnt#57 ) (byte*) print_char_cursor#29 ← phi( form_mode/(byte*) print_char_cursor#9 ) (byte*) print_line_cursor#28 ← phi( form_mode/(byte*) print_line_cursor#8 ) (byte*) print_screen#15 ← phi( form_mode/(byte*) print_screen#2 ) @@ -3123,7 +3090,6 @@ form_mode::@22: scope:[form_mode] from form_mode::@21 (byte) keyboard_modifiers#118 ← phi( form_mode::@21/(byte) keyboard_modifiers#120 ) (byte) keyboard_events_size#138 ← phi( form_mode::@21/(byte) keyboard_events_size#140 ) (signed byte) form_cursor_count#63 ← phi( form_mode::@21/(signed byte) form_cursor_count#64 ) - (byte) form_fields_cnt#51 ← phi( form_mode::@21/(byte) form_fields_cnt#54 ) (byte*) print_screen#28 ← phi( form_mode::@21/(byte*) print_screen#5 ) (byte*) print_char_cursor#30 ← phi( form_mode::@21/(byte*) print_char_cursor#7 ) (byte*) print_line_cursor#29 ← phi( form_mode::@21/(byte*) print_line_cursor#6 ) @@ -3137,7 +3103,6 @@ form_mode::@23: scope:[form_mode] from form_mode::@22 (byte) keyboard_modifiers#116 ← phi( form_mode::@22/(byte) keyboard_modifiers#118 ) (byte) keyboard_events_size#136 ← phi( form_mode::@22/(byte) keyboard_events_size#138 ) (signed byte) form_cursor_count#62 ← phi( form_mode::@22/(signed byte) form_cursor_count#63 ) - (byte) form_fields_cnt#47 ← phi( form_mode::@22/(byte) form_fields_cnt#51 ) (byte*) print_screen#22 ← phi( form_mode::@22/(byte*) print_screen#28 ) (byte*) print_line_cursor#30 ← phi( form_mode::@22/(byte*) print_line_cursor#2 ) (byte*) print_char_cursor#31 ← phi( form_mode::@22/(byte*) print_char_cursor#3 ) @@ -3151,7 +3116,6 @@ form_mode::@24: scope:[form_mode] from form_mode::@23 (byte) keyboard_modifiers#114 ← phi( form_mode::@23/(byte) keyboard_modifiers#116 ) (byte) keyboard_events_size#134 ← phi( form_mode::@23/(byte) keyboard_events_size#136 ) (signed byte) form_cursor_count#61 ← phi( form_mode::@23/(signed byte) form_cursor_count#62 ) - (byte) form_fields_cnt#44 ← phi( form_mode::@23/(byte) form_fields_cnt#47 ) (byte*) print_char_cursor#32 ← phi( form_mode::@23/(byte*) print_char_cursor#9 ) (byte*) print_line_cursor#31 ← phi( form_mode::@23/(byte*) print_line_cursor#8 ) (byte*) print_screen#16 ← phi( form_mode::@23/(byte*) print_screen#2 ) @@ -3166,7 +3130,6 @@ form_mode::@25: scope:[form_mode] from form_mode::@24 (byte) keyboard_events_size#131 ← phi( form_mode::@24/(byte) keyboard_events_size#134 ) (signed byte) form_cursor_count#60 ← phi( form_mode::@24/(signed byte) form_cursor_count#61 ) (byte*) print_screen#54 ← phi( form_mode::@24/(byte*) print_screen#6 ) - (byte) form_fields_cnt#40 ← phi( form_mode::@24/(byte) form_fields_cnt#44 ) (byte*) print_char_cursor#33 ← phi( form_mode::@24/(byte*) print_char_cursor#7 ) (byte*) print_line_cursor#32 ← phi( form_mode::@24/(byte*) print_line_cursor#6 ) (byte*) print_line_cursor#15 ← (byte*) print_line_cursor#32 @@ -3180,7 +3143,6 @@ form_mode::@26: scope:[form_mode] from form_mode::@25 (byte) keyboard_events_size#127 ← phi( form_mode::@25/(byte) keyboard_events_size#131 ) (signed byte) form_cursor_count#57 ← phi( form_mode::@25/(signed byte) form_cursor_count#60 ) (byte*) print_screen#52 ← phi( form_mode::@25/(byte*) print_screen#54 ) - (byte) form_fields_cnt#38 ← phi( form_mode::@25/(byte) form_fields_cnt#40 ) (byte*) print_line_cursor#33 ← phi( form_mode::@25/(byte*) print_line_cursor#2 ) (byte*) print_char_cursor#34 ← phi( form_mode::@25/(byte*) print_char_cursor#3 ) (byte*) print_char_cursor#17 ← (byte*) print_char_cursor#34 @@ -3196,11 +3158,9 @@ form_mode::@27: scope:[form_mode] from form_mode::@26 (byte*) print_char_cursor#73 ← phi( form_mode::@26/(byte*) print_char_cursor#17 ) (byte*) print_line_cursor#73 ← phi( form_mode::@26/(byte*) print_line_cursor#16 ) (byte*) print_screen#50 ← phi( form_mode::@26/(byte*) print_screen#52 ) - (byte) form_fields_cnt#34 ← phi( form_mode::@26/(byte) form_fields_cnt#38 ) call form_render_values to:form_mode::@28 form_mode::@28: scope:[form_mode] from form_mode::@27 - (byte) form_fields_cnt#71 ← phi( form_mode::@27/(byte) form_fields_cnt#34 ) (byte) form_field_idx#59 ← phi( form_mode::@27/(byte) form_field_idx#63 ) (byte) keyboard_modifiers#103 ← phi( form_mode::@27/(byte) keyboard_modifiers#108 ) (byte) keyboard_events_size#115 ← phi( form_mode::@27/(byte) keyboard_events_size#124 ) @@ -3212,7 +3172,6 @@ form_mode::@28: scope:[form_mode] from form_mode::@27 call render_preset_name to:form_mode::@29 form_mode::@29: scope:[form_mode] from form_mode::@28 - (byte) form_fields_cnt#68 ← phi( form_mode::@28/(byte) form_fields_cnt#71 ) (byte) form_field_idx#56 ← phi( form_mode::@28/(byte) form_field_idx#59 ) (byte) keyboard_modifiers#97 ← phi( form_mode::@28/(byte) keyboard_modifiers#103 ) (byte) keyboard_events_size#104 ← phi( form_mode::@28/(byte) keyboard_events_size#115 ) @@ -3260,7 +3219,6 @@ form_mode::@29: scope:[form_mode] from form_mode::@28 (byte) form_mode::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:form_mode::@1 form_mode::@1: scope:[form_mode] from form_mode::@1 form_mode::@29 - (byte) form_fields_cnt#64 ← phi( form_mode::@1/(byte) form_fields_cnt#64 form_mode::@29/(byte) form_fields_cnt#68 ) (byte) form_field_idx#49 ← phi( form_mode::@1/(byte) form_field_idx#49 form_mode::@29/(byte) form_field_idx#56 ) (byte) keyboard_modifiers#83 ← phi( form_mode::@1/(byte) keyboard_modifiers#83 form_mode::@29/(byte) keyboard_modifiers#97 ) (byte) keyboard_events_size#86 ← phi( form_mode::@1/(byte) keyboard_events_size#86 form_mode::@29/(byte) keyboard_events_size#104 ) @@ -3275,7 +3233,6 @@ form_mode::@1: scope:[form_mode] from form_mode::@1 form_mode::@29 if((bool~) form_mode::$34) goto form_mode::@1 to:form_mode::@10 form_mode::@10: scope:[form_mode] from form_mode::@1 - (byte) form_fields_cnt#60 ← phi( form_mode::@1/(byte) form_fields_cnt#64 ) (byte) form_field_idx#39 ← phi( form_mode::@1/(byte) form_field_idx#49 ) (byte) keyboard_modifiers#62 ← phi( form_mode::@1/(byte) keyboard_modifiers#83 ) (byte) keyboard_events_size#62 ← phi( form_mode::@1/(byte) keyboard_events_size#86 ) @@ -3288,7 +3245,6 @@ form_mode::@10: scope:[form_mode] from form_mode::@1 (byte) form_mode::preset_current#0 ← *((byte*) form_preset#0) to:form_mode::@2 form_mode::@2: scope:[form_mode] from form_mode::@10 form_mode::@33 form_mode::@9 - (byte) form_fields_cnt#58 ← phi( form_mode::@10/(byte) form_fields_cnt#60 form_mode::@33/(byte) form_fields_cnt#61 form_mode::@9/(byte) form_fields_cnt#62 ) (byte) form_mode::preset_current#8 ← phi( form_mode::@10/(byte) form_mode::preset_current#0 form_mode::@33/(byte) form_mode::preset_current#9 form_mode::@9/(byte) form_mode::preset_current#10 ) (byte) form_field_idx#28 ← phi( form_mode::@10/(byte) form_field_idx#39 form_mode::@33/(byte) form_field_idx#40 form_mode::@9/(byte) form_field_idx#41 ) (byte) keyboard_modifiers#45 ← phi( form_mode::@10/(byte) keyboard_modifiers#62 form_mode::@33/(byte) keyboard_modifiers#63 form_mode::@9/(byte) keyboard_modifiers#64 ) @@ -3300,7 +3256,6 @@ form_mode::@2: scope:[form_mode] from form_mode::@10 form_mode::@33 form_mode:: if(true) goto form_mode::@3 to:form_mode::@return form_mode::@3: scope:[form_mode] from form_mode::@2 - (byte) form_fields_cnt#55 ← phi( form_mode::@2/(byte) form_fields_cnt#58 ) (byte*) print_char_cursor#66 ← phi( form_mode::@2/(byte*) print_char_cursor#44 ) (byte*) print_line_cursor#66 ← phi( form_mode::@2/(byte*) print_line_cursor#42 ) (byte*) print_screen#43 ← phi( form_mode::@2/(byte*) print_screen#23 ) @@ -3311,7 +3266,6 @@ form_mode::@3: scope:[form_mode] from form_mode::@2 (signed byte) form_cursor_count#40 ← phi( form_mode::@2/(signed byte) form_cursor_count#21 ) to:form_mode::@5 form_mode::@5: scope:[form_mode] from form_mode::@3 form_mode::@6 - (byte) form_fields_cnt#52 ← phi( form_mode::@3/(byte) form_fields_cnt#55 form_mode::@6/(byte) form_fields_cnt#56 ) (byte*) print_char_cursor#59 ← phi( form_mode::@3/(byte*) print_char_cursor#66 form_mode::@6/(byte*) print_char_cursor#67 ) (byte*) print_line_cursor#58 ← phi( form_mode::@3/(byte*) print_line_cursor#66 form_mode::@6/(byte*) print_line_cursor#67 ) (byte*) print_screen#36 ← phi( form_mode::@3/(byte*) print_screen#43 form_mode::@6/(byte*) print_screen#44 ) @@ -3324,7 +3278,6 @@ form_mode::@5: scope:[form_mode] from form_mode::@3 form_mode::@6 if((bool~) form_mode::$35) goto form_mode::@6 to:form_mode::@7 form_mode::@6: scope:[form_mode] from form_mode::@5 - (byte) form_fields_cnt#56 ← phi( form_mode::@5/(byte) form_fields_cnt#52 ) (byte*) print_char_cursor#67 ← phi( form_mode::@5/(byte*) print_char_cursor#59 ) (byte*) print_line_cursor#67 ← phi( form_mode::@5/(byte*) print_line_cursor#58 ) (byte*) print_screen#44 ← phi( form_mode::@5/(byte*) print_screen#36 ) @@ -3335,7 +3288,6 @@ form_mode::@6: scope:[form_mode] from form_mode::@5 (signed byte) form_cursor_count#41 ← phi( form_mode::@5/(signed byte) form_cursor_count#32 ) to:form_mode::@5 form_mode::@7: scope:[form_mode] from form_mode::@5 - (byte) form_fields_cnt#48 ← phi( form_mode::@5/(byte) form_fields_cnt#52 ) (byte*) print_char_cursor#55 ← phi( form_mode::@5/(byte*) print_char_cursor#59 ) (byte*) print_line_cursor#52 ← phi( form_mode::@5/(byte*) print_line_cursor#58 ) (byte*) print_screen#32 ← phi( form_mode::@5/(byte*) print_screen#36 ) @@ -3348,7 +3300,6 @@ form_mode::@7: scope:[form_mode] from form_mode::@5 (byte) form_control::return#0 ← (byte) form_control::return#2 to:form_mode::@30 form_mode::@30: scope:[form_mode] from form_mode::@7 - (byte) form_fields_cnt#45 ← phi( form_mode::@7/(byte) form_fields_cnt#48 ) (byte*) print_char_cursor#45 ← phi( form_mode::@7/(byte*) print_char_cursor#55 ) (byte*) print_line_cursor#43 ← phi( form_mode::@7/(byte*) print_line_cursor#52 ) (byte*) print_screen#24 ← phi( form_mode::@7/(byte*) print_screen#32 ) @@ -3368,7 +3319,6 @@ form_mode::@30: scope:[form_mode] from form_mode::@7 if((bool~) form_mode::$38) goto form_mode::@8 to:form_mode::@return form_mode::@8: scope:[form_mode] from form_mode::@30 - (byte) form_fields_cnt#41 ← phi( form_mode::@30/(byte) form_fields_cnt#45 ) (byte) form_field_idx#52 ← phi( form_mode::@30/(byte) form_field_idx#2 ) (byte) keyboard_modifiers#86 ← phi( form_mode::@30/(byte) keyboard_modifiers#12 ) (byte) keyboard_events_size#89 ← phi( form_mode::@30/(byte) keyboard_events_size#12 ) @@ -3399,7 +3349,6 @@ form_mode::@return: scope:[form_mode] from form_mode::@2 form_mode::@30 return to:@return form_mode::@9: scope:[form_mode] from form_mode::@8 - (byte) form_fields_cnt#62 ← phi( form_mode::@8/(byte) form_fields_cnt#41 ) (byte) form_mode::preset_current#10 ← phi( form_mode::@8/(byte) form_mode::preset_current#2 ) (byte) form_field_idx#41 ← phi( form_mode::@8/(byte) form_field_idx#52 ) (byte) keyboard_modifiers#64 ← phi( form_mode::@8/(byte) keyboard_modifiers#86 ) @@ -3417,7 +3366,6 @@ form_mode::@18: scope:[form_mode] from form_mode::@8 (byte*) print_char_cursor#71 ← phi( form_mode::@8/(byte*) print_char_cursor#60 ) (byte*) print_line_cursor#71 ← phi( form_mode::@8/(byte*) print_line_cursor#59 ) (byte*) print_screen#48 ← phi( form_mode::@8/(byte*) print_screen#37 ) - (byte) form_fields_cnt#37 ← phi( form_mode::@8/(byte) form_fields_cnt#41 ) (byte) apply_preset::idx#0 ← *((byte*) form_preset#0) call apply_preset to:form_mode::@31 @@ -3429,12 +3377,10 @@ form_mode::@31: scope:[form_mode] from form_mode::@18 (byte*) print_char_cursor#68 ← phi( form_mode::@18/(byte*) print_char_cursor#71 ) (byte*) print_line_cursor#68 ← phi( form_mode::@18/(byte*) print_line_cursor#71 ) (byte*) print_screen#45 ← phi( form_mode::@18/(byte*) print_screen#48 ) - (byte) form_fields_cnt#35 ← phi( form_mode::@18/(byte) form_fields_cnt#37 ) (byte) form_mode::preset_current#1 ← *((byte*) form_preset#0) call form_render_values to:form_mode::@32 form_mode::@32: scope:[form_mode] from form_mode::@31 - (byte) form_fields_cnt#65 ← phi( form_mode::@31/(byte) form_fields_cnt#35 ) (byte) form_mode::preset_current#11 ← phi( form_mode::@31/(byte) form_mode::preset_current#1 ) (byte) form_field_idx#53 ← phi( form_mode::@31/(byte) form_field_idx#57 ) (byte) keyboard_modifiers#87 ← phi( form_mode::@31/(byte) keyboard_modifiers#98 ) @@ -3447,7 +3393,6 @@ form_mode::@32: scope:[form_mode] from form_mode::@31 call render_preset_name to:form_mode::@33 form_mode::@33: scope:[form_mode] from form_mode::@32 - (byte) form_fields_cnt#61 ← phi( form_mode::@32/(byte) form_fields_cnt#65 ) (byte) form_mode::preset_current#9 ← phi( form_mode::@32/(byte) form_mode::preset_current#11 ) (byte) form_field_idx#40 ← phi( form_mode::@32/(byte) form_field_idx#53 ) (byte) keyboard_modifiers#63 ← phi( form_mode::@32/(byte) keyboard_modifiers#87 ) @@ -3458,7 +3403,6 @@ form_mode::@33: scope:[form_mode] from form_mode::@32 (byte*) print_screen#30 ← phi( form_mode::@32/(byte*) print_screen#38 ) to:form_mode::@2 @64: scope:[] from @45 - (byte) form_fields_cnt#74 ← phi( @45/(byte) form_fields_cnt#75 ) (byte) keyboard_modifiers#77 ← phi( @45/(byte) keyboard_modifiers#88 ) (byte) keyboard_events_size#77 ← phi( @45/(byte) keyboard_events_size#91 ) (byte*) print_char_cursor#56 ← phi( @45/(byte*) print_char_cursor#62 ) @@ -3508,32 +3452,28 @@ form_field_ptr::@return: scope:[form_field_ptr] from form_field_ptr return to:@return form_render_values: scope:[form_render_values] from form_mode::@27 form_mode::@31 - (byte) form_fields_cnt#21 ← phi( form_mode::@27/(byte) form_fields_cnt#34 form_mode::@31/(byte) form_fields_cnt#35 ) (byte) form_render_values::idx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:form_render_values::@1 form_render_values::@1: scope:[form_render_values] from form_render_values form_render_values::@3 - (byte) form_fields_cnt#6 ← phi( form_render_values/(byte) form_fields_cnt#21 form_render_values::@3/(byte) form_fields_cnt#2 ) (byte) form_render_values::idx#2 ← phi( form_render_values/(byte) form_render_values::idx#0 form_render_values::@3/(byte) form_render_values::idx#1 ) (byte) form_field_ptr::field_idx#0 ← (byte) form_render_values::idx#2 call form_field_ptr (byte*) form_field_ptr::return#2 ← (byte*) form_field_ptr::return#1 to:form_render_values::@3 form_render_values::@3: scope:[form_render_values] from form_render_values::@1 - (byte) form_fields_cnt#2 ← phi( form_render_values::@1/(byte) form_fields_cnt#6 ) (byte) form_render_values::idx#3 ← phi( form_render_values::@1/(byte) form_render_values::idx#2 ) (byte*) form_field_ptr::return#5 ← phi( form_render_values::@1/(byte*) form_field_ptr::return#2 ) (byte*~) form_render_values::$0 ← (byte*) form_field_ptr::return#5 (byte*) form_render_values::field#0 ← (byte*~) form_render_values::$0 *((byte*) form_render_values::field#0) ← *((byte[]) print_hextab#0 + *((byte[]) form_fields_val#0 + (byte) form_render_values::idx#3)) (byte) form_render_values::idx#1 ← ++ (byte) form_render_values::idx#3 - (bool~) form_render_values::$1 ← (byte) form_render_values::idx#1 < (byte) form_fields_cnt#2 + (bool~) form_render_values::$1 ← (byte) form_render_values::idx#1 < (byte) form_fields_cnt#0 if((bool~) form_render_values::$1) goto form_render_values::@1 to:form_render_values::@return form_render_values::@return: scope:[form_render_values] from form_render_values::@3 return to:@return form_control: scope:[form_control] from form_mode::@7 - (byte) form_fields_cnt#53 ← phi( form_mode::@7/(byte) form_fields_cnt#48 ) (byte) keyboard_modifiers#105 ← phi( form_mode::@7/(byte) keyboard_modifiers#44 ) (byte) keyboard_events_size#117 ← phi( form_mode::@7/(byte) keyboard_events_size#46 ) (signed byte) form_cursor_count#22 ← phi( form_mode::@7/(signed byte) form_cursor_count#20 ) @@ -3543,7 +3483,6 @@ form_control: scope:[form_control] from form_mode::@7 (byte*) form_field_ptr::return#3 ← (byte*) form_field_ptr::return#1 to:form_control::@33 form_control::@33: scope:[form_control] from form_control - (byte) form_fields_cnt#50 ← phi( form_control/(byte) form_fields_cnt#53 ) (byte) form_field_idx#67 ← phi( form_control/(byte) form_field_idx#15 ) (byte) keyboard_modifiers#100 ← phi( form_control/(byte) keyboard_modifiers#105 ) (byte) keyboard_events_size#107 ← phi( form_control/(byte) keyboard_events_size#117 ) @@ -3557,7 +3496,6 @@ form_control::@33: scope:[form_control] from form_control if((bool~) form_control::$2) goto form_control::@1 to:form_control::@15 form_control::@1: scope:[form_control] from form_control::@15 form_control::@33 - (byte) form_fields_cnt#46 ← phi( form_control::@15/(byte) form_fields_cnt#49 form_control::@33/(byte) form_fields_cnt#50 ) (byte) form_field_idx#64 ← phi( form_control::@15/(byte) form_field_idx#66 form_control::@33/(byte) form_field_idx#67 ) (byte) keyboard_modifiers#89 ← phi( form_control::@15/(byte) keyboard_modifiers#99 form_control::@33/(byte) keyboard_modifiers#100 ) (byte) keyboard_events_size#92 ← phi( form_control::@15/(byte) keyboard_events_size#106 form_control::@33/(byte) keyboard_events_size#107 ) @@ -3568,7 +3506,6 @@ form_control::@1: scope:[form_control] from form_control::@15 form_control::@33 if((bool~) form_control::$4) goto form_control::@2 to:form_control::@16 form_control::@15: scope:[form_control] from form_control::@33 - (byte) form_fields_cnt#49 ← phi( form_control::@33/(byte) form_fields_cnt#50 ) (byte) form_field_idx#66 ← phi( form_control::@33/(byte) form_field_idx#67 ) (byte) keyboard_modifiers#99 ← phi( form_control::@33/(byte) keyboard_modifiers#100 ) (byte) keyboard_events_size#106 ← phi( form_control::@33/(byte) keyboard_events_size#107 ) @@ -3577,7 +3514,6 @@ form_control::@15: scope:[form_control] from form_control::@33 to:form_control::@1 form_control::@2: scope:[form_control] from form_control::@1 (signed byte) form_cursor_count#59 ← phi( form_control::@1/(signed byte) form_cursor_count#15 ) - (byte) form_fields_cnt#43 ← phi( form_control::@1/(byte) form_fields_cnt#46 ) (byte) form_field_idx#62 ← phi( form_control::@1/(byte) form_field_idx#64 ) (byte) keyboard_modifiers#67 ← phi( form_control::@1/(byte) keyboard_modifiers#89 ) (byte) keyboard_events_size#67 ← phi( form_control::@1/(byte) keyboard_events_size#92 ) @@ -3587,7 +3523,6 @@ form_control::@2: scope:[form_control] from form_control::@1 to:form_control::@3 form_control::@16: scope:[form_control] from form_control::@1 (signed byte) form_cursor_count#58 ← phi( form_control::@1/(signed byte) form_cursor_count#15 ) - (byte) form_fields_cnt#42 ← phi( form_control::@1/(byte) form_fields_cnt#46 ) (byte) form_field_idx#61 ← phi( form_control::@1/(byte) form_field_idx#64 ) (byte) keyboard_modifiers#66 ← phi( form_control::@1/(byte) keyboard_modifiers#89 ) (byte) keyboard_events_size#66 ← phi( form_control::@1/(byte) keyboard_events_size#92 ) @@ -3597,7 +3532,6 @@ form_control::@16: scope:[form_control] from form_control::@1 to:form_control::@3 form_control::@3: scope:[form_control] from form_control::@16 form_control::@2 (signed byte) form_cursor_count#56 ← phi( form_control::@16/(signed byte) form_cursor_count#58 form_control::@2/(signed byte) form_cursor_count#59 ) - (byte) form_fields_cnt#39 ← phi( form_control::@16/(byte) form_fields_cnt#42 form_control::@2/(byte) form_fields_cnt#43 ) (byte) form_field_idx#58 ← phi( form_control::@16/(byte) form_field_idx#61 form_control::@2/(byte) form_field_idx#62 ) (byte*) form_control::field#15 ← phi( form_control::@16/(byte*) form_control::field#2 form_control::@2/(byte*) form_control::field#1 ) (byte) keyboard_modifiers#46 ← phi( form_control::@16/(byte) keyboard_modifiers#66 form_control::@2/(byte) keyboard_modifiers#67 ) @@ -3606,7 +3540,6 @@ form_control::@3: scope:[form_control] from form_control::@16 form_control::@2 to:form_control::@34 form_control::@34: scope:[form_control] from form_control::@3 (signed byte) form_cursor_count#54 ← phi( form_control::@3/(signed byte) form_cursor_count#56 ) - (byte) form_fields_cnt#36 ← phi( form_control::@3/(byte) form_fields_cnt#39 ) (byte) form_field_idx#54 ← phi( form_control::@3/(byte) form_field_idx#58 ) (byte*) form_control::field#12 ← phi( form_control::@3/(byte*) form_control::field#15 ) (byte) keyboard_modifiers#29 ← phi( form_control::@3/(byte) keyboard_modifiers#6 ) @@ -3618,7 +3551,6 @@ form_control::@34: scope:[form_control] from form_control::@3 to:form_control::@35 form_control::@35: scope:[form_control] from form_control::@34 (signed byte) form_cursor_count#50 ← phi( form_control::@34/(signed byte) form_cursor_count#54 ) - (byte) form_fields_cnt#22 ← phi( form_control::@34/(byte) form_fields_cnt#36 ) (byte) form_field_idx#43 ← phi( form_control::@34/(byte) form_field_idx#54 ) (byte) keyboard_modifiers#47 ← phi( form_control::@34/(byte) keyboard_modifiers#14 ) (byte*) form_control::field#6 ← phi( form_control::@34/(byte*) form_control::field#12 ) @@ -3644,7 +3576,6 @@ form_control::@4: scope:[form_control] from form_control::@35 to:form_control::@24 form_control::@18: scope:[form_control] from form_control::@35 (byte) keyboard_events_size#108 ← phi( form_control::@35/(byte) keyboard_events_size#15 ) - (byte) form_fields_cnt#7 ← phi( form_control::@35/(byte) form_fields_cnt#22 ) (byte) form_field_idx#29 ← phi( form_control::@35/(byte) form_field_idx#43 ) (byte) keyboard_modifiers#30 ← phi( form_control::@35/(byte) keyboard_modifiers#47 ) (byte*) form_control::field#3 ← phi( form_control::@35/(byte*) form_control::field#6 ) @@ -3657,17 +3588,15 @@ form_control::@18: scope:[form_control] from form_control::@35 form_control::@5: scope:[form_control] from form_control::@18 (byte) keyboard_modifiers#91 ← phi( form_control::@18/(byte) keyboard_modifiers#30 ) (byte) keyboard_events_size#94 ← phi( form_control::@18/(byte) keyboard_events_size#108 ) - (byte) form_fields_cnt#3 ← phi( form_control::@18/(byte) form_fields_cnt#7 ) (byte) form_field_idx#16 ← phi( form_control::@18/(byte) form_field_idx#29 ) (byte) form_field_idx#5 ← ++ (byte) form_field_idx#16 - (bool~) form_control::$17 ← (byte) form_field_idx#5 == (byte) form_fields_cnt#3 + (bool~) form_control::$17 ← (byte) form_field_idx#5 == (byte) form_fields_cnt#0 (bool~) form_control::$18 ← ! (bool~) form_control::$17 if((bool~) form_control::$18) goto form_control::@8 to:form_control::@22 form_control::@19: scope:[form_control] from form_control::@18 (byte) keyboard_modifiers#90 ← phi( form_control::@18/(byte) keyboard_modifiers#30 ) (byte) keyboard_events_size#93 ← phi( form_control::@18/(byte) keyboard_events_size#108 ) - (byte) form_fields_cnt#8 ← phi( form_control::@18/(byte) form_fields_cnt#7 ) (byte) form_field_idx#17 ← phi( form_control::@18/(byte) form_field_idx#29 ) (byte) form_field_idx#6 ← -- (byte) form_field_idx#17 (bool~) form_control::$14 ← (byte) form_field_idx#6 == (byte/word/signed word/dword/signed dword) $ff @@ -3682,8 +3611,7 @@ form_control::@6: scope:[form_control] from form_control::@19 form_control::@20: scope:[form_control] from form_control::@19 (byte) keyboard_modifiers#68 ← phi( form_control::@19/(byte) keyboard_modifiers#90 ) (byte) keyboard_events_size#68 ← phi( form_control::@19/(byte) keyboard_events_size#93 ) - (byte) form_fields_cnt#4 ← phi( form_control::@19/(byte) form_fields_cnt#8 ) - (byte/signed word/word/dword/signed dword~) form_control::$16 ← (byte) form_fields_cnt#4 - (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte/signed word/word/dword/signed dword~) form_control::$16 ← (byte) form_fields_cnt#0 - (byte/signed byte/word/signed word/dword/signed dword) 1 (byte) form_field_idx#7 ← (byte/signed word/word/dword/signed dword~) form_control::$16 to:form_control::@7 form_control::@7: scope:[form_control] from form_control::@20 form_control::@22 form_control::@6 form_control::@8 @@ -3813,7 +3741,6 @@ form_control::@30: scope:[form_control] from form_control::@9 (byte) form_control::return#5 ← (byte/word/signed word/dword/signed dword) $ff to:form_control::@return @68: scope:[] from @64 - (byte) form_fields_cnt#73 ← phi( @64/(byte) form_fields_cnt#74 ) (byte) form_field_idx#36 ← phi( @64/(byte) form_field_idx#4 ) (byte) keyboard_modifiers#53 ← phi( @64/(byte) keyboard_modifiers#77 ) (byte) keyboard_events_size#53 ← phi( @64/(byte) keyboard_events_size#77 ) @@ -5373,81 +5300,6 @@ SYMBOL TABLE SSA (byte) form_field_ptr::y#0 (byte) form_fields_cnt (byte) form_fields_cnt#0 -(byte) form_fields_cnt#1 -(byte) form_fields_cnt#10 -(byte) form_fields_cnt#11 -(byte) form_fields_cnt#12 -(byte) form_fields_cnt#13 -(byte) form_fields_cnt#14 -(byte) form_fields_cnt#15 -(byte) form_fields_cnt#16 -(byte) form_fields_cnt#17 -(byte) form_fields_cnt#18 -(byte) form_fields_cnt#19 -(byte) form_fields_cnt#2 -(byte) form_fields_cnt#20 -(byte) form_fields_cnt#21 -(byte) form_fields_cnt#22 -(byte) form_fields_cnt#23 -(byte) form_fields_cnt#24 -(byte) form_fields_cnt#25 -(byte) form_fields_cnt#26 -(byte) form_fields_cnt#27 -(byte) form_fields_cnt#28 -(byte) form_fields_cnt#29 -(byte) form_fields_cnt#3 -(byte) form_fields_cnt#30 -(byte) form_fields_cnt#31 -(byte) form_fields_cnt#32 -(byte) form_fields_cnt#33 -(byte) form_fields_cnt#34 -(byte) form_fields_cnt#35 -(byte) form_fields_cnt#36 -(byte) form_fields_cnt#37 -(byte) form_fields_cnt#38 -(byte) form_fields_cnt#39 -(byte) form_fields_cnt#4 -(byte) form_fields_cnt#40 -(byte) form_fields_cnt#41 -(byte) form_fields_cnt#42 -(byte) form_fields_cnt#43 -(byte) form_fields_cnt#44 -(byte) form_fields_cnt#45 -(byte) form_fields_cnt#46 -(byte) form_fields_cnt#47 -(byte) form_fields_cnt#48 -(byte) form_fields_cnt#49 -(byte) form_fields_cnt#5 -(byte) form_fields_cnt#50 -(byte) form_fields_cnt#51 -(byte) form_fields_cnt#52 -(byte) form_fields_cnt#53 -(byte) form_fields_cnt#54 -(byte) form_fields_cnt#55 -(byte) form_fields_cnt#56 -(byte) form_fields_cnt#57 -(byte) form_fields_cnt#58 -(byte) form_fields_cnt#59 -(byte) form_fields_cnt#6 -(byte) form_fields_cnt#60 -(byte) form_fields_cnt#61 -(byte) form_fields_cnt#62 -(byte) form_fields_cnt#63 -(byte) form_fields_cnt#64 -(byte) form_fields_cnt#65 -(byte) form_fields_cnt#66 -(byte) form_fields_cnt#67 -(byte) form_fields_cnt#68 -(byte) form_fields_cnt#69 -(byte) form_fields_cnt#7 -(byte) form_fields_cnt#70 -(byte) form_fields_cnt#71 -(byte) form_fields_cnt#72 -(byte) form_fields_cnt#73 -(byte) form_fields_cnt#74 -(byte) form_fields_cnt#75 -(byte) form_fields_cnt#8 -(byte) form_fields_cnt#9 (byte[]) form_fields_max (byte[]) form_fields_max#0 (byte[]) form_fields_val @@ -6290,8 +6142,6 @@ SYMBOL TABLE SSA (byte) gfx_init_vic_bitmap::l#3 (byte) gfx_init_vic_bitmap::lines_cnt (byte) gfx_init_vic_bitmap::lines_cnt#0 -(byte) gfx_init_vic_bitmap::lines_cnt#1 -(byte) gfx_init_vic_bitmap::lines_cnt#2 (byte[]) gfx_init_vic_bitmap::lines_x (byte[]) gfx_init_vic_bitmap::lines_x#0 (byte[]) gfx_init_vic_bitmap::lines_y @@ -7419,28 +7269,28 @@ Inversing boolean not [717] (bool~) bitmap_line_ydxd::$4 ← (byte) bitmap_line_ Inversing boolean not [845] (bool~) get_plane::$14 ← (byte) get_plane::idx#15 != (byte/signed byte/word/signed word/dword/signed dword) $d from [844] (bool~) get_plane::$13 ← (byte) get_plane::idx#15 == (byte/signed byte/word/signed word/dword/signed dword) $d Inversing boolean not [872] (bool~) get_vic_screen::$5 ← (byte) get_vic_screen::idx#6 != (byte/signed byte/word/signed word/dword/signed dword) 4 from [871] (bool~) get_vic_screen::$4 ← (byte) get_vic_screen::idx#6 == (byte/signed byte/word/signed word/dword/signed dword) 4 Inversing boolean not [885] (bool~) get_vic_charset::$2 ← (byte) get_vic_charset::idx#2 != (byte/signed byte/word/signed word/dword/signed dword) 1 from [884] (bool~) get_vic_charset::$1 ← (byte) get_vic_charset::idx#2 == (byte/signed byte/word/signed word/dword/signed dword) 1 -Inversing boolean not [1140] (bool~) gfx_mode::$1 ← *((byte*) form_ctrl_line#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1139] (bool~) gfx_mode::$0 ← *((byte*) form_ctrl_line#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [1144] (bool~) gfx_mode::$4 ← *((byte*) form_ctrl_borof#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1143] (bool~) gfx_mode::$3 ← *((byte*) form_ctrl_borof#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [1151] (bool~) gfx_mode::$7 ← *((byte*) form_ctrl_hicol#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1150] (bool~) gfx_mode::$6 ← *((byte*) form_ctrl_hicol#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [1158] (bool~) gfx_mode::$10 ← *((byte*) form_ctrl_overs#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1157] (bool~) gfx_mode::$9 ← *((byte*) form_ctrl_overs#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [1165] (bool~) gfx_mode::$13 ← *((byte*) form_ctrl_colof#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1164] (bool~) gfx_mode::$12 ← *((byte*) form_ctrl_colof#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [1172] (bool~) gfx_mode::$16 ← *((byte*) form_ctrl_chunk#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1171] (bool~) gfx_mode::$15 ← *((byte*) form_ctrl_chunk#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [1183] (bool~) gfx_mode::$21 ← *((byte*) form_ctrl_ecm#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1182] (bool~) gfx_mode::$20 ← *((byte*) form_ctrl_ecm#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [1190] (bool~) gfx_mode::$24 ← *((byte*) form_ctrl_bmm#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1189] (bool~) gfx_mode::$23 ← *((byte*) form_ctrl_bmm#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [1199] (bool~) gfx_mode::$27 ← *((byte*) form_ctrl_mcm#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1198] (bool~) gfx_mode::$26 ← *((byte*) form_ctrl_mcm#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [1357] (bool~) gfx_mode::$90 ← (byte) gfx_mode::keyboard_event#0 != (byte) KEY_SPACE#0 from [1356] (bool~) gfx_mode::$89 ← (byte) gfx_mode::keyboard_event#0 == (byte) KEY_SPACE#0 -Inversing boolean not [1524] (bool~) gfx_init_plane_8bppchunky::$4 ← (byte*) gfx_init_plane_8bppchunky::gfxb#3 != (word/dword/signed dword) $8000 from [1523] (bool~) gfx_init_plane_8bppchunky::$3 ← (byte*) gfx_init_plane_8bppchunky::gfxb#3 == (word/dword/signed dword) $8000 -Inversing boolean not [1670] (bool~) gfx_init_plane_charset8::$7 ← (byte~) gfx_init_plane_charset8::$5 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1669] (bool~) gfx_init_plane_charset8::$6 ← (byte~) gfx_init_plane_charset8::$5 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [1843] (bool~) form_mode::$38 ← (byte~) form_mode::$36 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1842] (bool~) form_mode::$37 ← (byte~) form_mode::$36 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [1847] (bool~) form_mode::$40 ← (byte) form_mode::preset_current#2 == *((byte*) form_preset#0) from [1846] (bool~) form_mode::$39 ← (byte) form_mode::preset_current#2 != *((byte*) form_preset#0) -Inversing boolean not [1924] (bool~) form_control::$2 ← (signed byte) form_cursor_count#5 >= (byte/signed byte/word/signed word/dword/signed dword) 0 from [1923] (bool~) form_control::$1 ← (signed byte) form_cursor_count#5 < (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [1950] (bool~) form_control::$10 ← (byte) form_control::key_event#0 != (byte) KEY_CRSR_DOWN#0 from [1949] (bool~) form_control::$9 ← (byte) form_control::key_event#0 == (byte) KEY_CRSR_DOWN#0 -Inversing boolean not [1954] (bool~) form_control::$21 ← (byte) form_control::key_event#1 != (byte) KEY_CRSR_RIGHT#0 from [1953] (bool~) form_control::$20 ← (byte) form_control::key_event#1 == (byte) KEY_CRSR_RIGHT#0 -Inversing boolean not [1965] (bool~) form_control::$18 ← (byte) form_field_idx#5 != (byte) form_fields_cnt#3 from [1964] (bool~) form_control::$17 ← (byte) form_field_idx#5 == (byte) form_fields_cnt#3 -Inversing boolean not [1970] (bool~) form_control::$15 ← (byte) form_field_idx#6 != (byte/word/signed word/dword/signed dword) $ff from [1969] (bool~) form_control::$14 ← (byte) form_field_idx#6 == (byte/word/signed word/dword/signed dword) $ff -Inversing boolean not [1992] (bool~) form_control::$29 ← (byte) form_control::key_event#2 != (byte) KEY_SPACE#0 from [1991] (bool~) form_control::$28 ← (byte) form_control::key_event#2 == (byte) KEY_SPACE#0 -Inversing boolean not [2001] (bool~) form_control::$27 ← *((byte[]) form_fields_val#0 + (byte) form_field_idx#19) <= *((byte[]) form_fields_max#0 + (byte) form_field_idx#19) from [2000] (bool~) form_control::$26 ← *((byte[]) form_fields_val#0 + (byte) form_field_idx#19) > *((byte[]) form_fields_max#0 + (byte) form_field_idx#19) -Inversing boolean not [2006] (bool~) form_control::$25 ← *((byte[]) form_fields_val#0 + (byte) form_field_idx#20) != (byte/word/signed word/dword/signed dword) $ff from [2005] (bool~) form_control::$24 ← *((byte[]) form_fields_val#0 + (byte) form_field_idx#20) == (byte/word/signed word/dword/signed dword) $ff +Inversing boolean not [1128] (bool~) gfx_mode::$1 ← *((byte*) form_ctrl_line#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1127] (bool~) gfx_mode::$0 ← *((byte*) form_ctrl_line#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [1132] (bool~) gfx_mode::$4 ← *((byte*) form_ctrl_borof#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1131] (bool~) gfx_mode::$3 ← *((byte*) form_ctrl_borof#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [1139] (bool~) gfx_mode::$7 ← *((byte*) form_ctrl_hicol#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1138] (bool~) gfx_mode::$6 ← *((byte*) form_ctrl_hicol#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [1146] (bool~) gfx_mode::$10 ← *((byte*) form_ctrl_overs#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1145] (bool~) gfx_mode::$9 ← *((byte*) form_ctrl_overs#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [1153] (bool~) gfx_mode::$13 ← *((byte*) form_ctrl_colof#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1152] (bool~) gfx_mode::$12 ← *((byte*) form_ctrl_colof#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [1160] (bool~) gfx_mode::$16 ← *((byte*) form_ctrl_chunk#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1159] (bool~) gfx_mode::$15 ← *((byte*) form_ctrl_chunk#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [1171] (bool~) gfx_mode::$21 ← *((byte*) form_ctrl_ecm#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1170] (bool~) gfx_mode::$20 ← *((byte*) form_ctrl_ecm#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [1178] (bool~) gfx_mode::$24 ← *((byte*) form_ctrl_bmm#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1177] (bool~) gfx_mode::$23 ← *((byte*) form_ctrl_bmm#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [1187] (bool~) gfx_mode::$27 ← *((byte*) form_ctrl_mcm#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1186] (bool~) gfx_mode::$26 ← *((byte*) form_ctrl_mcm#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [1345] (bool~) gfx_mode::$90 ← (byte) gfx_mode::keyboard_event#0 != (byte) KEY_SPACE#0 from [1344] (bool~) gfx_mode::$89 ← (byte) gfx_mode::keyboard_event#0 == (byte) KEY_SPACE#0 +Inversing boolean not [1512] (bool~) gfx_init_plane_8bppchunky::$4 ← (byte*) gfx_init_plane_8bppchunky::gfxb#3 != (word/dword/signed dword) $8000 from [1511] (bool~) gfx_init_plane_8bppchunky::$3 ← (byte*) gfx_init_plane_8bppchunky::gfxb#3 == (word/dword/signed dword) $8000 +Inversing boolean not [1658] (bool~) gfx_init_plane_charset8::$7 ← (byte~) gfx_init_plane_charset8::$5 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1657] (bool~) gfx_init_plane_charset8::$6 ← (byte~) gfx_init_plane_charset8::$5 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [1831] (bool~) form_mode::$38 ← (byte~) form_mode::$36 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [1830] (bool~) form_mode::$37 ← (byte~) form_mode::$36 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [1835] (bool~) form_mode::$40 ← (byte) form_mode::preset_current#2 == *((byte*) form_preset#0) from [1834] (bool~) form_mode::$39 ← (byte) form_mode::preset_current#2 != *((byte*) form_preset#0) +Inversing boolean not [1911] (bool~) form_control::$2 ← (signed byte) form_cursor_count#5 >= (byte/signed byte/word/signed word/dword/signed dword) 0 from [1910] (bool~) form_control::$1 ← (signed byte) form_cursor_count#5 < (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [1937] (bool~) form_control::$10 ← (byte) form_control::key_event#0 != (byte) KEY_CRSR_DOWN#0 from [1936] (bool~) form_control::$9 ← (byte) form_control::key_event#0 == (byte) KEY_CRSR_DOWN#0 +Inversing boolean not [1941] (bool~) form_control::$21 ← (byte) form_control::key_event#1 != (byte) KEY_CRSR_RIGHT#0 from [1940] (bool~) form_control::$20 ← (byte) form_control::key_event#1 == (byte) KEY_CRSR_RIGHT#0 +Inversing boolean not [1952] (bool~) form_control::$18 ← (byte) form_field_idx#5 != (byte) form_fields_cnt#0 from [1951] (bool~) form_control::$17 ← (byte) form_field_idx#5 == (byte) form_fields_cnt#0 +Inversing boolean not [1957] (bool~) form_control::$15 ← (byte) form_field_idx#6 != (byte/word/signed word/dword/signed dword) $ff from [1956] (bool~) form_control::$14 ← (byte) form_field_idx#6 == (byte/word/signed word/dword/signed dword) $ff +Inversing boolean not [1979] (bool~) form_control::$29 ← (byte) form_control::key_event#2 != (byte) KEY_SPACE#0 from [1978] (bool~) form_control::$28 ← (byte) form_control::key_event#2 == (byte) KEY_SPACE#0 +Inversing boolean not [1988] (bool~) form_control::$27 ← *((byte[]) form_fields_val#0 + (byte) form_field_idx#19) <= *((byte[]) form_fields_max#0 + (byte) form_field_idx#19) from [1987] (bool~) form_control::$26 ← *((byte[]) form_fields_val#0 + (byte) form_field_idx#19) > *((byte[]) form_fields_max#0 + (byte) form_field_idx#19) +Inversing boolean not [1993] (bool~) form_control::$25 ← *((byte[]) form_fields_val#0 + (byte) form_field_idx#20) != (byte/word/signed word/dword/signed dword) $ff from [1992] (bool~) form_control::$24 ← *((byte[]) form_fields_val#0 + (byte) form_field_idx#20) == (byte/word/signed word/dword/signed dword) $ff Successful SSA optimization Pass2UnaryNotSimplification Alias (byte*) print_screen#0 = (byte*) print_line_cursor#0 (byte*) print_char_cursor#0 (byte*) print_screen#55 (byte*) print_line_cursor#76 (byte*) print_char_cursor#76 (byte*) print_screen#53 (byte*) print_line_cursor#75 (byte*) print_char_cursor#75 (byte*) print_screen#51 (byte*) print_line_cursor#74 (byte*) print_char_cursor#74 (byte*) print_screen#49 (byte*) print_line_cursor#72 (byte*) print_char_cursor#72 (byte*) print_screen#46 (byte*) print_line_cursor#69 (byte*) print_char_cursor#69 (byte*) print_screen#41 (byte*) print_line_cursor#64 (byte*) print_char_cursor#64 (byte*) print_screen#39 (byte*) print_line_cursor#61 (byte*) print_char_cursor#62 (byte*) print_screen#33 (byte*) print_line_cursor#53 (byte*) print_char_cursor#56 (byte*) print_screen#25 (byte*) print_line_cursor#44 (byte*) print_char_cursor#46 Alias (byte*) print_str_lines::str#3 = (byte*) print_str_lines::str#7 @@ -7568,7 +7418,6 @@ Alias (signed byte) form_cursor_count#28 = (signed byte) form_cursor_count#38 (s Alias (byte) keyboard_events_size#101 = (byte) keyboard_events_size#81 (byte) keyboard_events_size#57 Alias (byte) keyboard_modifiers#57 = (byte) keyboard_modifiers#78 (byte) keyboard_modifiers#94 Alias (byte) form_field_idx#38 = (byte) form_field_idx#48 (byte) form_field_idx#55 -Alias (byte) form_fields_cnt#67 = (byte) form_fields_cnt#69 (byte) form_fields_cnt#72 Alias (byte*) print_screen#14 = (byte*) print_screen#19 (byte*) print_screen#20 (byte*) print_screen#4 Alias (byte*) print_line_cursor#10 = (byte*) print_line_cursor#39 (byte*) print_line_cursor#40 (byte*) print_line_cursor#27 Alias (byte*) print_char_cursor#11 = (byte*) print_char_cursor#41 (byte*) print_char_cursor#42 (byte*) print_char_cursor#28 @@ -7576,7 +7425,6 @@ Alias (signed byte) form_cursor_count#1 = (signed byte) form_cursor_count#18 (si Alias (byte) keyboard_events_size#27 = (byte) keyboard_events_size#42 (byte) keyboard_events_size#43 (byte) keyboard_events_size#8 Alias (byte) keyboard_modifiers#24 = (byte) keyboard_modifiers#39 (byte) keyboard_modifiers#40 (byte) keyboard_modifiers#9 Alias (byte) form_field_idx#1 = (byte) form_field_idx#25 (byte) form_field_idx#26 (byte) form_field_idx#12 -Alias (byte) form_fields_cnt#59 = (byte) form_fields_cnt#63 (byte) form_fields_cnt#70 (byte) form_fields_cnt#66 Alias (byte*) print_screen#13 = (byte*) print_screen#3 (byte*) print_screen#26 Alias (byte*) print_line_cursor#26 = (byte*) print_line_cursor#9 (byte*) print_line_cursor#47 Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#27 (byte*) print_char_cursor#50 @@ -7609,11 +7457,9 @@ Alias (byte) get_vic_charset::idx#1 = (byte) get_vic_charset::idx#2 Alias (byte*) get_vic_charset::return#2 = (byte*) get_vic_charset::return#5 Alias (byte[]) FORM_TEXT#0 = (string~) $15 Alias (byte[]) FORM_COLS#0 = (string~) $31 -Alias (byte) form_fields_cnt#10 = (byte) form_fields_cnt#9 (byte) form_fields_cnt#23 (byte) form_fields_cnt#24 (byte) form_fields_cnt#12 (byte) form_fields_cnt#25 (byte) form_fields_cnt#13 (byte) form_fields_cnt#26 (byte) form_fields_cnt#15 (byte) form_fields_cnt#27 (byte) form_fields_cnt#16 (byte) form_fields_cnt#28 (byte) form_fields_cnt#17 (byte) form_fields_cnt#29 (byte) form_fields_cnt#18 (byte) form_fields_cnt#30 (byte) form_fields_cnt#19 (byte) form_fields_cnt#31 (byte) form_fields_cnt#20 (byte) form_fields_cnt#32 (byte) form_fields_cnt#33 (byte) form_fields_cnt#11 (byte) form_fields_cnt#14 Alias (byte) apply_preset::idx#1 = (byte) apply_preset::idx#2 (byte) apply_preset::idx#3 (byte) apply_preset::idx#4 (byte) apply_preset::idx#5 (byte) apply_preset::idx#6 (byte) apply_preset::idx#7 (byte) apply_preset::idx#8 (byte) apply_preset::idx#9 (byte) apply_preset::idx#10 (byte) apply_preset::idx#11 Alias (byte) render_preset_name::idx#10 = (byte) render_preset_name::idx#3 (byte) render_preset_name::idx#2 (byte) render_preset_name::idx#4 (byte) render_preset_name::idx#5 (byte) render_preset_name::idx#6 (byte) render_preset_name::idx#7 (byte) render_preset_name::idx#8 (byte) render_preset_name::idx#9 (byte) render_preset_name::idx#11 (byte) render_preset_name::idx#12 Alias (byte*) print_str_at::at#1 = (byte*~) render_preset_name::$13 -Alias (byte) form_fields_cnt#0 = (byte) form_fields_cnt#75 (byte) form_fields_cnt#74 (byte) form_fields_cnt#73 Alias (byte*) form_preset#0 = (byte*~) $32 Alias (byte*) form_ctrl_bmm#0 = (byte*~) $33 Alias (byte*) form_ctrl_mcm#0 = (byte*~) $34 @@ -7730,7 +7576,6 @@ Alias (byte*) gfx_init_screen3::ch#1 = (byte*) gfx_init_screen3::ch#4 Alias (byte) gfx_init_screen4::cy#2 = (byte) gfx_init_screen4::cy#3 Alias (byte*) gfx_init_screen4::ch#1 = (byte*) gfx_init_screen4::ch#4 Alias (byte) gfx_init_vic_bitmap::l#2 = (byte) gfx_init_vic_bitmap::l#3 -Alias (byte) gfx_init_vic_bitmap::lines_cnt#1 = (byte) gfx_init_vic_bitmap::lines_cnt#2 Alias (byte) gfx_init_plane_8bppchunky::gfxbCpuBank#0 = (byte~) gfx_init_plane_8bppchunky::$1 (byte) gfx_init_plane_8bppchunky::gfxbCpuBank#3 Alias (byte) gfx_init_plane_8bppchunky::c#0 = (byte~) gfx_init_plane_8bppchunky::$7 Alias (byte) gfx_init_plane_8bppchunky::gfxbCpuBank#4 = (byte) gfx_init_plane_8bppchunky::gfxbCpuBank#6 (byte) gfx_init_plane_8bppchunky::gfxbCpuBank#5 @@ -7778,7 +7623,6 @@ Alias (byte) gfx_init_plane_fill::by#2 = (byte) gfx_init_plane_fill::by#3 Alias (byte) gfx_init_plane_fill::fill#3 = (byte) gfx_init_plane_fill::fill#5 Alias (byte*) gfx_init_plane_fill::gfxb#1 = (byte*) gfx_init_plane_fill::gfxb#4 Alias (byte) dtvSetCpuBankSegment1::cpuBankIdx#12 = (byte~) gfx_init_plane_fill::$10 -Alias (byte) form_fields_cnt#34 = (byte) form_fields_cnt#54 (byte) form_fields_cnt#57 (byte) form_fields_cnt#51 (byte) form_fields_cnt#47 (byte) form_fields_cnt#44 (byte) form_fields_cnt#40 (byte) form_fields_cnt#38 (byte) form_fields_cnt#71 (byte) form_fields_cnt#68 Alias (signed byte) form_cursor_count#48 = (signed byte) form_cursor_count#64 (signed byte) form_cursor_count#65 (signed byte) form_cursor_count#63 (signed byte) form_cursor_count#62 (signed byte) form_cursor_count#61 (signed byte) form_cursor_count#60 (signed byte) form_cursor_count#57 (signed byte) form_cursor_count#55 (signed byte) form_cursor_count#52 Alias (byte) keyboard_events_size#104 = (byte) keyboard_events_size#140 (byte) keyboard_events_size#142 (byte) keyboard_events_size#138 (byte) keyboard_events_size#136 (byte) keyboard_events_size#134 (byte) keyboard_events_size#131 (byte) keyboard_events_size#127 (byte) keyboard_events_size#124 (byte) keyboard_events_size#115 Alias (byte) keyboard_modifiers#103 = (byte) keyboard_modifiers#120 (byte) keyboard_modifiers#122 (byte) keyboard_modifiers#118 (byte) keyboard_modifiers#116 (byte) keyboard_modifiers#114 (byte) keyboard_modifiers#112 (byte) keyboard_modifiers#110 (byte) keyboard_modifiers#108 (byte) keyboard_modifiers#97 @@ -7804,7 +7648,6 @@ Alias (signed byte) form_cursor_count#29 = (signed byte) form_cursor_count#39 Alias (byte) keyboard_events_size#62 = (byte) keyboard_events_size#86 Alias (byte) keyboard_modifiers#62 = (byte) keyboard_modifiers#83 Alias (byte) form_field_idx#39 = (byte) form_field_idx#49 -Alias (byte) form_fields_cnt#60 = (byte) form_fields_cnt#64 Alias (signed byte) form_cursor_count#21 = (signed byte) form_cursor_count#40 Alias (byte) keyboard_events_size#47 = (byte) keyboard_events_size#87 Alias (byte) keyboard_modifiers#45 = (byte) keyboard_modifiers#84 @@ -7813,7 +7656,6 @@ Alias (byte) form_mode::preset_current#6 = (byte) form_mode::preset_current#8 Alias (byte*) print_screen#23 = (byte*) print_screen#43 Alias (byte*) print_line_cursor#42 = (byte*) print_line_cursor#66 Alias (byte*) print_char_cursor#44 = (byte*) print_char_cursor#66 -Alias (byte) form_fields_cnt#55 = (byte) form_fields_cnt#58 Alias (signed byte) form_cursor_count#20 = (signed byte) form_cursor_count#41 (signed byte) form_cursor_count#32 Alias (byte) keyboard_events_size#46 = (byte) keyboard_events_size#88 (byte) keyboard_events_size#65 Alias (byte) keyboard_modifiers#44 = (byte) keyboard_modifiers#85 (byte) keyboard_modifiers#65 @@ -7822,7 +7664,6 @@ Alias (byte) form_mode::preset_current#10 = (byte) form_mode::preset_current#7 ( Alias (byte*) print_screen#24 = (byte*) print_screen#44 (byte*) print_screen#36 (byte*) print_screen#32 (byte*) print_screen#37 (byte*) print_screen#31 (byte*) print_screen#48 (byte*) print_screen#45 (byte*) print_screen#38 (byte*) print_screen#30 Alias (byte*) print_line_cursor#43 = (byte*) print_line_cursor#67 (byte*) print_line_cursor#58 (byte*) print_line_cursor#52 (byte*) print_line_cursor#59 (byte*) print_line_cursor#51 (byte*) print_line_cursor#71 (byte*) print_line_cursor#68 (byte*) print_line_cursor#60 (byte*) print_line_cursor#50 Alias (byte*) print_char_cursor#45 = (byte*) print_char_cursor#67 (byte*) print_char_cursor#59 (byte*) print_char_cursor#55 (byte*) print_char_cursor#60 (byte*) print_char_cursor#54 (byte*) print_char_cursor#71 (byte*) print_char_cursor#68 (byte*) print_char_cursor#61 (byte*) print_char_cursor#53 -Alias (byte) form_fields_cnt#35 = (byte) form_fields_cnt#56 (byte) form_fields_cnt#52 (byte) form_fields_cnt#48 (byte) form_fields_cnt#45 (byte) form_fields_cnt#41 (byte) form_fields_cnt#62 (byte) form_fields_cnt#37 (byte) form_fields_cnt#65 (byte) form_fields_cnt#61 Alias (byte) form_control::return#0 = (byte) form_control::return#6 Alias (signed byte) form_cursor_count#12 = (signed byte) form_cursor_count#2 (signed byte) form_cursor_count#42 (signed byte) form_cursor_count#31 (signed byte) form_cursor_count#53 (signed byte) form_cursor_count#49 (signed byte) form_cursor_count#43 (signed byte) form_cursor_count#30 Alias (byte) keyboard_events_size#105 = (byte) keyboard_events_size#12 (byte) keyboard_events_size#31 (byte) keyboard_events_size#89 (byte) keyboard_events_size#64 (byte) keyboard_events_size#116 (byte) keyboard_events_size#90 (byte) keyboard_events_size#63 @@ -7843,24 +7684,20 @@ Alias (byte*) form_field_ptr::line#0 = (byte*~) form_field_ptr::$0 Alias (byte*) form_field_ptr::return#0 = (byte*) form_field_ptr::field#0 (byte*~) form_field_ptr::$1 (byte*) form_field_ptr::return#4 (byte*) form_field_ptr::return#1 Alias (byte*) form_field_ptr::return#2 = (byte*) form_field_ptr::return#5 Alias (byte) form_render_values::idx#2 = (byte) form_render_values::idx#3 -Alias (byte) form_fields_cnt#2 = (byte) form_fields_cnt#6 Alias (byte*) form_render_values::field#0 = (byte*~) form_render_values::$0 Alias (byte*) form_field_ptr::return#3 = (byte*) form_field_ptr::return#6 Alias (signed byte) form_cursor_count#14 = (signed byte) form_cursor_count#22 Alias (byte) keyboard_events_size#106 = (byte) keyboard_events_size#107 (byte) keyboard_events_size#117 Alias (byte) keyboard_modifiers#100 = (byte) keyboard_modifiers#105 (byte) keyboard_modifiers#99 Alias (byte) form_field_idx#15 = (byte) form_field_idx#67 (byte) form_field_idx#66 -Alias (byte) form_fields_cnt#49 = (byte) form_fields_cnt#50 (byte) form_fields_cnt#53 Alias (byte*) form_control::field#0 = (byte*~) form_control::$0 (byte*) form_control::field#11 Alias (byte*) form_control::field#1 = (byte*) form_control::field#5 (byte*) form_control::field#2 Alias (byte) keyboard_events_size#66 = (byte) keyboard_events_size#67 (byte) keyboard_events_size#92 Alias (byte) keyboard_modifiers#66 = (byte) keyboard_modifiers#67 (byte) keyboard_modifiers#89 Alias (byte) form_field_idx#61 = (byte) form_field_idx#62 (byte) form_field_idx#64 -Alias (byte) form_fields_cnt#42 = (byte) form_fields_cnt#43 (byte) form_fields_cnt#46 Alias (signed byte) form_cursor_count#15 = (signed byte) form_cursor_count#59 (signed byte) form_cursor_count#58 Alias (byte*) form_control::field#10 = (byte*) form_control::field#12 (byte*) form_control::field#15 (byte*) form_control::field#6 (byte*) form_control::field#17 (byte*) form_control::field#3 (byte*) form_control::field#16 (byte*) form_control::field#14 (byte*) form_control::field#13 (byte*) form_control::field#7 (byte*) form_control::field#9 (byte*) form_control::field#8 Alias (byte) form_field_idx#16 = (byte) form_field_idx#54 (byte) form_field_idx#58 (byte) form_field_idx#43 (byte) form_field_idx#46 (byte) form_field_idx#29 (byte) form_field_idx#17 (byte) form_field_idx#47 (byte) form_field_idx#33 (byte) form_field_idx#19 (byte) form_field_idx#20 (byte) form_field_idx#34 (byte) form_field_idx#21 (byte) form_field_idx#35 (byte) form_field_idx#23 (byte) form_field_idx#30 (byte) form_field_idx#31 -Alias (byte) form_fields_cnt#22 = (byte) form_fields_cnt#36 (byte) form_fields_cnt#39 (byte) form_fields_cnt#7 (byte) form_fields_cnt#3 (byte) form_fields_cnt#8 (byte) form_fields_cnt#4 Alias (signed byte) form_cursor_count#24 = (signed byte) form_cursor_count#54 (signed byte) form_cursor_count#56 (signed byte) form_cursor_count#50 (signed byte) form_cursor_count#44 (signed byte) form_cursor_count#37 (signed byte) form_cursor_count#51 (signed byte) form_cursor_count#46 (signed byte) form_cursor_count#45 (signed byte) form_cursor_count#33 (signed byte) form_cursor_count#35 (signed byte) form_cursor_count#34 (signed byte) form_cursor_count#36 (signed byte) form_cursor_count#25 Alias (byte) keyboard_events_size#14 = (byte) keyboard_events_size#33 Alias (byte) keyboard_modifiers#14 = (byte) keyboard_modifiers#29 (byte) keyboard_modifiers#47 (byte) keyboard_modifiers#52 (byte) keyboard_modifiers#30 (byte) keyboard_modifiers#91 (byte) keyboard_modifiers#90 (byte) keyboard_modifiers#70 (byte) keyboard_modifiers#68 (byte) keyboard_modifiers#71 (byte) keyboard_modifiers#69 (byte) keyboard_modifiers#76 (byte) keyboard_modifiers#32 (byte) keyboard_modifiers#93 (byte) keyboard_modifiers#92 (byte) keyboard_modifiers#72 (byte) keyboard_modifiers#74 (byte) keyboard_modifiers#73 (byte) keyboard_modifiers#75 (byte) keyboard_modifiers#49 (byte) keyboard_modifiers#50 @@ -7912,7 +7749,6 @@ Alias (byte) bitmap_line_ydxd::y1#2 = (byte) bitmap_line_ydxd::y1#3 Alias (byte) bitmap_line_ydxd::y#3 = (byte) bitmap_line_ydxd::y#6 Alias (byte) bitmap_line_ydxd::xd#3 = (byte) bitmap_line_ydxd::xd#5 Alias (byte) bitmap_line_ydxd::yd#2 = (byte) bitmap_line_ydxd::yd#6 -Alias (byte) form_fields_cnt#10 = (byte) form_fields_cnt#5 Alias (byte) keyboard_events_size#130 = (byte) keyboard_events_size#157 (byte) keyboard_events_size#159 (byte) keyboard_events_size#155 (byte) keyboard_events_size#153 (byte) keyboard_events_size#151 (byte) keyboard_events_size#149 (byte) keyboard_events_size#147 (byte) keyboard_events_size#145 (byte) keyboard_events_size#143 Alias (byte) keyboard_modifiers#111 = (byte) keyboard_modifiers#137 (byte) keyboard_modifiers#139 (byte) keyboard_modifiers#135 (byte) keyboard_modifiers#133 (byte) keyboard_modifiers#131 (byte) keyboard_modifiers#129 (byte) keyboard_modifiers#127 (byte) keyboard_modifiers#125 (byte) keyboard_modifiers#123 Alias (word) gfx_init_plane_8bppchunky::x#2 = (word) gfx_init_plane_8bppchunky::x#3 @@ -7930,7 +7766,6 @@ Alias (byte*) form_control::field#0 = (byte*) form_control::field#1 (byte*) form Alias (byte) keyboard_events_size#106 = (byte) keyboard_events_size#66 (byte) keyboard_events_size#48 Alias (byte) keyboard_modifiers#100 = (byte) keyboard_modifiers#66 (byte) keyboard_modifiers#46 Alias (byte) form_field_idx#15 = (byte) form_field_idx#61 (byte) form_field_idx#16 (byte) form_field_idx#22 -Alias (byte) form_fields_cnt#22 = (byte) form_fields_cnt#42 (byte) form_fields_cnt#49 Alias (signed byte) form_cursor_count#15 = (signed byte) form_cursor_count#24 (signed byte) form_cursor_count#23 Alias (byte) keyboard_events_size#108 = (byte) keyboard_events_size#52 (byte) keyboard_events_size#49 Alias (byte) keyboard_modifiers#14 = (byte) keyboard_modifiers#51 (byte) keyboard_modifiers#48 @@ -7957,9 +7792,7 @@ Self Phi Eliminated (byte) bitmap_line_ydxi::y1#2 Self Phi Eliminated (byte) bitmap_line_ydxd::xd#3 Self Phi Eliminated (byte) bitmap_line_ydxd::yd#2 Self Phi Eliminated (byte) bitmap_line_ydxd::y1#2 -Self Phi Eliminated (byte) form_fields_cnt#59 Self Phi Eliminated (byte*) apply_preset::preset#13 -Self Phi Eliminated (byte) form_fields_cnt#1 Self Phi Eliminated (byte) gfx_mode::cy#2 Self Phi Eliminated (byte) keyboard_events_size#103 Self Phi Eliminated (byte) keyboard_modifiers#102 @@ -7975,7 +7808,6 @@ Self Phi Eliminated (byte) gfx_init_screen1::cy#2 Self Phi Eliminated (byte) gfx_init_screen2::cy#2 Self Phi Eliminated (byte) gfx_init_screen3::cy#2 Self Phi Eliminated (byte) gfx_init_screen4::cy#2 -Self Phi Eliminated (byte) gfx_init_vic_bitmap::lines_cnt#1 Self Phi Eliminated (byte) gfx_init_plane_8bppchunky::y#2 Self Phi Eliminated (byte) gfx_init_plane_horisontal::ay#2 Self Phi Eliminated (byte) gfx_init_plane_horisontal2::ay#2 @@ -7992,7 +7824,6 @@ Self Phi Eliminated (signed byte) form_cursor_count#29 Self Phi Eliminated (byte) keyboard_events_size#62 Self Phi Eliminated (byte) keyboard_modifiers#62 Self Phi Eliminated (byte) form_field_idx#39 -Self Phi Eliminated (byte) form_fields_cnt#60 Self Phi Eliminated (signed byte) form_cursor_count#20 Self Phi Eliminated (byte) keyboard_events_size#46 Self Phi Eliminated (byte) keyboard_modifiers#44 @@ -8001,8 +7832,6 @@ Self Phi Eliminated (byte) form_mode::preset_current#10 Self Phi Eliminated (byte*) print_screen#24 Self Phi Eliminated (byte*) print_line_cursor#43 Self Phi Eliminated (byte*) print_char_cursor#45 -Self Phi Eliminated (byte) form_fields_cnt#35 -Self Phi Eliminated (byte) form_fields_cnt#2 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (byte*) print_line_cursor#36 (byte*) print_line_cursor#2 Redundant Phi (byte*) print_line_cursor#1 (byte*) print_line_cursor#22 @@ -8042,8 +7871,6 @@ Redundant Phi (signed byte) form_cursor_count#28 (signed byte) form_cursor_count Redundant Phi (byte) keyboard_events_size#101 (byte) keyboard_events_size#0 Redundant Phi (byte) keyboard_modifiers#57 (byte) keyboard_modifiers#0 Redundant Phi (byte) form_field_idx#38 (byte) form_field_idx#36 -Redundant Phi (byte) form_fields_cnt#67 (byte) form_fields_cnt#0 -Redundant Phi (byte) form_fields_cnt#59 (byte) form_fields_cnt#67 Redundant Phi (byte*) print_screen#13 (byte*) print_screen#17 Redundant Phi (byte*) print_line_cursor#26 (byte*) print_line_cursor#17 Redundant Phi (byte*) print_char_cursor#10 (byte*) print_char_cursor#18 @@ -8055,9 +7882,7 @@ Redundant Phi (byte) keyboard_events_size#26 (byte) keyboard_events_size#11 Redundant Phi (byte) keyboard_modifiers#23 (byte) keyboard_modifiers#11 Redundant Phi (byte) get_vic_charset::idx#1 (byte) get_vic_charset::idx#0 Redundant Phi (byte) apply_preset::idx#1 (byte) apply_preset::idx#0 -Redundant Phi (byte) form_fields_cnt#10 (byte) form_fields_cnt#35 Redundant Phi (byte*) apply_preset::preset#13 (byte*) apply_preset::preset#14 -Redundant Phi (byte) form_fields_cnt#1 (byte) form_fields_cnt#10 Redundant Phi (byte) keyboard_events_size#130 (byte) keyboard_events_size#25 Redundant Phi (byte) keyboard_modifiers#111 (byte) keyboard_modifiers#22 Redundant Phi (byte) gfx_mode::cy#2 (byte) gfx_mode::cy#4 @@ -8078,7 +7903,6 @@ Redundant Phi (byte) gfx_init_screen1::cy#2 (byte) gfx_init_screen1::cy#4 Redundant Phi (byte) gfx_init_screen2::cy#2 (byte) gfx_init_screen2::cy#4 Redundant Phi (byte) gfx_init_screen3::cy#2 (byte) gfx_init_screen3::cy#4 Redundant Phi (byte) gfx_init_screen4::cy#2 (byte) gfx_init_screen4::cy#4 -Redundant Phi (byte) gfx_init_vic_bitmap::lines_cnt#1 (byte) gfx_init_vic_bitmap::lines_cnt#0 Redundant Phi (byte) gfx_init_plane_8bppchunky::y#2 (byte) gfx_init_plane_8bppchunky::y#6 Redundant Phi (byte) gfx_init_plane_horisontal::ay#2 (byte) gfx_init_plane_horisontal::ay#4 Redundant Phi (byte) gfx_init_plane_horisontal2::ay#2 (byte) gfx_init_plane_horisontal2::ay#4 @@ -8091,7 +7915,6 @@ Redundant Phi (byte) gfx_init_plane_fill::by#2 (byte) gfx_init_plane_fill::by#4 Redundant Phi (byte*) print_screen#21 (byte*) print_screen#14 Redundant Phi (byte*) print_line_cursor#41 (byte*) print_line_cursor#10 Redundant Phi (byte*) print_char_cursor#43 (byte*) print_char_cursor#11 -Redundant Phi (byte) form_fields_cnt#34 (byte) form_fields_cnt#59 Redundant Phi (signed byte) form_cursor_count#48 (signed byte) form_cursor_count#1 Redundant Phi (byte) keyboard_events_size#104 (byte) keyboard_events_size#27 Redundant Phi (byte) keyboard_modifiers#103 (byte) keyboard_modifiers#24 @@ -8117,7 +7940,6 @@ Redundant Phi (signed byte) form_cursor_count#29 (signed byte) form_cursor_count Redundant Phi (byte) keyboard_events_size#62 (byte) keyboard_events_size#104 Redundant Phi (byte) keyboard_modifiers#62 (byte) keyboard_modifiers#103 Redundant Phi (byte) form_field_idx#39 (byte) form_field_idx#56 -Redundant Phi (byte) form_fields_cnt#60 (byte) form_fields_cnt#34 Redundant Phi (signed byte) form_cursor_count#20 (signed byte) form_cursor_count#21 Redundant Phi (byte) keyboard_events_size#46 (byte) keyboard_events_size#47 Redundant Phi (byte) keyboard_modifiers#44 (byte) keyboard_modifiers#45 @@ -8126,18 +7948,15 @@ Redundant Phi (byte) form_mode::preset_current#10 (byte) form_mode::preset_curre Redundant Phi (byte*) print_screen#24 (byte*) print_screen#23 Redundant Phi (byte*) print_line_cursor#43 (byte*) print_line_cursor#42 Redundant Phi (byte*) print_char_cursor#45 (byte*) print_char_cursor#44 -Redundant Phi (byte) form_fields_cnt#35 (byte) form_fields_cnt#55 Redundant Phi (signed byte) form_cursor_count#12 (signed byte) form_cursor_count#16 Redundant Phi (byte) keyboard_events_size#105 (byte) keyboard_events_size#108 Redundant Phi (byte) keyboard_modifiers#104 (byte) keyboard_modifiers#14 Redundant Phi (byte) form_field_idx#13 (byte) form_field_idx#18 Redundant Phi (byte*) form_set_screen::line#0 (byte*) form_set_screen::screen#0 -Redundant Phi (byte) form_fields_cnt#2 (byte) form_fields_cnt#21 Redundant Phi (byte) form_field_idx#15 (byte) form_field_idx#27 Redundant Phi (signed byte) form_cursor_count#14 (signed byte) form_cursor_count#20 Redundant Phi (byte) keyboard_events_size#106 (byte) keyboard_events_size#46 Redundant Phi (byte) keyboard_modifiers#100 (byte) keyboard_modifiers#44 -Redundant Phi (byte) form_fields_cnt#22 (byte) form_fields_cnt#35 Redundant Phi (byte) keyboard_events_size#14 (byte) keyboard_events_size#100 Redundant Phi (byte) keyboard_modifiers#14 (byte) keyboard_modifiers#21 Redundant Phi (byte) keyboard_events_size#108 (byte) keyboard_events_size#24 @@ -8218,90 +8037,90 @@ Simple Condition (bool~) get_vic_screen::$5 [873] if((byte) get_vic_screen::idx# Simple Condition (bool~) get_vic_charset::$0 [881] if((byte) get_vic_charset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto get_vic_charset::@1 Simple Condition (bool~) get_vic_charset::$2 [886] if((byte) get_vic_charset::idx#0!=(byte/signed byte/word/signed word/dword/signed dword) 1) goto get_vic_charset::@3 Simple Condition (bool~) apply_preset::$0 [947] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto apply_preset::@1 -Simple Condition (bool~) apply_preset::$1 [952] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 1) goto apply_preset::@2 -Simple Condition (bool~) apply_preset::$2 [957] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 2) goto apply_preset::@3 -Simple Condition (bool~) apply_preset::$3 [962] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 3) goto apply_preset::@4 -Simple Condition (bool~) apply_preset::$4 [967] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 4) goto apply_preset::@5 -Simple Condition (bool~) apply_preset::$5 [972] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 5) goto apply_preset::@6 -Simple Condition (bool~) apply_preset::$6 [977] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 6) goto apply_preset::@7 -Simple Condition (bool~) apply_preset::$7 [982] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 7) goto apply_preset::@8 -Simple Condition (bool~) apply_preset::$8 [987] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 8) goto apply_preset::@9 -Simple Condition (bool~) apply_preset::$9 [992] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 9) goto apply_preset::@10 -Simple Condition (bool~) apply_preset::$10 [997] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) $a) goto apply_preset::@11 -Simple Condition (bool~) apply_preset::$11 [1008] if((byte) apply_preset::i#1!=(byte) form_fields_cnt#55) goto apply_preset::@23 -Simple Condition (bool~) render_preset_name::$0 [1013] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 0) goto render_preset_name::@1 -Simple Condition (bool~) render_preset_name::$1 [1017] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 1) goto render_preset_name::@2 -Simple Condition (bool~) render_preset_name::$2 [1021] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 2) goto render_preset_name::@3 -Simple Condition (bool~) render_preset_name::$3 [1025] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 3) goto render_preset_name::@4 -Simple Condition (bool~) render_preset_name::$4 [1029] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 4) goto render_preset_name::@5 -Simple Condition (bool~) render_preset_name::$5 [1033] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 5) goto render_preset_name::@6 -Simple Condition (bool~) render_preset_name::$6 [1037] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 6) goto render_preset_name::@7 -Simple Condition (bool~) render_preset_name::$7 [1041] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 7) goto render_preset_name::@8 -Simple Condition (bool~) render_preset_name::$8 [1045] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 8) goto render_preset_name::@9 -Simple Condition (bool~) render_preset_name::$9 [1049] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 9) goto render_preset_name::@10 -Simple Condition (bool~) render_preset_name::$10 [1053] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) $a) goto render_preset_name::@11 -Simple Condition (bool~) gfx_mode::$1 [1141] if(*((byte*) form_ctrl_line#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@1 -Simple Condition (bool~) gfx_mode::$4 [1145] if(*((byte*) form_ctrl_borof#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@2 -Simple Condition (bool~) gfx_mode::$7 [1152] if(*((byte*) form_ctrl_hicol#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@3 -Simple Condition (bool~) gfx_mode::$10 [1159] if(*((byte*) form_ctrl_overs#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@4 -Simple Condition (bool~) gfx_mode::$13 [1166] if(*((byte*) form_ctrl_colof#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@5 -Simple Condition (bool~) gfx_mode::$16 [1173] if(*((byte*) form_ctrl_chunk#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@6 -Simple Condition (bool~) gfx_mode::$21 [1184] if(*((byte*) form_ctrl_ecm#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@7 -Simple Condition (bool~) gfx_mode::$24 [1191] if(*((byte*) form_ctrl_bmm#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@8 -Simple Condition (bool~) gfx_mode::$27 [1200] if(*((byte*) form_ctrl_mcm#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@9 -Simple Condition (bool~) gfx_mode::$73 [1303] if((byte) gfx_mode::cx#1!=rangelast(0,$27)) goto gfx_mode::@11 -Simple Condition (bool~) gfx_mode::$74 [1307] if((byte) gfx_mode::cy#1!=rangelast(0,$18)) goto gfx_mode::@10 -Simple Condition (bool~) gfx_mode::$83 [1323] if(*((byte*) form_dtv_palet#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@12 -Simple Condition (bool~) gfx_mode::$84 [1332] if((byte) gfx_mode::j#1!=rangelast(0,$f)) goto gfx_mode::@13 -Simple Condition (bool~) gfx_mode::$85 [1337] if((byte) gfx_mode::i#1!=rangelast(0,$f)) goto gfx_mode::@15 -Simple Condition (bool~) gfx_mode::$86 [1343] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto gfx_mode::@20 -Simple Condition (bool~) gfx_mode::$90 [1358] if((byte) gfx_mode::keyboard_event#0!=(byte) KEY_SPACE#0) goto gfx_mode::@22 -Simple Condition (bool~) gfx_init_charset::$0 [1392] if((byte) gfx_init_charset::l#1!=rangelast(0,7)) goto gfx_init_charset::@2 -Simple Condition (bool~) gfx_init_charset::$1 [1396] if((byte) gfx_init_charset::c#1!=rangelast(0,$ff)) goto gfx_init_charset::@1 -Simple Condition (bool~) gfx_init_screen0::$4 [1412] if((byte) gfx_init_screen0::cx#1!=rangelast(0,$27)) goto gfx_init_screen0::@2 -Simple Condition (bool~) gfx_init_screen0::$5 [1416] if((byte) gfx_init_screen0::cy#1!=rangelast(0,$18)) goto gfx_init_screen0::@1 -Simple Condition (bool~) gfx_init_screen1::$2 [1429] if((byte) gfx_init_screen1::cx#1!=rangelast(0,$27)) goto gfx_init_screen1::@2 -Simple Condition (bool~) gfx_init_screen1::$3 [1433] if((byte) gfx_init_screen1::cy#1!=rangelast(0,$18)) goto gfx_init_screen1::@1 -Simple Condition (bool~) gfx_init_screen2::$5 [1451] if((byte) gfx_init_screen2::cx#1!=rangelast(0,$27)) goto gfx_init_screen2::@2 -Simple Condition (bool~) gfx_init_screen2::$6 [1455] if((byte) gfx_init_screen2::cy#1!=rangelast(0,$18)) goto gfx_init_screen2::@1 -Simple Condition (bool~) gfx_init_screen3::$4 [1470] if((byte) gfx_init_screen3::cx#1!=rangelast(0,$27)) goto gfx_init_screen3::@2 -Simple Condition (bool~) gfx_init_screen3::$5 [1474] if((byte) gfx_init_screen3::cy#1!=rangelast(0,$18)) goto gfx_init_screen3::@1 -Simple Condition (bool~) gfx_init_screen4::$0 [1485] if((byte) gfx_init_screen4::cx#1!=rangelast(0,$27)) goto gfx_init_screen4::@2 -Simple Condition (bool~) gfx_init_screen4::$1 [1489] if((byte) gfx_init_screen4::cy#1!=rangelast(0,$18)) goto gfx_init_screen4::@1 -Simple Condition (bool~) gfx_init_vic_bitmap::$5 [1509] if((byte) gfx_init_vic_bitmap::l#1<(byte) gfx_init_vic_bitmap::lines_cnt#0) goto gfx_init_vic_bitmap::@1 -Simple Condition (bool~) gfx_init_plane_8bppchunky::$4 [1525] if((byte*) gfx_init_plane_8bppchunky::gfxb#3!=(word/dword/signed dword) $8000) goto gfx_init_plane_8bppchunky::@3 -Simple Condition (bool~) gfx_init_plane_8bppchunky::$8 [1534] if((word) gfx_init_plane_8bppchunky::x#1!=rangelast(0,$13f)) goto gfx_init_plane_8bppchunky::@2 -Simple Condition (bool~) gfx_init_plane_8bppchunky::$9 [1544] if((byte) gfx_init_plane_8bppchunky::y#1!=rangelast(0,$c7)) goto gfx_init_plane_8bppchunky::@1 -Simple Condition (bool~) gfx_init_plane_horisontal::$6 [1566] if((byte~) gfx_init_plane_horisontal::$5==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_init_plane_horisontal::@3 -Simple Condition (bool~) gfx_init_plane_horisontal::$7 [1576] if((byte) gfx_init_plane_horisontal::ax#1!=rangelast(0,$27)) goto gfx_init_plane_horisontal::@2 -Simple Condition (bool~) gfx_init_plane_horisontal::$8 [1580] if((byte) gfx_init_plane_horisontal::ay#1!=rangelast(0,$c7)) goto gfx_init_plane_horisontal::@1 -Simple Condition (bool~) gfx_init_plane_horisontal2::$7 [1608] if((byte) gfx_init_plane_horisontal2::ax#1!=rangelast(0,$27)) goto gfx_init_plane_horisontal2::@2 -Simple Condition (bool~) gfx_init_plane_horisontal2::$8 [1612] if((byte) gfx_init_plane_horisontal2::ay#1!=rangelast(0,$c7)) goto gfx_init_plane_horisontal2::@1 -Simple Condition (bool~) gfx_init_plane_vertical::$5 [1636] if((byte) gfx_init_plane_vertical::bx#1!=rangelast(0,$27)) goto gfx_init_plane_vertical::@2 -Simple Condition (bool~) gfx_init_plane_vertical::$6 [1640] if((byte) gfx_init_plane_vertical::by#1!=rangelast(0,$c7)) goto gfx_init_plane_vertical::@1 -Simple Condition (bool~) gfx_init_plane_charset8::$7 [1671] if((byte~) gfx_init_plane_charset8::$5==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_init_plane_charset8::@4 -Simple Condition (bool~) gfx_init_plane_charset8::$9 [1680] if((byte) gfx_init_plane_charset8::cp#1!=rangelast(0,7)) goto gfx_init_plane_charset8::@3 -Simple Condition (bool~) gfx_init_plane_charset8::$10 [1686] if((byte) gfx_init_plane_charset8::cr#1!=rangelast(0,7)) goto gfx_init_plane_charset8::@2 -Simple Condition (bool~) gfx_init_plane_charset8::$11 [1690] if((byte) gfx_init_plane_charset8::ch#1!=rangelast(0,$ff)) goto gfx_init_plane_charset8::@1 -Simple Condition (bool~) gfx_init_plane_fill::$7 [1730] if((byte) gfx_init_plane_fill::bx#1!=rangelast(0,$27)) goto gfx_init_plane_fill::@2 -Simple Condition (bool~) gfx_init_plane_fill::$8 [1734] if((byte) gfx_init_plane_fill::by#1!=rangelast(0,$c7)) goto gfx_init_plane_fill::@1 -Simple Condition (bool~) form_mode::$34 [1821] if((byte) form_mode::i#1!=rangelast(0,$f)) goto form_mode::@1 -Simple Condition (bool~) form_mode::$35 [1831] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto form_mode::@6 -Simple Condition (bool~) form_mode::$38 [1844] if((byte~) form_mode::$36==(byte/signed byte/word/signed word/dword/signed dword) 0) goto form_mode::@8 -Simple Condition (bool~) form_mode::$40 [1848] if((byte) form_mode::preset_current#6==*((byte*) form_preset#0)) goto form_mode::@9 -Simple Condition (bool~) form_set_screen::$3 [1888] if((byte) form_set_screen::y#1!=rangelast(0,$18)) goto form_set_screen::@1 -Simple Condition (bool~) form_render_values::$1 [1913] if((byte) form_render_values::idx#1<(byte) form_fields_cnt#21) goto form_render_values::@1 -Simple Condition (bool~) form_control::$2 [1925] if((signed byte) form_cursor_count#5>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto form_control::@1 -Simple Condition (bool~) form_control::$4 [1929] if((signed byte) form_cursor_count#15<(signed word/signed byte/signed dword~) form_control::$3) goto form_control::@2 -Simple Condition (bool~) form_control::$10 [1951] if((byte) form_control::key_event#0!=(byte) KEY_CRSR_DOWN#0) goto form_control::@4 -Simple Condition (bool~) form_control::$21 [1955] if((byte) form_control::key_event#0!=(byte) KEY_CRSR_RIGHT#0) goto form_control::@9 -Simple Condition (bool~) form_control::$13 [1961] if((byte~) form_control::$12==(byte/signed byte/word/signed word/dword/signed dword) 0) goto form_control::@5 -Simple Condition (bool~) form_control::$18 [1966] if((byte) form_field_idx#45!=(byte) form_fields_cnt#55) goto form_control::@8 -Simple Condition (bool~) form_control::$15 [1971] if((byte) form_field_idx#44!=(byte/word/signed word/dword/signed dword) $ff) goto form_control::@6 -Simple Condition (bool~) form_control::$29 [1993] if((byte) form_control::key_event#0!=(byte) KEY_SPACE#0) goto form_control::@14 -Simple Condition (bool~) form_control::$23 [1997] if((byte~) form_control::$22==(byte/signed byte/word/signed word/dword/signed dword) 0) goto form_control::@10 -Simple Condition (bool~) form_control::$27 [2002] if(*((byte[]) form_fields_val#0 + (byte) form_field_idx#28)<=*((byte[]) form_fields_max#0 + (byte) form_field_idx#28)) goto form_control::@13 -Simple Condition (bool~) form_control::$25 [2007] if(*((byte[]) form_fields_val#0 + (byte) form_field_idx#28)!=(byte/word/signed word/dword/signed dword) $ff) goto form_control::@11 +Simple Condition (bool~) apply_preset::$1 [951] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 1) goto apply_preset::@2 +Simple Condition (bool~) apply_preset::$2 [955] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 2) goto apply_preset::@3 +Simple Condition (bool~) apply_preset::$3 [959] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 3) goto apply_preset::@4 +Simple Condition (bool~) apply_preset::$4 [963] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 4) goto apply_preset::@5 +Simple Condition (bool~) apply_preset::$5 [967] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 5) goto apply_preset::@6 +Simple Condition (bool~) apply_preset::$6 [971] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 6) goto apply_preset::@7 +Simple Condition (bool~) apply_preset::$7 [975] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 7) goto apply_preset::@8 +Simple Condition (bool~) apply_preset::$8 [979] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 8) goto apply_preset::@9 +Simple Condition (bool~) apply_preset::$9 [983] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) 9) goto apply_preset::@10 +Simple Condition (bool~) apply_preset::$10 [987] if((byte) apply_preset::idx#0==(byte/signed byte/word/signed word/dword/signed dword) $a) goto apply_preset::@11 +Simple Condition (bool~) apply_preset::$11 [996] if((byte) apply_preset::i#1!=(byte) form_fields_cnt#0) goto apply_preset::@23 +Simple Condition (bool~) render_preset_name::$0 [1001] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 0) goto render_preset_name::@1 +Simple Condition (bool~) render_preset_name::$1 [1005] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 1) goto render_preset_name::@2 +Simple Condition (bool~) render_preset_name::$2 [1009] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 2) goto render_preset_name::@3 +Simple Condition (bool~) render_preset_name::$3 [1013] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 3) goto render_preset_name::@4 +Simple Condition (bool~) render_preset_name::$4 [1017] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 4) goto render_preset_name::@5 +Simple Condition (bool~) render_preset_name::$5 [1021] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 5) goto render_preset_name::@6 +Simple Condition (bool~) render_preset_name::$6 [1025] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 6) goto render_preset_name::@7 +Simple Condition (bool~) render_preset_name::$7 [1029] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 7) goto render_preset_name::@8 +Simple Condition (bool~) render_preset_name::$8 [1033] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 8) goto render_preset_name::@9 +Simple Condition (bool~) render_preset_name::$9 [1037] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) 9) goto render_preset_name::@10 +Simple Condition (bool~) render_preset_name::$10 [1041] if((byte) render_preset_name::idx#10==(byte/signed byte/word/signed word/dword/signed dword) $a) goto render_preset_name::@11 +Simple Condition (bool~) gfx_mode::$1 [1129] if(*((byte*) form_ctrl_line#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@1 +Simple Condition (bool~) gfx_mode::$4 [1133] if(*((byte*) form_ctrl_borof#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@2 +Simple Condition (bool~) gfx_mode::$7 [1140] if(*((byte*) form_ctrl_hicol#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@3 +Simple Condition (bool~) gfx_mode::$10 [1147] if(*((byte*) form_ctrl_overs#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@4 +Simple Condition (bool~) gfx_mode::$13 [1154] if(*((byte*) form_ctrl_colof#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@5 +Simple Condition (bool~) gfx_mode::$16 [1161] if(*((byte*) form_ctrl_chunk#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@6 +Simple Condition (bool~) gfx_mode::$21 [1172] if(*((byte*) form_ctrl_ecm#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@7 +Simple Condition (bool~) gfx_mode::$24 [1179] if(*((byte*) form_ctrl_bmm#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@8 +Simple Condition (bool~) gfx_mode::$27 [1188] if(*((byte*) form_ctrl_mcm#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@9 +Simple Condition (bool~) gfx_mode::$73 [1291] if((byte) gfx_mode::cx#1!=rangelast(0,$27)) goto gfx_mode::@11 +Simple Condition (bool~) gfx_mode::$74 [1295] if((byte) gfx_mode::cy#1!=rangelast(0,$18)) goto gfx_mode::@10 +Simple Condition (bool~) gfx_mode::$83 [1311] if(*((byte*) form_dtv_palet#0)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_mode::@12 +Simple Condition (bool~) gfx_mode::$84 [1320] if((byte) gfx_mode::j#1!=rangelast(0,$f)) goto gfx_mode::@13 +Simple Condition (bool~) gfx_mode::$85 [1325] if((byte) gfx_mode::i#1!=rangelast(0,$f)) goto gfx_mode::@15 +Simple Condition (bool~) gfx_mode::$86 [1331] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto gfx_mode::@20 +Simple Condition (bool~) gfx_mode::$90 [1346] if((byte) gfx_mode::keyboard_event#0!=(byte) KEY_SPACE#0) goto gfx_mode::@22 +Simple Condition (bool~) gfx_init_charset::$0 [1380] if((byte) gfx_init_charset::l#1!=rangelast(0,7)) goto gfx_init_charset::@2 +Simple Condition (bool~) gfx_init_charset::$1 [1384] if((byte) gfx_init_charset::c#1!=rangelast(0,$ff)) goto gfx_init_charset::@1 +Simple Condition (bool~) gfx_init_screen0::$4 [1400] if((byte) gfx_init_screen0::cx#1!=rangelast(0,$27)) goto gfx_init_screen0::@2 +Simple Condition (bool~) gfx_init_screen0::$5 [1404] if((byte) gfx_init_screen0::cy#1!=rangelast(0,$18)) goto gfx_init_screen0::@1 +Simple Condition (bool~) gfx_init_screen1::$2 [1417] if((byte) gfx_init_screen1::cx#1!=rangelast(0,$27)) goto gfx_init_screen1::@2 +Simple Condition (bool~) gfx_init_screen1::$3 [1421] if((byte) gfx_init_screen1::cy#1!=rangelast(0,$18)) goto gfx_init_screen1::@1 +Simple Condition (bool~) gfx_init_screen2::$5 [1439] if((byte) gfx_init_screen2::cx#1!=rangelast(0,$27)) goto gfx_init_screen2::@2 +Simple Condition (bool~) gfx_init_screen2::$6 [1443] if((byte) gfx_init_screen2::cy#1!=rangelast(0,$18)) goto gfx_init_screen2::@1 +Simple Condition (bool~) gfx_init_screen3::$4 [1458] if((byte) gfx_init_screen3::cx#1!=rangelast(0,$27)) goto gfx_init_screen3::@2 +Simple Condition (bool~) gfx_init_screen3::$5 [1462] if((byte) gfx_init_screen3::cy#1!=rangelast(0,$18)) goto gfx_init_screen3::@1 +Simple Condition (bool~) gfx_init_screen4::$0 [1473] if((byte) gfx_init_screen4::cx#1!=rangelast(0,$27)) goto gfx_init_screen4::@2 +Simple Condition (bool~) gfx_init_screen4::$1 [1477] if((byte) gfx_init_screen4::cy#1!=rangelast(0,$18)) goto gfx_init_screen4::@1 +Simple Condition (bool~) gfx_init_vic_bitmap::$5 [1497] if((byte) gfx_init_vic_bitmap::l#1<(byte) gfx_init_vic_bitmap::lines_cnt#0) goto gfx_init_vic_bitmap::@1 +Simple Condition (bool~) gfx_init_plane_8bppchunky::$4 [1513] if((byte*) gfx_init_plane_8bppchunky::gfxb#3!=(word/dword/signed dword) $8000) goto gfx_init_plane_8bppchunky::@3 +Simple Condition (bool~) gfx_init_plane_8bppchunky::$8 [1522] if((word) gfx_init_plane_8bppchunky::x#1!=rangelast(0,$13f)) goto gfx_init_plane_8bppchunky::@2 +Simple Condition (bool~) gfx_init_plane_8bppchunky::$9 [1532] if((byte) gfx_init_plane_8bppchunky::y#1!=rangelast(0,$c7)) goto gfx_init_plane_8bppchunky::@1 +Simple Condition (bool~) gfx_init_plane_horisontal::$6 [1554] if((byte~) gfx_init_plane_horisontal::$5==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_init_plane_horisontal::@3 +Simple Condition (bool~) gfx_init_plane_horisontal::$7 [1564] if((byte) gfx_init_plane_horisontal::ax#1!=rangelast(0,$27)) goto gfx_init_plane_horisontal::@2 +Simple Condition (bool~) gfx_init_plane_horisontal::$8 [1568] if((byte) gfx_init_plane_horisontal::ay#1!=rangelast(0,$c7)) goto gfx_init_plane_horisontal::@1 +Simple Condition (bool~) gfx_init_plane_horisontal2::$7 [1596] if((byte) gfx_init_plane_horisontal2::ax#1!=rangelast(0,$27)) goto gfx_init_plane_horisontal2::@2 +Simple Condition (bool~) gfx_init_plane_horisontal2::$8 [1600] if((byte) gfx_init_plane_horisontal2::ay#1!=rangelast(0,$c7)) goto gfx_init_plane_horisontal2::@1 +Simple Condition (bool~) gfx_init_plane_vertical::$5 [1624] if((byte) gfx_init_plane_vertical::bx#1!=rangelast(0,$27)) goto gfx_init_plane_vertical::@2 +Simple Condition (bool~) gfx_init_plane_vertical::$6 [1628] if((byte) gfx_init_plane_vertical::by#1!=rangelast(0,$c7)) goto gfx_init_plane_vertical::@1 +Simple Condition (bool~) gfx_init_plane_charset8::$7 [1659] if((byte~) gfx_init_plane_charset8::$5==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gfx_init_plane_charset8::@4 +Simple Condition (bool~) gfx_init_plane_charset8::$9 [1668] if((byte) gfx_init_plane_charset8::cp#1!=rangelast(0,7)) goto gfx_init_plane_charset8::@3 +Simple Condition (bool~) gfx_init_plane_charset8::$10 [1674] if((byte) gfx_init_plane_charset8::cr#1!=rangelast(0,7)) goto gfx_init_plane_charset8::@2 +Simple Condition (bool~) gfx_init_plane_charset8::$11 [1678] if((byte) gfx_init_plane_charset8::ch#1!=rangelast(0,$ff)) goto gfx_init_plane_charset8::@1 +Simple Condition (bool~) gfx_init_plane_fill::$7 [1718] if((byte) gfx_init_plane_fill::bx#1!=rangelast(0,$27)) goto gfx_init_plane_fill::@2 +Simple Condition (bool~) gfx_init_plane_fill::$8 [1722] if((byte) gfx_init_plane_fill::by#1!=rangelast(0,$c7)) goto gfx_init_plane_fill::@1 +Simple Condition (bool~) form_mode::$34 [1809] if((byte) form_mode::i#1!=rangelast(0,$f)) goto form_mode::@1 +Simple Condition (bool~) form_mode::$35 [1819] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto form_mode::@6 +Simple Condition (bool~) form_mode::$38 [1832] if((byte~) form_mode::$36==(byte/signed byte/word/signed word/dword/signed dword) 0) goto form_mode::@8 +Simple Condition (bool~) form_mode::$40 [1836] if((byte) form_mode::preset_current#6==*((byte*) form_preset#0)) goto form_mode::@9 +Simple Condition (bool~) form_set_screen::$3 [1876] if((byte) form_set_screen::y#1!=rangelast(0,$18)) goto form_set_screen::@1 +Simple Condition (bool~) form_render_values::$1 [1900] if((byte) form_render_values::idx#1<(byte) form_fields_cnt#0) goto form_render_values::@1 +Simple Condition (bool~) form_control::$2 [1912] if((signed byte) form_cursor_count#5>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto form_control::@1 +Simple Condition (bool~) form_control::$4 [1916] if((signed byte) form_cursor_count#15<(signed word/signed byte/signed dword~) form_control::$3) goto form_control::@2 +Simple Condition (bool~) form_control::$10 [1938] if((byte) form_control::key_event#0!=(byte) KEY_CRSR_DOWN#0) goto form_control::@4 +Simple Condition (bool~) form_control::$21 [1942] if((byte) form_control::key_event#0!=(byte) KEY_CRSR_RIGHT#0) goto form_control::@9 +Simple Condition (bool~) form_control::$13 [1948] if((byte~) form_control::$12==(byte/signed byte/word/signed word/dword/signed dword) 0) goto form_control::@5 +Simple Condition (bool~) form_control::$18 [1953] if((byte) form_field_idx#45!=(byte) form_fields_cnt#0) goto form_control::@8 +Simple Condition (bool~) form_control::$15 [1958] if((byte) form_field_idx#44!=(byte/word/signed word/dword/signed dword) $ff) goto form_control::@6 +Simple Condition (bool~) form_control::$29 [1980] if((byte) form_control::key_event#0!=(byte) KEY_SPACE#0) goto form_control::@14 +Simple Condition (bool~) form_control::$23 [1984] if((byte~) form_control::$22==(byte/signed byte/word/signed word/dword/signed dword) 0) goto form_control::@10 +Simple Condition (bool~) form_control::$27 [1989] if(*((byte[]) form_fields_val#0 + (byte) form_field_idx#28)<=*((byte[]) form_fields_max#0 + (byte) form_field_idx#28)) goto form_control::@13 +Simple Condition (bool~) form_control::$25 [1994] if(*((byte[]) form_fields_val#0 + (byte) form_field_idx#28)!=(byte/word/signed word/dword/signed dword) $ff) goto form_control::@11 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) PROCPORT_DDR#0 = ((byte*))0 Constant (const byte) PROCPORT_DDR_MEMORY_MASK#0 = 7 @@ -8815,6 +8634,7 @@ Constant (const byte) form_mode::$33 = >FORM_SCREEN#0 Constant (const signed byte) form_cursor_count#26 = FORM_CURSOR_BLINK#0/2 Constant (const signed word/signed byte/signed dword) form_control::$3 = FORM_CURSOR_BLINK#0/2 Constant (const signed byte) form_cursor_count#6 = FORM_CURSOR_BLINK#0 +Constant (const byte) form_field_idx#7 = form_fields_cnt#0-1 Constant (const signed byte) form_cursor_count#7 = FORM_CURSOR_BLINK#0/2 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) bitmap_init::$1 = >bitmap_init::bitmap#0 @@ -9110,23 +8930,17 @@ Self Phi Eliminated (byte) keyboard_events_size#126 Self Phi Eliminated (byte) gfx_init_plane_charset8::ch#7 Self Phi Eliminated (byte) gfx_init_plane_fill::fill#4 Self Phi Eliminated (byte) form_mode::preset_current#6 -Self Phi Eliminated (byte) form_fields_cnt#55 -Self Phi Eliminated (byte) form_fields_cnt#55 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (byte) keyboard_events_size#126 (byte) keyboard_events_size#13 Redundant Phi (byte) keyboard_events_size#11 (byte) keyboard_events_size#24 Redundant Phi (byte) gfx_init_plane_charset8::ch#7 (byte) gfx_init_plane_charset8::ch#8 Redundant Phi (byte) gfx_init_plane_fill::fill#4 (byte) gfx_init_plane_fill::fill#6 -Redundant Phi (byte) form_fields_cnt#55 (const byte) form_fields_cnt#0 Redundant Phi (signed byte) form_cursor_count#13 (signed byte) form_cursor_count#16 Redundant Phi (byte) keyboard_events_size#13 (byte) keyboard_events_size#24 Redundant Phi (byte) form_field_idx#14 (byte) form_field_idx#18 Successful SSA optimization Pass2RedundantPhiElimination Redundant Phi (byte) keyboard_events_size#45 (byte) keyboard_events_size#24 -Redundant Phi (byte) form_fields_cnt#21 (const byte) form_fields_cnt#0 Successful SSA optimization Pass2RedundantPhiElimination -Constant (const byte) form_field_idx#7 = form_fields_cnt#0-1 -Successful SSA optimization Pass2ConstantIdentification Culled Empty Block (label) gfx_mode::@16 Successful SSA optimization Pass2CullEmptyBlocks Inlining constant with var siblings (const byte) dtvSetCpuBankSegment1::cpuBankIdx#2 @@ -9284,8 +9098,8 @@ Inlining constant with var siblings (const byte) form_field_idx#8 Inlining constant with var siblings (const byte) keyboard_modifiers#2 Inlining constant with var siblings (const signed byte) form_cursor_count#26 Inlining constant with var siblings (const signed byte) form_cursor_count#6 -Inlining constant with var siblings (const signed byte) form_cursor_count#7 Inlining constant with var siblings (const byte) form_field_idx#7 +Inlining constant with var siblings (const signed byte) form_cursor_count#7 Constant inlined form_field_idx#36 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined gfx_init_plane_charset8::cp#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined gfx_init_plane_horisontal::gfxa#0 = ((byte*))(word/signed word/dword/signed dword) $4000+(const dword) PLANE_HORISONTAL#0&(word/signed word/dword/signed dword) $3fff diff --git a/src/test/ref/c64dtv-gfxmodes.asm b/src/test/ref/c64dtv-gfxmodes.asm index c0924286d..8e24ee16e 100644 --- a/src/test/ref/c64dtv-gfxmodes.asm +++ b/src/test/ref/c64dtv-gfxmodes.asm @@ -508,6 +508,7 @@ mode_8bpppixelcell: { .label PLANEA = $3c00 // 8BPP Pixel Cell Charset (contains 256 64 byte chars) .label PLANEB = $4000 + .label CHARGEN = $d000 .label _14 = 7 .label gfxa = 2 .label ay = 4 @@ -598,9 +599,9 @@ mode_8bpppixelcell: { sta gfxb lda #>PLANEB sta gfxb+1 - lda #<$d000 + lda #$d000 + lda #>CHARGEN sta chargen+1 b4: lda #0 diff --git a/src/test/ref/c64dtv-gfxmodes.cfg b/src/test/ref/c64dtv-gfxmodes.cfg index 0a9acbac6..f6c08bdc8 100644 --- a/src/test/ref/c64dtv-gfxmodes.cfg +++ b/src/test/ref/c64dtv-gfxmodes.cfg @@ -472,7 +472,7 @@ mode_8bpppixelcell::@4: scope:[mode_8bpppixelcell] from mode_8bpppixelcell::@10 [260] (byte) mode_8bpppixelcell::ch#8 ← phi( mode_8bpppixelcell::@10/(byte/signed byte/word/signed word/dword/signed dword) 0 mode_8bpppixelcell::@13/(byte) mode_8bpppixelcell::ch#1 ) [260] (byte) mode_8bpppixelcell::col#7 ← phi( mode_8bpppixelcell::@10/(byte/signed byte/word/signed word/dword/signed dword) 0 mode_8bpppixelcell::@13/(byte) mode_8bpppixelcell::col#1 ) [260] (byte*) mode_8bpppixelcell::gfxb#7 ← phi( mode_8bpppixelcell::@10/(const byte*) mode_8bpppixelcell::PLANEB#0 mode_8bpppixelcell::@13/(byte*) mode_8bpppixelcell::gfxb#1 ) - [260] (byte*) mode_8bpppixelcell::chargen#4 ← phi( mode_8bpppixelcell::@10/((byte*))(word/dword/signed dword) $d000 mode_8bpppixelcell::@13/(byte*) mode_8bpppixelcell::chargen#1 ) + [260] (byte*) mode_8bpppixelcell::chargen#4 ← phi( mode_8bpppixelcell::@10/(const byte*) mode_8bpppixelcell::CHARGEN#0 mode_8bpppixelcell::@13/(byte*) mode_8bpppixelcell::chargen#1 ) to:mode_8bpppixelcell::@5 mode_8bpppixelcell::@5: scope:[mode_8bpppixelcell] from mode_8bpppixelcell::@12 mode_8bpppixelcell::@4 [261] (byte) mode_8bpppixelcell::cr#6 ← phi( mode_8bpppixelcell::@12/(byte) mode_8bpppixelcell::cr#1 mode_8bpppixelcell::@4/(byte/signed byte/word/signed word/dword/signed dword) 0 ) diff --git a/src/test/ref/c64dtv-gfxmodes.log b/src/test/ref/c64dtv-gfxmodes.log index 983f13abc..a7566b95a 100644 --- a/src/test/ref/c64dtv-gfxmodes.log +++ b/src/test/ref/c64dtv-gfxmodes.log @@ -1,3 +1,7 @@ +Identified constant variable (byte*) dtvSetCpuBankSegment1::cpuBank +Identified constant variable (byte*) DTV_BLITTER_ALU +Identified constant variable (byte) mode_stdbitmap::lines_cnt +Identified constant variable (byte*) mode_8bpppixelcell::CHARGEN Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx CONTROL FLOW GRAPH SSA @@ -2239,7 +2243,6 @@ mode_stdbitmap::@10: scope:[mode_stdbitmap] from mode_stdbitmap::@9 to:mode_stdbitmap::@4 mode_stdbitmap::@4: scope:[mode_stdbitmap] from mode_stdbitmap::@10 mode_stdbitmap::@11 (byte) dtv_control#180 ← phi( mode_stdbitmap::@10/(byte) dtv_control#196 mode_stdbitmap::@11/(byte) dtv_control#152 ) - (byte) mode_stdbitmap::lines_cnt#2 ← phi( mode_stdbitmap::@10/(byte) mode_stdbitmap::lines_cnt#0 mode_stdbitmap::@11/(byte) mode_stdbitmap::lines_cnt#1 ) (byte) mode_stdbitmap::l#2 ← phi( mode_stdbitmap::@10/(byte) mode_stdbitmap::l#0 mode_stdbitmap::@11/(byte) mode_stdbitmap::l#1 ) (byte/signed word/word/dword/signed dword~) mode_stdbitmap::$28 ← (byte) mode_stdbitmap::l#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 (byte/signed word/word/dword/signed dword~) mode_stdbitmap::$29 ← (byte) mode_stdbitmap::l#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 @@ -2251,10 +2254,9 @@ mode_stdbitmap::@4: scope:[mode_stdbitmap] from mode_stdbitmap::@10 mode_stdbit to:mode_stdbitmap::@11 mode_stdbitmap::@11: scope:[mode_stdbitmap] from mode_stdbitmap::@4 (byte) dtv_control#152 ← phi( mode_stdbitmap::@4/(byte) dtv_control#180 ) - (byte) mode_stdbitmap::lines_cnt#1 ← phi( mode_stdbitmap::@4/(byte) mode_stdbitmap::lines_cnt#2 ) (byte) mode_stdbitmap::l#3 ← phi( mode_stdbitmap::@4/(byte) mode_stdbitmap::l#2 ) (byte) mode_stdbitmap::l#1 ← ++ (byte) mode_stdbitmap::l#3 - (bool~) mode_stdbitmap::$31 ← (byte) mode_stdbitmap::l#1 < (byte) mode_stdbitmap::lines_cnt#1 + (bool~) mode_stdbitmap::$31 ← (byte) mode_stdbitmap::l#1 < (byte) mode_stdbitmap::lines_cnt#0 if((bool~) mode_stdbitmap::$31) goto mode_stdbitmap::@4 to:mode_stdbitmap::@8 mode_stdbitmap::@8: scope:[mode_stdbitmap] from mode_stdbitmap::@11 @@ -5964,8 +5966,6 @@ SYMBOL TABLE SSA (byte) mode_stdbitmap::l#3 (byte) mode_stdbitmap::lines_cnt (byte) mode_stdbitmap::lines_cnt#0 -(byte) mode_stdbitmap::lines_cnt#1 -(byte) mode_stdbitmap::lines_cnt#2 (byte[]) mode_stdbitmap::lines_x (byte[]) mode_stdbitmap::lines_x#0 (byte[]) mode_stdbitmap::lines_y @@ -6744,7 +6744,6 @@ Alias (byte) mode_stdbitmap::cy#2 = (byte) mode_stdbitmap::cy#3 Alias (byte*) mode_stdbitmap::ch#1 = (byte*) mode_stdbitmap::ch#4 Alias (byte) dtv_control#196 = (byte) dtv_control#240 (byte) dtv_control#248 (byte) dtv_control#227 (byte) dtv_control#211 Alias (byte) mode_stdbitmap::l#2 = (byte) mode_stdbitmap::l#3 -Alias (byte) mode_stdbitmap::lines_cnt#1 = (byte) mode_stdbitmap::lines_cnt#2 Alias (byte) dtv_control#120 = (byte) dtv_control#152 (byte) dtv_control#180 Alias (byte) dtv_control#28 = (byte) dtv_control#79 (byte) dtv_control#80 (byte) dtv_control#29 Alias (byte) dtv_control#212 = (byte) dtv_control#228 @@ -6831,7 +6830,7 @@ Alias (byte) mode_8bpppixelcell::ay#2 = (byte) mode_8bpppixelcell::ay#3 Alias (byte*) mode_8bpppixelcell::gfxa#1 = (byte*) mode_8bpppixelcell::gfxa#4 Alias (byte) dtv_control#253 = (byte) dtv_control#262 (byte) dtv_control#269 Alias (byte*) mode_8bpppixelcell::PLANEB#0 = (byte*) mode_8bpppixelcell::gfxb#0 -Alias (byte*) mode_8bpppixelcell::chargen#0 = (byte*) mode_8bpppixelcell::CHARGEN#0 +Alias (byte*) mode_8bpppixelcell::CHARGEN#0 = (byte*) mode_8bpppixelcell::chargen#0 Alias (byte) mode_8bpppixelcell::bits#1 = (byte~) mode_8bpppixelcell::$22 Alias (byte) mode_8bpppixelcell::col#3 = (byte) mode_8bpppixelcell::col#4 (byte) mode_8bpppixelcell::c#1 Alias (byte*) mode_8bpppixelcell::gfxb#3 = (byte*) mode_8bpppixelcell::gfxb#4 @@ -6951,7 +6950,6 @@ Self Phi Eliminated (byte) dtv_control#119 Self Phi Eliminated (byte) dtv_control#265 Self Phi Eliminated (byte) mode_stdbitmap::cy#2 Self Phi Eliminated (byte) dtv_control#196 -Self Phi Eliminated (byte) mode_stdbitmap::lines_cnt#1 Self Phi Eliminated (byte) dtv_control#120 Self Phi Eliminated (byte) dtv_control#212 Self Phi Eliminated (byte) mode_hicolstdchar::cy#2 @@ -7085,7 +7083,6 @@ Redundant Phi (byte) dtv_control#25 (byte) dtv_control#16 Redundant Phi (byte) dtv_control#265 (byte) dtv_control#27 Redundant Phi (byte) mode_stdbitmap::cy#2 (byte) mode_stdbitmap::cy#4 Redundant Phi (byte) dtv_control#196 (byte) dtv_control#258 -Redundant Phi (byte) mode_stdbitmap::lines_cnt#1 (byte) mode_stdbitmap::lines_cnt#0 Redundant Phi (byte) dtv_control#120 (byte) dtv_control#196 Redundant Phi (byte) dtv_control#28 (byte) dtv_control#16 Redundant Phi (byte) dtv_control#212 (byte) dtv_control#30 @@ -7607,7 +7604,7 @@ Constant (const byte*) mode_8bpppixelcell::PLANEB#0 = ((byte*))$4000 Constant (const byte) mode_8bpppixelcell::i#0 = 0 Constant (const byte) mode_8bpppixelcell::ay#0 = 0 Constant (const byte) mode_8bpppixelcell::ax#0 = 0 -Constant (const byte*) mode_8bpppixelcell::chargen#0 = ((byte*))$d000 +Constant (const byte*) mode_8bpppixelcell::CHARGEN#0 = ((byte*))$d000 Constant (const byte) mode_8bpppixelcell::col#0 = 0 Constant (const byte) mode_8bpppixelcell::ch#0 = 0 Constant (const byte) mode_8bpppixelcell::cr#0 = 0 @@ -8278,7 +8275,6 @@ Inlining constant with var siblings (const byte) mode_sixsfred2::bx#0 Inlining constant with var siblings (const byte) mode_8bpppixelcell::i#0 Inlining constant with var siblings (const byte) mode_8bpppixelcell::ay#0 Inlining constant with var siblings (const byte) mode_8bpppixelcell::ax#0 -Inlining constant with var siblings (const byte*) mode_8bpppixelcell::chargen#0 Inlining constant with var siblings (const byte) mode_8bpppixelcell::col#0 Inlining constant with var siblings (const byte) mode_8bpppixelcell::ch#0 Inlining constant with var siblings (const byte) mode_8bpppixelcell::cr#0 @@ -8346,7 +8342,6 @@ Constant inlined mode_mcchar::$0 = ((dword))(const byte*) mode_mcchar::CHARSET#0 Constant inlined mode_mcchar::$1 = ((dword))(const byte*) mode_mcchar::CHARSET#0/(dword/signed dword) $10000 Constant inlined mode_hicolmcchar::$8 = >((word))(const byte*) mode_hicolmcchar::COLORS#0/(word/signed word/dword/signed dword) $400 Constant inlined mode_hicolmcchar::$7 = ((word))(const byte*) mode_hicolmcchar::COLORS#0/(word/signed word/dword/signed dword) $400 -Constant inlined mode_8bpppixelcell::chargen#0 = ((byte*))(word/dword/signed dword) $d000 Constant inlined mode_hicolmcchar::$6 = (const byte*) mode_hicolmcchar::COLORS#0/(word/signed word/dword/signed dword) $400 Constant inlined mode_hicolmcchar::$5 = <((word))(const byte*) mode_hicolmcchar::COLORS#0/(word/signed word/dword/signed dword) $400 Constant inlined mode_hicolmcchar::$9 = ((word))(const byte*) mode_hicolmcchar::CHARSET#0 @@ -9719,7 +9714,7 @@ mode_8bpppixelcell::@4: scope:[mode_8bpppixelcell] from mode_8bpppixelcell::@10 [260] (byte) mode_8bpppixelcell::ch#8 ← phi( mode_8bpppixelcell::@10/(byte/signed byte/word/signed word/dword/signed dword) 0 mode_8bpppixelcell::@13/(byte) mode_8bpppixelcell::ch#1 ) [260] (byte) mode_8bpppixelcell::col#7 ← phi( mode_8bpppixelcell::@10/(byte/signed byte/word/signed word/dword/signed dword) 0 mode_8bpppixelcell::@13/(byte) mode_8bpppixelcell::col#1 ) [260] (byte*) mode_8bpppixelcell::gfxb#7 ← phi( mode_8bpppixelcell::@10/(const byte*) mode_8bpppixelcell::PLANEB#0 mode_8bpppixelcell::@13/(byte*) mode_8bpppixelcell::gfxb#1 ) - [260] (byte*) mode_8bpppixelcell::chargen#4 ← phi( mode_8bpppixelcell::@10/((byte*))(word/dword/signed dword) $d000 mode_8bpppixelcell::@13/(byte*) mode_8bpppixelcell::chargen#1 ) + [260] (byte*) mode_8bpppixelcell::chargen#4 ← phi( mode_8bpppixelcell::@10/(const byte*) mode_8bpppixelcell::CHARGEN#0 mode_8bpppixelcell::@13/(byte*) mode_8bpppixelcell::chargen#1 ) to:mode_8bpppixelcell::@5 mode_8bpppixelcell::@5: scope:[mode_8bpppixelcell] from mode_8bpppixelcell::@12 mode_8bpppixelcell::@4 [261] (byte) mode_8bpppixelcell::cr#6 ← phi( mode_8bpppixelcell::@12/(byte) mode_8bpppixelcell::cr#1 mode_8bpppixelcell::@4/(byte/signed byte/word/signed word/dword/signed dword) 0 ) @@ -13959,6 +13954,7 @@ mode_8bpppixelcell: { .label PLANEA = $3c00 // 8BPP Pixel Cell Charset (contains 256 64 byte chars) .label PLANEB = $4000 + .label CHARGEN = $d000 .label _13 = $d3 .label _14 = $d4 .label _15 = $d5 @@ -14146,10 +14142,10 @@ mode_8bpppixelcell: { sta gfxb lda #>PLANEB sta gfxb+1 - //SEG468 [260] phi (byte*) mode_8bpppixelcell::chargen#4 = ((byte*))(word/dword/signed dword) $d000 [phi:mode_8bpppixelcell::@10->mode_8bpppixelcell::@4#3] -- pbuz1=pbuc1 - lda #<$d000 + //SEG468 [260] phi (byte*) mode_8bpppixelcell::chargen#4 = (const byte*) mode_8bpppixelcell::CHARGEN#0 [phi:mode_8bpppixelcell::@10->mode_8bpppixelcell::@4#3] -- pbuz1=pbuc1 + lda #$d000 + lda #>CHARGEN sta chargen+1 jmp b4 //SEG469 [260] phi from mode_8bpppixelcell::@13 to mode_8bpppixelcell::@4 [phi:mode_8bpppixelcell::@13->mode_8bpppixelcell::@4] @@ -20677,6 +20673,7 @@ mode_8bpppixelcell: { .label PLANEA = $3c00 // 8BPP Pixel Cell Charset (contains 256 64 byte chars) .label PLANEB = $4000 + .label CHARGEN = $d000 .label _14 = 7 .label gfxa = 2 .label ay = 4 @@ -20845,10 +20842,10 @@ mode_8bpppixelcell: { sta gfxb lda #>PLANEB sta gfxb+1 - //SEG468 [260] phi (byte*) mode_8bpppixelcell::chargen#4 = ((byte*))(word/dword/signed dword) $d000 [phi:mode_8bpppixelcell::@10->mode_8bpppixelcell::@4#3] -- pbuz1=pbuc1 - lda #<$d000 + //SEG468 [260] phi (byte*) mode_8bpppixelcell::chargen#4 = (const byte*) mode_8bpppixelcell::CHARGEN#0 [phi:mode_8bpppixelcell::@10->mode_8bpppixelcell::@4#3] -- pbuz1=pbuc1 + lda #$d000 + lda #>CHARGEN sta chargen+1 jmp b4 //SEG469 [260] phi from mode_8bpppixelcell::@13 to mode_8bpppixelcell::@4 [phi:mode_8bpppixelcell::@13->mode_8bpppixelcell::@4] @@ -25918,6 +25915,7 @@ FINAL SYMBOL TABLE (label) mode_8bpppixelcell::@9 (label) mode_8bpppixelcell::@return (byte*) mode_8bpppixelcell::CHARGEN +(const byte*) mode_8bpppixelcell::CHARGEN#0 CHARGEN = ((byte*))(word/dword/signed dword) $d000 (byte*) mode_8bpppixelcell::PLANEA (const byte*) mode_8bpppixelcell::PLANEA#0 PLANEA = ((byte*))(word/signed word/dword/signed dword) $3c00 (byte*) mode_8bpppixelcell::PLANEB @@ -27594,6 +27592,7 @@ mode_8bpppixelcell: { .label PLANEA = $3c00 // 8BPP Pixel Cell Charset (contains 256 64 byte chars) .label PLANEB = $4000 + .label CHARGEN = $d000 .label _14 = 7 .label gfxa = 2 .label ay = 4 @@ -27739,10 +27738,10 @@ mode_8bpppixelcell: { sta gfxb lda #>PLANEB sta gfxb+1 - //SEG468 [260] phi (byte*) mode_8bpppixelcell::chargen#4 = ((byte*))(word/dword/signed dword) $d000 [phi:mode_8bpppixelcell::@10->mode_8bpppixelcell::@4#3] -- pbuz1=pbuc1 - lda #<$d000 + //SEG468 [260] phi (byte*) mode_8bpppixelcell::chargen#4 = (const byte*) mode_8bpppixelcell::CHARGEN#0 [phi:mode_8bpppixelcell::@10->mode_8bpppixelcell::@4#3] -- pbuz1=pbuc1 + lda #$d000 + lda #>CHARGEN sta chargen+1 //SEG469 [260] phi from mode_8bpppixelcell::@13 to mode_8bpppixelcell::@4 [phi:mode_8bpppixelcell::@13->mode_8bpppixelcell::@4] //SEG470 [260] phi (byte) mode_8bpppixelcell::ch#8 = (byte) mode_8bpppixelcell::ch#1 [phi:mode_8bpppixelcell::@13->mode_8bpppixelcell::@4#0] -- register_copy diff --git a/src/test/ref/c64dtv-gfxmodes.sym b/src/test/ref/c64dtv-gfxmodes.sym index 3005498bd..b5added7f 100644 --- a/src/test/ref/c64dtv-gfxmodes.sym +++ b/src/test/ref/c64dtv-gfxmodes.sym @@ -766,6 +766,7 @@ (label) mode_8bpppixelcell::@9 (label) mode_8bpppixelcell::@return (byte*) mode_8bpppixelcell::CHARGEN +(const byte*) mode_8bpppixelcell::CHARGEN#0 CHARGEN = ((byte*))(word/dword/signed dword) $d000 (byte*) mode_8bpppixelcell::PLANEA (const byte*) mode_8bpppixelcell::PLANEA#0 PLANEA = ((byte*))(word/signed word/dword/signed dword) $3c00 (byte*) mode_8bpppixelcell::PLANEB diff --git a/src/test/ref/cast-deref.log b/src/test/ref/cast-deref.log index a41748633..dec7c2f2c 100644 --- a/src/test/ref/cast-deref.log +++ b/src/test/ref/cast-deref.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -12,10 +13,9 @@ 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::SCREEN#1 ← phi( main/(byte*) main::SCREEN#0 main::@1/(byte*) main::SCREEN#1 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) (byte~) main::$4 ← ((byte)) *((signed byte[]) main::sbs#0 + (byte) main::i#2) - *((byte*) main::SCREEN#1 + (byte) main::i#2) ← (byte~) main::$4 + *((byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$4 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,3) (bool~) main::$5 ← (byte) main::i#1 != rangelast(0,3) if((bool~) main::$5) goto main::@1 @@ -46,7 +46,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::SCREEN (byte*) main::SCREEN#0 -(byte*) main::SCREEN#1 (byte) main::i (byte) main::i#0 (byte) main::i#1 @@ -56,10 +55,6 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte*) main::SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$5 [12] if((byte) main::i#1!=rangelast(0,3)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const signed byte/signed word/signed dword) main::$0 = -1 diff --git a/src/test/ref/cast-not-needed.log b/src/test/ref/cast-not-needed.log index a1a55ed87..dfeffc2ce 100644 --- a/src/test/ref/cast-not-needed.log +++ b/src/test/ref/cast-not-needed.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) sprite +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -5,11 +7,9 @@ CONTROL FLOW GRAPH SSA (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $4400 to:@1 main: scope:[main] from @1 - (byte*) sprite#1 ← phi( @1/(byte*) sprite#2 ) - (byte*) SCREEN#1 ← phi( @1/(byte*) SCREEN#2 ) - (byte*~) main::$0 ← (byte*) SCREEN#1 + (word/signed word/dword/signed dword) $378 + (byte*~) main::$0 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) $378 (byte*) main::sprite_ptr#0 ← (byte*~) main::$0 - (byte*~) main::$1 ← (byte*) sprite#1 / (byte/signed byte/word/signed word/dword/signed dword) $40 + (byte*~) main::$1 ← (byte*) sprite#0 / (byte/signed byte/word/signed word/dword/signed dword) $40 (byte~) main::$2 ← ((byte)) (byte*~) main::$1 *((byte*) main::sprite_ptr#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$2 to:main::@return @@ -17,8 +17,6 @@ main::@return: scope:[main] from main return to:@return @1: scope:[] from @begin - (byte*) sprite#2 ← phi( @begin/(byte*) sprite#0 ) - (byte*) SCREEN#2 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -32,8 +30,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 (void()) main() (byte*~) main::$0 (byte*~) main::$1 @@ -43,18 +39,11 @@ SYMBOL TABLE SSA (byte*) main::sprite_ptr#0 (byte*) sprite (byte*) sprite#0 -(byte*) sprite#1 -(byte*) sprite#2 Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte*) main::sprite_ptr#0 = (byte*~) main::$0 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#2 -Alias (byte*) sprite#0 = (byte*) sprite#2 Successful SSA optimization Pass2AliasElimination -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte*) sprite#1 (byte*) sprite#0 -Successful SSA optimization Pass2RedundantPhiElimination Constant (const byte*) sprite#0 = ((byte*))$5000 Constant (const byte*) SCREEN#0 = ((byte*))$4400 Successful SSA optimization Pass2ConstantIdentification diff --git a/src/test/ref/cast-precedence-problem.log b/src/test/ref/cast-precedence-problem.log index c7d9d1a57..4e410ffc6 100644 --- a/src/test/ref/cast-precedence-problem.log +++ b/src/test/ref/cast-precedence-problem.log @@ -1,3 +1,7 @@ +Identified constant variable (byte*) main::SCREEN +Identified constant variable (byte) main::min +Identified constant variable (byte) main::max +Identified constant variable (byte*) main::BGCOL CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -24,12 +28,10 @@ main: scope:[main] from @1 if((bool~) main::$7) goto main::@1 to:main::@3 main::@1: scope:[main] from main - (byte*) main::BGCOL#1 ← phi( main/(byte*) main::BGCOL#0 ) - *((byte*) main::BGCOL#1) ← (byte/signed byte/word/signed word/dword/signed dword) 5 + *((byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5 to:main::@return main::@3: scope:[main] from main - (byte*) main::BGCOL#2 ← phi( main/(byte*) main::BGCOL#0 ) - *((byte*) main::BGCOL#2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 + *((byte*) main::BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 to:main::@return main::@return: scope:[main] from main::@1 main::@3 return @@ -60,8 +62,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::BGCOL (byte*) main::BGCOL#0 -(byte*) main::BGCOL#1 -(byte*) main::BGCOL#2 (byte*) main::SCREEN (byte*) main::SCREEN#0 (byte) main::max @@ -82,7 +82,6 @@ Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::midw#0 = (byte/signed word/word/dword/signed dword~) main::$3 Alias (byte) main::sumb#0 = (byte~) main::$4 Alias (byte) main::midb#0 = (byte/signed word/word/dword/signed dword~) main::$6 -Alias (byte*) main::BGCOL#0 = (byte*) main::BGCOL#1 (byte*) main::BGCOL#2 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$7 [18] if(*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0)==*((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification diff --git a/src/test/ref/casting.log b/src/test/ref/casting.log index ea38b0236..8921d5226 100644 --- a/src/test/ref/casting.log +++ b/src/test/ref/casting.log @@ -1,3 +1,6 @@ +Identified constant variable (byte*) SCREEN +Identified constant variable (word) w::w1 +Identified constant variable (word) w::w2 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -16,18 +19,16 @@ main: scope:[main] from @2 (byte*) SCREEN4#5 ← phi( @2/(byte*) SCREEN4#6 ) (byte*) SCREEN3#5 ← phi( @2/(byte*) SCREEN3#6 ) (byte*) SCREEN2#2 ← phi( @2/(byte*) SCREEN2#3 ) - (byte*) SCREEN#2 ← phi( @2/(byte*) SCREEN#3 ) (byte) main::b#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@1 (byte*) SCREEN4#4 ← phi( main/(byte*) SCREEN4#5 main::@1/(byte*) SCREEN4#4 ) (byte*) SCREEN3#4 ← phi( main/(byte*) SCREEN3#5 main::@1/(byte*) SCREEN3#4 ) (byte*) SCREEN2#1 ← phi( main/(byte*) SCREEN2#2 main::@1/(byte*) SCREEN2#1 ) - (byte*) SCREEN#1 ← phi( main/(byte*) SCREEN#2 main::@1/(byte*) SCREEN#1 ) (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@1/(byte) main::b#1 ) (byte/word/signed word/dword/signed dword~) main::$0 ← (byte/word/signed word/dword/signed dword) $c8 - (byte) main::b#2 (byte) main::b2#0 ← (byte/word/signed word/dword/signed dword~) main::$0 - *((byte*) SCREEN#1 + (byte) main::b#2) ← (byte) main::b2#0 + *((byte*) SCREEN#0 + (byte) main::b#2) ← (byte) main::b2#0 (signed byte~) main::$1 ← ((signed byte)) (byte) main::b#2 (signed byte~) main::$2 ← - (signed byte~) main::$1 (signed byte) main::sb#0 ← (signed byte~) main::$2 @@ -77,7 +78,6 @@ w::@return: scope:[w] from w::@1 (byte*) SCREEN4#6 ← phi( @begin/(byte*) SCREEN4#0 ) (byte*) SCREEN3#6 ← phi( @begin/(byte*) SCREEN3#0 ) (byte*) SCREEN2#3 ← phi( @begin/(byte*) SCREEN2#0 ) - (byte*) SCREEN#3 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@3 @3: scope:[] from @2 @@ -97,9 +97,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 (byte*) SCREEN2 (byte*) SCREEN2#0 (byte*) SCREEN2#1 @@ -172,20 +169,16 @@ Alias (byte*) SCREEN3#3 = (byte*) SCREEN3#4 Alias (byte*) SCREEN4#3 = (byte*) SCREEN4#4 Alias (byte) w::b#0 = (byte~) w::$1 Alias (byte) w::b2#0 = (byte/signed word/word/dword/signed dword~) w::$3 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#1 Self Phi Eliminated (byte*) SCREEN2#1 Self Phi Eliminated (byte*) SCREEN3#3 Self Phi Eliminated (byte*) SCREEN4#3 Self Phi Eliminated (byte*) SCREEN3#1 Self Phi Eliminated (byte*) SCREEN4#1 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#0 Redundant Phi (byte*) SCREEN2#2 (byte*) SCREEN2#0 Redundant Phi (byte*) SCREEN3#5 (byte*) SCREEN3#0 Redundant Phi (byte*) SCREEN4#5 (byte*) SCREEN4#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2 Redundant Phi (byte*) SCREEN2#1 (byte*) SCREEN2#2 Redundant Phi (byte*) SCREEN3#3 (byte*) SCREEN3#5 Redundant Phi (byte*) SCREEN4#3 (byte*) SCREEN4#5 diff --git a/src/test/ref/chargen.log b/src/test/ref/chargen.log index 6fa5fa8df..cc349b5da 100644 --- a/src/test/ref/chargen.log +++ b/src/test/ref/chargen.log @@ -1,3 +1,6 @@ +Identified constant variable (byte*) PROCPORT +Identified constant variable (byte*) CHARGEN +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -6,18 +9,14 @@ CONTROL FLOW GRAPH SSA (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@1 main: scope:[main] from @1 - (byte*) SCREEN#1 ← phi( @1/(byte*) SCREEN#2 ) - (byte*) PROCPORT#1 ← phi( @1/(byte*) PROCPORT#3 ) - (byte*) CHARGEN#1 ← phi( @1/(byte*) CHARGEN#2 ) asm { sei } - (byte*~) main::$0 ← (byte*) CHARGEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte*~) main::$0 ← (byte*) CHARGEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 8 (byte*) main::CHAR_A#0 ← (byte*~) main::$0 - *((byte*) PROCPORT#1) ← (byte/signed byte/word/signed word/dword/signed dword) $32 - (byte*) main::sc#0 ← (byte*) SCREEN#1 + *((byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $32 + (byte*) main::sc#0 ← (byte*) SCREEN#0 (byte) main::y#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@5 - (byte*) PROCPORT#8 ← phi( main/(byte*) PROCPORT#1 main::@5/(byte*) PROCPORT#4 ) (byte*) main::sc#7 ← phi( main/(byte*) main::sc#0 main::@5/(byte*) main::sc#2 ) (byte) main::y#2 ← phi( main/(byte) main::y#0 main::@5/(byte) main::y#1 ) (byte*) main::CHAR_A#1 ← phi( main/(byte*) main::CHAR_A#0 main::@5/(byte*) main::CHAR_A#2 ) @@ -25,7 +24,6 @@ main::@1: scope:[main] from main main::@5 (byte) main::x#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@2 main::@2: scope:[main] from main::@1 main::@3 - (byte*) PROCPORT#6 ← phi( main::@1/(byte*) PROCPORT#8 main::@3/(byte*) PROCPORT#5 ) (byte*) main::CHAR_A#4 ← phi( main::@1/(byte*) main::CHAR_A#1 main::@3/(byte*) main::CHAR_A#3 ) (byte) main::y#5 ← phi( main::@1/(byte) main::y#2 main::@3/(byte) main::y#4 ) (byte) main::x#3 ← phi( main::@1/(byte) main::x#0 main::@3/(byte) main::x#1 ) @@ -38,7 +36,6 @@ main::@2: scope:[main] from main::@1 main::@3 if((bool~) main::$3) goto main::@3 to:main::@4 main::@3: scope:[main] from main::@2 main::@4 - (byte*) PROCPORT#5 ← phi( main::@2/(byte*) PROCPORT#6 main::@4/(byte*) PROCPORT#7 ) (byte*) main::CHAR_A#3 ← phi( main::@2/(byte*) main::CHAR_A#4 main::@4/(byte*) main::CHAR_A#5 ) (byte) main::y#4 ← phi( main::@2/(byte) main::y#5 main::@4/(byte) main::y#6 ) (byte) main::x#2 ← phi( main::@2/(byte) main::x#3 main::@4/(byte) main::x#4 ) @@ -54,7 +51,6 @@ main::@3: scope:[main] from main::@2 main::@4 if((bool~) main::$5) goto main::@2 to:main::@5 main::@4: scope:[main] from main::@2 - (byte*) PROCPORT#7 ← phi( main::@2/(byte*) PROCPORT#6 ) (byte*) main::CHAR_A#5 ← phi( main::@2/(byte*) main::CHAR_A#4 ) (byte) main::y#6 ← phi( main::@2/(byte) main::y#5 ) (byte) main::x#4 ← phi( main::@2/(byte) main::x#3 ) @@ -63,7 +59,6 @@ main::@4: scope:[main] from main::@2 (byte) main::c#1 ← (byte) '*' to:main::@3 main::@5: scope:[main] from main::@3 - (byte*) PROCPORT#4 ← phi( main::@3/(byte*) PROCPORT#5 ) (byte*) main::CHAR_A#2 ← phi( main::@3/(byte*) main::CHAR_A#3 ) (byte) main::y#3 ← phi( main::@3/(byte) main::y#4 ) (byte*) main::sc#4 ← phi( main::@3/(byte*) main::sc#1 ) @@ -74,17 +69,13 @@ main::@5: scope:[main] from main::@3 if((bool~) main::$7) goto main::@1 to:main::@6 main::@6: scope:[main] from main::@5 - (byte*) PROCPORT#2 ← phi( main::@5/(byte*) PROCPORT#4 ) - *((byte*) PROCPORT#2) ← (byte/signed byte/word/signed word/dword/signed dword) $37 + *((byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $37 asm { cli } to:main::@return main::@return: scope:[main] from main::@6 return to:@return @1: scope:[] from @begin - (byte*) SCREEN#2 ← phi( @begin/(byte*) SCREEN#0 ) - (byte*) PROCPORT#3 ← phi( @begin/(byte*) PROCPORT#0 ) - (byte*) CHARGEN#2 ← phi( @begin/(byte*) CHARGEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -98,22 +89,10 @@ SYMBOL TABLE SSA (label) @end (byte*) CHARGEN (byte*) CHARGEN#0 -(byte*) CHARGEN#1 -(byte*) CHARGEN#2 (byte*) PROCPORT (byte*) PROCPORT#0 -(byte*) PROCPORT#1 -(byte*) PROCPORT#2 -(byte*) PROCPORT#3 -(byte*) PROCPORT#4 -(byte*) PROCPORT#5 -(byte*) PROCPORT#6 -(byte*) PROCPORT#7 -(byte*) PROCPORT#8 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 (void()) main() (byte*~) main::$0 (byte~) main::$1 @@ -173,7 +152,7 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [17] (bool~) main::$3 ← (byte~) main::$1 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [16] (bool~) main::$2 ← (byte~) main::$1 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [16] (bool~) main::$3 ← (byte~) main::$1 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [15] (bool~) main::$2 ← (byte~) main::$1 != (byte/signed byte/word/signed word/dword/signed dword) 0 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte*) main::CHAR_A#0 = (byte*~) main::$0 Alias (byte) main::bits#1 = (byte~) main::$4 @@ -182,37 +161,26 @@ Alias (byte) main::bits#2 = (byte) main::bits#4 Alias (byte) main::x#3 = (byte) main::x#4 Alias (byte) main::y#5 = (byte) main::y#6 Alias (byte*) main::CHAR_A#4 = (byte*) main::CHAR_A#5 -Alias (byte*) PROCPORT#6 = (byte*) PROCPORT#7 Alias (byte*) main::sc#1 = (byte*) main::sc#4 Alias (byte) main::y#3 = (byte) main::y#4 Alias (byte*) main::CHAR_A#2 = (byte*) main::CHAR_A#3 -Alias (byte*) PROCPORT#2 = (byte*) PROCPORT#4 (byte*) PROCPORT#5 Alias (byte*) main::sc#2 = (byte*~) main::$6 -Alias (byte*) CHARGEN#0 = (byte*) CHARGEN#2 -Alias (byte*) PROCPORT#0 = (byte*) PROCPORT#3 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#2 Successful SSA optimization Pass2AliasElimination Alias (byte*) main::sc#3 = (byte*) main::sc#5 Alias (byte) main::bits#2 = (byte) main::bits#3 Alias (byte) main::x#2 = (byte) main::x#3 Alias (byte) main::y#3 = (byte) main::y#5 Alias (byte*) main::CHAR_A#2 = (byte*) main::CHAR_A#4 -Alias (byte*) PROCPORT#2 = (byte*) PROCPORT#6 Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (byte) main::y#3 Self Phi Eliminated (byte*) main::CHAR_A#2 -Self Phi Eliminated (byte*) PROCPORT#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) CHARGEN#1 (byte*) CHARGEN#0 -Redundant Phi (byte*) PROCPORT#1 (byte*) PROCPORT#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 Redundant Phi (byte) main::y#3 (byte) main::y#2 Redundant Phi (byte*) main::CHAR_A#2 (byte*) main::CHAR_A#1 -Redundant Phi (byte*) PROCPORT#2 (byte*) PROCPORT#8 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$3 [18] if((byte~) main::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3 -Simple Condition (bool~) main::$5 [26] if((byte) main::x#1!=rangelast(0,7)) goto main::@2 -Simple Condition (bool~) main::$7 [34] if((byte) main::y#1!=rangelast(0,7)) goto main::@1 +Simple Condition (bool~) main::$3 [17] if((byte~) main::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@3 +Simple Condition (bool~) main::$5 [25] if((byte) main::x#1!=rangelast(0,7)) goto main::@2 +Simple Condition (bool~) main::$7 [33] if((byte) main::y#1!=rangelast(0,7)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) PROCPORT#0 = ((byte*))1 Constant (const byte*) CHARGEN#0 = ((byte*))$d000 @@ -230,10 +198,8 @@ Resolved ranged comparison value if(main::x#1!=rangelast(0,7)) goto main::@2 to Resolved ranged next value main::y#1 ← ++ main::y#2 to ++ Resolved ranged comparison value if(main::y#1!=rangelast(0,7)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 8 Self Phi Eliminated (byte*) main::CHAR_A#1 -Self Phi Eliminated (byte*) PROCPORT#8 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (byte*) main::CHAR_A#1 (const byte*) main::CHAR_A#0 -Redundant Phi (byte*) PROCPORT#8 (const byte*) PROCPORT#0 Successful SSA optimization Pass2RedundantPhiElimination Inlining constant with var siblings (const byte) main::y#0 Inlining constant with var siblings (const byte) main::x#0 diff --git a/src/test/ref/clobber-a-problem.log b/src/test/ref/clobber-a-problem.log index 12bc93926..2c5e10e5b 100644 --- a/src/test/ref/clobber-a-problem.log +++ b/src/test/ref/clobber-a-problem.log @@ -1,4 +1,8 @@ Resolved forward reference irq to interrupt(HARDWARE_CLOBBER)(void()) irq() +Identified constant variable (byte*) BORDERCOL +Identified constant variable (byte*) RASTER +Identified constant variable (byte) DARK_GREY +Identified constant variable (byte) BLACK CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -16,19 +20,11 @@ main::@return: scope:[main] from main return to:@return @1: scope:[] from @begin - (byte) BLACK#5 ← phi( @begin/(byte) BLACK#0 ) - (byte*) RASTER#5 ← phi( @begin/(byte*) RASTER#0 ) - (byte*) BORDERCOL#5 ← phi( @begin/(byte*) BORDERCOL#0 ) - (byte) DARK_GREY#3 ← phi( @begin/(byte) DARK_GREY#0 ) (byte) irq_raster_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:@2 irq: scope:[irq] from - (byte) BLACK#2 ← phi( @2/(byte) BLACK#4 ) - (byte*) RASTER#2 ← phi( @2/(byte*) RASTER#4 ) (byte) irq_raster_next#3 ← phi( @2/(byte) irq_raster_next#5 ) - (byte*) BORDERCOL#1 ← phi( @2/(byte*) BORDERCOL#3 ) - (byte) DARK_GREY#1 ← phi( @2/(byte) DARK_GREY#2 ) - *((byte*) BORDERCOL#1) ← (byte) DARK_GREY#1 + *((byte*) BORDERCOL#0) ← (byte) DARK_GREY#0 (byte) irq_raster_next#1 ← (byte) irq_raster_next#3 + (byte/signed byte/word/signed word/dword/signed dword) $15 (byte) irq::raster_next#0 ← (byte) irq_raster_next#1 (byte~) irq::$0 ← (byte) irq::raster_next#0 & (byte/signed byte/word/signed word/dword/signed dword) 7 @@ -38,18 +34,12 @@ irq: scope:[irq] from to:irq::@2 irq::@1: scope:[irq] from irq irq::@2 (byte) irq_raster_next#6 ← phi( irq/(byte) irq_raster_next#1 irq::@2/(byte) irq_raster_next#7 ) - (byte*) BORDERCOL#2 ← phi( irq/(byte*) BORDERCOL#1 irq::@2/(byte*) BORDERCOL#4 ) - (byte) BLACK#1 ← phi( irq/(byte) BLACK#2 irq::@2/(byte) BLACK#3 ) - (byte*) RASTER#1 ← phi( irq/(byte*) RASTER#2 irq::@2/(byte*) RASTER#3 ) (byte) irq::raster_next#2 ← phi( irq/(byte) irq::raster_next#0 irq::@2/(byte) irq::raster_next#1 ) - *((byte*) RASTER#1) ← (byte) irq::raster_next#2 - *((byte*) BORDERCOL#2) ← (byte) BLACK#1 + *((byte*) RASTER#0) ← (byte) irq::raster_next#2 + *((byte*) BORDERCOL#0) ← (byte) BLACK#0 to:irq::@return irq::@2: scope:[irq] from irq (byte) irq_raster_next#7 ← phi( irq/(byte) irq_raster_next#1 ) - (byte*) BORDERCOL#4 ← phi( irq/(byte*) BORDERCOL#1 ) - (byte) BLACK#3 ← phi( irq/(byte) BLACK#2 ) - (byte*) RASTER#3 ← phi( irq/(byte*) RASTER#2 ) (byte) irq::raster_next#3 ← phi( irq/(byte) irq::raster_next#0 ) (byte) irq::raster_next#1 ← (byte) irq::raster_next#3 - (byte/signed byte/word/signed word/dword/signed dword) 1 to:irq::@1 @@ -59,11 +49,7 @@ irq::@return: scope:[irq] from irq::@1 return to:@return @2: scope:[] from @1 - (byte) BLACK#4 ← phi( @1/(byte) BLACK#5 ) - (byte*) RASTER#4 ← phi( @1/(byte*) RASTER#5 ) (byte) irq_raster_next#5 ← phi( @1/(byte) irq_raster_next#0 ) - (byte*) BORDERCOL#3 ← phi( @1/(byte*) BORDERCOL#5 ) - (byte) DARK_GREY#2 ← phi( @1/(byte) DARK_GREY#3 ) call main to:@3 @3: scope:[] from @2 @@ -78,32 +64,14 @@ SYMBOL TABLE SSA (label) @end (byte) BLACK (byte) BLACK#0 -(byte) BLACK#1 -(byte) BLACK#2 -(byte) BLACK#3 -(byte) BLACK#4 -(byte) BLACK#5 (byte*) BORDERCOL (byte*) BORDERCOL#0 -(byte*) BORDERCOL#1 -(byte*) BORDERCOL#2 -(byte*) BORDERCOL#3 -(byte*) BORDERCOL#4 -(byte*) BORDERCOL#5 (byte) DARK_GREY (byte) DARK_GREY#0 -(byte) DARK_GREY#1 -(byte) DARK_GREY#2 -(byte) DARK_GREY#3 (void()**) KERNEL_IRQ (void()**) KERNEL_IRQ#0 (byte*) RASTER (byte*) RASTER#0 -(byte*) RASTER#1 -(byte*) RASTER#2 -(byte*) RASTER#3 -(byte*) RASTER#4 -(byte*) RASTER#5 interrupt(HARDWARE_CLOBBER)(void()) irq() (byte~) irq::$0 (bool~) irq::$1 @@ -131,32 +99,18 @@ interrupt(HARDWARE_CLOBBER)(void()) irq() Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [16] (bool~) irq::$2 ← (byte~) irq::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 from [15] (bool~) irq::$1 ← (byte~) irq::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [15] (bool~) irq::$2 ← (byte~) irq::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 from [14] (bool~) irq::$1 ← (byte~) irq::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 Successful SSA optimization Pass2UnaryNotSimplification -Alias (byte) DARK_GREY#0 = (byte) DARK_GREY#3 (byte) DARK_GREY#2 -Alias (byte*) BORDERCOL#0 = (byte*) BORDERCOL#5 (byte*) BORDERCOL#3 -Alias (byte*) RASTER#0 = (byte*) RASTER#5 (byte*) RASTER#4 -Alias (byte) BLACK#0 = (byte) BLACK#5 (byte) BLACK#4 Alias (byte) irq::raster_next#0 = (byte) irq::raster_next#3 -Alias (byte*) RASTER#2 = (byte*) RASTER#3 -Alias (byte) BLACK#2 = (byte) BLACK#3 -Alias (byte*) BORDERCOL#1 = (byte*) BORDERCOL#4 Alias (byte) irq_raster_next#1 = (byte) irq_raster_next#7 Alias (byte) irq_raster_next#2 = (byte) irq_raster_next#4 (byte) irq_raster_next#6 Alias (byte) irq_raster_next#0 = (byte) irq_raster_next#5 Successful SSA optimization Pass2AliasElimination -Alias (byte*) RASTER#1 = (byte*) RASTER#2 -Alias (byte) BLACK#1 = (byte) BLACK#2 -Alias (byte*) BORDERCOL#1 = (byte*) BORDERCOL#2 Alias (byte) irq_raster_next#1 = (byte) irq_raster_next#2 Successful SSA optimization Pass2AliasElimination -Redundant Phi (byte) DARK_GREY#1 (byte) DARK_GREY#0 -Redundant Phi (byte*) BORDERCOL#1 (byte*) BORDERCOL#0 Redundant Phi (byte) irq_raster_next#3 (byte) irq_raster_next#0 -Redundant Phi (byte*) RASTER#1 (byte*) RASTER#0 -Redundant Phi (byte) BLACK#1 (byte) BLACK#0 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) irq::$2 [17] if((byte~) irq::$0!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto irq::@1 +Simple Condition (bool~) irq::$2 [16] if((byte~) irq::$0!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto irq::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) BORDERCOL#0 = ((byte*))$d020 Constant (const byte*) RASTER#0 = ((byte*))$d012 diff --git a/src/test/ref/complex/tetris/test-sprites.log b/src/test/ref/complex/tetris/test-sprites.log index ec6e46b52..fc7a9d47a 100644 --- a/src/test/ref/complex/tetris/test-sprites.log +++ b/src/test/ref/complex/tetris/test-sprites.log @@ -1,4 +1,17 @@ Resolved forward reference sprites_irq to interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() +Identified constant variable (byte*) current_piece_gfx +Identified constant variable (byte) current_piece_char +Identified constant variable (byte) current_xpos +Identified constant variable (byte) current_ypos +Identified constant variable (byte) render_screen_render +Identified constant variable (byte) render_screen_show +Identified constant variable (dword) score_bcd +Identified constant variable (word) lines_bcd +Identified constant variable (byte) level_bcd +Identified constant variable (byte) level +Identified constant variable (byte) game_over +Identified constant variable (byte*) SIN +Identified constant variable (byte*) SIN_SPRITE Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx Inlined call (byte~) $5 ← call toSpritePtr (byte*) PLAYFIELD_SPRITES Inlined call (byte~) sprites_irq::$5 ← call toSpritePtr (byte*) PLAYFIELD_SPRITES @@ -375,23 +388,17 @@ sprites_irq::@return: scope:[sprites_irq] from sprites_irq::@7 (byte) sin_idx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:@9 main: scope:[main] from @9 - (byte*) SIN#23 ← phi( @9/(byte*) SIN#24 ) (byte) sin_idx#33 ← phi( @9/(byte) sin_idx#16 ) - (byte*) SIN_SPRITE#14 ← phi( @9/(byte*) SIN_SPRITE#15 ) (byte*) main::vicSelectGfxBank1_gfx#0 ← (byte*) PLAYFIELD_SCREEN_1#0 to:main::vicSelectGfxBank1 main::vicSelectGfxBank1: scope:[main] from main - (byte*) SIN#22 ← phi( main/(byte*) SIN#23 ) (byte) sin_idx#32 ← phi( main/(byte) sin_idx#33 ) - (byte*) SIN_SPRITE#13 ← phi( main/(byte*) SIN_SPRITE#14 ) (byte*) main::vicSelectGfxBank1_gfx#1 ← phi( main/(byte*) main::vicSelectGfxBank1_gfx#0 ) *((byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 (byte*) main::vicSelectGfxBank1_toDd001_gfx#0 ← (byte*) main::vicSelectGfxBank1_gfx#1 to:main::vicSelectGfxBank1_toDd001 main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1 - (byte*) SIN#21 ← phi( main::vicSelectGfxBank1/(byte*) SIN#22 ) (byte) sin_idx#31 ← phi( main::vicSelectGfxBank1/(byte) sin_idx#32 ) - (byte*) SIN_SPRITE#12 ← phi( main::vicSelectGfxBank1/(byte*) SIN_SPRITE#13 ) (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 ← phi( main::vicSelectGfxBank1/(byte*) main::vicSelectGfxBank1_toDd001_gfx#0 ) (word) main::vicSelectGfxBank1_toDd001_$0#0 ← ((word)) (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 (byte) main::vicSelectGfxBank1_toDd001_$1#0 ← > (word) main::vicSelectGfxBank1_toDd001_$0#0 @@ -400,31 +407,23 @@ main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1 (byte) main::vicSelectGfxBank1_toDd001_return#0 ← (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 to:main::vicSelectGfxBank1_toDd001_@return main::vicSelectGfxBank1_toDd001_@return: scope:[main] from main::vicSelectGfxBank1_toDd001 - (byte*) SIN#20 ← phi( main::vicSelectGfxBank1_toDd001/(byte*) SIN#21 ) (byte) sin_idx#30 ← phi( main::vicSelectGfxBank1_toDd001/(byte) sin_idx#31 ) - (byte*) SIN_SPRITE#11 ← phi( main::vicSelectGfxBank1_toDd001/(byte*) SIN_SPRITE#12 ) (byte) main::vicSelectGfxBank1_toDd001_return#2 ← phi( main::vicSelectGfxBank1_toDd001/(byte) main::vicSelectGfxBank1_toDd001_return#0 ) (byte) main::vicSelectGfxBank1_toDd001_return#1 ← (byte) main::vicSelectGfxBank1_toDd001_return#2 to:main::vicSelectGfxBank1_@1 main::vicSelectGfxBank1_@1: scope:[main] from main::vicSelectGfxBank1_toDd001_@return - (byte*) SIN#19 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte*) SIN#20 ) (byte) sin_idx#29 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte) sin_idx#30 ) - (byte*) SIN_SPRITE#10 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte*) SIN_SPRITE#11 ) (byte) main::vicSelectGfxBank1_toDd001_return#3 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte) main::vicSelectGfxBank1_toDd001_return#1 ) (byte) main::vicSelectGfxBank1_$0#0 ← (byte) main::vicSelectGfxBank1_toDd001_return#3 *((byte*) CIA2_PORT_A#0) ← (byte) main::vicSelectGfxBank1_$0#0 to:main::@3 main::@3: scope:[main] from main::vicSelectGfxBank1_@1 - (byte*) SIN#18 ← phi( main::vicSelectGfxBank1_@1/(byte*) SIN#19 ) (byte) sin_idx#28 ← phi( main::vicSelectGfxBank1_@1/(byte) sin_idx#29 ) - (byte*) SIN_SPRITE#9 ← phi( main::vicSelectGfxBank1_@1/(byte*) SIN_SPRITE#10 ) (byte*) main::toD0181_screen#0 ← (byte*) PLAYFIELD_SCREEN_1#0 (byte*) main::toD0181_gfx#0 ← (byte*) PLAYFIELD_CHARSET#0 to:main::toD0181 main::toD0181: scope:[main] from main::@3 - (byte*) SIN#17 ← phi( main::@3/(byte*) SIN#18 ) (byte) sin_idx#27 ← phi( main::@3/(byte) sin_idx#28 ) - (byte*) SIN_SPRITE#8 ← phi( main::@3/(byte*) SIN_SPRITE#9 ) (byte*) main::toD0181_gfx#1 ← phi( main::@3/(byte*) main::toD0181_gfx#0 ) (byte*) main::toD0181_screen#1 ← phi( main::@3/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 @@ -439,34 +438,26 @@ main::toD0181: scope:[main] from main::@3 (byte) main::toD0181_return#0 ← (byte) main::toD0181_$8#0 to:main::toD0181_@return main::toD0181_@return: scope:[main] from main::toD0181 - (byte*) SIN#16 ← phi( main::toD0181/(byte*) SIN#17 ) (byte) sin_idx#26 ← phi( main::toD0181/(byte) sin_idx#27 ) - (byte*) SIN_SPRITE#6 ← phi( main::toD0181/(byte*) SIN_SPRITE#8 ) (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 ) (byte) main::toD0181_return#1 ← (byte) main::toD0181_return#2 to:main::@4 main::@4: scope:[main] from main::toD0181_@return - (byte*) SIN#15 ← phi( main::toD0181_@return/(byte*) SIN#16 ) (byte) sin_idx#25 ← phi( main::toD0181_@return/(byte) sin_idx#26 ) - (byte*) SIN_SPRITE#4 ← phi( main::toD0181_@return/(byte*) SIN_SPRITE#6 ) (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) (byte~) main::$1 ← (byte) main::toD0181_return#3 *((byte*) D018#0) ← (byte~) main::$1 call sprites_init to:main::@6 main::@6: scope:[main] from main::@4 - (byte*) SIN#14 ← phi( main::@4/(byte*) SIN#15 ) (byte) sin_idx#24 ← phi( main::@4/(byte) sin_idx#25 ) - (byte*) SIN_SPRITE#3 ← phi( main::@4/(byte*) SIN_SPRITE#4 ) *((byte*) SPRITES_ENABLE#0) ← (byte/word/signed word/dword/signed dword) $ff (byte) main::xpos#0 ← (byte/signed byte/word/signed word/dword/signed dword) $18 (byte) main::ypos#0 ← (byte/signed byte/word/signed word/dword/signed dword) $32 (byte) main::s#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4 to:main::@1 main::@1: scope:[main] from main::@5 main::@6 - (byte*) SIN#13 ← phi( main::@5/(byte*) SIN#10 main::@6/(byte*) SIN#14 ) (byte) sin_idx#23 ← phi( main::@5/(byte) sin_idx#20 main::@6/(byte) sin_idx#24 ) - (byte*) SIN_SPRITE#1 ← phi( main::@5/(byte*) SIN_SPRITE#2 main::@6/(byte*) SIN_SPRITE#3 ) (byte) main::ypos#2 ← phi( main::@5/(byte) main::ypos#1 main::@6/(byte) main::ypos#0 ) (byte) main::xpos#2 ← phi( main::@5/(byte) main::xpos#1 main::@6/(byte) main::xpos#0 ) (byte) main::s#2 ← phi( main::@5/(byte) main::s#1 main::@6/(byte) main::s#0 ) @@ -476,12 +467,10 @@ main::@1: scope:[main] from main::@5 main::@6 *((byte*) SPRITES_YPOS#0 + (byte) main::s2#0) ← (byte) main::ypos#2 (byte/signed word/word/dword/signed dword~) main::$4 ← (byte) main::s#2 - (byte/signed byte/word/signed word/dword/signed dword) 3 *((byte*) SPRITES_COLS#0 + (byte) main::s#2) ← (byte/signed word/word/dword/signed dword~) main::$4 - (byte*) main::toSpritePtr2_sprite#0 ← (byte*) SIN_SPRITE#1 + (byte*) main::toSpritePtr2_sprite#0 ← (byte*) SIN_SPRITE#0 to:main::toSpritePtr2 main::toSpritePtr2: scope:[main] from main::@1 - (byte*) SIN#12 ← phi( main::@1/(byte*) SIN#13 ) (byte) sin_idx#22 ← phi( main::@1/(byte) sin_idx#23 ) - (byte*) SIN_SPRITE#7 ← phi( main::@1/(byte*) SIN_SPRITE#1 ) (byte) main::ypos#5 ← phi( main::@1/(byte) main::ypos#2 ) (byte) main::xpos#5 ← phi( main::@1/(byte) main::xpos#2 ) (byte) main::s#5 ← phi( main::@1/(byte) main::s#2 ) @@ -492,9 +481,7 @@ main::toSpritePtr2: scope:[main] from main::@1 (byte) main::toSpritePtr2_return#0 ← (byte) main::toSpritePtr2_$2#0 to:main::toSpritePtr2_@return main::toSpritePtr2_@return: scope:[main] from main::toSpritePtr2 - (byte*) SIN#11 ← phi( main::toSpritePtr2/(byte*) SIN#12 ) (byte) sin_idx#21 ← phi( main::toSpritePtr2/(byte) sin_idx#22 ) - (byte*) SIN_SPRITE#5 ← phi( main::toSpritePtr2/(byte*) SIN_SPRITE#7 ) (byte) main::ypos#4 ← phi( main::toSpritePtr2/(byte) main::ypos#5 ) (byte) main::xpos#4 ← phi( main::toSpritePtr2/(byte) main::xpos#5 ) (byte) main::s#4 ← phi( main::toSpritePtr2/(byte) main::s#5 ) @@ -502,9 +489,7 @@ main::toSpritePtr2_@return: scope:[main] from main::toSpritePtr2 (byte) main::toSpritePtr2_return#1 ← (byte) main::toSpritePtr2_return#2 to:main::@5 main::@5: scope:[main] from main::toSpritePtr2_@return - (byte*) SIN#10 ← phi( main::toSpritePtr2_@return/(byte*) SIN#11 ) (byte) sin_idx#20 ← phi( main::toSpritePtr2_@return/(byte) sin_idx#21 ) - (byte*) SIN_SPRITE#2 ← phi( main::toSpritePtr2_@return/(byte*) SIN_SPRITE#5 ) (byte) main::ypos#3 ← phi( main::toSpritePtr2_@return/(byte) main::ypos#4 ) (byte) main::xpos#3 ← phi( main::toSpritePtr2_@return/(byte) main::xpos#4 ) (byte) main::s#3 ← phi( main::toSpritePtr2_@return/(byte) main::s#4 ) @@ -518,12 +503,10 @@ main::@5: scope:[main] from main::toSpritePtr2_@return if((bool~) main::$6) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@5 - (byte*) SIN#9 ← phi( main::@5/(byte*) SIN#10 ) (byte) sin_idx#17 ← phi( main::@5/(byte) sin_idx#20 ) call sprites_irq_init to:main::@7 main::@7: scope:[main] from main::@2 - (byte*) SIN#8 ← phi( main::@2/(byte*) SIN#9 ) (byte) sin_idx#12 ← phi( main::@2/(byte) sin_idx#17 ) call loop to:main::@8 @@ -537,26 +520,21 @@ main::@return: scope:[main] from main::@8 return to:@return loop: scope:[loop] from main::@7 - (byte*) SIN#6 ← phi( main::@7/(byte*) SIN#8 ) (byte) sin_idx#18 ← phi( main::@7/(byte) sin_idx#12 ) to:loop::@1 loop::@1: scope:[loop] from loop loop::@9 - (byte*) SIN#5 ← phi( loop/(byte*) SIN#6 loop::@9/(byte*) SIN#7 ) (byte) sin_idx#15 ← phi( loop/(byte) sin_idx#18 loop::@9/(byte) sin_idx#3 ) if(true) goto loop::@2 to:loop::@return loop::@2: scope:[loop] from loop::@1 - (byte*) SIN#4 ← phi( loop::@1/(byte*) SIN#5 ) (byte) sin_idx#19 ← phi( loop::@1/(byte) sin_idx#15 ) to:loop::@4 loop::@4: scope:[loop] from loop::@2 loop::@4 - (byte*) SIN#3 ← phi( loop::@2/(byte*) SIN#4 loop::@4/(byte*) SIN#3 ) (byte) sin_idx#13 ← phi( loop::@2/(byte) sin_idx#19 loop::@4/(byte) sin_idx#13 ) (bool~) loop::$0 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $ff if((bool~) loop::$0) goto loop::@4 to:loop::@8 loop::@8: scope:[loop] from loop::@4 - (byte*) SIN#2 ← phi( loop::@4/(byte*) SIN#3 ) (byte) sin_idx#8 ← phi( loop::@4/(byte) sin_idx#13 ) (byte) loop::idx#0 ← (byte) sin_idx#8 (byte) loop::s#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4 @@ -564,17 +542,15 @@ loop::@8: scope:[loop] from loop::@4 loop::@5: scope:[loop] from loop::@5 loop::@8 (byte) sin_idx#14 ← phi( loop::@5/(byte) sin_idx#14 loop::@8/(byte) sin_idx#8 ) (byte) loop::idx#2 ← phi( loop::@5/(byte) loop::idx#1 loop::@8/(byte) loop::idx#0 ) - (byte*) SIN#1 ← phi( loop::@5/(byte*) SIN#1 loop::@8/(byte*) SIN#2 ) (byte) loop::s#2 ← phi( loop::@5/(byte) loop::s#1 loop::@8/(byte) loop::s#0 ) (byte~) loop::$1 ← (byte) loop::s#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 - *((byte*) SPRITES_YPOS#0 + (byte~) loop::$1) ← *((byte*) SIN#1 + (byte) loop::idx#2) + *((byte*) SPRITES_YPOS#0 + (byte~) loop::$1) ← *((byte*) SIN#0 + (byte) loop::idx#2) (byte) loop::idx#1 ← (byte) loop::idx#2 + (byte/signed byte/word/signed word/dword/signed dword) $a (byte) loop::s#1 ← (byte) loop::s#2 + rangenext(4,7) (bool~) loop::$2 ← (byte) loop::s#1 != rangelast(4,7) if((bool~) loop::$2) goto loop::@5 to:loop::@9 loop::@9: scope:[loop] from loop::@5 - (byte*) SIN#7 ← phi( loop::@5/(byte*) SIN#1 ) (byte) sin_idx#9 ← phi( loop::@5/(byte) sin_idx#14 ) (byte) sin_idx#3 ← ++ (byte) sin_idx#9 to:loop::@1 @@ -584,8 +560,6 @@ loop::@return: scope:[loop] from loop::@1 return to:@return @9: scope:[] from @7 - (byte*) SIN#24 ← phi( @7/(byte*) SIN#0 ) - (byte*) SIN_SPRITE#15 ← phi( @7/(byte*) SIN_SPRITE#0 ) (byte) irq_cnt#17 ← phi( @7/(byte) irq_cnt#19 ) (byte) render_screen_showing#4 ← phi( @7/(byte) render_screen_showing#5 ) (byte) irq_sprite_ptr#14 ← phi( @7/(byte) irq_sprite_ptr#17 ) @@ -750,47 +724,8 @@ SYMBOL TABLE SSA (byte) RED#0 (byte*) SIN (byte*) SIN#0 -(byte*) SIN#1 -(byte*) SIN#10 -(byte*) SIN#11 -(byte*) SIN#12 -(byte*) SIN#13 -(byte*) SIN#14 -(byte*) SIN#15 -(byte*) SIN#16 -(byte*) SIN#17 -(byte*) SIN#18 -(byte*) SIN#19 -(byte*) SIN#2 -(byte*) SIN#20 -(byte*) SIN#21 -(byte*) SIN#22 -(byte*) SIN#23 -(byte*) SIN#24 -(byte*) SIN#3 -(byte*) SIN#4 -(byte*) SIN#5 -(byte*) SIN#6 -(byte*) SIN#7 -(byte*) SIN#8 -(byte*) SIN#9 (byte*) SIN_SPRITE (byte*) SIN_SPRITE#0 -(byte*) SIN_SPRITE#1 -(byte*) SIN_SPRITE#10 -(byte*) SIN_SPRITE#11 -(byte*) SIN_SPRITE#12 -(byte*) SIN_SPRITE#13 -(byte*) SIN_SPRITE#14 -(byte*) SIN_SPRITE#15 -(byte*) SIN_SPRITE#2 -(byte*) SIN_SPRITE#3 -(byte*) SIN_SPRITE#4 -(byte*) SIN_SPRITE#5 -(byte*) SIN_SPRITE#6 -(byte*) SIN_SPRITE#7 -(byte*) SIN_SPRITE#8 -(byte*) SIN_SPRITE#9 (byte*) SPRITES_COLS (byte*) SPRITES_COLS#0 (byte*) SPRITES_ENABLE @@ -1248,9 +1183,7 @@ Alias (byte) irq_sprite_ypos#11 = (byte) irq_sprite_ypos#8 (byte) irq_sprite_ypo Alias (byte) irq_sprite_ptr#11 = (byte) irq_sprite_ptr#8 (byte) irq_sprite_ptr#4 Alias (byte) irq_cnt#0 = (byte) irq_cnt#19 (byte) irq_cnt#17 Alias (byte*) main::vicSelectGfxBank1_gfx#0 = (byte*) main::vicSelectGfxBank1_gfx#1 (byte*) main::vicSelectGfxBank1_toDd001_gfx#0 (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 -Alias (byte*) SIN_SPRITE#10 = (byte*) SIN_SPRITE#13 (byte*) SIN_SPRITE#14 (byte*) SIN_SPRITE#12 (byte*) SIN_SPRITE#11 (byte*) SIN_SPRITE#9 (byte*) SIN_SPRITE#8 (byte*) SIN_SPRITE#6 (byte*) SIN_SPRITE#4 (byte*) SIN_SPRITE#3 Alias (byte) sin_idx#24 = (byte) sin_idx#32 (byte) sin_idx#33 (byte) sin_idx#31 (byte) sin_idx#30 (byte) sin_idx#29 (byte) sin_idx#28 (byte) sin_idx#27 (byte) sin_idx#26 (byte) sin_idx#25 -Alias (byte*) SIN#14 = (byte*) SIN#22 (byte*) SIN#23 (byte*) SIN#21 (byte*) SIN#20 (byte*) SIN#19 (byte*) SIN#18 (byte*) SIN#17 (byte*) SIN#16 (byte*) SIN#15 Alias (byte) main::vicSelectGfxBank1_toDd001_return#0 = (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 (byte) main::vicSelectGfxBank1_toDd001_return#2 (byte) main::vicSelectGfxBank1_toDd001_return#1 (byte) main::vicSelectGfxBank1_toDd001_return#3 (byte) main::vicSelectGfxBank1_$0#0 Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 @@ -1260,20 +1193,13 @@ Alias (byte*) main::toSpritePtr2_sprite#0 = (byte*) main::toSpritePtr2_sprite#1 Alias (byte) main::s#2 = (byte) main::s#5 (byte) main::s#4 (byte) main::s#3 Alias (byte) main::xpos#2 = (byte) main::xpos#5 (byte) main::xpos#4 (byte) main::xpos#3 Alias (byte) main::ypos#2 = (byte) main::ypos#5 (byte) main::ypos#4 (byte) main::ypos#3 -Alias (byte*) SIN_SPRITE#1 = (byte*) SIN_SPRITE#7 (byte*) SIN_SPRITE#5 (byte*) SIN_SPRITE#2 Alias (byte) sin_idx#12 = (byte) sin_idx#22 (byte) sin_idx#23 (byte) sin_idx#21 (byte) sin_idx#20 (byte) sin_idx#17 -Alias (byte*) SIN#10 = (byte*) SIN#12 (byte*) SIN#13 (byte*) SIN#11 (byte*) SIN#9 (byte*) SIN#8 Alias (byte) main::toSpritePtr2_return#0 = (byte) main::toSpritePtr2_$2#0 (byte) main::toSpritePtr2_return#2 (byte) main::toSpritePtr2_return#1 (byte) main::toSpritePtr2_return#3 (byte~) main::$5 Alias (byte) sin_idx#1 = (byte) sin_idx#6 (byte) sin_idx#7 (byte) sin_idx#2 Alias (byte) sin_idx#10 = (byte) sin_idx#19 (byte) sin_idx#15 (byte) sin_idx#4 -Alias (byte*) SIN#4 = (byte*) SIN#5 Alias (byte) sin_idx#13 = (byte) sin_idx#8 -Alias (byte*) SIN#2 = (byte*) SIN#3 Alias (byte) sin_idx#14 = (byte) sin_idx#9 -Alias (byte*) SIN#1 = (byte*) SIN#7 Alias (byte) sin_idx#0 = (byte) sin_idx#16 -Alias (byte*) SIN_SPRITE#0 = (byte*) SIN_SPRITE#15 -Alias (byte*) SIN#0 = (byte*) SIN#24 Alias (byte) sin_idx#11 = (byte) sin_idx#5 Successful SSA optimization Pass2AliasElimination Alias candidate removed (volatile)(byte) IRQ_RASTER_FIRST#0 = (byte/signed word/word/dword/signed dword~) $3 (byte) irq_raster_next#0 (byte) irq_raster_next#23 (byte) irq_raster_next#21 (byte) irq_raster_next#20 (byte) irq_raster_next#17 (byte) irq_raster_next#10 @@ -1297,12 +1223,8 @@ Self Phi Eliminated (byte) render_screen_showing#1 Self Phi Eliminated (byte) irq_cnt#10 Self Phi Eliminated (byte) irq_raster_next#11 Self Phi Eliminated (byte) irq_sprite_ypos#10 -Self Phi Eliminated (byte*) SIN_SPRITE#1 Self Phi Eliminated (byte) sin_idx#12 -Self Phi Eliminated (byte*) SIN#10 Self Phi Eliminated (byte) sin_idx#13 -Self Phi Eliminated (byte*) SIN#2 -Self Phi Eliminated (byte*) SIN#1 Self Phi Eliminated (byte) sin_idx#14 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (byte) irq_sprite_ypos#22 (byte) irq_sprite_ypos#0 @@ -1327,18 +1249,11 @@ Redundant Phi (byte) sprites_irq::toSpritePtr2_return#3 (byte) sprites_irq::toSp Redundant Phi (byte) irq_sprite_ypos#14 (byte) irq_sprite_ypos#18 Redundant Phi (byte) irq_raster_next#17 (byte) irq_raster_next#20 Redundant Phi (byte) irq_sprite_ptr#17 (byte) irq_sprite_ptr#0 -Redundant Phi (byte*) SIN_SPRITE#10 (byte*) SIN_SPRITE#0 Redundant Phi (byte) sin_idx#24 (byte) sin_idx#0 -Redundant Phi (byte*) SIN#14 (byte*) SIN#0 -Redundant Phi (byte*) SIN_SPRITE#1 (byte*) SIN_SPRITE#10 Redundant Phi (byte) sin_idx#12 (byte) sin_idx#24 -Redundant Phi (byte*) SIN#10 (byte*) SIN#14 Redundant Phi (byte) sin_idx#1 (byte) sin_idx#10 Redundant Phi (byte) sin_idx#18 (byte) sin_idx#12 -Redundant Phi (byte*) SIN#6 (byte*) SIN#10 Redundant Phi (byte) sin_idx#13 (byte) sin_idx#10 -Redundant Phi (byte*) SIN#2 (byte*) SIN#4 -Redundant Phi (byte*) SIN#1 (byte*) SIN#2 Redundant Phi (byte) sin_idx#14 (byte) sin_idx#13 Redundant Phi (byte) irq_sprite_ypos#9 (byte) irq_sprite_ypos#14 Redundant Phi (byte) irq_raster_next#10 (byte) irq_raster_next#17 @@ -1545,10 +1460,6 @@ Culled Empty Block (label) loop::@2 Culled Empty Block (label) @11 Successful SSA optimization Pass2CullEmptyBlocks Alias candidate removed (volatile)(byte) sprites_irq::raster_sprite_gfx_modify#0 = (byte/signed word/word/dword/signed dword~) sprites_irq::$0 -Self Phi Eliminated (byte*) SIN#4 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SIN#4 (const byte*) SIN#0 -Successful SSA optimization Pass2RedundantPhiElimination Alias candidate removed (volatile)(byte) sprites_irq::raster_sprite_gfx_modify#0 = (byte/signed word/word/dword/signed dword~) sprites_irq::$0 Inlining constant with var siblings (const byte) sprites_init::s#0 Inlining constant with var siblings (const byte) sprites_init::xpos#0 diff --git a/src/test/ref/complex/tetris/tetris.log b/src/test/ref/complex/tetris/tetris.log index f7408426b..26f0b11c6 100644 --- a/src/test/ref/complex/tetris/tetris.log +++ b/src/test/ref/complex/tetris/tetris.log @@ -7,6 +7,7 @@ Resolved forward reference COLLISION_NONE to (byte) COLLISION_NONE Resolved forward reference COLLISION_NONE to (byte) COLLISION_NONE Resolved forward reference COLLISION_NONE to (byte) COLLISION_NONE Resolved forward reference COLLISION_NONE to (byte) COLLISION_NONE +Identified constant variable (byte) render_screen_original::SPACE Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx Inlined call call vicSelectGfxBank (byte*) PLAYFIELD_CHARSET Inlined call (byte~) render_show::$2 ← call toD018 (byte*) PLAYFIELD_SCREEN_1 (byte*) PLAYFIELD_CHARSET @@ -865,7 +866,6 @@ render_screen_original::@1: scope:[render_screen_original] from render_screen_o (byte*) render_screen_original::oscr#4 ← phi( render_screen_original/(byte*) render_screen_original::oscr#0 render_screen_original::@7/(byte*) render_screen_original::oscr#5 ) (byte*) render_screen_original::cols#7 ← phi( render_screen_original/(byte*) render_screen_original::cols#0 render_screen_original::@7/(byte*) render_screen_original::cols#8 ) (byte*) render_screen_original::screen#8 ← phi( render_screen_original/(byte*) render_screen_original::screen#9 render_screen_original::@7/(byte*) render_screen_original::screen#10 ) - (byte) render_screen_original::SPACE#3 ← phi( render_screen_original/(byte) render_screen_original::SPACE#0 render_screen_original::@7/(byte) render_screen_original::SPACE#5 ) (byte) render_screen_original::x#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:render_screen_original::@2 render_screen_original::@2: scope:[render_screen_original] from render_screen_original::@1 render_screen_original::@2 @@ -875,8 +875,7 @@ render_screen_original::@2: scope:[render_screen_original] from render_screen_o (byte) render_screen_original::x#4 ← phi( render_screen_original::@1/(byte) render_screen_original::x#0 render_screen_original::@2/(byte) render_screen_original::x#1 ) (byte*) render_screen_original::cols#4 ← phi( render_screen_original::@1/(byte*) render_screen_original::cols#7 render_screen_original::@2/(byte*) render_screen_original::cols#1 ) (byte*) render_screen_original::screen#5 ← phi( render_screen_original::@1/(byte*) render_screen_original::screen#8 render_screen_original::@2/(byte*) render_screen_original::screen#2 ) - (byte) render_screen_original::SPACE#1 ← phi( render_screen_original::@1/(byte) render_screen_original::SPACE#3 render_screen_original::@2/(byte) render_screen_original::SPACE#1 ) - *((byte*) render_screen_original::screen#5) ← (byte) render_screen_original::SPACE#1 + *((byte*) render_screen_original::screen#5) ← (byte) render_screen_original::SPACE#0 (byte*) render_screen_original::screen#2 ← ++ (byte*) render_screen_original::screen#5 *((byte*) render_screen_original::cols#4) ← (byte) BLACK#0 (byte*) render_screen_original::cols#1 ← ++ (byte*) render_screen_original::cols#4 @@ -886,7 +885,6 @@ render_screen_original::@2: scope:[render_screen_original] from render_screen_o to:render_screen_original::@3 render_screen_original::@3: scope:[render_screen_original] from render_screen_original::@2 render_screen_original::@3 (byte) render_screen_original::y#4 ← phi( render_screen_original::@2/(byte) render_screen_original::y#5 render_screen_original::@3/(byte) render_screen_original::y#4 ) - (byte) render_screen_original::SPACE#4 ← phi( render_screen_original::@2/(byte) render_screen_original::SPACE#1 render_screen_original::@3/(byte) render_screen_original::SPACE#4 ) (byte) render_screen_original::x#5 ← phi( render_screen_original::@2/(byte) render_screen_original::x#1 render_screen_original::@3/(byte) render_screen_original::x#2 ) (byte*) render_screen_original::cols#5 ← phi( render_screen_original::@2/(byte*) render_screen_original::cols#1 render_screen_original::@3/(byte*) render_screen_original::cols#2 ) (byte*) render_screen_original::ocols#2 ← phi( render_screen_original::@2/(byte*) render_screen_original::ocols#3 render_screen_original::@3/(byte*) render_screen_original::ocols#1 ) @@ -909,8 +907,7 @@ render_screen_original::@4: scope:[render_screen_original] from render_screen_o (byte) render_screen_original::x#6 ← phi( render_screen_original::@3/(byte) render_screen_original::x#2 render_screen_original::@4/(byte) render_screen_original::x#3 ) (byte*) render_screen_original::cols#6 ← phi( render_screen_original::@3/(byte*) render_screen_original::cols#2 render_screen_original::@4/(byte*) render_screen_original::cols#3 ) (byte*) render_screen_original::screen#7 ← phi( render_screen_original::@3/(byte*) render_screen_original::screen#3 render_screen_original::@4/(byte*) render_screen_original::screen#4 ) - (byte) render_screen_original::SPACE#2 ← phi( render_screen_original::@3/(byte) render_screen_original::SPACE#4 render_screen_original::@4/(byte) render_screen_original::SPACE#2 ) - *((byte*) render_screen_original::screen#7) ← (byte) render_screen_original::SPACE#2 + *((byte*) render_screen_original::screen#7) ← (byte) render_screen_original::SPACE#0 (byte*) render_screen_original::screen#4 ← ++ (byte*) render_screen_original::screen#7 *((byte*) render_screen_original::cols#6) ← (byte) BLACK#0 (byte*) render_screen_original::cols#3 ← ++ (byte*) render_screen_original::cols#6 @@ -923,7 +920,6 @@ render_screen_original::@7: scope:[render_screen_original] from render_screen_o (byte*) render_screen_original::oscr#5 ← phi( render_screen_original::@4/(byte*) render_screen_original::oscr#6 ) (byte*) render_screen_original::cols#8 ← phi( render_screen_original::@4/(byte*) render_screen_original::cols#3 ) (byte*) render_screen_original::screen#10 ← phi( render_screen_original::@4/(byte*) render_screen_original::screen#4 ) - (byte) render_screen_original::SPACE#5 ← phi( render_screen_original::@4/(byte) render_screen_original::SPACE#2 ) (byte) render_screen_original::y#2 ← phi( render_screen_original::@4/(byte) render_screen_original::y#3 ) (byte) render_screen_original::y#1 ← (byte) render_screen_original::y#2 + rangenext(0,$18) (bool~) render_screen_original::$7 ← (byte) render_screen_original::y#1 != rangelast(0,$18) @@ -6950,11 +6946,6 @@ SYMBOL TABLE SSA (label) render_screen_original::@return (byte) render_screen_original::SPACE (byte) render_screen_original::SPACE#0 -(byte) render_screen_original::SPACE#1 -(byte) render_screen_original::SPACE#2 -(byte) render_screen_original::SPACE#3 -(byte) render_screen_original::SPACE#4 -(byte) render_screen_original::SPACE#5 (byte*) render_screen_original::cols (byte*) render_screen_original::cols#0 (byte*) render_screen_original::cols#1 @@ -7586,7 +7577,6 @@ Alias (byte) render_bcd::bcd#7 = (byte) render_bcd::bcd#8 Alias (byte*) render_screen_original::oscr#0 = (byte*~) render_screen_original::$1 Alias (byte*) render_screen_original::ocols#0 = (byte*~) render_screen_original::$3 Alias (byte) render_screen_original::y#2 = (byte) render_screen_original::y#3 -Alias (byte) render_screen_original::SPACE#2 = (byte) render_screen_original::SPACE#5 Alias (byte*) render_screen_original::screen#10 = (byte*) render_screen_original::screen#4 Alias (byte*) render_screen_original::cols#3 = (byte*) render_screen_original::cols#8 Alias (byte*) render_screen_original::oscr#5 = (byte*) render_screen_original::oscr#6 @@ -8191,13 +8181,10 @@ Alias candidate removed (volatile)(byte) sprites_irq::raster_sprite_gfx_modify#0 Alias candidate removed (volatile)(byte) sprites_irq::toSpritePtr2_return#0 = (byte) sprites_irq::toSpritePtr2_$2#0 (byte) sprites_irq::toSpritePtr2_return#2 (byte) sprites_irq::toSpritePtr2_return#1 (byte) sprites_irq::toSpritePtr2_return#3 (byte~) sprites_irq::$5 (byte) irq_sprite_ptr#1 Self Phi Eliminated (byte) keyboard_event_scan::row_scan#1 Self Phi Eliminated (byte) keyboard_event_scan::row#10 -Self Phi Eliminated (byte) render_screen_original::SPACE#1 Self Phi Eliminated (byte*) render_screen_original::oscr#3 Self Phi Eliminated (byte*) render_screen_original::ocols#3 Self Phi Eliminated (byte) render_screen_original::y#5 -Self Phi Eliminated (byte) render_screen_original::SPACE#4 Self Phi Eliminated (byte) render_screen_original::y#4 -Self Phi Eliminated (byte) render_screen_original::SPACE#2 Self Phi Eliminated (byte) render_screen_original::y#2 Self Phi Eliminated (byte*) render_screen_original::oscr#5 Self Phi Eliminated (byte*) render_screen_original::ocols#5 @@ -8299,13 +8286,10 @@ Redundant Phi (byte) render_screen_render#12 (byte) render_screen_render#20 Redundant Phi (dword) score_bcd#10 (dword) score_bcd#42 Redundant Phi (word) lines_bcd#10 (word) lines_bcd#42 Redundant Phi (byte) level_bcd#13 (byte) level_bcd#100 -Redundant Phi (byte) render_screen_original::SPACE#1 (byte) render_screen_original::SPACE#3 Redundant Phi (byte*) render_screen_original::oscr#3 (byte*) render_screen_original::oscr#4 Redundant Phi (byte*) render_screen_original::ocols#3 (byte*) render_screen_original::ocols#4 Redundant Phi (byte) render_screen_original::y#5 (byte) render_screen_original::y#6 -Redundant Phi (byte) render_screen_original::SPACE#4 (byte) render_screen_original::SPACE#1 Redundant Phi (byte) render_screen_original::y#4 (byte) render_screen_original::y#5 -Redundant Phi (byte) render_screen_original::SPACE#2 (byte) render_screen_original::SPACE#4 Redundant Phi (byte) render_screen_original::y#2 (byte) render_screen_original::y#4 Redundant Phi (byte*) render_screen_original::oscr#5 (byte*) render_screen_original::oscr#1 Redundant Phi (byte*) render_screen_original::ocols#5 (byte*) render_screen_original::ocols#1 @@ -9232,7 +9216,6 @@ Alias (byte) render_screen_showing#1 = (byte) render_screen_showing#2 Alias (byte) main::render#1 = (byte) main::render#2 Successful SSA optimization Pass2AliasElimination Alias candidate removed (volatile)(byte) sprites_irq::raster_sprite_gfx_modify#0 = (byte/signed word/word/dword/signed dword~) sprites_irq::$0 -Self Phi Eliminated (byte) render_screen_original::SPACE#3 Self Phi Eliminated (byte) render_screen_render#13 Self Phi Eliminated (byte) render_screen_render#14 Self Phi Eliminated (byte) current_xpos#16 @@ -9247,7 +9230,6 @@ Self Phi Eliminated (byte) current_piece_char#43 Self Phi Eliminated (byte) render_screen_show#16 Self Phi Eliminated (byte) render_screen_render#18 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte) render_screen_original::SPACE#3 (const byte) render_screen_original::SPACE#0 Redundant Phi (byte) render_screen_render#13 (byte) render_screen_render#22 Redundant Phi (byte) render_screen_render#14 (byte) render_screen_render#33 Redundant Phi (byte) current_xpos#16 (byte) current_xpos#59 diff --git a/src/test/ref/concat-char.log b/src/test/ref/concat-char.log index db7206646..40b33fc39 100644 --- a/src/test/ref/concat-char.log +++ b/src/test/ref/concat-char.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) main::screen +Identified constant variable (byte) main::l CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -10,9 +12,8 @@ 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::screen#1 ← phi( main/(byte*) main::screen#0 main::@1/(byte*) main::screen#1 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) - *((byte*) main::screen#1 + (byte) main::i#2) ← *((byte[]) main::msg#0 + (byte) main::i#2) + *((byte*) main::screen#0 + (byte) main::i#2) ← *((byte[]) main::msg#0 + (byte) main::i#2) (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,2) (bool~) main::$1 ← (byte) main::i#1 != rangelast(0,2) if((bool~) main::$1) goto main::@1 @@ -48,16 +49,11 @@ SYMBOL TABLE SSA (byte[]) main::msg#0 (byte*) main::screen (byte*) main::screen#0 -(byte*) main::screen#1 Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte[]) main::msg#0 = (string~) main::$0 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::screen#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::screen#1 (byte*) main::screen#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$1 [9] if((byte) main::i#1!=rangelast(0,2)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) main::screen#0 = ((byte*))$400 diff --git a/src/test/ref/consolidate-array-index-problem.log b/src/test/ref/consolidate-array-index-problem.log index 45d400b44..6096afad6 100644 --- a/src/test/ref/consolidate-array-index-problem.log +++ b/src/test/ref/consolidate-array-index-problem.log @@ -1,3 +1,6 @@ +Identified constant variable (byte) main::BLACK +Identified constant variable (byte*) main::screen +Identified constant variable (byte*) main::cols CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -9,14 +12,11 @@ main: scope:[main] from @1 (byte) main::x#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@1 - (byte*) main::cols#1 ← phi( main/(byte*) main::cols#0 main::@1/(byte*) main::cols#1 ) - (byte) main::BLACK#1 ← phi( main/(byte) main::BLACK#0 main::@1/(byte) main::BLACK#1 ) - (byte*) main::screen#1 ← phi( main/(byte*) main::screen#0 main::@1/(byte*) main::screen#1 ) (byte) main::x#2 ← phi( main/(byte) main::x#0 main::@1/(byte) main::x#1 ) (byte/signed word/word/dword/signed dword~) main::$0 ← (byte) main::x#2 + (byte/signed byte/word/signed word/dword/signed dword) $c (byte) main::y#0 ← (byte/signed word/word/dword/signed dword~) main::$0 - *((byte*) main::screen#1 + (byte) main::y#0) ← (byte) 'a' - *((byte*) main::cols#1 + (byte) main::y#0) ← (byte) main::BLACK#1 + *((byte*) main::screen#0 + (byte) main::y#0) ← (byte) 'a' + *((byte*) main::cols#0 + (byte) main::y#0) ← (byte) main::BLACK#0 (byte) main::x#1 ← (byte) main::x#2 + rangenext(0,$a) (bool~) main::$1 ← (byte) main::x#1 != rangelast(0,$a) if((bool~) main::$1) goto main::@1 @@ -43,13 +43,10 @@ SYMBOL TABLE SSA (label) main::@return (byte) main::BLACK (byte) main::BLACK#0 -(byte) main::BLACK#1 (byte*) main::cols (byte*) main::cols#0 -(byte*) main::cols#1 (byte*) main::screen (byte*) main::screen#0 -(byte*) main::screen#1 (byte) main::x (byte) main::x#0 (byte) main::x#1 @@ -61,14 +58,6 @@ Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::y#0 = (byte/signed word/word/dword/signed dword~) main::$0 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::screen#1 -Self Phi Eliminated (byte) main::BLACK#1 -Self Phi Eliminated (byte*) main::cols#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::screen#1 (byte*) main::screen#0 -Redundant Phi (byte) main::BLACK#1 (byte) main::BLACK#0 -Redundant Phi (byte*) main::cols#1 (byte*) main::cols#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$1 [11] if((byte) main::x#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte) main::BLACK#0 = 0 diff --git a/src/test/ref/const-early-identification.asm b/src/test/ref/const-early-identification.asm new file mode 100644 index 000000000..d6699989c --- /dev/null +++ b/src/test/ref/const-early-identification.asm @@ -0,0 +1,32 @@ +// Tests that constants are identified early +.pc = $801 "Basic" +:BasicUpstart(bbegin) +.pc = $80d "Program" + .label SCREEN = $400 + .label A = 2 +bbegin: + // Not an early constant (address-of is used) + lda #'a' + sta A + jsr main +main: { + .const B = 'b' + .label addrA = A + lda A + sta SCREEN + lda #B + sta SCREEN+1 + lda addrA + sta SCREEN+2 + jsr sub + rts +} +sub: { + .const C = 'c' + lda #C + sta SCREEN+3 + ldx A + inx + stx SCREEN+4 + rts +} diff --git a/src/test/ref/const-early-identification.cfg b/src/test/ref/const-early-identification.cfg new file mode 100644 index 000000000..bcad524e9 --- /dev/null +++ b/src/test/ref/const-early-identification.cfg @@ -0,0 +1,26 @@ +@begin: scope:[] from + [0] (byte) A#0 ← (byte) 'a' + to:@2 +@2: scope:[] from @begin + [1] phi() + [2] call main + to:@end +@end: scope:[] from @2 + [3] phi() +main: scope:[main] from @2 + [4] *((const byte*) SCREEN#0) ← (byte) A#0 + [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::B#0 + [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte*) main::addrA#0) + [7] call sub + to:main::@return +main::@return: scope:[main] from main + [8] return + to:@return +sub: scope:[sub] from main + [9] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (const byte) sub::C#0 + [10] (byte) sub::D#0 ← (byte) A#0 + (byte/signed byte/word/signed word/dword/signed dword) 1 + [11] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte) sub::D#0 + to:sub::@return +sub::@return: scope:[sub] from sub + [12] return + to:@return diff --git a/src/test/ref/const-early-identification.log b/src/test/ref/const-early-identification.log new file mode 100644 index 000000000..344db308e --- /dev/null +++ b/src/test/ref/const-early-identification.log @@ -0,0 +1,410 @@ +Identified constant variable (byte*) SCREEN +Identified constant variable (byte) main::B +Identified constant variable (byte) sub::C + +CONTROL FLOW GRAPH SSA +@begin: scope:[] from + (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 + (byte) A#0 ← (byte) 'a' + to:@2 +main: scope:[main] from @2 + (byte) A#1 ← phi( @2/(byte) A#3 ) + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) A#1 + (byte) main::B#0 ← (byte) 'b' + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::B#0 + (byte*~) main::$0 ← & (byte) A#1 + (byte*) main::addrA#0 ← (byte*~) main::$0 + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← *((byte*) main::addrA#0) + call sub + to:main::@1 +main::@1: scope:[main] from main + to:main::@return +main::@return: scope:[main] from main::@1 + return + to:@return +sub: scope:[sub] from main + (byte) A#2 ← phi( main/(byte) A#1 ) + (byte) sub::C#0 ← (byte) 'c' + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte) sub::C#0 + (byte/signed word/word/dword/signed dword~) sub::$0 ← (byte) A#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) sub::D#0 ← (byte/signed word/word/dword/signed dword~) sub::$0 + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte) sub::D#0 + to:sub::@return +sub::@return: scope:[sub] from sub + return + to:@return +@2: scope:[] from @begin + (byte) A#3 ← phi( @begin/(byte) A#0 ) + call main + to:@3 +@3: scope:[] from @2 + to:@end +@end: scope:[] from @3 + +SYMBOL TABLE SSA +(label) @2 +(label) @3 +(label) @begin +(label) @end +(byte) A +(byte) A#0 +(byte) A#1 +(byte) A#2 +(byte) A#3 +(byte*) SCREEN +(byte*) SCREEN#0 +(void()) main() +(byte*~) main::$0 +(label) main::@1 +(label) main::@return +(byte) main::B +(byte) main::B#0 +(byte*) main::addrA +(byte*) main::addrA#0 +(void()) sub() +(byte/signed word/word/dword/signed dword~) sub::$0 +(label) sub::@return +(byte) sub::C +(byte) sub::C#0 +(byte) sub::D +(byte) sub::D#0 + +Culled Empty Block (label) main::@1 +Culled Empty Block (label) @3 +Successful SSA optimization Pass2CullEmptyBlocks +Alias (byte*) main::addrA#0 = (byte*~) main::$0 +Alias (byte) sub::D#0 = (byte/signed word/word/dword/signed dword~) sub::$0 +Alias (byte) A#0 = (byte) A#3 +Successful SSA optimization Pass2AliasElimination +Redundant Phi (byte) A#1 (byte) A#0 +Redundant Phi (byte) A#2 (byte) A#1 +Successful SSA optimization Pass2RedundantPhiElimination +Constant (const byte*) SCREEN#0 = ((byte*))$400 +Constant (const byte) main::B#0 = 'b' +Constant (const byte*) main::addrA#0 = &A#0 +Constant (const byte) sub::C#0 = 'c' +Successful SSA optimization Pass2ConstantIdentification +Consolidated array index constant in *(SCREEN#0+0) +Consolidated array index constant in *(SCREEN#0+1) +Consolidated array index constant in *(SCREEN#0+2) +Consolidated array index constant in *(SCREEN#0+3) +Consolidated array index constant in *(SCREEN#0+4) +Successful SSA optimization Pass2ConstantAdditionElimination +Simplifying constant plus zero SCREEN#0+0 +Adding NOP phi() at start of @2 +Adding NOP phi() at start of @end +CALL GRAPH +Calls in [] to main:2 +Calls in [main] to sub:7 + +Created 0 initial phi equivalence classes +Coalesced down to 0 phi equivalence classes +Adding NOP phi() at start of @2 +Adding NOP phi() at start of @end + +FINAL CONTROL FLOW GRAPH +@begin: scope:[] from + [0] (byte) A#0 ← (byte) 'a' + to:@2 +@2: scope:[] from @begin + [1] phi() + [2] call main + to:@end +@end: scope:[] from @2 + [3] phi() +main: scope:[main] from @2 + [4] *((const byte*) SCREEN#0) ← (byte) A#0 + [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::B#0 + [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte*) main::addrA#0) + [7] call sub + to:main::@return +main::@return: scope:[main] from main + [8] return + to:@return +sub: scope:[sub] from main + [9] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (const byte) sub::C#0 + [10] (byte) sub::D#0 ← (byte) A#0 + (byte/signed byte/word/signed word/dword/signed dword) 1 + [11] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte) sub::D#0 + to:sub::@return +sub::@return: scope:[sub] from sub + [12] return + to:@return + + +VARIABLE REGISTER WEIGHTS +(byte) A +(byte) A#0 1.0 +(byte*) SCREEN +(void()) main() +(byte) main::B +(byte*) main::addrA +(void()) sub() +(byte) sub::C +(byte) sub::D +(byte) sub::D#0 4.0 + +Initial phi equivalence classes +Added variable A#0 to zero page equivalence class [ A#0 ] +Added variable sub::D#0 to zero page equivalence class [ sub::D#0 ] +Complete equivalence classes +[ A#0 ] +[ sub::D#0 ] +Allocated zp ZP_BYTE:2 [ A#0 ] +Allocated zp ZP_BYTE:3 [ sub::D#0 ] + +INITIAL ASM +//SEG0 File Comments +// Tests that constants are identified early +//SEG1 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(bbegin) +.pc = $80d "Program" +//SEG2 Global Constants & labels + .label SCREEN = $400 + .label A = 2 +//SEG3 @begin +bbegin: +//SEG4 [0] (byte) A#0 ← (byte) 'a' -- vbuz1=vbuc1 + // Not an early constant (address-of is used) + lda #'a' + sta A +//SEG5 [1] phi from @begin to @2 [phi:@begin->@2] +b2_from_bbegin: + jmp b2 +//SEG6 @2 +b2: +//SEG7 [2] call main + jsr main +//SEG8 [3] phi from @2 to @end [phi:@2->@end] +bend_from_b2: + jmp bend +//SEG9 @end +bend: +//SEG10 main +main: { + .const B = 'b' + .label addrA = A + //SEG11 [4] *((const byte*) SCREEN#0) ← (byte) A#0 -- _deref_pbuc1=vbuz1 + lda A + sta SCREEN + //SEG12 [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::B#0 -- _deref_pbuc1=vbuc2 + lda #B + sta SCREEN+1 + //SEG13 [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte*) main::addrA#0) -- _deref_pbuc1=_deref_pbuc2 + lda addrA + sta SCREEN+2 + //SEG14 [7] call sub + jsr sub + jmp breturn + //SEG15 main::@return + breturn: + //SEG16 [8] return + rts +} +//SEG17 sub +sub: { + .const C = 'c' + .label D = 3 + //SEG18 [9] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (const byte) sub::C#0 -- _deref_pbuc1=vbuc2 + lda #C + sta SCREEN+3 + //SEG19 [10] (byte) sub::D#0 ← (byte) A#0 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_plus_1 + ldy A + iny + sty D + //SEG20 [11] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte) sub::D#0 -- _deref_pbuc1=vbuz1 + lda D + sta SCREEN+4 + jmp breturn + //SEG21 sub::@return + breturn: + //SEG22 [12] return + rts +} + +REGISTER UPLIFT POTENTIAL REGISTERS +Statement [0] (byte) A#0 ← (byte) 'a' [ A#0 ] ( ) always clobbers reg byte a +Statement [4] *((const byte*) SCREEN#0) ← (byte) A#0 [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a +Statement [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::B#0 [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a +Statement [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte*) main::addrA#0) [ A#0 ] ( main:2 [ A#0 ] ) always clobbers reg byte a +Statement [9] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (const byte) sub::C#0 [ A#0 ] ( main:2::sub:7 [ A#0 ] ) always clobbers reg byte a +Potential registers zp ZP_BYTE:2 [ A#0 ] : zp ZP_BYTE:2 , +Potential registers zp ZP_BYTE:3 [ sub::D#0 ] : zp ZP_BYTE:3 , reg byte a , reg byte x , reg byte y , + +REGISTER UPLIFT SCOPES +Uplift Scope [sub] 4: zp ZP_BYTE:3 [ sub::D#0 ] +Uplift Scope [] 1: zp ZP_BYTE:2 [ A#0 ] +Uplift Scope [main] + +Uplifting [sub] best 77 combination reg byte x [ sub::D#0 ] +Uplifting [] best 77 combination zp ZP_BYTE:2 [ A#0 ] +Uplifting [main] best 77 combination +Attempting to uplift remaining variables inzp ZP_BYTE:2 [ A#0 ] +Uplifting [] best 77 combination zp ZP_BYTE:2 [ A#0 ] + +ASSEMBLER BEFORE OPTIMIZATION +//SEG0 File Comments +// Tests that constants are identified early +//SEG1 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(bbegin) +.pc = $80d "Program" +//SEG2 Global Constants & labels + .label SCREEN = $400 + .label A = 2 +//SEG3 @begin +bbegin: +//SEG4 [0] (byte) A#0 ← (byte) 'a' -- vbuz1=vbuc1 + // Not an early constant (address-of is used) + lda #'a' + sta A +//SEG5 [1] phi from @begin to @2 [phi:@begin->@2] +b2_from_bbegin: + jmp b2 +//SEG6 @2 +b2: +//SEG7 [2] call main + jsr main +//SEG8 [3] phi from @2 to @end [phi:@2->@end] +bend_from_b2: + jmp bend +//SEG9 @end +bend: +//SEG10 main +main: { + .const B = 'b' + .label addrA = A + //SEG11 [4] *((const byte*) SCREEN#0) ← (byte) A#0 -- _deref_pbuc1=vbuz1 + lda A + sta SCREEN + //SEG12 [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::B#0 -- _deref_pbuc1=vbuc2 + lda #B + sta SCREEN+1 + //SEG13 [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte*) main::addrA#0) -- _deref_pbuc1=_deref_pbuc2 + lda addrA + sta SCREEN+2 + //SEG14 [7] call sub + jsr sub + jmp breturn + //SEG15 main::@return + breturn: + //SEG16 [8] return + rts +} +//SEG17 sub +sub: { + .const C = 'c' + //SEG18 [9] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (const byte) sub::C#0 -- _deref_pbuc1=vbuc2 + lda #C + sta SCREEN+3 + //SEG19 [10] (byte) sub::D#0 ← (byte) A#0 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuz1_plus_1 + ldx A + inx + //SEG20 [11] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte) sub::D#0 -- _deref_pbuc1=vbuxx + stx SCREEN+4 + jmp breturn + //SEG21 sub::@return + breturn: + //SEG22 [12] return + rts +} + +ASSEMBLER OPTIMIZATIONS +Removing instruction jmp b2 +Removing instruction jmp bend +Removing instruction jmp breturn +Removing instruction jmp breturn +Succesful ASM optimization Pass5NextJumpElimination +Removing instruction b2_from_bbegin: +Removing instruction bend_from_b2: +Succesful ASM optimization Pass5RedundantLabelElimination +Removing instruction b2: +Removing instruction bend: +Removing instruction breturn: +Removing instruction breturn: +Succesful ASM optimization Pass5UnusedLabelElimination + +FINAL SYMBOL TABLE +(label) @2 +(label) @begin +(label) @end +(byte) A +(byte) A#0 A zp ZP_BYTE:2 1.0 +(byte*) SCREEN +(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400 +(void()) main() +(label) main::@return +(byte) main::B +(const byte) main::B#0 B = (byte) 'b' +(byte*) main::addrA +(const byte*) main::addrA#0 addrA = &(byte) A#0 +(void()) sub() +(label) sub::@return +(byte) sub::C +(const byte) sub::C#0 C = (byte) 'c' +(byte) sub::D +(byte) sub::D#0 reg byte x 4.0 + +zp ZP_BYTE:2 [ A#0 ] +reg byte x [ sub::D#0 ] + + +FINAL ASSEMBLER +Score: 65 + +//SEG0 File Comments +// Tests that constants are identified early +//SEG1 Basic Upstart +.pc = $801 "Basic" +:BasicUpstart(bbegin) +.pc = $80d "Program" +//SEG2 Global Constants & labels + .label SCREEN = $400 + .label A = 2 +//SEG3 @begin +bbegin: +//SEG4 [0] (byte) A#0 ← (byte) 'a' -- vbuz1=vbuc1 + // Not an early constant (address-of is used) + lda #'a' + sta A +//SEG5 [1] phi from @begin to @2 [phi:@begin->@2] +//SEG6 @2 +//SEG7 [2] call main + jsr main +//SEG8 [3] phi from @2 to @end [phi:@2->@end] +//SEG9 @end +//SEG10 main +main: { + .const B = 'b' + .label addrA = A + //SEG11 [4] *((const byte*) SCREEN#0) ← (byte) A#0 -- _deref_pbuc1=vbuz1 + lda A + sta SCREEN + //SEG12 [5] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (const byte) main::B#0 -- _deref_pbuc1=vbuc2 + lda #B + sta SCREEN+1 + //SEG13 [6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← *((const byte*) main::addrA#0) -- _deref_pbuc1=_deref_pbuc2 + lda addrA + sta SCREEN+2 + //SEG14 [7] call sub + jsr sub + //SEG15 main::@return + //SEG16 [8] return + rts +} +//SEG17 sub +sub: { + .const C = 'c' + //SEG18 [9] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 3) ← (const byte) sub::C#0 -- _deref_pbuc1=vbuc2 + lda #C + sta SCREEN+3 + //SEG19 [10] (byte) sub::D#0 ← (byte) A#0 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuz1_plus_1 + ldx A + inx + //SEG20 [11] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte) sub::D#0 -- _deref_pbuc1=vbuxx + stx SCREEN+4 + //SEG21 sub::@return + //SEG22 [12] return + rts +} + diff --git a/src/test/ref/const-early-identification.sym b/src/test/ref/const-early-identification.sym new file mode 100644 index 000000000..638b8d966 --- /dev/null +++ b/src/test/ref/const-early-identification.sym @@ -0,0 +1,22 @@ +(label) @2 +(label) @begin +(label) @end +(byte) A +(byte) A#0 A zp ZP_BYTE:2 1.0 +(byte*) SCREEN +(const byte*) SCREEN#0 SCREEN = ((byte*))(word/signed word/dword/signed dword) $400 +(void()) main() +(label) main::@return +(byte) main::B +(const byte) main::B#0 B = (byte) 'b' +(byte*) main::addrA +(const byte*) main::addrA#0 addrA = &(byte) A#0 +(void()) sub() +(label) sub::@return +(byte) sub::C +(const byte) sub::C#0 C = (byte) 'c' +(byte) sub::D +(byte) sub::D#0 reg byte x 4.0 + +zp ZP_BYTE:2 [ A#0 ] +reg byte x [ sub::D#0 ] diff --git a/src/test/ref/const-if-problem.log b/src/test/ref/const-if-problem.log index f53c86b91..2edc6a6af 100644 --- a/src/test/ref/const-if-problem.log +++ b/src/test/ref/const-if-problem.log @@ -1,21 +1,18 @@ +Identified constant variable (byte*) SCREEN +Identified constant variable (byte) cc CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@1 main: scope:[main] from @3 - (byte) cc#4 ← phi( @3/(byte) cc#5 ) - (byte*) SCREEN#4 ← phi( @3/(byte*) SCREEN#6 ) (bool~) main::$0 ← (byte/signed byte/word/signed word/dword/signed dword) 1 == (byte/signed byte/word/signed word/dword/signed dword) 1 if((bool~) main::$0) goto main::@1 to:main::@3 main::@1: scope:[main] from main - (byte*) SCREEN#1 ← phi( main/(byte*) SCREEN#4 ) - *((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'a' + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'a' to:main::@return main::@3: scope:[main] from main - (byte*) SCREEN#5 ← phi( main/(byte*) SCREEN#4 ) - (byte) cc#3 ← phi( main/(byte) cc#4 ) call doit to:main::@5 main::@5: scope:[main] from main::@3 @@ -24,13 +21,10 @@ main::@return: scope:[main] from main::@1 main::@5 return to:@return @1: scope:[] from @begin - (byte*) SCREEN#7 ← phi( @begin/(byte*) SCREEN#0 ) (byte) cc#0 ← (byte) 'b' to:@3 doit: scope:[doit] from main::@3 - (byte*) SCREEN#2 ← phi( main::@3/(byte*) SCREEN#5 ) - (byte) cc#1 ← phi( main::@3/(byte) cc#3 ) - *((byte*) SCREEN#2 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) cc#1 + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) cc#0 call doit2 to:doit::@1 doit::@1: scope:[doit] from doit @@ -39,16 +33,12 @@ doit::@return: scope:[doit] from doit::@1 return to:@return doit2: scope:[doit2] from doit - (byte*) SCREEN#3 ← phi( doit/(byte*) SCREEN#2 ) - (byte) cc#2 ← phi( doit/(byte) cc#1 ) - *((byte*) SCREEN#3 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) cc#2 + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) cc#0 to:doit2::@return doit2::@return: scope:[doit2] from doit2 return to:@return @3: scope:[] from @1 - (byte) cc#5 ← phi( @1/(byte) cc#0 ) - (byte*) SCREEN#6 ← phi( @1/(byte*) SCREEN#7 ) call main to:@4 @4: scope:[] from @3 @@ -63,20 +53,8 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 (byte) cc (byte) cc#0 -(byte) cc#1 -(byte) cc#2 -(byte) cc#3 -(byte) cc#4 -(byte) cc#5 (void()) doit() (label) doit::@1 (label) doit::@return @@ -93,19 +71,7 @@ Culled Empty Block (label) main::@5 Culled Empty Block (label) doit::@1 Culled Empty Block (label) @4 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) SCREEN#1 = (byte*) SCREEN#4 (byte*) SCREEN#5 -Alias (byte) cc#3 = (byte) cc#4 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#7 (byte*) SCREEN#6 -Alias (byte) cc#0 = (byte) cc#5 -Successful SSA optimization Pass2AliasElimination -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte) cc#3 (byte) cc#0 -Redundant Phi (byte) cc#1 (byte) cc#3 -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#1 -Redundant Phi (byte) cc#2 (byte) cc#1 -Redundant Phi (byte*) SCREEN#3 (byte*) SCREEN#2 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$0 [3] if((byte/signed byte/word/signed word/dword/signed dword) 1==(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 +Simple Condition (bool~) main::$0 [2] if((byte/signed byte/word/signed word/dword/signed dword) 1==(byte/signed byte/word/signed word/dword/signed dword) 1) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) cc#0 = 'b' diff --git a/src/test/ref/const-mult-div.log b/src/test/ref/const-mult-div.log index fb9bd9957..633b14031 100644 --- a/src/test/ref/const-mult-div.log +++ b/src/test/ref/const-mult-div.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/const-param.log b/src/test/ref/const-param.log index a16d0d1f9..728ebce73 100644 --- a/src/test/ref/const-param.log +++ b/src/test/ref/const-param.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -11,30 +12,27 @@ main: scope:[main] from @2 (byte) sum::return#0 ← (byte) sum::return#4 to:main::@1 main::@1: scope:[main] from main - (byte*) main::screen#1 ← phi( main/(byte*) main::screen#0 ) (byte) sum::return#5 ← phi( main/(byte) sum::return#0 ) (byte~) main::$0 ← (byte) sum::return#5 - *((byte*) main::screen#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 + *((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 (byte) sum::a#1 ← (byte) main::reverse#0 (byte) sum::b#1 ← (byte) 'm' call sum (byte) sum::return#1 ← (byte) sum::return#4 to:main::@2 main::@2: scope:[main] from main::@1 - (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#1 ) (byte) sum::return#6 ← phi( main::@1/(byte) sum::return#1 ) (byte~) main::$1 ← (byte) sum::return#6 - *((byte*) main::screen#2 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 + *((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 (byte) sum::a#2 ← (byte) main::reverse#0 (byte) sum::b#2 ← (byte) 'l' call sum (byte) sum::return#2 ← (byte) sum::return#4 to:main::@3 main::@3: scope:[main] from main::@2 - (byte*) main::screen#3 ← phi( main::@2/(byte*) main::screen#2 ) (byte) sum::return#7 ← phi( main::@2/(byte) sum::return#2 ) (byte~) main::$2 ← (byte) sum::return#7 - *((byte*) main::screen#3 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte~) main::$2 + *((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte~) main::$2 to:main::@return main::@return: scope:[main] from main::@3 return @@ -74,9 +72,6 @@ SYMBOL TABLE SSA (byte) main::reverse#0 (byte*) main::screen (byte*) main::screen#0 -(byte*) main::screen#1 -(byte*) main::screen#2 -(byte*) main::screen#3 (byte()) sum((byte) sum::a , (byte) sum::b) (byte~) sum::$0 (label) sum::@return @@ -104,7 +99,6 @@ SYMBOL TABLE SSA Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) sum::return#0 = (byte) sum::return#5 -Alias (byte*) main::screen#0 = (byte*) main::screen#1 (byte*) main::screen#2 (byte*) main::screen#3 Alias (byte) sum::return#1 = (byte) sum::return#6 Alias (byte) sum::return#2 = (byte) sum::return#7 Alias (byte) sum::return#3 = (byte~) sum::$0 (byte) sum::return#8 (byte) sum::return#4 diff --git a/src/test/ref/const-pointer.log b/src/test/ref/const-pointer.log index e525dc26a..f24bac7a1 100644 --- a/src/test/ref/const-pointer.log +++ b/src/test/ref/const-pointer.log @@ -1,3 +1,6 @@ +Identified constant variable (byte*) main::screen +Identified constant variable (byte*) main::NULL +Identified constant variable (byte*) main::rem CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -10,12 +13,10 @@ main: scope:[main] from @1 if((bool~) main::$0) goto main::@1 to:main::@3 main::@1: scope:[main] from main - (byte*) main::screen#1 ← phi( main/(byte*) main::screen#0 ) - *((byte*) main::screen#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '*' + *((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '*' to:main::@return main::@3: scope:[main] from main - (byte*) main::screen#2 ← phi( main/(byte*) main::screen#0 ) - *((byte*) main::screen#2 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '.' + *((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) '.' to:main::@return main::@return: scope:[main] from main::@1 main::@3 return @@ -43,13 +44,9 @@ SYMBOL TABLE SSA (byte*) main::rem#0 (byte*) main::screen (byte*) main::screen#0 -(byte*) main::screen#1 -(byte*) main::screen#2 Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) main::screen#0 = (byte*) main::screen#1 (byte*) main::screen#2 -Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$0 [4] if((byte*) main::rem#0!=(byte*) main::NULL#0) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) main::screen#0 = ((byte*))$400 diff --git a/src/test/ref/const-signed-promotion.log b/src/test/ref/const-signed-promotion.log index dfe57ac76..5b1154ff5 100644 --- a/src/test/ref/const-signed-promotion.log +++ b/src/test/ref/const-signed-promotion.log @@ -1,3 +1,4 @@ +Identified constant variable (signed word*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/const-word-pointer.log b/src/test/ref/const-word-pointer.log index df27992a6..aa2632e4f 100644 --- a/src/test/ref/const-word-pointer.log +++ b/src/test/ref/const-word-pointer.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/constant-string-concat.log b/src/test/ref/constant-string-concat.log index c6a382b3d..7c6a0d406 100644 --- a/src/test/ref/constant-string-concat.log +++ b/src/test/ref/constant-string-concat.log @@ -1,3 +1,5 @@ +Identified constant variable (byte) main::e +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -19,9 +21,8 @@ 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::SCREEN#1 ← phi( main/(byte*) main::SCREEN#0 main::@1/(byte*) main::SCREEN#1 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) - *((byte*) main::SCREEN#1 + (byte) main::i#2) ← *((byte[]) main::s5#0 + (byte) main::i#2) + *((byte*) main::SCREEN#0 + (byte) main::i#2) ← *((byte[]) main::s5#0 + (byte) main::i#2) (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,7) (bool~) main::$6 ← (byte) main::i#1 != rangelast(0,7) if((bool~) main::$6) goto main::@1 @@ -57,7 +58,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::SCREEN (byte*) main::SCREEN#0 -(byte*) main::SCREEN#1 (byte) main::e (byte) main::e#0 (byte) main::i @@ -83,10 +83,6 @@ Alias (byte[]) main::s3#0 = (string~) main::$2 Alias (byte[]) main::s4#0 = (string~) main::$4 Alias (byte[]) main::s5#0 = (byte[]~) main::$5 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$6 [18] if((byte) main::i#1!=rangelast(0,7)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte[]) main::s#0 = "e"+"l" diff --git a/src/test/ref/constantmin.log b/src/test/ref/constantmin.log index 8cf73dd5c..9174af07c 100644 --- a/src/test/ref/constantmin.log +++ b/src/test/ref/constantmin.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) VIC +Identified constant variable (byte) RED CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -12,9 +14,8 @@ CONTROL FLOW GRAPH SSA to:@1 main: scope:[main] from @1 (byte*) BGCOL#1 ← phi( @1/(byte*) BGCOL#2 ) - (byte) RED#1 ← phi( @1/(byte) RED#2 ) *((byte*) SCREEN#0) ← (byte) STAR#0 - *((byte*) BGCOL#1) ← (byte) RED#1 + *((byte*) BGCOL#1) ← (byte) RED#0 (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) $28 to:main::@1 main::@1: scope:[main] from main main::@1 @@ -30,7 +31,6 @@ main::@return: scope:[main] from main::@1 to:@return @1: scope:[] from @begin (byte*) BGCOL#2 ← phi( @begin/(byte*) BGCOL#0 ) - (byte) RED#2 ← phi( @begin/(byte) RED#0 ) call main to:@2 @2: scope:[] from @1 @@ -51,8 +51,6 @@ SYMBOL TABLE SSA (byte*) BGCOL#2 (byte) RED (byte) RED#0 -(byte) RED#1 -(byte) RED#2 (byte*) SCREEN (byte*) SCREEN#0 (byte) STAR @@ -72,9 +70,7 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte*) BGCOL#0 = (byte*~) $2 (byte*) BGCOL#2 -Alias (byte) RED#0 = (byte) RED#2 Successful SSA optimization Pass2AliasElimination -Redundant Phi (byte) RED#1 (byte) RED#0 Redundant Phi (byte*) BGCOL#1 (byte*) BGCOL#0 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$1 [17] if((byte) main::i#1!=rangelast($28,$4f)) goto main::@1 diff --git a/src/test/ref/constants.log b/src/test/ref/constants.log index 2e660b88d..978f51ea1 100644 --- a/src/test/ref/constants.log +++ b/src/test/ref/constants.log @@ -1,3 +1,5 @@ +Identified constant variable (byte) test_bytes::bb +Identified constant variable (signed byte) test_sbytes::bb CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -133,12 +135,11 @@ test_bytes: scope:[test_bytes] from main::@1 call assert_byte to:test_bytes::@1 test_bytes::@1: scope:[test_bytes] from test_bytes - (byte) test_bytes::bb#1 ← phi( test_bytes/(byte) test_bytes::bb#0 ) (byte*) print_line_cursor#32 ← phi( test_bytes/(byte*) print_line_cursor#14 ) (byte*) print_char_cursor#43 ← phi( test_bytes/(byte*) print_char_cursor#20 ) (byte*) print_char_cursor#11 ← (byte*) print_char_cursor#43 (byte*) print_line_cursor#9 ← (byte*) print_line_cursor#32 - (byte/signed word/word/dword/signed dword~) test_bytes::$1 ← (byte) test_bytes::bb#1 + (byte/signed byte/word/signed word/dword/signed dword) 2 + (byte/signed word/word/dword/signed dword~) test_bytes::$1 ← (byte) test_bytes::bb#0 + (byte/signed byte/word/signed word/dword/signed dword) 2 (byte) test_bytes::bc#0 ← (byte/signed word/word/dword/signed dword~) test_bytes::$1 (byte*) assert_byte::msg#1 ← (const string) test_bytes::msg1 (byte) assert_byte::b#1 ← (byte) test_bytes::bc#0 @@ -251,12 +252,11 @@ test_sbytes: scope:[test_sbytes] from main::@2 call assert_sbyte to:test_sbytes::@1 test_sbytes::@1: scope:[test_sbytes] from test_sbytes - (signed byte) test_sbytes::bb#1 ← phi( test_sbytes/(signed byte) test_sbytes::bb#0 ) (byte*) print_line_cursor#38 ← phi( test_sbytes/(byte*) print_line_cursor#22 ) (byte*) print_char_cursor#53 ← phi( test_sbytes/(byte*) print_char_cursor#32 ) (byte*) print_char_cursor#21 ← (byte*) print_char_cursor#53 (byte*) print_line_cursor#15 ← (byte*) print_line_cursor#38 - (signed word/signed byte/signed dword~) test_sbytes::$1 ← (signed byte) test_sbytes::bb#1 + (byte/signed byte/word/signed word/dword/signed dword) 2 + (signed word/signed byte/signed dword~) test_sbytes::$1 ← (signed byte) test_sbytes::bb#0 + (byte/signed byte/word/signed word/dword/signed dword) 2 (signed byte) test_sbytes::bc#0 ← (signed word/signed byte/signed dword~) test_sbytes::$1 (byte*) assert_sbyte::msg#1 ← (const string) test_sbytes::msg1 (signed byte) assert_sbyte::b#1 ← (signed byte) test_sbytes::bc#0 @@ -701,7 +701,6 @@ SYMBOL TABLE SSA (label) test_bytes::@return (byte) test_bytes::bb (byte) test_bytes::bb#0 -(byte) test_bytes::bb#1 (byte) test_bytes::bc (byte) test_bytes::bc#0 (byte) test_bytes::bc#1 @@ -726,7 +725,6 @@ SYMBOL TABLE SSA (label) test_sbytes::@return (signed byte) test_sbytes::bb (signed byte) test_sbytes::bb#0 -(signed byte) test_sbytes::bb#1 (signed byte) test_sbytes::bc (signed byte) test_sbytes::bc#0 (signed byte) test_sbytes::bc#1 @@ -754,7 +752,6 @@ Alias (byte*) print_char_cursor#40 = (byte*) print_char_cursor#8 Alias (byte*) print_line_cursor#29 = (byte*) print_line_cursor#6 Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#9 (byte*) print_char_cursor#41 (byte*) print_char_cursor#42 Alias (byte*) print_line_cursor#30 = (byte*) print_line_cursor#7 (byte*) print_line_cursor#31 (byte*) print_line_cursor#8 -Alias (byte) test_bytes::bb#0 = (byte) test_bytes::bb#1 Alias (byte*) print_char_cursor#11 = (byte*) print_char_cursor#43 Alias (byte*) print_line_cursor#32 = (byte*) print_line_cursor#9 Alias (byte) test_bytes::bc#0 = (byte/signed word/word/dword/signed dword~) test_bytes::$1 (byte) test_bytes::bc#1 @@ -772,7 +769,6 @@ Alias (byte*) print_char_cursor#17 = (byte*) print_char_cursor#49 Alias (byte*) print_char_cursor#18 = (byte*) print_char_cursor#50 Alias (byte*) print_line_cursor#13 = (byte*) print_line_cursor#36 (byte*) print_line_cursor#37 (byte*) print_line_cursor#14 Alias (byte*) print_char_cursor#19 = (byte*) print_char_cursor#51 (byte*) print_char_cursor#52 (byte*) print_char_cursor#20 -Alias (signed byte) test_sbytes::bb#0 = (signed byte) test_sbytes::bb#1 Alias (byte*) print_char_cursor#21 = (byte*) print_char_cursor#53 Alias (byte*) print_line_cursor#15 = (byte*) print_line_cursor#38 Alias (signed byte) test_sbytes::bc#0 = (signed word/signed byte/signed dword~) test_sbytes::$1 (signed byte) test_sbytes::bc#1 diff --git a/src/test/ref/double-assignment.log b/src/test/ref/double-assignment.log index b6118d439..dfc7c94bd 100644 --- a/src/test/ref/double-assignment.log +++ b/src/test/ref/double-assignment.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/double-indexing-arrays.log b/src/test/ref/double-indexing-arrays.log index a88a18eb0..c9bfafeb8 100644 --- a/src/test/ref/double-indexing-arrays.log +++ b/src/test/ref/double-indexing-arrays.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) SCREEN +Identified constant variable (byte*) COLS CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -8,40 +10,36 @@ CONTROL FLOW GRAPH SSA (byte*) COLS#0 ← ((byte*)) (word/dword/signed dword) $d800 to:@1 main: scope:[main] from @1 - (byte*) COLS#2 ← phi( @1/(byte*) COLS#3 ) - (byte*) SCREEN#2 ← phi( @1/(byte*) SCREEN#3 ) (byte) main::x#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@1 - (byte*) COLS#1 ← phi( main/(byte*) COLS#2 main::@1/(byte*) COLS#1 ) - (byte*) SCREEN#1 ← phi( main/(byte*) SCREEN#2 main::@1/(byte*) SCREEN#1 ) (byte) main::x#2 ← phi( main/(byte) main::x#0 main::@1/(byte) main::x#1 ) - *((byte*) SCREEN#1 + (byte) main::x#2) ← *((byte[$3e8]) MAPDATA#0 + (byte) main::x#2) - *((byte*) COLS#1 + (byte) main::x#2) ← *((byte[$100]) COLORMAP1#0 + *((byte[$3e8]) MAPDATA#0 + (byte) main::x#2)) + *((byte*) SCREEN#0 + (byte) main::x#2) ← *((byte[$3e8]) MAPDATA#0 + (byte) main::x#2) + *((byte*) COLS#0 + (byte) main::x#2) ← *((byte[$100]) COLORMAP1#0 + *((byte[$3e8]) MAPDATA#0 + (byte) main::x#2)) (byte/word/signed word/dword/signed dword~) main::$0 ← (byte/word/signed word/dword/signed dword) $c8 + (byte) main::x#2 (byte/word/signed word/dword/signed dword~) main::$1 ← (byte/word/signed word/dword/signed dword) $c8 + (byte) main::x#2 - *((byte*) SCREEN#1 + (byte/word/signed word/dword/signed dword~) main::$0) ← *((byte[$3e8]) MAPDATA#0 + (byte/word/signed word/dword/signed dword~) main::$1) + *((byte*) SCREEN#0 + (byte/word/signed word/dword/signed dword~) main::$0) ← *((byte[$3e8]) MAPDATA#0 + (byte/word/signed word/dword/signed dword~) main::$1) (byte/word/signed word/dword/signed dword~) main::$2 ← (byte/word/signed word/dword/signed dword) $c8 + (byte) main::x#2 (byte/word/signed word/dword/signed dword~) main::$3 ← (byte/word/signed word/dword/signed dword) $c8 + (byte) main::x#2 - *((byte*) COLS#1 + (byte/word/signed word/dword/signed dword~) main::$2) ← *((byte[$100]) COLORMAP1#0 + *((byte[$3e8]) MAPDATA#0 + (byte/word/signed word/dword/signed dword~) main::$3)) + *((byte*) COLS#0 + (byte/word/signed word/dword/signed dword~) main::$2) ← *((byte[$100]) COLORMAP1#0 + *((byte[$3e8]) MAPDATA#0 + (byte/word/signed word/dword/signed dword~) main::$3)) (word/signed word/dword/signed dword~) main::$4 ← (word/signed word/dword/signed dword) $190 + (byte) main::x#2 (word/signed word/dword/signed dword~) main::$5 ← (word/signed word/dword/signed dword) $190 + (byte) main::x#2 - *((byte*) SCREEN#1 + (word/signed word/dword/signed dword~) main::$4) ← *((byte[$3e8]) MAPDATA#0 + (word/signed word/dword/signed dword~) main::$5) + *((byte*) SCREEN#0 + (word/signed word/dword/signed dword~) main::$4) ← *((byte[$3e8]) MAPDATA#0 + (word/signed word/dword/signed dword~) main::$5) (word/signed word/dword/signed dword~) main::$6 ← (word/signed word/dword/signed dword) $190 + (byte) main::x#2 (word/signed word/dword/signed dword~) main::$7 ← (word/signed word/dword/signed dword) $190 + (byte) main::x#2 - *((byte*) COLS#1 + (word/signed word/dword/signed dword~) main::$6) ← *((byte[$100]) COLORMAP1#0 + *((byte[$3e8]) MAPDATA#0 + (word/signed word/dword/signed dword~) main::$7)) + *((byte*) COLS#0 + (word/signed word/dword/signed dword~) main::$6) ← *((byte[$100]) COLORMAP1#0 + *((byte[$3e8]) MAPDATA#0 + (word/signed word/dword/signed dword~) main::$7)) (word/signed word/dword/signed dword~) main::$8 ← (word/signed word/dword/signed dword) $258 + (byte) main::x#2 (word/signed word/dword/signed dword~) main::$9 ← (word/signed word/dword/signed dword) $258 + (byte) main::x#2 - *((byte*) SCREEN#1 + (word/signed word/dword/signed dword~) main::$8) ← *((byte[$3e8]) MAPDATA#0 + (word/signed word/dword/signed dword~) main::$9) + *((byte*) SCREEN#0 + (word/signed word/dword/signed dword~) main::$8) ← *((byte[$3e8]) MAPDATA#0 + (word/signed word/dword/signed dword~) main::$9) (word/signed word/dword/signed dword~) main::$10 ← (word/signed word/dword/signed dword) $258 + (byte) main::x#2 (word/signed word/dword/signed dword~) main::$11 ← (word/signed word/dword/signed dword) $258 + (byte) main::x#2 - *((byte*) COLS#1 + (word/signed word/dword/signed dword~) main::$10) ← *((byte[$100]) COLORMAP2#0 + *((byte[$3e8]) MAPDATA#0 + (word/signed word/dword/signed dword~) main::$11)) + *((byte*) COLS#0 + (word/signed word/dword/signed dword~) main::$10) ← *((byte[$100]) COLORMAP2#0 + *((byte[$3e8]) MAPDATA#0 + (word/signed word/dword/signed dword~) main::$11)) (word/signed word/dword/signed dword~) main::$12 ← (word/signed word/dword/signed dword) $320 + (byte) main::x#2 (word/signed word/dword/signed dword~) main::$13 ← (word/signed word/dword/signed dword) $320 + (byte) main::x#2 - *((byte*) SCREEN#1 + (word/signed word/dword/signed dword~) main::$12) ← *((byte[$3e8]) MAPDATA#0 + (word/signed word/dword/signed dword~) main::$13) + *((byte*) SCREEN#0 + (word/signed word/dword/signed dword~) main::$12) ← *((byte[$3e8]) MAPDATA#0 + (word/signed word/dword/signed dword~) main::$13) (word/signed word/dword/signed dword~) main::$14 ← (word/signed word/dword/signed dword) $320 + (byte) main::x#2 (word/signed word/dword/signed dword~) main::$15 ← (word/signed word/dword/signed dword) $320 + (byte) main::x#2 - *((byte*) COLS#1 + (word/signed word/dword/signed dword~) main::$14) ← *((byte[$100]) COLORMAP2#0 + *((byte[$3e8]) MAPDATA#0 + (word/signed word/dword/signed dword~) main::$15)) + *((byte*) COLS#0 + (word/signed word/dword/signed dword~) main::$14) ← *((byte[$100]) COLORMAP2#0 + *((byte[$3e8]) MAPDATA#0 + (word/signed word/dword/signed dword~) main::$15)) (byte) main::x#1 ← (byte) main::x#2 + rangenext(0,$c8) (bool~) main::$16 ← (byte) main::x#1 != rangelast(0,$c8) if((bool~) main::$16) goto main::@1 @@ -50,8 +48,6 @@ main::@return: scope:[main] from main::@1 return to:@return @1: scope:[] from @begin - (byte*) COLS#3 ← phi( @begin/(byte*) COLS#0 ) - (byte*) SCREEN#3 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -69,16 +65,10 @@ SYMBOL TABLE SSA (byte[$100]) COLORMAP2#0 (byte*) COLS (byte*) COLS#0 -(byte*) COLS#1 -(byte*) COLS#2 -(byte*) COLS#3 (byte[$3e8]) MAPDATA (byte[$3e8]) MAPDATA#0 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 (void()) main() (byte/word/signed word/dword/signed dword~) main::$0 (byte/word/signed word/dword/signed dword~) main::$1 @@ -106,18 +96,7 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) SCREEN#0 = (byte*) SCREEN#3 -Alias (byte*) COLS#0 = (byte*) COLS#3 -Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#1 -Self Phi Eliminated (byte*) COLS#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#0 -Redundant Phi (byte*) COLS#2 (byte*) COLS#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2 -Redundant Phi (byte*) COLS#1 (byte*) COLS#2 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$16 [36] if((byte) main::x#1!=rangelast(0,$c8)) goto main::@1 +Simple Condition (bool~) main::$16 [35] if((byte) main::x#1!=rangelast(0,$c8)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte[$3e8]) MAPDATA#0 = { fill( $3e8, 0) } Constant (const byte[$100]) COLORMAP1#0 = { fill( $100, 0) } diff --git a/src/test/ref/dword.log b/src/test/ref/dword.log index 49f32bdfe..18311f9b0 100644 --- a/src/test/ref/dword.log +++ b/src/test/ref/dword.log @@ -1,3 +1,4 @@ +Identified constant variable (dword) main::a CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -8,8 +9,7 @@ main: scope:[main] from @1 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 ) - (dword) main::a#1 ← phi( main/(dword) main::a#0 main::@1/(dword) main::a#1 ) - (dword~) main::$0 ← (dword) main::a#1 + (byte) main::i#2 + (dword~) main::$0 ← (dword) main::a#0 + (byte) main::i#2 (dword) main::b#0 ← (dword~) main::$0 (byte~) main::$1 ← ((byte)) (dword) main::b#0 (byte) main::c#0 ← (byte~) main::$1 @@ -44,7 +44,6 @@ SYMBOL TABLE SSA (byte*) main::SCREEN#0 (dword) main::a (dword) main::a#0 -(dword) main::a#1 (dword) main::b (dword) main::b#0 (byte) main::c @@ -59,10 +58,6 @@ Successful SSA optimization Pass2CullEmptyBlocks Alias (dword) main::b#0 = (dword~) main::$0 Alias (byte) main::c#0 = (byte~) main::$1 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (dword) main::a#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (dword) main::a#1 (dword) main::a#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$2 [11] if((byte) main::i#1!=rangelast(0,$64)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const dword) main::a#0 = $ee6b2800 diff --git a/src/test/ref/emptyblock-error.log b/src/test/ref/emptyblock-error.log index 1881b0fd0..7a6402f16 100644 --- a/src/test/ref/emptyblock-error.log +++ b/src/test/ref/emptyblock-error.log @@ -1,23 +1,20 @@ +Identified constant variable (byte*) B CONTROL FLOW GRAPH SSA @begin: scope:[] from to:@2 main: scope:[main] from @3 - (byte*) B#11 ← phi( @3/(byte*) B#13 ) (byte) a#20 ← phi( @3/(byte) a#19 ) to:main::@1 main::@1: scope:[main] from main main::@7 - (byte*) B#10 ← phi( main/(byte*) B#11 main::@7/(byte*) B#12 ) (byte) a#15 ← phi( main/(byte) a#20 main::@7/(byte) a#0 ) if(true) goto main::@2 to:main::@return main::@2: scope:[main] from main::@1 - (byte*) B#9 ← phi( main::@1/(byte*) B#10 ) (byte) a#14 ← phi( main::@1/(byte) a#15 ) call menu to:main::@7 main::@7: scope:[main] from main::@2 - (byte*) B#12 ← phi( main::@2/(byte*) B#9 ) (byte) a#8 ← phi( main::@2/(byte) a#3 ) (byte) a#0 ← (byte) a#8 to:main::@1 @@ -27,16 +24,13 @@ main::@return: scope:[main] from main::@1 return to:@return menu: scope:[menu] from main::@2 - (byte*) B#8 ← phi( main::@2/(byte*) B#9 ) (byte) a#21 ← phi( main::@2/(byte) a#14 ) to:menu::@1 menu::@1: scope:[menu] from menu - (byte*) B#7 ← phi( menu/(byte*) B#8 ) (byte) a#17 ← phi( menu/(byte) a#21 ) if(true) goto menu::@2 to:menu::@return menu::@2: scope:[menu] from menu::@1 - (byte*) B#6 ← phi( menu::@1/(byte*) B#7 ) (byte) a#16 ← phi( menu::@1/(byte) a#17 ) call mode to:menu::@8 @@ -55,27 +49,22 @@ menu::@return: scope:[menu] from menu::@1 menu::@8 to:@3 mode: scope:[mode] from menu::@2 (byte) a#22 ← phi( menu::@2/(byte) a#16 ) - (byte*) B#4 ← phi( menu::@2/(byte*) B#6 ) to:mode::@1 mode::@1: scope:[mode] from mode mode::@4 mode::@7 (byte) a#18 ← phi( mode/(byte) a#22 mode::@4/(byte) a#23 mode::@7/(byte) a#5 ) - (byte*) B#3 ← phi( mode/(byte*) B#4 mode::@4/(byte*) B#5 mode::@7/(byte*) B#2 ) if(true) goto mode::@2 to:mode::@return mode::@2: scope:[mode] from mode::@1 (byte) a#24 ← phi( mode::@1/(byte) a#18 ) - (byte*) B#1 ← phi( mode::@1/(byte*) B#3 ) - (bool~) mode::$0 ← *((byte*) B#1) == (byte/signed byte/word/signed word/dword/signed dword) 0 + (bool~) mode::$0 ← *((byte*) B#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 (bool~) mode::$1 ← ! (bool~) mode::$0 if((bool~) mode::$1) goto mode::@4 to:mode::@7 mode::@4: scope:[mode] from mode::@2 (byte) a#23 ← phi( mode::@2/(byte) a#24 ) - (byte*) B#5 ← phi( mode::@2/(byte*) B#1 ) to:mode::@1 mode::@7: scope:[mode] from mode::@2 - (byte*) B#2 ← phi( mode::@2/(byte*) B#1 ) - (byte) a#5 ← *((byte*) B#2) + (byte) a#5 ← *((byte*) B#0) to:mode::@1 mode::@return: scope:[mode] from mode::@1 (byte) a#12 ← phi( mode::@1/(byte) a#18 ) @@ -83,7 +72,6 @@ mode::@return: scope:[mode] from mode::@1 return to:@return @3: scope:[] from @2 - (byte*) B#13 ← phi( @2/(byte*) B#0 ) (byte) a#19 ← phi( @2/(byte) a#4 ) call main to:@4 @@ -101,19 +89,6 @@ SYMBOL TABLE SSA (label) @end (byte*) B (byte*) B#0 -(byte*) B#1 -(byte*) B#10 -(byte*) B#11 -(byte*) B#12 -(byte*) B#13 -(byte*) B#2 -(byte*) B#3 -(byte*) B#4 -(byte*) B#5 -(byte*) B#6 -(byte*) B#7 -(byte*) B#8 -(byte*) B#9 (byte) a (byte) a#0 (byte) a#1 @@ -159,36 +134,24 @@ SYMBOL TABLE SSA (label) mode::@7 (label) mode::@return -Inversing boolean not [27] (bool~) mode::$1 ← *((byte*) B#1) != (byte/signed byte/word/signed word/dword/signed dword) 0 from [26] (bool~) mode::$0 ← *((byte*) B#1) == (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [27] (bool~) mode::$1 ← *((byte*) B#0) != (byte/signed byte/word/signed word/dword/signed dword) 0 from [26] (bool~) mode::$0 ← *((byte*) B#0) == (byte/signed byte/word/signed word/dword/signed dword) 0 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) a#1 = (byte) a#14 (byte) a#15 (byte) a#9 -Alias (byte*) B#10 = (byte*) B#9 (byte*) B#12 Alias (byte) a#0 = (byte) a#8 Alias (byte) a#16 = (byte) a#17 (byte) a#21 -Alias (byte*) B#6 = (byte*) B#7 (byte*) B#8 Alias (byte) a#10 = (byte) a#2 Alias (byte) a#11 = (byte) a#3 -Alias (byte*) B#1 = (byte*) B#3 (byte*) B#5 (byte*) B#2 Alias (byte) a#12 = (byte) a#24 (byte) a#18 (byte) a#23 (byte) a#6 Alias (byte) a#19 = (byte) a#4 -Alias (byte*) B#0 = (byte*) B#13 Alias (byte) a#13 = (byte) a#7 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) B#10 -Self Phi Eliminated (byte*) B#1 -Self Phi Eliminated (byte*) B#1 Self Phi Eliminated (byte) a#12 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (byte) a#20 (byte) a#19 -Redundant Phi (byte*) B#11 (byte*) B#0 -Redundant Phi (byte*) B#10 (byte*) B#11 Redundant Phi (byte) a#0 (byte) a#11 Redundant Phi (byte) a#16 (byte) a#1 -Redundant Phi (byte*) B#6 (byte*) B#10 Redundant Phi (byte) a#10 (byte) a#12 -Redundant Phi (byte*) B#4 (byte*) B#6 Redundant Phi (byte) a#22 (byte) a#16 -Redundant Phi (byte*) B#1 (byte*) B#4 Redundant Phi (byte) a#13 (byte) a#1 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) mode::$1 [28] if(*((byte*) B#0)!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mode::@4 diff --git a/src/test/ref/examples/3d/3d.log b/src/test/ref/examples/3d/3d.log index 813f6035f..c5295206e 100644 --- a/src/test/ref/examples/3d/3d.log +++ b/src/test/ref/examples/3d/3d.log @@ -89,6 +89,28 @@ Resolved forward reference COSH_LO to (byte*) COSH_LO Resolved forward reference mulf_sqr1 to (byte*) mulf_sqr1 Resolved forward reference mulf_sqr2 to (byte*) mulf_sqr2 Resolved forward reference PERSP_Z to (signed byte*) PERSP_Z +Identified constant variable (signed byte*) xr +Identified constant variable (signed byte*) yr +Identified constant variable (signed byte*) zr +Identified constant variable (signed byte*) pp +Identified constant variable (signed byte*) xp +Identified constant variable (signed byte*) yp +Identified constant variable (word*) psp1 +Identified constant variable (word*) psp2 +Identified constant variable (byte*) SCREEN +Identified constant variable (signed byte) sz +Identified constant variable (byte*) debug_print_init::COLS +Identified constant variable (byte*) sprites_init::SCREEN +Identified constant variable (byte*) mulf_sqr1 +Identified constant variable (byte*) mulf_sqr2 +Identified constant variable (byte*) SPRITE +Identified constant variable (signed byte*) PERSP_Z +Identified constant variable (signed byte*) SINH +Identified constant variable (signed byte*) SINQ +Identified constant variable (byte*) SINH_LO +Identified constant variable (byte*) SINH_HI +Identified constant variable (byte*) SINQ_LO +Identified constant variable (byte*) SINQ_HI Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx Inlined call call print_sbyte_pos (signed byte) sx (byte/signed byte/word/signed word/dword/signed dword) 0 (byte/signed byte/word/signed word/dword/signed dword) $25 Inlined call call print_sbyte_pos (signed byte) sy (byte/signed byte/word/signed word/dword/signed dword) 1 (byte/signed byte/word/signed word/dword/signed dword) $25 @@ -330,80 +352,34 @@ print_cls::@return: scope:[print_cls] from print_cls::@2 (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@24 main: scope:[main] from @33 - (signed byte*) PERSP_Z#20 ← phi( @33/(signed byte*) PERSP_Z#0 ) - (signed byte*) yp#20 ← phi( @33/(signed byte*) yp#21 ) - (signed byte*) xp#20 ← phi( @33/(signed byte*) xp#21 ) - (signed byte*) pp#20 ← phi( @33/(signed byte*) pp#21 ) - (signed byte*) zr#20 ← phi( @33/(signed byte*) zr#21 ) - (signed byte*) yr#20 ← phi( @33/(signed byte*) yr#21 ) - (signed byte*) xr#20 ← phi( @33/(signed byte*) xr#21 ) - (signed byte*) SINQ#17 ← phi( @33/(signed byte*) SINQ#0 ) (signed byte*) COSQ#17 ← phi( @33/(signed byte*) COSQ#0 ) - (signed byte*) SINH#17 ← phi( @33/(signed byte*) SINH#0 ) (signed byte*) COSH#17 ← phi( @33/(signed byte*) COSH#0 ) - (signed byte) sz#23 ← phi( @33/(signed byte) sz#25 ) - (byte*) SCREEN#19 ← phi( @33/(byte*) SCREEN#21 ) (byte*) print_screen#42 ← phi( @33/(byte*) print_screen#44 ) (signed byte) sy#26 ← phi( @33/(signed byte) sy#18 ) (signed byte) sx#24 ← phi( @33/(signed byte) sx#17 ) - (byte*) SPRITE#3 ← phi( @33/(byte*) SPRITE#0 ) (byte*) print_char_cursor#19 ← phi( @33/(byte*) print_char_cursor#18 ) (byte*) print_line_cursor#19 ← phi( @33/(byte*) print_line_cursor#18 ) - (word*) psp2#3 ← phi( @33/(word*) psp2#5 ) - (byte*) mulf_sqr2#3 ← phi( @33/(byte*) mulf_sqr2#0 ) - (word*) psp1#3 ← phi( @33/(word*) psp1#5 ) - (byte*) mulf_sqr1#3 ← phi( @33/(byte*) mulf_sqr1#0 ) asm { sei } call sprites_init to:main::@1 main::@1: scope:[main] from main - (signed byte*) PERSP_Z#19 ← phi( main/(signed byte*) PERSP_Z#20 ) - (signed byte*) yp#19 ← phi( main/(signed byte*) yp#20 ) - (signed byte*) xp#19 ← phi( main/(signed byte*) xp#20 ) - (signed byte*) pp#19 ← phi( main/(signed byte*) pp#20 ) - (signed byte*) zr#19 ← phi( main/(signed byte*) zr#20 ) - (signed byte*) yr#19 ← phi( main/(signed byte*) yr#20 ) - (signed byte*) xr#19 ← phi( main/(signed byte*) xr#20 ) - (signed byte*) SINQ#15 ← phi( main/(signed byte*) SINQ#17 ) (signed byte*) COSQ#15 ← phi( main/(signed byte*) COSQ#17 ) - (signed byte*) SINH#15 ← phi( main/(signed byte*) SINH#17 ) (signed byte*) COSH#15 ← phi( main/(signed byte*) COSH#17 ) - (signed byte) sz#21 ← phi( main/(signed byte) sz#23 ) - (byte*) SCREEN#17 ← phi( main/(byte*) SCREEN#19 ) (byte*) print_screen#29 ← phi( main/(byte*) print_screen#42 ) (signed byte) sy#19 ← phi( main/(signed byte) sy#26 ) (signed byte) sx#18 ← phi( main/(signed byte) sx#24 ) (byte*) print_char_cursor#14 ← phi( main/(byte*) print_char_cursor#19 ) (byte*) print_line_cursor#14 ← phi( main/(byte*) print_line_cursor#19 ) - (word*) psp2#1 ← phi( main/(word*) psp2#3 ) - (byte*) mulf_sqr2#1 ← phi( main/(byte*) mulf_sqr2#3 ) - (word*) psp1#1 ← phi( main/(word*) psp1#3 ) - (byte*) mulf_sqr1#1 ← phi( main/(byte*) mulf_sqr1#3 ) - (word~) main::$1 ← ((word)) (byte*) mulf_sqr1#1 - *((word*) psp1#1) ← (word~) main::$1 - (word~) main::$2 ← ((word)) (byte*) mulf_sqr2#1 - *((word*) psp2#1) ← (word~) main::$2 + (word~) main::$1 ← ((word)) (byte*) mulf_sqr1#0 + *((word*) psp1#0) ← (word~) main::$1 + (word~) main::$2 ← ((word)) (byte*) mulf_sqr2#0 + *((word*) psp2#0) ← (word~) main::$2 call debug_print_init to:main::@2 main::@2: scope:[main] from main::@1 - (byte*) SCREEN#73 ← phi( main::@1/(byte*) SCREEN#17 ) (byte*) print_screen#63 ← phi( main::@1/(byte*) print_screen#29 ) - (word*) psp2#22 ← phi( main::@1/(word*) psp2#1 ) - (word*) psp1#22 ← phi( main::@1/(word*) psp1#1 ) - (signed byte*) PERSP_Z#17 ← phi( main::@1/(signed byte*) PERSP_Z#19 ) - (byte*) mulf_sqr2#19 ← phi( main::@1/(byte*) mulf_sqr2#1 ) - (byte*) mulf_sqr1#19 ← phi( main::@1/(byte*) mulf_sqr1#1 ) - (signed byte*) yp#17 ← phi( main::@1/(signed byte*) yp#19 ) - (signed byte*) xp#17 ← phi( main::@1/(signed byte*) xp#19 ) - (signed byte*) pp#17 ← phi( main::@1/(signed byte*) pp#19 ) - (signed byte*) zr#17 ← phi( main::@1/(signed byte*) zr#19 ) - (signed byte*) yr#17 ← phi( main::@1/(signed byte*) yr#19 ) - (signed byte*) xr#17 ← phi( main::@1/(signed byte*) xr#19 ) - (signed byte*) SINQ#13 ← phi( main::@1/(signed byte*) SINQ#15 ) (signed byte*) COSQ#13 ← phi( main::@1/(signed byte*) COSQ#15 ) - (signed byte*) SINH#13 ← phi( main::@1/(signed byte*) SINH#15 ) (signed byte*) COSH#13 ← phi( main::@1/(signed byte*) COSH#15 ) - (signed byte) sz#19 ← phi( main::@1/(signed byte) sz#21 ) (signed byte) sy#13 ← phi( main::@1/(signed byte) sy#19 ) (signed byte) sx#13 ← phi( main::@1/(signed byte) sx#18 ) (byte*) print_char_cursor#9 ← phi( main::@1/(byte*) print_char_cursor#6 ) @@ -432,16 +408,7 @@ main::@return: scope:[main] from main::@3 return to:@return @24: scope:[] from @23 - (signed byte*) yp#23 ← phi( @23/(signed byte*) yp#0 ) - (signed byte*) xp#23 ← phi( @23/(signed byte*) xp#0 ) - (signed byte*) pp#23 ← phi( @23/(signed byte*) pp#0 ) - (signed byte*) zr#23 ← phi( @23/(signed byte*) zr#0 ) - (signed byte*) yr#23 ← phi( @23/(signed byte*) yr#0 ) - (signed byte*) xr#23 ← phi( @23/(signed byte*) xr#0 ) - (byte*) SCREEN#26 ← phi( @23/(byte*) SCREEN#0 ) (byte*) print_screen#49 ← phi( @23/(byte*) print_screen#50 ) - (word*) psp2#11 ← phi( @23/(word*) psp2#0 ) - (word*) psp1#11 ← phi( @23/(word*) psp1#0 ) (byte*) print_char_cursor#23 ← phi( @23/(byte*) print_char_cursor#24 ) (byte*) print_line_cursor#23 ← phi( @23/(byte*) print_line_cursor#24 ) (signed byte/signed word/signed dword~) $0 ← - (byte/signed byte/word/signed word/dword/signed dword) $34 @@ -464,304 +431,109 @@ main::@return: scope:[main] from main::@3 (signed byte) sz#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:@28 anim: scope:[anim] from main::@2 - (byte*) SCREEN#71 ← phi( main::@2/(byte*) SCREEN#73 ) (byte*) print_screen#61 ← phi( main::@2/(byte*) print_screen#63 ) - (word*) psp2#20 ← phi( main::@2/(word*) psp2#22 ) - (word*) psp1#20 ← phi( main::@2/(word*) psp1#22 ) - (signed byte*) PERSP_Z#15 ← phi( main::@2/(signed byte*) PERSP_Z#17 ) - (byte*) mulf_sqr2#17 ← phi( main::@2/(byte*) mulf_sqr2#19 ) - (byte*) mulf_sqr1#17 ← phi( main::@2/(byte*) mulf_sqr1#19 ) - (signed byte*) yp#15 ← phi( main::@2/(signed byte*) yp#17 ) - (signed byte*) xp#15 ← phi( main::@2/(signed byte*) xp#17 ) - (signed byte*) pp#15 ← phi( main::@2/(signed byte*) pp#17 ) - (signed byte*) zr#15 ← phi( main::@2/(signed byte*) zr#17 ) - (signed byte*) yr#15 ← phi( main::@2/(signed byte*) yr#17 ) - (signed byte*) xr#15 ← phi( main::@2/(signed byte*) xr#17 ) - (signed byte*) SINQ#11 ← phi( main::@2/(signed byte*) SINQ#13 ) (signed byte*) COSQ#11 ← phi( main::@2/(signed byte*) COSQ#13 ) - (signed byte*) SINH#11 ← phi( main::@2/(signed byte*) SINH#13 ) (signed byte*) COSH#11 ← phi( main::@2/(signed byte*) COSH#13 ) - (signed byte) sz#16 ← phi( main::@2/(signed byte) sz#19 ) (signed byte) sy#20 ← phi( main::@2/(signed byte) sy#13 ) (signed byte) sx#19 ← phi( main::@2/(signed byte) sx#13 ) to:anim::@1 anim::@1: scope:[anim] from anim anim::@30 - (byte*) SCREEN#70 ← phi( anim/(byte*) SCREEN#71 anim::@30/(byte*) SCREEN#72 ) (byte*) print_screen#60 ← phi( anim/(byte*) print_screen#61 anim::@30/(byte*) print_screen#62 ) - (word*) psp2#19 ← phi( anim/(word*) psp2#20 anim::@30/(word*) psp2#21 ) - (word*) psp1#19 ← phi( anim/(word*) psp1#20 anim::@30/(word*) psp1#21 ) - (signed byte*) PERSP_Z#14 ← phi( anim/(signed byte*) PERSP_Z#15 anim::@30/(signed byte*) PERSP_Z#16 ) - (byte*) mulf_sqr2#16 ← phi( anim/(byte*) mulf_sqr2#17 anim::@30/(byte*) mulf_sqr2#18 ) - (byte*) mulf_sqr1#16 ← phi( anim/(byte*) mulf_sqr1#17 anim::@30/(byte*) mulf_sqr1#18 ) - (signed byte*) yp#14 ← phi( anim/(signed byte*) yp#15 anim::@30/(signed byte*) yp#16 ) - (signed byte*) xp#14 ← phi( anim/(signed byte*) xp#15 anim::@30/(signed byte*) xp#16 ) - (signed byte*) pp#14 ← phi( anim/(signed byte*) pp#15 anim::@30/(signed byte*) pp#16 ) - (signed byte*) zr#14 ← phi( anim/(signed byte*) zr#15 anim::@30/(signed byte*) zr#16 ) - (signed byte*) yr#14 ← phi( anim/(signed byte*) yr#15 anim::@30/(signed byte*) yr#16 ) - (signed byte*) xr#14 ← phi( anim/(signed byte*) xr#15 anim::@30/(signed byte*) xr#16 ) - (signed byte*) SINQ#10 ← phi( anim/(signed byte*) SINQ#11 anim::@30/(signed byte*) SINQ#12 ) (signed byte*) COSQ#10 ← phi( anim/(signed byte*) COSQ#11 anim::@30/(signed byte*) COSQ#12 ) - (signed byte*) SINH#10 ← phi( anim/(signed byte*) SINH#11 anim::@30/(signed byte*) SINH#12 ) (signed byte*) COSH#10 ← phi( anim/(signed byte*) COSH#11 anim::@30/(signed byte*) COSH#12 ) - (signed byte) sz#14 ← phi( anim/(signed byte) sz#16 anim::@30/(signed byte) sz#17 ) (signed byte) sy#16 ← phi( anim/(signed byte) sy#20 anim::@30/(signed byte) sy#3 ) (signed byte) sx#16 ← phi( anim/(signed byte) sx#19 anim::@30/(signed byte) sx#3 ) if(true) goto anim::@2 to:anim::@return anim::@2: scope:[anim] from anim::@1 - (byte*) SCREEN#68 ← phi( anim::@1/(byte*) SCREEN#70 ) (byte*) print_screen#58 ← phi( anim::@1/(byte*) print_screen#60 ) - (word*) psp2#17 ← phi( anim::@1/(word*) psp2#19 ) - (word*) psp1#17 ← phi( anim::@1/(word*) psp1#19 ) - (signed byte*) PERSP_Z#12 ← phi( anim::@1/(signed byte*) PERSP_Z#14 ) - (byte*) mulf_sqr2#14 ← phi( anim::@1/(byte*) mulf_sqr2#16 ) - (byte*) mulf_sqr1#14 ← phi( anim::@1/(byte*) mulf_sqr1#16 ) - (signed byte*) yp#12 ← phi( anim::@1/(signed byte*) yp#14 ) - (signed byte*) xp#12 ← phi( anim::@1/(signed byte*) xp#14 ) - (signed byte*) pp#12 ← phi( anim::@1/(signed byte*) pp#14 ) - (signed byte*) zr#12 ← phi( anim::@1/(signed byte*) zr#14 ) - (signed byte*) yr#12 ← phi( anim::@1/(signed byte*) yr#14 ) - (signed byte*) xr#12 ← phi( anim::@1/(signed byte*) xr#14 ) - (signed byte*) SINQ#8 ← phi( anim::@1/(signed byte*) SINQ#10 ) (signed byte*) COSQ#8 ← phi( anim::@1/(signed byte*) COSQ#10 ) - (signed byte*) SINH#8 ← phi( anim::@1/(signed byte*) SINH#10 ) (signed byte*) COSH#8 ← phi( anim::@1/(signed byte*) COSH#10 ) - (signed byte) sz#11 ← phi( anim::@1/(signed byte) sz#14 ) (signed byte) sy#31 ← phi( anim::@1/(signed byte) sy#16 ) (signed byte) sx#28 ← phi( anim::@1/(signed byte) sx#16 ) to:anim::@4 anim::@4: scope:[anim] from anim::@2 anim::@5 - (byte*) SCREEN#66 ← phi( anim::@2/(byte*) SCREEN#68 anim::@5/(byte*) SCREEN#69 ) (byte*) print_screen#56 ← phi( anim::@2/(byte*) print_screen#58 anim::@5/(byte*) print_screen#59 ) - (word*) psp2#15 ← phi( anim::@2/(word*) psp2#17 anim::@5/(word*) psp2#18 ) - (word*) psp1#15 ← phi( anim::@2/(word*) psp1#17 anim::@5/(word*) psp1#18 ) - (signed byte*) PERSP_Z#10 ← phi( anim::@2/(signed byte*) PERSP_Z#12 anim::@5/(signed byte*) PERSP_Z#13 ) - (byte*) mulf_sqr2#12 ← phi( anim::@2/(byte*) mulf_sqr2#14 anim::@5/(byte*) mulf_sqr2#15 ) - (byte*) mulf_sqr1#12 ← phi( anim::@2/(byte*) mulf_sqr1#14 anim::@5/(byte*) mulf_sqr1#15 ) - (signed byte*) yp#10 ← phi( anim::@2/(signed byte*) yp#12 anim::@5/(signed byte*) yp#13 ) - (signed byte*) xp#10 ← phi( anim::@2/(signed byte*) xp#12 anim::@5/(signed byte*) xp#13 ) - (signed byte*) pp#10 ← phi( anim::@2/(signed byte*) pp#12 anim::@5/(signed byte*) pp#13 ) - (signed byte*) zr#10 ← phi( anim::@2/(signed byte*) zr#12 anim::@5/(signed byte*) zr#13 ) - (signed byte*) yr#10 ← phi( anim::@2/(signed byte*) yr#12 anim::@5/(signed byte*) yr#13 ) - (signed byte*) xr#10 ← phi( anim::@2/(signed byte*) xr#12 anim::@5/(signed byte*) xr#13 ) - (signed byte*) SINQ#6 ← phi( anim::@2/(signed byte*) SINQ#8 anim::@5/(signed byte*) SINQ#9 ) (signed byte*) COSQ#6 ← phi( anim::@2/(signed byte*) COSQ#8 anim::@5/(signed byte*) COSQ#9 ) - (signed byte*) SINH#6 ← phi( anim::@2/(signed byte*) SINH#8 anim::@5/(signed byte*) SINH#9 ) (signed byte*) COSH#6 ← phi( anim::@2/(signed byte*) COSH#8 anim::@5/(signed byte*) COSH#9 ) - (signed byte) sz#8 ← phi( anim::@2/(signed byte) sz#11 anim::@5/(signed byte) sz#12 ) (signed byte) sy#27 ← phi( anim::@2/(signed byte) sy#31 anim::@5/(signed byte) sy#32 ) (signed byte) sx#25 ← phi( anim::@2/(signed byte) sx#28 anim::@5/(signed byte) sx#29 ) (bool~) anim::$0 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $ff if((bool~) anim::$0) goto anim::@5 to:anim::@7 anim::@5: scope:[anim] from anim::@4 - (byte*) SCREEN#69 ← phi( anim::@4/(byte*) SCREEN#66 ) (byte*) print_screen#59 ← phi( anim::@4/(byte*) print_screen#56 ) - (word*) psp2#18 ← phi( anim::@4/(word*) psp2#15 ) - (word*) psp1#18 ← phi( anim::@4/(word*) psp1#15 ) - (signed byte*) PERSP_Z#13 ← phi( anim::@4/(signed byte*) PERSP_Z#10 ) - (byte*) mulf_sqr2#15 ← phi( anim::@4/(byte*) mulf_sqr2#12 ) - (byte*) mulf_sqr1#15 ← phi( anim::@4/(byte*) mulf_sqr1#12 ) - (signed byte*) yp#13 ← phi( anim::@4/(signed byte*) yp#10 ) - (signed byte*) xp#13 ← phi( anim::@4/(signed byte*) xp#10 ) - (signed byte*) pp#13 ← phi( anim::@4/(signed byte*) pp#10 ) - (signed byte*) zr#13 ← phi( anim::@4/(signed byte*) zr#10 ) - (signed byte*) yr#13 ← phi( anim::@4/(signed byte*) yr#10 ) - (signed byte*) xr#13 ← phi( anim::@4/(signed byte*) xr#10 ) - (signed byte*) SINQ#9 ← phi( anim::@4/(signed byte*) SINQ#6 ) (signed byte*) COSQ#9 ← phi( anim::@4/(signed byte*) COSQ#6 ) - (signed byte*) SINH#9 ← phi( anim::@4/(signed byte*) SINH#6 ) (signed byte*) COSH#9 ← phi( anim::@4/(signed byte*) COSH#6 ) - (signed byte) sz#12 ← phi( anim::@4/(signed byte) sz#8 ) (signed byte) sy#32 ← phi( anim::@4/(signed byte) sy#27 ) (signed byte) sx#29 ← phi( anim::@4/(signed byte) sx#25 ) to:anim::@4 anim::@7: scope:[anim] from anim::@4 anim::@8 - (byte*) SCREEN#65 ← phi( anim::@4/(byte*) SCREEN#66 anim::@8/(byte*) SCREEN#67 ) (byte*) print_screen#55 ← phi( anim::@4/(byte*) print_screen#56 anim::@8/(byte*) print_screen#57 ) - (word*) psp2#14 ← phi( anim::@4/(word*) psp2#15 anim::@8/(word*) psp2#16 ) - (word*) psp1#14 ← phi( anim::@4/(word*) psp1#15 anim::@8/(word*) psp1#16 ) - (signed byte*) PERSP_Z#9 ← phi( anim::@4/(signed byte*) PERSP_Z#10 anim::@8/(signed byte*) PERSP_Z#11 ) - (byte*) mulf_sqr2#11 ← phi( anim::@4/(byte*) mulf_sqr2#12 anim::@8/(byte*) mulf_sqr2#13 ) - (byte*) mulf_sqr1#11 ← phi( anim::@4/(byte*) mulf_sqr1#12 anim::@8/(byte*) mulf_sqr1#13 ) - (signed byte*) yp#9 ← phi( anim::@4/(signed byte*) yp#10 anim::@8/(signed byte*) yp#11 ) - (signed byte*) xp#9 ← phi( anim::@4/(signed byte*) xp#10 anim::@8/(signed byte*) xp#11 ) - (signed byte*) pp#9 ← phi( anim::@4/(signed byte*) pp#10 anim::@8/(signed byte*) pp#11 ) - (signed byte*) zr#9 ← phi( anim::@4/(signed byte*) zr#10 anim::@8/(signed byte*) zr#11 ) - (signed byte*) yr#9 ← phi( anim::@4/(signed byte*) yr#10 anim::@8/(signed byte*) yr#11 ) - (signed byte*) xr#9 ← phi( anim::@4/(signed byte*) xr#10 anim::@8/(signed byte*) xr#11 ) - (signed byte*) SINQ#5 ← phi( anim::@4/(signed byte*) SINQ#6 anim::@8/(signed byte*) SINQ#7 ) (signed byte*) COSQ#5 ← phi( anim::@4/(signed byte*) COSQ#6 anim::@8/(signed byte*) COSQ#7 ) - (signed byte*) SINH#5 ← phi( anim::@4/(signed byte*) SINH#6 anim::@8/(signed byte*) SINH#7 ) (signed byte*) COSH#5 ← phi( anim::@4/(signed byte*) COSH#6 anim::@8/(signed byte*) COSH#7 ) - (signed byte) sz#6 ← phi( anim::@4/(signed byte) sz#8 anim::@8/(signed byte) sz#9 ) (signed byte) sy#22 ← phi( anim::@4/(signed byte) sy#27 anim::@8/(signed byte) sy#28 ) (signed byte) sx#21 ← phi( anim::@4/(signed byte) sx#25 anim::@8/(signed byte) sx#26 ) (bool~) anim::$1 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $fe if((bool~) anim::$1) goto anim::@8 to:anim::@10 anim::@8: scope:[anim] from anim::@7 - (byte*) SCREEN#67 ← phi( anim::@7/(byte*) SCREEN#65 ) (byte*) print_screen#57 ← phi( anim::@7/(byte*) print_screen#55 ) - (word*) psp2#16 ← phi( anim::@7/(word*) psp2#14 ) - (word*) psp1#16 ← phi( anim::@7/(word*) psp1#14 ) - (signed byte*) PERSP_Z#11 ← phi( anim::@7/(signed byte*) PERSP_Z#9 ) - (byte*) mulf_sqr2#13 ← phi( anim::@7/(byte*) mulf_sqr2#11 ) - (byte*) mulf_sqr1#13 ← phi( anim::@7/(byte*) mulf_sqr1#11 ) - (signed byte*) yp#11 ← phi( anim::@7/(signed byte*) yp#9 ) - (signed byte*) xp#11 ← phi( anim::@7/(signed byte*) xp#9 ) - (signed byte*) pp#11 ← phi( anim::@7/(signed byte*) pp#9 ) - (signed byte*) zr#11 ← phi( anim::@7/(signed byte*) zr#9 ) - (signed byte*) yr#11 ← phi( anim::@7/(signed byte*) yr#9 ) - (signed byte*) xr#11 ← phi( anim::@7/(signed byte*) xr#9 ) - (signed byte*) SINQ#7 ← phi( anim::@7/(signed byte*) SINQ#5 ) (signed byte*) COSQ#7 ← phi( anim::@7/(signed byte*) COSQ#5 ) - (signed byte*) SINH#7 ← phi( anim::@7/(signed byte*) SINH#5 ) (signed byte*) COSH#7 ← phi( anim::@7/(signed byte*) COSH#5 ) - (signed byte) sz#9 ← phi( anim::@7/(signed byte) sz#6 ) (signed byte) sy#28 ← phi( anim::@7/(signed byte) sy#22 ) (signed byte) sx#26 ← phi( anim::@7/(signed byte) sx#21 ) to:anim::@7 anim::@10: scope:[anim] from anim::@11 anim::@7 - (byte*) SCREEN#63 ← phi( anim::@11/(byte*) SCREEN#64 anim::@7/(byte*) SCREEN#65 ) (byte*) print_screen#53 ← phi( anim::@11/(byte*) print_screen#54 anim::@7/(byte*) print_screen#55 ) - (word*) psp2#12 ← phi( anim::@11/(word*) psp2#13 anim::@7/(word*) psp2#14 ) - (word*) psp1#12 ← phi( anim::@11/(word*) psp1#13 anim::@7/(word*) psp1#14 ) - (signed byte*) PERSP_Z#7 ← phi( anim::@11/(signed byte*) PERSP_Z#8 anim::@7/(signed byte*) PERSP_Z#9 ) - (byte*) mulf_sqr2#9 ← phi( anim::@11/(byte*) mulf_sqr2#10 anim::@7/(byte*) mulf_sqr2#11 ) - (byte*) mulf_sqr1#9 ← phi( anim::@11/(byte*) mulf_sqr1#10 anim::@7/(byte*) mulf_sqr1#11 ) - (signed byte*) yp#7 ← phi( anim::@11/(signed byte*) yp#8 anim::@7/(signed byte*) yp#9 ) - (signed byte*) xp#7 ← phi( anim::@11/(signed byte*) xp#8 anim::@7/(signed byte*) xp#9 ) - (signed byte*) pp#7 ← phi( anim::@11/(signed byte*) pp#8 anim::@7/(signed byte*) pp#9 ) - (signed byte*) zr#7 ← phi( anim::@11/(signed byte*) zr#8 anim::@7/(signed byte*) zr#9 ) - (signed byte*) yr#7 ← phi( anim::@11/(signed byte*) yr#8 anim::@7/(signed byte*) yr#9 ) - (signed byte*) xr#7 ← phi( anim::@11/(signed byte*) xr#8 anim::@7/(signed byte*) xr#9 ) - (signed byte*) SINQ#3 ← phi( anim::@11/(signed byte*) SINQ#4 anim::@7/(signed byte*) SINQ#5 ) (signed byte*) COSQ#3 ← phi( anim::@11/(signed byte*) COSQ#4 anim::@7/(signed byte*) COSQ#5 ) - (signed byte*) SINH#3 ← phi( anim::@11/(signed byte*) SINH#4 anim::@7/(signed byte*) SINH#5 ) (signed byte*) COSH#3 ← phi( anim::@11/(signed byte*) COSH#4 anim::@7/(signed byte*) COSH#5 ) - (signed byte) sz#3 ← phi( anim::@11/(signed byte) sz#5 anim::@7/(signed byte) sz#6 ) (signed byte) sy#14 ← phi( anim::@11/(signed byte) sy#21 anim::@7/(signed byte) sy#22 ) (signed byte) sx#14 ← phi( anim::@11/(signed byte) sx#20 anim::@7/(signed byte) sx#21 ) (bool~) anim::$2 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $fd if((bool~) anim::$2) goto anim::@11 to:anim::@12 anim::@11: scope:[anim] from anim::@10 - (byte*) SCREEN#64 ← phi( anim::@10/(byte*) SCREEN#63 ) (byte*) print_screen#54 ← phi( anim::@10/(byte*) print_screen#53 ) - (word*) psp2#13 ← phi( anim::@10/(word*) psp2#12 ) - (word*) psp1#13 ← phi( anim::@10/(word*) psp1#12 ) - (signed byte*) PERSP_Z#8 ← phi( anim::@10/(signed byte*) PERSP_Z#7 ) - (byte*) mulf_sqr2#10 ← phi( anim::@10/(byte*) mulf_sqr2#9 ) - (byte*) mulf_sqr1#10 ← phi( anim::@10/(byte*) mulf_sqr1#9 ) - (signed byte*) yp#8 ← phi( anim::@10/(signed byte*) yp#7 ) - (signed byte*) xp#8 ← phi( anim::@10/(signed byte*) xp#7 ) - (signed byte*) pp#8 ← phi( anim::@10/(signed byte*) pp#7 ) - (signed byte*) zr#8 ← phi( anim::@10/(signed byte*) zr#7 ) - (signed byte*) yr#8 ← phi( anim::@10/(signed byte*) yr#7 ) - (signed byte*) xr#8 ← phi( anim::@10/(signed byte*) xr#7 ) - (signed byte*) SINQ#4 ← phi( anim::@10/(signed byte*) SINQ#3 ) (signed byte*) COSQ#4 ← phi( anim::@10/(signed byte*) COSQ#3 ) - (signed byte*) SINH#4 ← phi( anim::@10/(signed byte*) SINH#3 ) (signed byte*) COSH#4 ← phi( anim::@10/(signed byte*) COSH#3 ) - (signed byte) sz#5 ← phi( anim::@10/(signed byte) sz#3 ) (signed byte) sy#21 ← phi( anim::@10/(signed byte) sy#14 ) (signed byte) sx#20 ← phi( anim::@10/(signed byte) sx#14 ) to:anim::@10 anim::@12: scope:[anim] from anim::@10 - (byte*) SCREEN#62 ← phi( anim::@10/(byte*) SCREEN#63 ) (byte*) print_screen#51 ← phi( anim::@10/(byte*) print_screen#53 ) - (word*) psp2#10 ← phi( anim::@10/(word*) psp2#12 ) - (word*) psp1#10 ← phi( anim::@10/(word*) psp1#12 ) - (signed byte*) PERSP_Z#6 ← phi( anim::@10/(signed byte*) PERSP_Z#7 ) - (byte*) mulf_sqr2#8 ← phi( anim::@10/(byte*) mulf_sqr2#9 ) - (byte*) mulf_sqr1#8 ← phi( anim::@10/(byte*) mulf_sqr1#9 ) - (signed byte*) yp#6 ← phi( anim::@10/(signed byte*) yp#7 ) - (signed byte*) xp#6 ← phi( anim::@10/(signed byte*) xp#7 ) - (signed byte*) pp#6 ← phi( anim::@10/(signed byte*) pp#7 ) - (signed byte*) zr#6 ← phi( anim::@10/(signed byte*) zr#7 ) - (signed byte*) yr#6 ← phi( anim::@10/(signed byte*) yr#7 ) - (signed byte*) xr#6 ← phi( anim::@10/(signed byte*) xr#7 ) - (signed byte*) SINQ#2 ← phi( anim::@10/(signed byte*) SINQ#3 ) (signed byte*) COSQ#2 ← phi( anim::@10/(signed byte*) COSQ#3 ) - (signed byte*) SINH#2 ← phi( anim::@10/(signed byte*) SINH#3 ) (signed byte*) COSH#2 ← phi( anim::@10/(signed byte*) COSH#3 ) - (signed byte) sz#1 ← phi( anim::@10/(signed byte) sz#3 ) (signed byte) sy#8 ← phi( anim::@10/(signed byte) sy#14 ) (signed byte) sx#8 ← phi( anim::@10/(signed byte) sx#14 ) *((byte*) BORDERCOL#0) ← ++ *((byte*) BORDERCOL#0) (signed byte) calculate_matrix::sx#0 ← (signed byte) sx#8 (signed byte) calculate_matrix::sy#0 ← (signed byte) sy#8 - (signed byte) calculate_matrix::sz#0 ← (signed byte) sz#1 + (signed byte) calculate_matrix::sz#0 ← (signed byte) sz#0 call calculate_matrix to:anim::@27 anim::@27: scope:[anim] from anim::@12 - (byte*) SCREEN#61 ← phi( anim::@12/(byte*) SCREEN#62 ) - (signed byte*) SINQ#20 ← phi( anim::@12/(signed byte*) SINQ#2 ) (signed byte*) COSQ#20 ← phi( anim::@12/(signed byte*) COSQ#2 ) - (signed byte*) SINH#20 ← phi( anim::@12/(signed byte*) SINH#2 ) (signed byte*) COSH#20 ← phi( anim::@12/(signed byte*) COSH#2 ) - (signed byte) sz#27 ← phi( anim::@12/(signed byte) sz#1 ) (byte*) print_screen#48 ← phi( anim::@12/(byte*) print_screen#51 ) (signed byte) sy#34 ← phi( anim::@12/(signed byte) sy#8 ) (signed byte) sx#31 ← phi( anim::@12/(signed byte) sx#8 ) - (word*) psp2#8 ← phi( anim::@12/(word*) psp2#10 ) - (word*) psp1#8 ← phi( anim::@12/(word*) psp1#10 ) - (signed byte*) PERSP_Z#5 ← phi( anim::@12/(signed byte*) PERSP_Z#6 ) - (byte*) mulf_sqr2#7 ← phi( anim::@12/(byte*) mulf_sqr2#8 ) - (byte*) mulf_sqr1#7 ← phi( anim::@12/(byte*) mulf_sqr1#8 ) - (signed byte*) yp#5 ← phi( anim::@12/(signed byte*) yp#6 ) - (signed byte*) xp#5 ← phi( anim::@12/(signed byte*) xp#6 ) - (signed byte*) pp#5 ← phi( anim::@12/(signed byte*) pp#6 ) - (signed byte*) zr#5 ← phi( anim::@12/(signed byte*) zr#6 ) - (signed byte*) yr#5 ← phi( anim::@12/(signed byte*) yr#6 ) - (signed byte*) xr#5 ← phi( anim::@12/(signed byte*) xr#6 ) call store_matrix to:anim::@28 anim::@28: scope:[anim] from anim::@27 - (byte*) SCREEN#60 ← phi( anim::@27/(byte*) SCREEN#61 ) - (signed byte*) SINQ#19 ← phi( anim::@27/(signed byte*) SINQ#20 ) (signed byte*) COSQ#19 ← phi( anim::@27/(signed byte*) COSQ#20 ) - (signed byte*) SINH#19 ← phi( anim::@27/(signed byte*) SINH#20 ) (signed byte*) COSH#19 ← phi( anim::@27/(signed byte*) COSH#20 ) - (signed byte) sz#26 ← phi( anim::@27/(signed byte) sz#27 ) (byte*) print_screen#46 ← phi( anim::@27/(byte*) print_screen#48 ) (signed byte) sy#33 ← phi( anim::@27/(signed byte) sy#34 ) (signed byte) sx#30 ← phi( anim::@27/(signed byte) sx#31 ) - (word*) psp2#6 ← phi( anim::@27/(word*) psp2#8 ) - (word*) psp1#6 ← phi( anim::@27/(word*) psp1#8 ) - (signed byte*) PERSP_Z#3 ← phi( anim::@27/(signed byte*) PERSP_Z#5 ) - (byte*) mulf_sqr2#5 ← phi( anim::@27/(byte*) mulf_sqr2#7 ) - (byte*) mulf_sqr1#5 ← phi( anim::@27/(byte*) mulf_sqr1#7 ) - (signed byte*) yp#4 ← phi( anim::@27/(signed byte*) yp#5 ) - (signed byte*) xp#4 ← phi( anim::@27/(signed byte*) xp#5 ) - (signed byte*) pp#4 ← phi( anim::@27/(signed byte*) pp#5 ) - (signed byte*) zr#4 ← phi( anim::@27/(signed byte*) zr#5 ) - (signed byte*) yr#4 ← phi( anim::@27/(signed byte*) yr#5 ) - (signed byte*) xr#4 ← phi( anim::@27/(signed byte*) xr#5 ) (byte) anim::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:anim::@13 anim::@13: scope:[anim] from anim::@28 anim::@29 - (byte*) SCREEN#59 ← phi( anim::@28/(byte*) SCREEN#60 anim::@29/(byte*) SCREEN#58 ) - (signed byte*) SINQ#18 ← phi( anim::@28/(signed byte*) SINQ#19 anim::@29/(signed byte*) SINQ#16 ) (signed byte*) COSQ#18 ← phi( anim::@28/(signed byte*) COSQ#19 anim::@29/(signed byte*) COSQ#16 ) - (signed byte*) SINH#18 ← phi( anim::@28/(signed byte*) SINH#19 anim::@29/(signed byte*) SINH#16 ) (signed byte*) COSH#18 ← phi( anim::@28/(signed byte*) COSH#19 anim::@29/(signed byte*) COSH#16 ) - (signed byte) sz#24 ← phi( anim::@28/(signed byte) sz#26 anim::@29/(signed byte) sz#22 ) (byte*) print_screen#45 ← phi( anim::@28/(byte*) print_screen#46 anim::@29/(byte*) print_screen#43 ) (signed byte) sy#29 ← phi( anim::@28/(signed byte) sy#33 anim::@29/(signed byte) sy#23 ) (signed byte) sx#27 ← phi( anim::@28/(signed byte) sx#30 anim::@29/(signed byte) sx#22 ) - (word*) psp2#4 ← phi( anim::@28/(word*) psp2#6 anim::@29/(word*) psp2#7 ) - (word*) psp1#4 ← phi( anim::@28/(word*) psp1#6 anim::@29/(word*) psp1#7 ) - (signed byte*) PERSP_Z#2 ← phi( anim::@28/(signed byte*) PERSP_Z#3 anim::@29/(signed byte*) PERSP_Z#4 ) - (byte*) mulf_sqr2#4 ← phi( anim::@28/(byte*) mulf_sqr2#5 anim::@29/(byte*) mulf_sqr2#6 ) - (byte*) mulf_sqr1#4 ← phi( anim::@28/(byte*) mulf_sqr1#5 anim::@29/(byte*) mulf_sqr1#6 ) - (signed byte*) yp#3 ← phi( anim::@28/(signed byte*) yp#4 anim::@29/(signed byte*) yp#1 ) - (signed byte*) xp#3 ← phi( anim::@28/(signed byte*) xp#4 anim::@29/(signed byte*) xp#1 ) - (signed byte*) pp#3 ← phi( anim::@28/(signed byte*) pp#4 anim::@29/(signed byte*) pp#1 ) - (signed byte*) zr#3 ← phi( anim::@28/(signed byte*) zr#4 anim::@29/(signed byte*) zr#1 ) - (signed byte*) yr#3 ← phi( anim::@28/(signed byte*) yr#4 anim::@29/(signed byte*) yr#1 ) - (signed byte*) xr#3 ← phi( anim::@28/(signed byte*) xr#4 anim::@29/(signed byte*) xr#1 ) (byte) anim::i#2 ← phi( anim::@28/(byte) anim::i#0 anim::@29/(byte) anim::i#1 ) *((byte*) BORDERCOL#0) ← ++ *((byte*) BORDERCOL#0) (signed byte) rotate_matrix::x#0 ← *((signed byte[8]) xs#0 + (byte) anim::i#2) @@ -770,39 +542,24 @@ anim::@13: scope:[anim] from anim::@28 anim::@29 call rotate_matrix to:anim::@29 anim::@29: scope:[anim] from anim::@13 - (byte*) SCREEN#58 ← phi( anim::@13/(byte*) SCREEN#59 ) - (signed byte*) SINQ#16 ← phi( anim::@13/(signed byte*) SINQ#18 ) (signed byte*) COSQ#16 ← phi( anim::@13/(signed byte*) COSQ#18 ) - (signed byte*) SINH#16 ← phi( anim::@13/(signed byte*) SINH#18 ) (signed byte*) COSH#16 ← phi( anim::@13/(signed byte*) COSH#18 ) - (signed byte) sz#22 ← phi( anim::@13/(signed byte) sz#24 ) (byte*) print_screen#43 ← phi( anim::@13/(byte*) print_screen#45 ) (signed byte) sy#23 ← phi( anim::@13/(signed byte) sy#29 ) (signed byte) sx#22 ← phi( anim::@13/(signed byte) sx#27 ) - (word*) psp2#7 ← phi( anim::@13/(word*) psp2#4 ) - (word*) psp1#7 ← phi( anim::@13/(word*) psp1#4 ) - (signed byte*) PERSP_Z#4 ← phi( anim::@13/(signed byte*) PERSP_Z#2 ) - (byte*) mulf_sqr2#6 ← phi( anim::@13/(byte*) mulf_sqr2#4 ) - (byte*) mulf_sqr1#6 ← phi( anim::@13/(byte*) mulf_sqr1#4 ) - (signed byte*) yp#1 ← phi( anim::@13/(signed byte*) yp#3 ) - (signed byte*) xp#1 ← phi( anim::@13/(signed byte*) xp#3 ) - (signed byte*) pp#1 ← phi( anim::@13/(signed byte*) pp#3 ) - (signed byte*) zr#1 ← phi( anim::@13/(signed byte*) zr#3 ) - (signed byte*) yr#1 ← phi( anim::@13/(signed byte*) yr#3 ) (byte) anim::i#3 ← phi( anim::@13/(byte) anim::i#2 ) - (signed byte*) xr#1 ← phi( anim::@13/(signed byte*) xr#3 ) - *((signed byte[8]) xrs#0 + (byte) anim::i#3) ← *((signed byte*) xr#1) - *((signed byte[8]) yrs#0 + (byte) anim::i#3) ← *((signed byte*) yr#1) - *((signed byte[8]) zrs#0 + (byte) anim::i#3) ← *((signed byte*) zr#1) - *((signed byte[8]) pps#0 + (byte) anim::i#3) ← *((signed byte*) pp#1) - *((signed byte[8]) xps#0 + (byte) anim::i#3) ← *((signed byte*) xp#1) - *((signed byte[8]) yps#0 + (byte) anim::i#3) ← *((signed byte*) yp#1) + *((signed byte[8]) xrs#0 + (byte) anim::i#3) ← *((signed byte*) xr#0) + *((signed byte[8]) yrs#0 + (byte) anim::i#3) ← *((signed byte*) yr#0) + *((signed byte[8]) zrs#0 + (byte) anim::i#3) ← *((signed byte*) zr#0) + *((signed byte[8]) pps#0 + (byte) anim::i#3) ← *((signed byte*) pp#0) + *((signed byte[8]) xps#0 + (byte) anim::i#3) ← *((signed byte*) xp#0) + *((signed byte[8]) yps#0 + (byte) anim::i#3) ← *((signed byte*) yp#0) (byte~) anim::$6 ← (byte) anim::i#3 << (byte/signed byte/word/signed word/dword/signed dword) 1 (byte) anim::i2#0 ← (byte~) anim::$6 - (byte~) anim::$7 ← ((byte)) *((signed byte*) xp#1) + (byte~) anim::$7 ← ((byte)) *((signed byte*) xp#0) (byte/word/signed word/dword/signed dword~) anim::$8 ← (byte/word/signed word/dword/signed dword) $80 + (byte~) anim::$7 *((byte*) SPRITES_XPOS#0 + (byte) anim::i2#0) ← (byte/word/signed word/dword/signed dword~) anim::$8 - (byte~) anim::$9 ← ((byte)) *((signed byte*) yp#1) + (byte~) anim::$9 ← ((byte)) *((signed byte*) yp#0) (byte/word/signed word/dword/signed dword~) anim::$10 ← (byte/word/signed word/dword/signed dword) $80 + (byte~) anim::$9 *((byte*) SPRITES_YPOS#0 + (byte) anim::i2#0) ← (byte/word/signed word/dword/signed dword~) anim::$10 (byte) anim::i#1 ← (byte) anim::i#3 + rangenext(0,7) @@ -810,23 +567,8 @@ anim::@29: scope:[anim] from anim::@13 if((bool~) anim::$11) goto anim::@13 to:anim::@25 anim::@25: scope:[anim] from anim::@29 - (byte*) SCREEN#57 ← phi( anim::@29/(byte*) SCREEN#58 ) - (word*) psp2#23 ← phi( anim::@29/(word*) psp2#7 ) - (word*) psp1#23 ← phi( anim::@29/(word*) psp1#7 ) - (signed byte*) PERSP_Z#18 ← phi( anim::@29/(signed byte*) PERSP_Z#4 ) - (byte*) mulf_sqr2#20 ← phi( anim::@29/(byte*) mulf_sqr2#6 ) - (byte*) mulf_sqr1#20 ← phi( anim::@29/(byte*) mulf_sqr1#6 ) - (signed byte*) yp#18 ← phi( anim::@29/(signed byte*) yp#1 ) - (signed byte*) xp#18 ← phi( anim::@29/(signed byte*) xp#1 ) - (signed byte*) pp#18 ← phi( anim::@29/(signed byte*) pp#1 ) - (signed byte*) zr#18 ← phi( anim::@29/(signed byte*) zr#1 ) - (signed byte*) yr#18 ← phi( anim::@29/(signed byte*) yr#1 ) - (signed byte*) xr#18 ← phi( anim::@29/(signed byte*) xr#1 ) - (signed byte*) SINQ#14 ← phi( anim::@29/(signed byte*) SINQ#16 ) (signed byte*) COSQ#14 ← phi( anim::@29/(signed byte*) COSQ#16 ) - (signed byte*) SINH#14 ← phi( anim::@29/(signed byte*) SINH#16 ) (signed byte*) COSH#14 ← phi( anim::@29/(signed byte*) COSH#16 ) - (signed byte) sz#20 ← phi( anim::@29/(signed byte) sz#22 ) (byte*) print_screen#30 ← phi( anim::@29/(byte*) print_screen#43 ) (signed byte) sy#15 ← phi( anim::@29/(signed byte) sy#23 ) (signed byte) sx#15 ← phi( anim::@29/(signed byte) sx#22 ) @@ -834,24 +576,9 @@ anim::@25: scope:[anim] from anim::@29 call debug_print to:anim::@30 anim::@30: scope:[anim] from anim::@25 - (byte*) SCREEN#72 ← phi( anim::@25/(byte*) SCREEN#57 ) (byte*) print_screen#62 ← phi( anim::@25/(byte*) print_screen#30 ) - (word*) psp2#21 ← phi( anim::@25/(word*) psp2#23 ) - (word*) psp1#21 ← phi( anim::@25/(word*) psp1#23 ) - (signed byte*) PERSP_Z#16 ← phi( anim::@25/(signed byte*) PERSP_Z#18 ) - (byte*) mulf_sqr2#18 ← phi( anim::@25/(byte*) mulf_sqr2#20 ) - (byte*) mulf_sqr1#18 ← phi( anim::@25/(byte*) mulf_sqr1#20 ) - (signed byte*) yp#16 ← phi( anim::@25/(signed byte*) yp#18 ) - (signed byte*) xp#16 ← phi( anim::@25/(signed byte*) xp#18 ) - (signed byte*) pp#16 ← phi( anim::@25/(signed byte*) pp#18 ) - (signed byte*) zr#16 ← phi( anim::@25/(signed byte*) zr#18 ) - (signed byte*) yr#16 ← phi( anim::@25/(signed byte*) yr#18 ) - (signed byte*) xr#16 ← phi( anim::@25/(signed byte*) xr#18 ) - (signed byte*) SINQ#12 ← phi( anim::@25/(signed byte*) SINQ#14 ) (signed byte*) COSQ#12 ← phi( anim::@25/(signed byte*) COSQ#14 ) - (signed byte*) SINH#12 ← phi( anim::@25/(signed byte*) SINH#14 ) (signed byte*) COSH#12 ← phi( anim::@25/(signed byte*) COSH#14 ) - (signed byte) sz#17 ← phi( anim::@25/(signed byte) sz#20 ) (signed byte) sy#9 ← phi( anim::@25/(signed byte) sy#15 ) (signed byte) sx#9 ← phi( anim::@25/(signed byte) sx#15 ) *((byte*) BORDERCOL#0) ← (byte) LIGHT_BLUE#0 @@ -866,20 +593,18 @@ anim::@return: scope:[anim] from anim::@1 return to:@return debug_print_init: scope:[debug_print_init] from main::@1 - (byte*) SCREEN#15 ← phi( main::@1/(byte*) SCREEN#17 ) (byte*) print_char_cursor#16 ← phi( main::@1/(byte*) print_char_cursor#14 ) (byte*) print_line_cursor#16 ← phi( main::@1/(byte*) print_line_cursor#14 ) (byte*) print_screen#16 ← phi( main::@1/(byte*) print_screen#29 ) call print_cls to:debug_print_init::@5 debug_print_init::@5: scope:[debug_print_init] from debug_print_init - (byte*) SCREEN#1 ← phi( debug_print_init/(byte*) SCREEN#15 ) (byte*) print_char_cursor#11 ← phi( debug_print_init/(byte*) print_char_cursor#2 ) (byte*) print_line_cursor#11 ← phi( debug_print_init/(byte*) print_line_cursor#2 ) (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#11 (byte*) print_char_cursor#5 ← (byte*) print_char_cursor#11 (byte/signed byte/word/signed word/dword/signed dword~) debug_print_init::$1 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 0 - (byte*~) debug_print_init::$2 ← (byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword~) debug_print_init::$1 + (byte*~) debug_print_init::$2 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword~) debug_print_init::$1 (byte*~) debug_print_init::$3 ← (byte*~) debug_print_init::$2 + (byte/signed byte/word/signed word/dword/signed dword) $22 (byte*) print_str_at::str#1 ← (const string) debug_print_init::str (byte*) print_str_at::at#1 ← (byte*~) debug_print_init::$3 @@ -888,9 +613,8 @@ debug_print_init::@5: scope:[debug_print_init] from debug_print_init debug_print_init::@6: scope:[debug_print_init] from debug_print_init::@5 (byte*) print_char_cursor#40 ← phi( debug_print_init::@5/(byte*) print_char_cursor#5 ) (byte*) print_line_cursor#40 ← phi( debug_print_init::@5/(byte*) print_line_cursor#5 ) - (byte*) SCREEN#2 ← phi( debug_print_init::@5/(byte*) SCREEN#1 ) (byte/signed byte/word/signed word/dword/signed dword~) debug_print_init::$5 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 1 - (byte*~) debug_print_init::$6 ← (byte*) SCREEN#2 + (byte/signed byte/word/signed word/dword/signed dword~) debug_print_init::$5 + (byte*~) debug_print_init::$6 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword~) debug_print_init::$5 (byte*~) debug_print_init::$7 ← (byte*~) debug_print_init::$6 + (byte/signed byte/word/signed word/dword/signed dword) $22 (byte*) print_str_at::str#2 ← (const string) debug_print_init::str1 (byte*) print_str_at::at#2 ← (byte*~) debug_print_init::$7 @@ -899,9 +623,8 @@ debug_print_init::@6: scope:[debug_print_init] from debug_print_init::@5 debug_print_init::@7: scope:[debug_print_init] from debug_print_init::@6 (byte*) print_char_cursor#39 ← phi( debug_print_init::@6/(byte*) print_char_cursor#40 ) (byte*) print_line_cursor#39 ← phi( debug_print_init::@6/(byte*) print_line_cursor#40 ) - (byte*) SCREEN#3 ← phi( debug_print_init::@6/(byte*) SCREEN#2 ) (byte/signed byte/word/signed word/dword/signed dword~) debug_print_init::$9 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte*~) debug_print_init::$10 ← (byte*) SCREEN#3 + (byte/signed byte/word/signed word/dword/signed dword~) debug_print_init::$9 + (byte*~) debug_print_init::$10 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword~) debug_print_init::$9 (byte*~) debug_print_init::$11 ← (byte*~) debug_print_init::$10 + (byte/signed byte/word/signed word/dword/signed dword) $22 (byte*) print_str_at::str#3 ← (const string) debug_print_init::str2 (byte*) print_str_at::at#3 ← (byte*~) debug_print_init::$11 @@ -910,9 +633,8 @@ debug_print_init::@7: scope:[debug_print_init] from debug_print_init::@6 debug_print_init::@8: scope:[debug_print_init] from debug_print_init::@7 (byte*) print_char_cursor#38 ← phi( debug_print_init::@7/(byte*) print_char_cursor#39 ) (byte*) print_line_cursor#38 ← phi( debug_print_init::@7/(byte*) print_line_cursor#39 ) - (byte*) SCREEN#4 ← phi( debug_print_init::@7/(byte*) SCREEN#3 ) (word/signed word/dword/signed dword~) debug_print_init::$13 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $10 - (byte*~) debug_print_init::$14 ← (byte*) SCREEN#4 + (word/signed word/dword/signed dword~) debug_print_init::$13 + (byte*~) debug_print_init::$14 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) debug_print_init::$13 (byte*) print_str_at::str#4 ← (const string) debug_print_init::str3 (byte*) print_str_at::at#4 ← (byte*~) debug_print_init::$14 call print_str_at @@ -920,9 +642,8 @@ debug_print_init::@8: scope:[debug_print_init] from debug_print_init::@7 debug_print_init::@9: scope:[debug_print_init] from debug_print_init::@8 (byte*) print_char_cursor#37 ← phi( debug_print_init::@8/(byte*) print_char_cursor#38 ) (byte*) print_line_cursor#37 ← phi( debug_print_init::@8/(byte*) print_line_cursor#38 ) - (byte*) SCREEN#5 ← phi( debug_print_init::@8/(byte*) SCREEN#4 ) (word/signed word/dword/signed dword~) debug_print_init::$16 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $11 - (byte*~) debug_print_init::$17 ← (byte*) SCREEN#5 + (word/signed word/dword/signed dword~) debug_print_init::$16 + (byte*~) debug_print_init::$17 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) debug_print_init::$16 (byte*) print_str_at::str#5 ← (const string) debug_print_init::str4 (byte*) print_str_at::at#5 ← (byte*~) debug_print_init::$17 call print_str_at @@ -930,9 +651,8 @@ debug_print_init::@9: scope:[debug_print_init] from debug_print_init::@8 debug_print_init::@10: scope:[debug_print_init] from debug_print_init::@9 (byte*) print_char_cursor#36 ← phi( debug_print_init::@9/(byte*) print_char_cursor#37 ) (byte*) print_line_cursor#36 ← phi( debug_print_init::@9/(byte*) print_line_cursor#37 ) - (byte*) SCREEN#6 ← phi( debug_print_init::@9/(byte*) SCREEN#5 ) (word/signed word/dword/signed dword~) debug_print_init::$19 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $12 - (byte*~) debug_print_init::$20 ← (byte*) SCREEN#6 + (word/signed word/dword/signed dword~) debug_print_init::$19 + (byte*~) debug_print_init::$20 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) debug_print_init::$19 (byte*) print_str_at::str#6 ← (const string) debug_print_init::str5 (byte*) print_str_at::at#6 ← (byte*~) debug_print_init::$20 call print_str_at @@ -940,9 +660,8 @@ debug_print_init::@10: scope:[debug_print_init] from debug_print_init::@9 debug_print_init::@11: scope:[debug_print_init] from debug_print_init::@10 (byte*) print_char_cursor#35 ← phi( debug_print_init::@10/(byte*) print_char_cursor#36 ) (byte*) print_line_cursor#35 ← phi( debug_print_init::@10/(byte*) print_line_cursor#36 ) - (byte*) SCREEN#7 ← phi( debug_print_init::@10/(byte*) SCREEN#6 ) (word/signed word/dword/signed dword~) debug_print_init::$22 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $13 - (byte*~) debug_print_init::$23 ← (byte*) SCREEN#7 + (word/signed word/dword/signed dword~) debug_print_init::$22 + (byte*~) debug_print_init::$23 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) debug_print_init::$22 (byte*) print_str_at::str#7 ← (const string) debug_print_init::str6 (byte*) print_str_at::at#7 ← (byte*~) debug_print_init::$23 call print_str_at @@ -950,9 +669,8 @@ debug_print_init::@11: scope:[debug_print_init] from debug_print_init::@10 debug_print_init::@12: scope:[debug_print_init] from debug_print_init::@11 (byte*) print_char_cursor#34 ← phi( debug_print_init::@11/(byte*) print_char_cursor#35 ) (byte*) print_line_cursor#34 ← phi( debug_print_init::@11/(byte*) print_line_cursor#35 ) - (byte*) SCREEN#8 ← phi( debug_print_init::@11/(byte*) SCREEN#7 ) (word/signed word/dword/signed dword~) debug_print_init::$25 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $14 - (byte*~) debug_print_init::$26 ← (byte*) SCREEN#8 + (word/signed word/dword/signed dword~) debug_print_init::$25 + (byte*~) debug_print_init::$26 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) debug_print_init::$25 (byte*) print_str_at::str#8 ← (const string) debug_print_init::str7 (byte*) print_str_at::at#8 ← (byte*~) debug_print_init::$26 call print_str_at @@ -960,9 +678,8 @@ debug_print_init::@12: scope:[debug_print_init] from debug_print_init::@11 debug_print_init::@13: scope:[debug_print_init] from debug_print_init::@12 (byte*) print_char_cursor#33 ← phi( debug_print_init::@12/(byte*) print_char_cursor#34 ) (byte*) print_line_cursor#33 ← phi( debug_print_init::@12/(byte*) print_line_cursor#34 ) - (byte*) SCREEN#9 ← phi( debug_print_init::@12/(byte*) SCREEN#8 ) (word/signed word/dword/signed dword~) debug_print_init::$28 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $15 - (byte*~) debug_print_init::$29 ← (byte*) SCREEN#9 + (word/signed word/dword/signed dword~) debug_print_init::$28 + (byte*~) debug_print_init::$29 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) debug_print_init::$28 (byte*) print_str_at::str#9 ← (const string) debug_print_init::str8 (byte*) print_str_at::at#9 ← (byte*~) debug_print_init::$29 call print_str_at @@ -970,9 +687,8 @@ debug_print_init::@13: scope:[debug_print_init] from debug_print_init::@12 debug_print_init::@14: scope:[debug_print_init] from debug_print_init::@13 (byte*) print_char_cursor#32 ← phi( debug_print_init::@13/(byte*) print_char_cursor#33 ) (byte*) print_line_cursor#32 ← phi( debug_print_init::@13/(byte*) print_line_cursor#33 ) - (byte*) SCREEN#10 ← phi( debug_print_init::@13/(byte*) SCREEN#9 ) (word/signed word/dword/signed dword~) debug_print_init::$31 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $16 - (byte*~) debug_print_init::$32 ← (byte*) SCREEN#10 + (word/signed word/dword/signed dword~) debug_print_init::$31 + (byte*~) debug_print_init::$32 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) debug_print_init::$31 (byte*) print_str_at::str#10 ← (const string) debug_print_init::str9 (byte*) print_str_at::at#10 ← (byte*~) debug_print_init::$32 call print_str_at @@ -980,9 +696,8 @@ debug_print_init::@14: scope:[debug_print_init] from debug_print_init::@13 debug_print_init::@15: scope:[debug_print_init] from debug_print_init::@14 (byte*) print_char_cursor#31 ← phi( debug_print_init::@14/(byte*) print_char_cursor#32 ) (byte*) print_line_cursor#31 ← phi( debug_print_init::@14/(byte*) print_line_cursor#32 ) - (byte*) SCREEN#11 ← phi( debug_print_init::@14/(byte*) SCREEN#10 ) (word/signed word/dword/signed dword~) debug_print_init::$34 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $17 - (byte*~) debug_print_init::$35 ← (byte*) SCREEN#11 + (word/signed word/dword/signed dword~) debug_print_init::$34 + (byte*~) debug_print_init::$35 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) debug_print_init::$34 (byte*) print_str_at::str#11 ← (const string) debug_print_init::str10 (byte*) print_str_at::at#11 ← (byte*~) debug_print_init::$35 call print_str_at @@ -990,9 +705,8 @@ debug_print_init::@15: scope:[debug_print_init] from debug_print_init::@14 debug_print_init::@16: scope:[debug_print_init] from debug_print_init::@15 (byte*) print_char_cursor#30 ← phi( debug_print_init::@15/(byte*) print_char_cursor#31 ) (byte*) print_line_cursor#30 ← phi( debug_print_init::@15/(byte*) print_line_cursor#31 ) - (byte*) SCREEN#12 ← phi( debug_print_init::@15/(byte*) SCREEN#11 ) (word/signed word/dword/signed dword~) debug_print_init::$37 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $18 - (byte*~) debug_print_init::$38 ← (byte*) SCREEN#12 + (word/signed word/dword/signed dword~) debug_print_init::$37 + (byte*~) debug_print_init::$38 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) debug_print_init::$37 (byte*) print_str_at::str#12 ← (const string) debug_print_init::str11 (byte*) print_str_at::at#12 ← (byte*~) debug_print_init::$38 call print_str_at @@ -1000,9 +714,8 @@ debug_print_init::@16: scope:[debug_print_init] from debug_print_init::@15 debug_print_init::@17: scope:[debug_print_init] from debug_print_init::@16 (byte*) print_char_cursor#29 ← phi( debug_print_init::@16/(byte*) print_char_cursor#30 ) (byte*) print_line_cursor#29 ← phi( debug_print_init::@16/(byte*) print_line_cursor#30 ) - (byte*) SCREEN#13 ← phi( debug_print_init::@16/(byte*) SCREEN#12 ) (word/signed word/dword/signed dword~) debug_print_init::$40 ← (byte/signed byte/word/signed word/dword/signed dword) $10 * (byte/signed byte/word/signed word/dword/signed dword) $28 - (byte*~) debug_print_init::$41 ← (byte*) SCREEN#13 + (word/signed word/dword/signed dword~) debug_print_init::$40 + (byte*~) debug_print_init::$41 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) debug_print_init::$40 (byte*) debug_print_init::at_line#0 ← (byte*~) debug_print_init::$41 (byte) debug_print_init::c#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4 (byte*) debug_print_init::COLS#0 ← ((byte*)) (word/dword/signed dword) $d800 @@ -1141,8 +854,6 @@ debug_print_init::@return: scope:[debug_print_init] from debug_print_init::@3 return to:@return debug_print: scope:[debug_print] from anim::@25 - (byte*) SCREEN#56 ← phi( anim::@25/(byte*) SCREEN#57 ) - (signed byte) sz#18 ← phi( anim::@25/(signed byte) sz#20 ) (signed byte) sy#30 ← phi( anim::@25/(signed byte) sy#15 ) (byte*) print_screen#17 ← phi( anim::@25/(byte*) print_screen#30 ) (signed byte) sx#11 ← phi( anim::@25/(signed byte) sx#15 ) @@ -1151,8 +862,6 @@ debug_print: scope:[debug_print] from anim::@25 (byte) debug_print::print_sbyte_pos1_col#0 ← (byte/signed byte/word/signed word/dword/signed dword) $25 to:debug_print::print_sbyte_pos1 debug_print::print_sbyte_pos1: scope:[debug_print] from debug_print - (byte*) SCREEN#55 ← phi( debug_print/(byte*) SCREEN#56 ) - (signed byte) sz#15 ← phi( debug_print/(signed byte) sz#18 ) (signed byte) sy#24 ← phi( debug_print/(signed byte) sy#30 ) (signed byte) debug_print::print_sbyte_pos1_sb#1 ← phi( debug_print/(signed byte) debug_print::print_sbyte_pos1_sb#0 ) (byte) debug_print::print_sbyte_pos1_col#1 ← phi( debug_print/(byte) debug_print::print_sbyte_pos1_col#0 ) @@ -1166,14 +875,10 @@ debug_print::print_sbyte_pos1: scope:[debug_print] from debug_print call print_sbyte_at to:debug_print::@15 debug_print::@15: scope:[debug_print] from debug_print::print_sbyte_pos1 - (byte*) SCREEN#54 ← phi( debug_print::print_sbyte_pos1/(byte*) SCREEN#55 ) - (signed byte) sz#13 ← phi( debug_print::print_sbyte_pos1/(signed byte) sz#15 ) (byte*) print_screen#31 ← phi( debug_print::print_sbyte_pos1/(byte*) print_screen#4 ) (signed byte) sy#17 ← phi( debug_print::print_sbyte_pos1/(signed byte) sy#24 ) to:debug_print::@3 debug_print::@3: scope:[debug_print] from debug_print::@15 - (byte*) SCREEN#53 ← phi( debug_print::@15/(byte*) SCREEN#54 ) - (signed byte) sz#10 ← phi( debug_print::@15/(signed byte) sz#13 ) (byte*) print_screen#18 ← phi( debug_print::@15/(byte*) print_screen#31 ) (signed byte) sy#11 ← phi( debug_print::@15/(signed byte) sy#17 ) (signed byte) debug_print::print_sbyte_pos2_sb#0 ← (signed byte) sy#11 @@ -1181,8 +886,6 @@ debug_print::@3: scope:[debug_print] from debug_print::@15 (byte) debug_print::print_sbyte_pos2_col#0 ← (byte/signed byte/word/signed word/dword/signed dword) $25 to:debug_print::print_sbyte_pos2 debug_print::print_sbyte_pos2: scope:[debug_print] from debug_print::@3 - (byte*) SCREEN#52 ← phi( debug_print::@3/(byte*) SCREEN#53 ) - (signed byte) sz#7 ← phi( debug_print::@3/(signed byte) sz#10 ) (signed byte) debug_print::print_sbyte_pos2_sb#1 ← phi( debug_print::@3/(signed byte) debug_print::print_sbyte_pos2_sb#0 ) (byte) debug_print::print_sbyte_pos2_col#1 ← phi( debug_print::@3/(byte) debug_print::print_sbyte_pos2_col#0 ) (byte*) print_screen#5 ← phi( debug_print::@3/(byte*) print_screen#18 ) @@ -1195,20 +898,15 @@ debug_print::print_sbyte_pos2: scope:[debug_print] from debug_print::@3 call print_sbyte_at to:debug_print::@16 debug_print::@16: scope:[debug_print] from debug_print::print_sbyte_pos2 - (byte*) SCREEN#51 ← phi( debug_print::print_sbyte_pos2/(byte*) SCREEN#52 ) (byte*) print_screen#32 ← phi( debug_print::print_sbyte_pos2/(byte*) print_screen#5 ) - (signed byte) sz#4 ← phi( debug_print::print_sbyte_pos2/(signed byte) sz#7 ) to:debug_print::@4 debug_print::@4: scope:[debug_print] from debug_print::@16 - (byte*) SCREEN#50 ← phi( debug_print::@16/(byte*) SCREEN#51 ) (byte*) print_screen#19 ← phi( debug_print::@16/(byte*) print_screen#32 ) - (signed byte) sz#2 ← phi( debug_print::@16/(signed byte) sz#4 ) - (signed byte) debug_print::print_sbyte_pos3_sb#0 ← (signed byte) sz#2 + (signed byte) debug_print::print_sbyte_pos3_sb#0 ← (signed byte) sz#0 (byte) debug_print::print_sbyte_pos3_row#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2 (byte) debug_print::print_sbyte_pos3_col#0 ← (byte/signed byte/word/signed word/dword/signed dword) $25 to:debug_print::print_sbyte_pos3 debug_print::print_sbyte_pos3: scope:[debug_print] from debug_print::@4 - (byte*) SCREEN#49 ← phi( debug_print::@4/(byte*) SCREEN#50 ) (signed byte) debug_print::print_sbyte_pos3_sb#1 ← phi( debug_print::@4/(signed byte) debug_print::print_sbyte_pos3_sb#0 ) (byte) debug_print::print_sbyte_pos3_col#1 ← phi( debug_print::@4/(byte) debug_print::print_sbyte_pos3_col#0 ) (byte*) print_screen#6 ← phi( debug_print::@4/(byte*) print_screen#19 ) @@ -1221,18 +919,15 @@ debug_print::print_sbyte_pos3: scope:[debug_print] from debug_print::@4 call print_sbyte_at to:debug_print::@17 debug_print::@17: scope:[debug_print] from debug_print::print_sbyte_pos3 - (byte*) SCREEN#48 ← phi( debug_print::print_sbyte_pos3/(byte*) SCREEN#49 ) (byte*) print_screen#33 ← phi( debug_print::print_sbyte_pos3/(byte*) print_screen#6 ) to:debug_print::@5 debug_print::@5: scope:[debug_print] from debug_print::@17 - (byte*) SCREEN#47 ← phi( debug_print::@17/(byte*) SCREEN#48 ) (byte*) print_screen#20 ← phi( debug_print::@17/(byte*) print_screen#33 ) (signed byte) debug_print::print_sbyte_pos4_sb#0 ← *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) (byte) debug_print::print_sbyte_pos4_row#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4 (byte) debug_print::print_sbyte_pos4_col#0 ← (byte/signed byte/word/signed word/dword/signed dword) $1d to:debug_print::print_sbyte_pos4 debug_print::print_sbyte_pos4: scope:[debug_print] from debug_print::@5 - (byte*) SCREEN#46 ← phi( debug_print::@5/(byte*) SCREEN#47 ) (signed byte) debug_print::print_sbyte_pos4_sb#1 ← phi( debug_print::@5/(signed byte) debug_print::print_sbyte_pos4_sb#0 ) (byte) debug_print::print_sbyte_pos4_col#1 ← phi( debug_print::@5/(byte) debug_print::print_sbyte_pos4_col#0 ) (byte*) print_screen#7 ← phi( debug_print::@5/(byte*) print_screen#20 ) @@ -1245,18 +940,15 @@ debug_print::print_sbyte_pos4: scope:[debug_print] from debug_print::@5 call print_sbyte_at to:debug_print::@18 debug_print::@18: scope:[debug_print] from debug_print::print_sbyte_pos4 - (byte*) SCREEN#45 ← phi( debug_print::print_sbyte_pos4/(byte*) SCREEN#46 ) (byte*) print_screen#34 ← phi( debug_print::print_sbyte_pos4/(byte*) print_screen#7 ) to:debug_print::@6 debug_print::@6: scope:[debug_print] from debug_print::@18 - (byte*) SCREEN#44 ← phi( debug_print::@18/(byte*) SCREEN#45 ) (byte*) print_screen#21 ← phi( debug_print::@18/(byte*) print_screen#34 ) (signed byte) debug_print::print_sbyte_pos5_sb#0 ← *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) (byte) debug_print::print_sbyte_pos5_row#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4 (byte) debug_print::print_sbyte_pos5_col#0 ← (byte/signed byte/word/signed word/dword/signed dword) $21 to:debug_print::print_sbyte_pos5 debug_print::print_sbyte_pos5: scope:[debug_print] from debug_print::@6 - (byte*) SCREEN#43 ← phi( debug_print::@6/(byte*) SCREEN#44 ) (signed byte) debug_print::print_sbyte_pos5_sb#1 ← phi( debug_print::@6/(signed byte) debug_print::print_sbyte_pos5_sb#0 ) (byte) debug_print::print_sbyte_pos5_col#1 ← phi( debug_print::@6/(byte) debug_print::print_sbyte_pos5_col#0 ) (byte*) print_screen#8 ← phi( debug_print::@6/(byte*) print_screen#21 ) @@ -1269,18 +961,15 @@ debug_print::print_sbyte_pos5: scope:[debug_print] from debug_print::@6 call print_sbyte_at to:debug_print::@19 debug_print::@19: scope:[debug_print] from debug_print::print_sbyte_pos5 - (byte*) SCREEN#42 ← phi( debug_print::print_sbyte_pos5/(byte*) SCREEN#43 ) (byte*) print_screen#35 ← phi( debug_print::print_sbyte_pos5/(byte*) print_screen#8 ) to:debug_print::@7 debug_print::@7: scope:[debug_print] from debug_print::@19 - (byte*) SCREEN#41 ← phi( debug_print::@19/(byte*) SCREEN#42 ) (byte*) print_screen#22 ← phi( debug_print::@19/(byte*) print_screen#35 ) (signed byte) debug_print::print_sbyte_pos6_sb#0 ← *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) (byte) debug_print::print_sbyte_pos6_row#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4 (byte) debug_print::print_sbyte_pos6_col#0 ← (byte/signed byte/word/signed word/dword/signed dword) $25 to:debug_print::print_sbyte_pos6 debug_print::print_sbyte_pos6: scope:[debug_print] from debug_print::@7 - (byte*) SCREEN#40 ← phi( debug_print::@7/(byte*) SCREEN#41 ) (signed byte) debug_print::print_sbyte_pos6_sb#1 ← phi( debug_print::@7/(signed byte) debug_print::print_sbyte_pos6_sb#0 ) (byte) debug_print::print_sbyte_pos6_col#1 ← phi( debug_print::@7/(byte) debug_print::print_sbyte_pos6_col#0 ) (byte*) print_screen#9 ← phi( debug_print::@7/(byte*) print_screen#22 ) @@ -1293,18 +982,15 @@ debug_print::print_sbyte_pos6: scope:[debug_print] from debug_print::@7 call print_sbyte_at to:debug_print::@20 debug_print::@20: scope:[debug_print] from debug_print::print_sbyte_pos6 - (byte*) SCREEN#39 ← phi( debug_print::print_sbyte_pos6/(byte*) SCREEN#40 ) (byte*) print_screen#36 ← phi( debug_print::print_sbyte_pos6/(byte*) print_screen#9 ) to:debug_print::@8 debug_print::@8: scope:[debug_print] from debug_print::@20 - (byte*) SCREEN#38 ← phi( debug_print::@20/(byte*) SCREEN#39 ) (byte*) print_screen#23 ← phi( debug_print::@20/(byte*) print_screen#36 ) (signed byte) debug_print::print_sbyte_pos7_sb#0 ← *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) (byte) debug_print::print_sbyte_pos7_row#0 ← (byte/signed byte/word/signed word/dword/signed dword) 5 (byte) debug_print::print_sbyte_pos7_col#0 ← (byte/signed byte/word/signed word/dword/signed dword) $1d to:debug_print::print_sbyte_pos7 debug_print::print_sbyte_pos7: scope:[debug_print] from debug_print::@8 - (byte*) SCREEN#37 ← phi( debug_print::@8/(byte*) SCREEN#38 ) (signed byte) debug_print::print_sbyte_pos7_sb#1 ← phi( debug_print::@8/(signed byte) debug_print::print_sbyte_pos7_sb#0 ) (byte) debug_print::print_sbyte_pos7_col#1 ← phi( debug_print::@8/(byte) debug_print::print_sbyte_pos7_col#0 ) (byte*) print_screen#10 ← phi( debug_print::@8/(byte*) print_screen#23 ) @@ -1317,18 +1003,15 @@ debug_print::print_sbyte_pos7: scope:[debug_print] from debug_print::@8 call print_sbyte_at to:debug_print::@21 debug_print::@21: scope:[debug_print] from debug_print::print_sbyte_pos7 - (byte*) SCREEN#36 ← phi( debug_print::print_sbyte_pos7/(byte*) SCREEN#37 ) (byte*) print_screen#37 ← phi( debug_print::print_sbyte_pos7/(byte*) print_screen#10 ) to:debug_print::@9 debug_print::@9: scope:[debug_print] from debug_print::@21 - (byte*) SCREEN#35 ← phi( debug_print::@21/(byte*) SCREEN#36 ) (byte*) print_screen#24 ← phi( debug_print::@21/(byte*) print_screen#37 ) (signed byte) debug_print::print_sbyte_pos8_sb#0 ← *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 4) (byte) debug_print::print_sbyte_pos8_row#0 ← (byte/signed byte/word/signed word/dword/signed dword) 5 (byte) debug_print::print_sbyte_pos8_col#0 ← (byte/signed byte/word/signed word/dword/signed dword) $21 to:debug_print::print_sbyte_pos8 debug_print::print_sbyte_pos8: scope:[debug_print] from debug_print::@9 - (byte*) SCREEN#34 ← phi( debug_print::@9/(byte*) SCREEN#35 ) (signed byte) debug_print::print_sbyte_pos8_sb#1 ← phi( debug_print::@9/(signed byte) debug_print::print_sbyte_pos8_sb#0 ) (byte) debug_print::print_sbyte_pos8_col#1 ← phi( debug_print::@9/(byte) debug_print::print_sbyte_pos8_col#0 ) (byte*) print_screen#11 ← phi( debug_print::@9/(byte*) print_screen#24 ) @@ -1341,18 +1024,15 @@ debug_print::print_sbyte_pos8: scope:[debug_print] from debug_print::@9 call print_sbyte_at to:debug_print::@22 debug_print::@22: scope:[debug_print] from debug_print::print_sbyte_pos8 - (byte*) SCREEN#33 ← phi( debug_print::print_sbyte_pos8/(byte*) SCREEN#34 ) (byte*) print_screen#38 ← phi( debug_print::print_sbyte_pos8/(byte*) print_screen#11 ) to:debug_print::@10 debug_print::@10: scope:[debug_print] from debug_print::@22 - (byte*) SCREEN#32 ← phi( debug_print::@22/(byte*) SCREEN#33 ) (byte*) print_screen#25 ← phi( debug_print::@22/(byte*) print_screen#38 ) (signed byte) debug_print::print_sbyte_pos9_sb#0 ← *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 5) (byte) debug_print::print_sbyte_pos9_row#0 ← (byte/signed byte/word/signed word/dword/signed dword) 5 (byte) debug_print::print_sbyte_pos9_col#0 ← (byte/signed byte/word/signed word/dword/signed dword) $25 to:debug_print::print_sbyte_pos9 debug_print::print_sbyte_pos9: scope:[debug_print] from debug_print::@10 - (byte*) SCREEN#31 ← phi( debug_print::@10/(byte*) SCREEN#32 ) (signed byte) debug_print::print_sbyte_pos9_sb#1 ← phi( debug_print::@10/(signed byte) debug_print::print_sbyte_pos9_sb#0 ) (byte) debug_print::print_sbyte_pos9_col#1 ← phi( debug_print::@10/(byte) debug_print::print_sbyte_pos9_col#0 ) (byte*) print_screen#12 ← phi( debug_print::@10/(byte*) print_screen#25 ) @@ -1365,18 +1045,15 @@ debug_print::print_sbyte_pos9: scope:[debug_print] from debug_print::@10 call print_sbyte_at to:debug_print::@23 debug_print::@23: scope:[debug_print] from debug_print::print_sbyte_pos9 - (byte*) SCREEN#30 ← phi( debug_print::print_sbyte_pos9/(byte*) SCREEN#31 ) (byte*) print_screen#39 ← phi( debug_print::print_sbyte_pos9/(byte*) print_screen#12 ) to:debug_print::@11 debug_print::@11: scope:[debug_print] from debug_print::@23 - (byte*) SCREEN#29 ← phi( debug_print::@23/(byte*) SCREEN#30 ) (byte*) print_screen#26 ← phi( debug_print::@23/(byte*) print_screen#39 ) (signed byte) debug_print::print_sbyte_pos10_sb#0 ← *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 6) (byte) debug_print::print_sbyte_pos10_row#0 ← (byte/signed byte/word/signed word/dword/signed dword) 6 (byte) debug_print::print_sbyte_pos10_col#0 ← (byte/signed byte/word/signed word/dword/signed dword) $1d to:debug_print::print_sbyte_pos10 debug_print::print_sbyte_pos10: scope:[debug_print] from debug_print::@11 - (byte*) SCREEN#28 ← phi( debug_print::@11/(byte*) SCREEN#29 ) (signed byte) debug_print::print_sbyte_pos10_sb#1 ← phi( debug_print::@11/(signed byte) debug_print::print_sbyte_pos10_sb#0 ) (byte) debug_print::print_sbyte_pos10_col#1 ← phi( debug_print::@11/(byte) debug_print::print_sbyte_pos10_col#0 ) (byte*) print_screen#13 ← phi( debug_print::@11/(byte*) print_screen#26 ) @@ -1389,18 +1066,15 @@ debug_print::print_sbyte_pos10: scope:[debug_print] from debug_print::@11 call print_sbyte_at to:debug_print::@24 debug_print::@24: scope:[debug_print] from debug_print::print_sbyte_pos10 - (byte*) SCREEN#27 ← phi( debug_print::print_sbyte_pos10/(byte*) SCREEN#28 ) (byte*) print_screen#40 ← phi( debug_print::print_sbyte_pos10/(byte*) print_screen#13 ) to:debug_print::@12 debug_print::@12: scope:[debug_print] from debug_print::@24 - (byte*) SCREEN#25 ← phi( debug_print::@24/(byte*) SCREEN#27 ) (byte*) print_screen#27 ← phi( debug_print::@24/(byte*) print_screen#40 ) (signed byte) debug_print::print_sbyte_pos11_sb#0 ← *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 7) (byte) debug_print::print_sbyte_pos11_row#0 ← (byte/signed byte/word/signed word/dword/signed dword) 6 (byte) debug_print::print_sbyte_pos11_col#0 ← (byte/signed byte/word/signed word/dword/signed dword) $21 to:debug_print::print_sbyte_pos11 debug_print::print_sbyte_pos11: scope:[debug_print] from debug_print::@12 - (byte*) SCREEN#23 ← phi( debug_print::@12/(byte*) SCREEN#25 ) (signed byte) debug_print::print_sbyte_pos11_sb#1 ← phi( debug_print::@12/(signed byte) debug_print::print_sbyte_pos11_sb#0 ) (byte) debug_print::print_sbyte_pos11_col#1 ← phi( debug_print::@12/(byte) debug_print::print_sbyte_pos11_col#0 ) (byte*) print_screen#14 ← phi( debug_print::@12/(byte*) print_screen#27 ) @@ -1413,18 +1087,15 @@ debug_print::print_sbyte_pos11: scope:[debug_print] from debug_print::@12 call print_sbyte_at to:debug_print::@25 debug_print::@25: scope:[debug_print] from debug_print::print_sbyte_pos11 - (byte*) SCREEN#22 ← phi( debug_print::print_sbyte_pos11/(byte*) SCREEN#23 ) (byte*) print_screen#41 ← phi( debug_print::print_sbyte_pos11/(byte*) print_screen#14 ) to:debug_print::@13 debug_print::@13: scope:[debug_print] from debug_print::@25 - (byte*) SCREEN#20 ← phi( debug_print::@25/(byte*) SCREEN#22 ) (byte*) print_screen#28 ← phi( debug_print::@25/(byte*) print_screen#41 ) (signed byte) debug_print::print_sbyte_pos12_sb#0 ← *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 8) (byte) debug_print::print_sbyte_pos12_row#0 ← (byte/signed byte/word/signed word/dword/signed dword) 6 (byte) debug_print::print_sbyte_pos12_col#0 ← (byte/signed byte/word/signed word/dword/signed dword) $25 to:debug_print::print_sbyte_pos12 debug_print::print_sbyte_pos12: scope:[debug_print] from debug_print::@13 - (byte*) SCREEN#18 ← phi( debug_print::@13/(byte*) SCREEN#20 ) (signed byte) debug_print::print_sbyte_pos12_sb#1 ← phi( debug_print::@13/(signed byte) debug_print::print_sbyte_pos12_sb#0 ) (byte) debug_print::print_sbyte_pos12_col#1 ← phi( debug_print::@13/(byte) debug_print::print_sbyte_pos12_col#0 ) (byte*) print_screen#15 ← phi( debug_print::@13/(byte*) print_screen#28 ) @@ -1437,12 +1108,10 @@ debug_print::print_sbyte_pos12: scope:[debug_print] from debug_print::@13 call print_sbyte_at to:debug_print::@26 debug_print::@26: scope:[debug_print] from debug_print::print_sbyte_pos12 - (byte*) SCREEN#16 ← phi( debug_print::print_sbyte_pos12/(byte*) SCREEN#18 ) to:debug_print::@14 debug_print::@14: scope:[debug_print] from debug_print::@26 - (byte*) SCREEN#14 ← phi( debug_print::@26/(byte*) SCREEN#16 ) (word/signed word/dword/signed dword~) debug_print::$12 ← (byte/signed byte/word/signed word/dword/signed dword) $13 * (byte/signed byte/word/signed word/dword/signed dword) $28 - (byte*~) debug_print::$13 ← (byte*) SCREEN#14 + (word/signed word/dword/signed dword~) debug_print::$12 + (byte*~) debug_print::$13 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) debug_print::$12 (byte*) debug_print::at_line#0 ← (byte*~) debug_print::$13 (byte) debug_print::c#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4 (byte) debug_print::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -1526,7 +1195,6 @@ debug_print::@return: scope:[debug_print] from debug_print::@32 return to:@return sprites_init: scope:[sprites_init] from main - (byte*) SPRITE#2 ← phi( main/(byte*) SPRITE#3 ) (byte*) sprites_init::SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 *((byte*) SPRITES_ENABLE#0) ← (byte/word/signed word/dword/signed dword) $ff (byte*~) sprites_init::$0 ← (byte*) sprites_init::SCREEN#0 + (word/signed word/dword/signed dword) $3f8 @@ -1536,8 +1204,7 @@ sprites_init: scope:[sprites_init] from main sprites_init::@1: scope:[sprites_init] from sprites_init sprites_init::@1 (byte) sprites_init::i#2 ← phi( sprites_init/(byte) sprites_init::i#0 sprites_init::@1/(byte) sprites_init::i#1 ) (byte*) sprites_init::sprites_ptr#1 ← phi( sprites_init/(byte*) sprites_init::sprites_ptr#0 sprites_init::@1/(byte*) sprites_init::sprites_ptr#1 ) - (byte*) SPRITE#1 ← phi( sprites_init/(byte*) SPRITE#2 sprites_init::@1/(byte*) SPRITE#1 ) - (byte*~) sprites_init::$1 ← (byte*) SPRITE#1 / (byte/signed byte/word/signed word/dword/signed dword) $40 + (byte*~) sprites_init::$1 ← (byte*) SPRITE#0 / (byte/signed byte/word/signed word/dword/signed dword) $40 (byte~) sprites_init::$2 ← ((byte)) (byte*~) sprites_init::$1 *((byte*) sprites_init::sprites_ptr#1 + (byte) sprites_init::i#2) ← (byte~) sprites_init::$2 *((byte*) SPRITES_COLS#0 + (byte) sprites_init::i#2) ← (byte) GREEN#0 @@ -1549,17 +1216,7 @@ sprites_init::@return: scope:[sprites_init] from sprites_init::@1 return to:@return @28: scope:[] from @24 - (signed byte*) yp#22 ← phi( @24/(signed byte*) yp#23 ) - (signed byte*) xp#22 ← phi( @24/(signed byte*) xp#23 ) - (signed byte*) pp#22 ← phi( @24/(signed byte*) pp#23 ) - (signed byte*) zr#22 ← phi( @24/(signed byte*) zr#23 ) - (signed byte*) yr#22 ← phi( @24/(signed byte*) yr#23 ) - (signed byte*) xr#22 ← phi( @24/(signed byte*) xr#23 ) - (signed byte) sz#28 ← phi( @24/(signed byte) sz#0 ) - (byte*) SCREEN#24 ← phi( @24/(byte*) SCREEN#26 ) (byte*) print_screen#47 ← phi( @24/(byte*) print_screen#49 ) - (word*) psp2#9 ← phi( @24/(word*) psp2#11 ) - (word*) psp1#9 ← phi( @24/(word*) psp1#11 ) (signed byte) sy#25 ← phi( @24/(signed byte) sy#2 ) (signed byte) sx#23 ← phi( @24/(signed byte) sx#2 ) (byte*) print_char_cursor#21 ← phi( @24/(byte*) print_char_cursor#23 ) @@ -1567,9 +1224,7 @@ sprites_init::@return: scope:[sprites_init] from sprites_init::@1 (signed byte[9]) rotation_matrix#0 ← { fill( 9, 0) } to:@33 calculate_matrix: scope:[calculate_matrix] from anim::@12 - (signed byte*) SINQ#1 ← phi( anim::@12/(signed byte*) SINQ#2 ) (signed byte*) COSQ#1 ← phi( anim::@12/(signed byte*) COSQ#2 ) - (signed byte*) SINH#1 ← phi( anim::@12/(signed byte*) SINH#2 ) (signed byte*) COSH#1 ← phi( anim::@12/(signed byte*) COSH#2 ) (signed byte) calculate_matrix::sx#1 ← phi( anim::@12/(signed byte) calculate_matrix::sx#0 ) (signed byte) calculate_matrix::sz#1 ← phi( anim::@12/(signed byte) calculate_matrix::sz#0 ) @@ -1596,31 +1251,31 @@ calculate_matrix: scope:[calculate_matrix] from anim::@12 (signed byte) calculate_matrix::t10#0 ← (signed byte~) calculate_matrix::$9 (signed byte~) calculate_matrix::$10 ← *((signed byte*) COSH#1 + (signed byte) calculate_matrix::t1#0) + *((signed byte*) COSH#1 + (signed byte) calculate_matrix::t2#0) *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (signed byte~) calculate_matrix::$10 - (signed byte~) calculate_matrix::$11 ← *((signed byte*) SINH#1 + (signed byte) calculate_matrix::t1#0) - *((signed byte*) SINH#1 + (signed byte) calculate_matrix::t2#0) + (signed byte~) calculate_matrix::$11 ← *((signed byte*) SINH#0 + (signed byte) calculate_matrix::t1#0) - *((signed byte*) SINH#0 + (signed byte) calculate_matrix::t2#0) *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (signed byte~) calculate_matrix::$11 - (signed byte~) calculate_matrix::$12 ← *((signed byte*) SINH#1 + (signed byte) calculate_matrix::sy#1) + *((signed byte*) SINH#1 + (signed byte) calculate_matrix::sy#1) + (signed byte~) calculate_matrix::$12 ← *((signed byte*) SINH#0 + (signed byte) calculate_matrix::sy#1) + *((signed byte*) SINH#0 + (signed byte) calculate_matrix::sy#1) *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (signed byte~) calculate_matrix::$12 - (signed byte~) calculate_matrix::$13 ← *((signed byte*) SINH#1 + (signed byte) calculate_matrix::t3#0) - *((signed byte*) SINH#1 + (signed byte) calculate_matrix::t4#0) + (signed byte~) calculate_matrix::$13 ← *((signed byte*) SINH#0 + (signed byte) calculate_matrix::t3#0) - *((signed byte*) SINH#0 + (signed byte) calculate_matrix::t4#0) (signed byte~) calculate_matrix::$14 ← (signed byte~) calculate_matrix::$13 + *((signed byte*) COSQ#1 + (signed byte) calculate_matrix::t6#0) (signed byte~) calculate_matrix::$15 ← (signed byte~) calculate_matrix::$14 - *((signed byte*) COSQ#1 + (signed byte) calculate_matrix::t5#0) (signed byte~) calculate_matrix::$16 ← (signed byte~) calculate_matrix::$15 + *((signed byte*) COSQ#1 + (signed byte) calculate_matrix::t8#0) (signed byte~) calculate_matrix::$17 ← (signed byte~) calculate_matrix::$16 - *((signed byte*) COSQ#1 + (signed byte) calculate_matrix::t7#0) *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) ← (signed byte~) calculate_matrix::$17 (signed byte~) calculate_matrix::$18 ← *((signed byte*) COSH#1 + (signed byte) calculate_matrix::t3#0) + *((signed byte*) COSH#1 + (signed byte) calculate_matrix::t4#0) - (signed byte~) calculate_matrix::$19 ← (signed byte~) calculate_matrix::$18 + *((signed byte*) SINQ#1 + (signed byte) calculate_matrix::t5#0) - (signed byte~) calculate_matrix::$20 ← (signed byte~) calculate_matrix::$19 - *((signed byte*) SINQ#1 + (signed byte) calculate_matrix::t6#0) - (signed byte~) calculate_matrix::$21 ← (signed byte~) calculate_matrix::$20 - *((signed byte*) SINQ#1 + (signed byte) calculate_matrix::t7#0) - (signed byte~) calculate_matrix::$22 ← (signed byte~) calculate_matrix::$21 - *((signed byte*) SINQ#1 + (signed byte) calculate_matrix::t8#0) + (signed byte~) calculate_matrix::$19 ← (signed byte~) calculate_matrix::$18 + *((signed byte*) SINQ#0 + (signed byte) calculate_matrix::t5#0) + (signed byte~) calculate_matrix::$20 ← (signed byte~) calculate_matrix::$19 - *((signed byte*) SINQ#0 + (signed byte) calculate_matrix::t6#0) + (signed byte~) calculate_matrix::$21 ← (signed byte~) calculate_matrix::$20 - *((signed byte*) SINQ#0 + (signed byte) calculate_matrix::t7#0) + (signed byte~) calculate_matrix::$22 ← (signed byte~) calculate_matrix::$21 - *((signed byte*) SINQ#0 + (signed byte) calculate_matrix::t8#0) *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 4) ← (signed byte~) calculate_matrix::$22 - (signed byte~) calculate_matrix::$23 ← *((signed byte*) SINH#1 + (signed byte) calculate_matrix::t9#0) - *((signed byte*) SINH#1 + (signed byte) calculate_matrix::t10#0) + (signed byte~) calculate_matrix::$23 ← *((signed byte*) SINH#0 + (signed byte) calculate_matrix::t9#0) - *((signed byte*) SINH#0 + (signed byte) calculate_matrix::t10#0) *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 5) ← (signed byte~) calculate_matrix::$23 (signed byte~) calculate_matrix::$24 ← *((signed byte*) COSH#1 + (signed byte) calculate_matrix::t4#0) - *((signed byte*) COSH#1 + (signed byte) calculate_matrix::t3#0) - (signed byte~) calculate_matrix::$25 ← (signed byte~) calculate_matrix::$24 + *((signed byte*) SINQ#1 + (signed byte) calculate_matrix::t6#0) - (signed byte~) calculate_matrix::$26 ← (signed byte~) calculate_matrix::$25 - *((signed byte*) SINQ#1 + (signed byte) calculate_matrix::t5#0) - (signed byte~) calculate_matrix::$27 ← (signed byte~) calculate_matrix::$26 - *((signed byte*) SINQ#1 + (signed byte) calculate_matrix::t8#0) - (signed byte~) calculate_matrix::$28 ← (signed byte~) calculate_matrix::$27 - *((signed byte*) SINQ#1 + (signed byte) calculate_matrix::t7#0) + (signed byte~) calculate_matrix::$25 ← (signed byte~) calculate_matrix::$24 + *((signed byte*) SINQ#0 + (signed byte) calculate_matrix::t6#0) + (signed byte~) calculate_matrix::$26 ← (signed byte~) calculate_matrix::$25 - *((signed byte*) SINQ#0 + (signed byte) calculate_matrix::t5#0) + (signed byte~) calculate_matrix::$27 ← (signed byte~) calculate_matrix::$26 - *((signed byte*) SINQ#0 + (signed byte) calculate_matrix::t8#0) + (signed byte~) calculate_matrix::$28 ← (signed byte~) calculate_matrix::$27 - *((signed byte*) SINQ#0 + (signed byte) calculate_matrix::t7#0) *((signed byte[9]) rotation_matrix#0 + (byte/signed byte/word/signed word/dword/signed dword) 6) ← (signed byte~) calculate_matrix::$28 - (signed byte~) calculate_matrix::$29 ← *((signed byte*) SINH#1 + (signed byte) calculate_matrix::t3#0) + *((signed byte*) SINH#1 + (signed byte) calculate_matrix::t4#0) + (signed byte~) calculate_matrix::$29 ← *((signed byte*) SINH#0 + (signed byte) calculate_matrix::t3#0) + *((signed byte*) SINH#0 + (signed byte) calculate_matrix::t4#0) (signed byte~) calculate_matrix::$30 ← (signed byte~) calculate_matrix::$29 + *((signed byte*) COSQ#1 + (signed byte) calculate_matrix::t6#0) (signed byte~) calculate_matrix::$31 ← (signed byte~) calculate_matrix::$30 - *((signed byte*) COSQ#1 + (signed byte) calculate_matrix::t5#0) (signed byte~) calculate_matrix::$32 ← (signed byte~) calculate_matrix::$31 + *((signed byte*) COSQ#1 + (signed byte) calculate_matrix::t7#0) @@ -1639,40 +1294,19 @@ store_matrix::@return: scope:[store_matrix] from store_matrix return to:@return rotate_matrix: scope:[rotate_matrix] from anim::@13 - (signed byte*) xp#2 ← phi( anim::@13/(signed byte*) xp#3 ) - (signed byte*) yp#2 ← phi( anim::@13/(signed byte*) yp#3 ) - (word*) psp2#2 ← phi( anim::@13/(word*) psp2#4 ) - (word*) psp1#2 ← phi( anim::@13/(word*) psp1#4 ) - (signed byte*) pp#2 ← phi( anim::@13/(signed byte*) pp#3 ) - (signed byte*) PERSP_Z#1 ← phi( anim::@13/(signed byte*) PERSP_Z#2 ) - (byte*) mulf_sqr2#2 ← phi( anim::@13/(byte*) mulf_sqr2#4 ) - (byte*) mulf_sqr1#2 ← phi( anim::@13/(byte*) mulf_sqr1#4 ) - (signed byte*) zr#2 ← phi( anim::@13/(signed byte*) zr#3 ) (signed byte) rotate_matrix::z#1 ← phi( anim::@13/(signed byte) rotate_matrix::z#0 ) - (signed byte*) yr#2 ← phi( anim::@13/(signed byte*) yr#3 ) (signed byte) rotate_matrix::y#1 ← phi( anim::@13/(signed byte) rotate_matrix::y#0 ) - (signed byte*) xr#2 ← phi( anim::@13/(signed byte*) xr#3 ) (signed byte) rotate_matrix::x#1 ← phi( anim::@13/(signed byte) rotate_matrix::x#0 ) - *((signed byte*) xr#2) ← (signed byte) rotate_matrix::x#1 - *((signed byte*) yr#2) ← (signed byte) rotate_matrix::y#1 - *((signed byte*) zr#2) ← (signed byte) rotate_matrix::z#1 + *((signed byte*) xr#0) ← (signed byte) rotate_matrix::x#1 + *((signed byte*) yr#0) ← (signed byte) rotate_matrix::y#1 + *((signed byte*) zr#0) ← (signed byte) rotate_matrix::z#1 asm { ldxzr C1: ldamulf_sqr1,x sec C2: sbcmulf_sqr2,x staC3+1 F1: ldamulf_sqr1,x sec F2: sbcmulf_sqr2,x staF3+1 I1: ldamulf_sqr1,x sec I2: sbcmulf_sqr2,x staI3+1 ldxxr ldyyr I3: lda#0 clc G1: adcmulf_sqr1,x sec G2: sbcmulf_sqr2,x clc H1: adcmulf_sqr1,y sec H2: sbcmulf_sqr2,y stazr staPP+1 PP: ldaPERSP_Z stapp stapsp1 eor#$ff stapsp2 C3: lda#0 clc A1: adcmulf_sqr1,x sec A2: sbcmulf_sqr2,x clc B1: adcmulf_sqr1,y sec B2: sbcmulf_sqr2,y staxr staXX+1 clc F3: lda#0 clc D1: adcmulf_sqr1,x sec D2: sbcmulf_sqr2,x clc E1: adcmulf_sqr1,y sec E2: sbcmulf_sqr2,y stayr tay lda(psp1),y sec sbc(psp2),y stayp XX: ldy#0 lda(psp1),y sec sbc(psp2),y staxp } to:rotate_matrix::@return rotate_matrix::@return: scope:[rotate_matrix] from rotate_matrix return to:@return @33: scope:[] from @28 - (signed byte*) yp#21 ← phi( @28/(signed byte*) yp#22 ) - (signed byte*) xp#21 ← phi( @28/(signed byte*) xp#22 ) - (signed byte*) pp#21 ← phi( @28/(signed byte*) pp#22 ) - (signed byte*) zr#21 ← phi( @28/(signed byte*) zr#22 ) - (signed byte*) yr#21 ← phi( @28/(signed byte*) yr#22 ) - (signed byte*) xr#21 ← phi( @28/(signed byte*) xr#22 ) - (signed byte) sz#25 ← phi( @28/(signed byte) sz#28 ) - (byte*) SCREEN#21 ← phi( @28/(byte*) SCREEN#24 ) (byte*) print_screen#44 ← phi( @28/(byte*) print_screen#47 ) - (word*) psp2#5 ← phi( @28/(word*) psp2#9 ) - (word*) psp1#5 ← phi( @28/(word*) psp1#9 ) (signed byte) sy#18 ← phi( @28/(signed byte) sy#25 ) (signed byte) sx#17 ← phi( @28/(signed byte) sx#23 ) (byte*) print_char_cursor#18 ← phi( @28/(byte*) print_char_cursor#21 ) @@ -1966,26 +1600,6 @@ SYMBOL TABLE SSA (byte) ORANGE#0 (signed byte*) PERSP_Z (signed byte*) PERSP_Z#0 -(signed byte*) PERSP_Z#1 -(signed byte*) PERSP_Z#10 -(signed byte*) PERSP_Z#11 -(signed byte*) PERSP_Z#12 -(signed byte*) PERSP_Z#13 -(signed byte*) PERSP_Z#14 -(signed byte*) PERSP_Z#15 -(signed byte*) PERSP_Z#16 -(signed byte*) PERSP_Z#17 -(signed byte*) PERSP_Z#18 -(signed byte*) PERSP_Z#19 -(signed byte*) PERSP_Z#2 -(signed byte*) PERSP_Z#20 -(signed byte*) PERSP_Z#3 -(signed byte*) PERSP_Z#4 -(signed byte*) PERSP_Z#5 -(signed byte*) PERSP_Z#6 -(signed byte*) PERSP_Z#7 -(signed byte*) PERSP_Z#8 -(signed byte*) PERSP_Z#9 (byte) PINK (byte) PINK#0 (byte*) PROCPORT @@ -2012,136 +1626,20 @@ SYMBOL TABLE SSA (byte) RED#0 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#11 -(byte*) SCREEN#12 -(byte*) SCREEN#13 -(byte*) SCREEN#14 -(byte*) SCREEN#15 -(byte*) SCREEN#16 -(byte*) SCREEN#17 -(byte*) SCREEN#18 -(byte*) SCREEN#19 -(byte*) SCREEN#2 -(byte*) SCREEN#20 -(byte*) SCREEN#21 -(byte*) SCREEN#22 -(byte*) SCREEN#23 -(byte*) SCREEN#24 -(byte*) SCREEN#25 -(byte*) SCREEN#26 -(byte*) SCREEN#27 -(byte*) SCREEN#28 -(byte*) SCREEN#29 -(byte*) SCREEN#3 -(byte*) SCREEN#30 -(byte*) SCREEN#31 -(byte*) SCREEN#32 -(byte*) SCREEN#33 -(byte*) SCREEN#34 -(byte*) SCREEN#35 -(byte*) SCREEN#36 -(byte*) SCREEN#37 -(byte*) SCREEN#38 -(byte*) SCREEN#39 -(byte*) SCREEN#4 -(byte*) SCREEN#40 -(byte*) SCREEN#41 -(byte*) SCREEN#42 -(byte*) SCREEN#43 -(byte*) SCREEN#44 -(byte*) SCREEN#45 -(byte*) SCREEN#46 -(byte*) SCREEN#47 -(byte*) SCREEN#48 -(byte*) SCREEN#49 -(byte*) SCREEN#5 -(byte*) SCREEN#50 -(byte*) SCREEN#51 -(byte*) SCREEN#52 -(byte*) SCREEN#53 -(byte*) SCREEN#54 -(byte*) SCREEN#55 -(byte*) SCREEN#56 -(byte*) SCREEN#57 -(byte*) SCREEN#58 -(byte*) SCREEN#59 -(byte*) SCREEN#6 -(byte*) SCREEN#60 -(byte*) SCREEN#61 -(byte*) SCREEN#62 -(byte*) SCREEN#63 -(byte*) SCREEN#64 -(byte*) SCREEN#65 -(byte*) SCREEN#66 -(byte*) SCREEN#67 -(byte*) SCREEN#68 -(byte*) SCREEN#69 -(byte*) SCREEN#7 -(byte*) SCREEN#70 -(byte*) SCREEN#71 -(byte*) SCREEN#72 -(byte*) SCREEN#73 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (signed byte*) SINH (signed byte*) SINH#0 -(signed byte*) SINH#1 -(signed byte*) SINH#10 -(signed byte*) SINH#11 -(signed byte*) SINH#12 -(signed byte*) SINH#13 -(signed byte*) SINH#14 -(signed byte*) SINH#15 -(signed byte*) SINH#16 -(signed byte*) SINH#17 -(signed byte*) SINH#18 -(signed byte*) SINH#19 -(signed byte*) SINH#2 -(signed byte*) SINH#20 -(signed byte*) SINH#3 -(signed byte*) SINH#4 -(signed byte*) SINH#5 -(signed byte*) SINH#6 -(signed byte*) SINH#7 -(signed byte*) SINH#8 -(signed byte*) SINH#9 (byte*) SINH_HI (byte*) SINH_HI#0 (byte*) SINH_LO (byte*) SINH_LO#0 (signed byte*) SINQ (signed byte*) SINQ#0 -(signed byte*) SINQ#1 -(signed byte*) SINQ#10 -(signed byte*) SINQ#11 -(signed byte*) SINQ#12 -(signed byte*) SINQ#13 -(signed byte*) SINQ#14 -(signed byte*) SINQ#15 -(signed byte*) SINQ#16 -(signed byte*) SINQ#17 -(signed byte*) SINQ#18 -(signed byte*) SINQ#19 -(signed byte*) SINQ#2 -(signed byte*) SINQ#20 -(signed byte*) SINQ#3 -(signed byte*) SINQ#4 -(signed byte*) SINQ#5 -(signed byte*) SINQ#6 -(signed byte*) SINQ#7 -(signed byte*) SINQ#8 -(signed byte*) SINQ#9 (byte*) SINQ_HI (byte*) SINQ_HI#0 (byte*) SINQ_LO (byte*) SINQ_LO#0 (byte*) SPRITE (byte*) SPRITE#0 -(byte*) SPRITE#1 -(byte*) SPRITE#2 -(byte*) SPRITE#3 (byte*) SPRITES_COLS (byte*) SPRITES_COLS#0 (byte*) SPRITES_ENABLE @@ -2727,73 +2225,10 @@ SYMBOL TABLE SSA (label) main::@return (byte*) mulf_sqr1 (byte*) mulf_sqr1#0 -(byte*) mulf_sqr1#1 -(byte*) mulf_sqr1#10 -(byte*) mulf_sqr1#11 -(byte*) mulf_sqr1#12 -(byte*) mulf_sqr1#13 -(byte*) mulf_sqr1#14 -(byte*) mulf_sqr1#15 -(byte*) mulf_sqr1#16 -(byte*) mulf_sqr1#17 -(byte*) mulf_sqr1#18 -(byte*) mulf_sqr1#19 -(byte*) mulf_sqr1#2 -(byte*) mulf_sqr1#20 -(byte*) mulf_sqr1#3 -(byte*) mulf_sqr1#4 -(byte*) mulf_sqr1#5 -(byte*) mulf_sqr1#6 -(byte*) mulf_sqr1#7 -(byte*) mulf_sqr1#8 -(byte*) mulf_sqr1#9 (byte*) mulf_sqr2 (byte*) mulf_sqr2#0 -(byte*) mulf_sqr2#1 -(byte*) mulf_sqr2#10 -(byte*) mulf_sqr2#11 -(byte*) mulf_sqr2#12 -(byte*) mulf_sqr2#13 -(byte*) mulf_sqr2#14 -(byte*) mulf_sqr2#15 -(byte*) mulf_sqr2#16 -(byte*) mulf_sqr2#17 -(byte*) mulf_sqr2#18 -(byte*) mulf_sqr2#19 -(byte*) mulf_sqr2#2 -(byte*) mulf_sqr2#20 -(byte*) mulf_sqr2#3 -(byte*) mulf_sqr2#4 -(byte*) mulf_sqr2#5 -(byte*) mulf_sqr2#6 -(byte*) mulf_sqr2#7 -(byte*) mulf_sqr2#8 -(byte*) mulf_sqr2#9 (signed byte*) pp (signed byte*) pp#0 -(signed byte*) pp#1 -(signed byte*) pp#10 -(signed byte*) pp#11 -(signed byte*) pp#12 -(signed byte*) pp#13 -(signed byte*) pp#14 -(signed byte*) pp#15 -(signed byte*) pp#16 -(signed byte*) pp#17 -(signed byte*) pp#18 -(signed byte*) pp#19 -(signed byte*) pp#2 -(signed byte*) pp#20 -(signed byte*) pp#21 -(signed byte*) pp#22 -(signed byte*) pp#23 -(signed byte*) pp#3 -(signed byte*) pp#4 -(signed byte*) pp#5 -(signed byte*) pp#6 -(signed byte*) pp#7 -(signed byte*) pp#8 -(signed byte*) pp#9 (signed byte[8]) pps (signed byte[8]) pps#0 (void()) print_byte_at((byte) print_byte_at::b , (byte*) print_byte_at::at) @@ -3096,54 +2531,8 @@ SYMBOL TABLE SSA (byte*) print_str_at::str#9 (word*) psp1 (word*) psp1#0 -(word*) psp1#1 -(word*) psp1#10 -(word*) psp1#11 -(word*) psp1#12 -(word*) psp1#13 -(word*) psp1#14 -(word*) psp1#15 -(word*) psp1#16 -(word*) psp1#17 -(word*) psp1#18 -(word*) psp1#19 -(word*) psp1#2 -(word*) psp1#20 -(word*) psp1#21 -(word*) psp1#22 -(word*) psp1#23 -(word*) psp1#3 -(word*) psp1#4 -(word*) psp1#5 -(word*) psp1#6 -(word*) psp1#7 -(word*) psp1#8 -(word*) psp1#9 (word*) psp2 (word*) psp2#0 -(word*) psp2#1 -(word*) psp2#10 -(word*) psp2#11 -(word*) psp2#12 -(word*) psp2#13 -(word*) psp2#14 -(word*) psp2#15 -(word*) psp2#16 -(word*) psp2#17 -(word*) psp2#18 -(word*) psp2#19 -(word*) psp2#2 -(word*) psp2#20 -(word*) psp2#21 -(word*) psp2#22 -(word*) psp2#23 -(word*) psp2#3 -(word*) psp2#4 -(word*) psp2#5 -(word*) psp2#6 -(word*) psp2#7 -(word*) psp2#8 -(word*) psp2#9 (void()) rotate_matrix((signed byte) rotate_matrix::x , (signed byte) rotate_matrix::y , (signed byte) rotate_matrix::z) (label) rotate_matrix::@return (signed byte) rotate_matrix::x @@ -3246,171 +2635,28 @@ SYMBOL TABLE SSA (signed byte) sy#9 (signed byte) sz (signed byte) sz#0 -(signed byte) sz#1 -(signed byte) sz#10 -(signed byte) sz#11 -(signed byte) sz#12 -(signed byte) sz#13 -(signed byte) sz#14 -(signed byte) sz#15 -(signed byte) sz#16 -(signed byte) sz#17 -(signed byte) sz#18 -(signed byte) sz#19 -(signed byte) sz#2 -(signed byte) sz#20 -(signed byte) sz#21 -(signed byte) sz#22 -(signed byte) sz#23 -(signed byte) sz#24 -(signed byte) sz#25 -(signed byte) sz#26 -(signed byte) sz#27 -(signed byte) sz#28 -(signed byte) sz#3 -(signed byte) sz#4 -(signed byte) sz#5 -(signed byte) sz#6 -(signed byte) sz#7 -(signed byte) sz#8 -(signed byte) sz#9 (signed byte*) xp (signed byte*) xp#0 -(signed byte*) xp#1 -(signed byte*) xp#10 -(signed byte*) xp#11 -(signed byte*) xp#12 -(signed byte*) xp#13 -(signed byte*) xp#14 -(signed byte*) xp#15 -(signed byte*) xp#16 -(signed byte*) xp#17 -(signed byte*) xp#18 -(signed byte*) xp#19 -(signed byte*) xp#2 -(signed byte*) xp#20 -(signed byte*) xp#21 -(signed byte*) xp#22 -(signed byte*) xp#23 -(signed byte*) xp#3 -(signed byte*) xp#4 -(signed byte*) xp#5 -(signed byte*) xp#6 -(signed byte*) xp#7 -(signed byte*) xp#8 -(signed byte*) xp#9 (signed byte[8]) xps (signed byte[8]) xps#0 (signed byte*) xr (signed byte*) xr#0 -(signed byte*) xr#1 -(signed byte*) xr#10 -(signed byte*) xr#11 -(signed byte*) xr#12 -(signed byte*) xr#13 -(signed byte*) xr#14 -(signed byte*) xr#15 -(signed byte*) xr#16 -(signed byte*) xr#17 -(signed byte*) xr#18 -(signed byte*) xr#19 -(signed byte*) xr#2 -(signed byte*) xr#20 -(signed byte*) xr#21 -(signed byte*) xr#22 -(signed byte*) xr#23 -(signed byte*) xr#3 -(signed byte*) xr#4 -(signed byte*) xr#5 -(signed byte*) xr#6 -(signed byte*) xr#7 -(signed byte*) xr#8 -(signed byte*) xr#9 (signed byte[8]) xrs (signed byte[8]) xrs#0 (signed byte[8]) xs (signed byte[8]) xs#0 (signed byte*) yp (signed byte*) yp#0 -(signed byte*) yp#1 -(signed byte*) yp#10 -(signed byte*) yp#11 -(signed byte*) yp#12 -(signed byte*) yp#13 -(signed byte*) yp#14 -(signed byte*) yp#15 -(signed byte*) yp#16 -(signed byte*) yp#17 -(signed byte*) yp#18 -(signed byte*) yp#19 -(signed byte*) yp#2 -(signed byte*) yp#20 -(signed byte*) yp#21 -(signed byte*) yp#22 -(signed byte*) yp#23 -(signed byte*) yp#3 -(signed byte*) yp#4 -(signed byte*) yp#5 -(signed byte*) yp#6 -(signed byte*) yp#7 -(signed byte*) yp#8 -(signed byte*) yp#9 (signed byte[8]) yps (signed byte[8]) yps#0 (signed byte*) yr (signed byte*) yr#0 -(signed byte*) yr#1 -(signed byte*) yr#10 -(signed byte*) yr#11 -(signed byte*) yr#12 -(signed byte*) yr#13 -(signed byte*) yr#14 -(signed byte*) yr#15 -(signed byte*) yr#16 -(signed byte*) yr#17 -(signed byte*) yr#18 -(signed byte*) yr#19 -(signed byte*) yr#2 -(signed byte*) yr#20 -(signed byte*) yr#21 -(signed byte*) yr#22 -(signed byte*) yr#23 -(signed byte*) yr#3 -(signed byte*) yr#4 -(signed byte*) yr#5 -(signed byte*) yr#6 -(signed byte*) yr#7 -(signed byte*) yr#8 -(signed byte*) yr#9 (signed byte[8]) yrs (signed byte[8]) yrs#0 (signed byte[8]) ys (signed byte[8]) ys#0 (signed byte*) zr (signed byte*) zr#0 -(signed byte*) zr#1 -(signed byte*) zr#10 -(signed byte*) zr#11 -(signed byte*) zr#12 -(signed byte*) zr#13 -(signed byte*) zr#14 -(signed byte*) zr#15 -(signed byte*) zr#16 -(signed byte*) zr#17 -(signed byte*) zr#18 -(signed byte*) zr#19 -(signed byte*) zr#2 -(signed byte*) zr#20 -(signed byte*) zr#21 -(signed byte*) zr#22 -(signed byte*) zr#23 -(signed byte*) zr#3 -(signed byte*) zr#4 -(signed byte*) zr#5 -(signed byte*) zr#6 -(signed byte*) zr#7 -(signed byte*) zr#8 -(signed byte*) zr#9 (signed byte[8]) zrs (signed byte[8]) zrs#0 (signed byte[8]) zs @@ -3418,6 +2664,7 @@ SYMBOL TABLE SSA Culled Empty Block (label) print_sbyte_at::@7 Culled Empty Block (label) print_byte_at::@2 +Culled Empty Block (label) debug_print::@26 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte*) print_line_cursor#0 = (byte*) print_screen#0 (byte*) print_char_cursor#0 (byte*) print_line_cursor#26 (byte*) print_char_cursor#26 (byte*) print_screen#52 (byte*) print_line_cursor#24 (byte*) print_char_cursor#24 (byte*) print_screen#50 (byte*) print_line_cursor#23 (byte*) print_char_cursor#23 (byte*) print_screen#49 (byte*) print_line_cursor#21 (byte*) print_char_cursor#21 (byte*) print_screen#47 (byte*) print_line_cursor#18 (byte*) print_char_cursor#18 (byte*) print_screen#44 Alias (byte*) print_str_at::str#13 = (byte*) print_str_at::str#14 @@ -3431,144 +2678,44 @@ Alias (byte) print_byte_at::b#1 = (byte) print_byte_at::b#2 Alias (byte*) print_byte_at::at#1 = (byte*) print_byte_at::at#2 Alias (byte*) print_char_at::at#3 = (byte*~) print_byte_at::$3 Alias (byte*) print_line_cursor#1 = (byte*) print_screen#3 (byte*) print_screen#2 (byte*) print_char_cursor#1 (byte*) print_line_cursor#8 (byte*) print_char_cursor#8 (byte*) print_line_cursor#2 (byte*) print_char_cursor#2 -Alias (byte*) mulf_sqr1#1 = (byte*) mulf_sqr1#3 (byte*) mulf_sqr1#19 -Alias (word*) psp1#1 = (word*) psp1#3 (word*) psp1#22 -Alias (byte*) mulf_sqr2#1 = (byte*) mulf_sqr2#3 (byte*) mulf_sqr2#19 -Alias (word*) psp2#1 = (word*) psp2#3 (word*) psp2#22 Alias (byte*) print_line_cursor#14 = (byte*) print_line_cursor#19 Alias (byte*) print_char_cursor#14 = (byte*) print_char_cursor#19 Alias (signed byte) sx#13 = (signed byte) sx#18 (signed byte) sx#24 Alias (signed byte) sy#13 = (signed byte) sy#19 (signed byte) sy#26 Alias (byte*) print_screen#29 = (byte*) print_screen#42 (byte*) print_screen#63 -Alias (byte*) SCREEN#17 = (byte*) SCREEN#19 (byte*) SCREEN#73 -Alias (signed byte) sz#19 = (signed byte) sz#21 (signed byte) sz#23 Alias (signed byte*) COSH#13 = (signed byte*) COSH#15 (signed byte*) COSH#17 -Alias (signed byte*) SINH#13 = (signed byte*) SINH#15 (signed byte*) SINH#17 Alias (signed byte*) COSQ#13 = (signed byte*) COSQ#15 (signed byte*) COSQ#17 -Alias (signed byte*) SINQ#13 = (signed byte*) SINQ#15 (signed byte*) SINQ#17 -Alias (signed byte*) xr#17 = (signed byte*) xr#19 (signed byte*) xr#20 -Alias (signed byte*) yr#17 = (signed byte*) yr#19 (signed byte*) yr#20 -Alias (signed byte*) zr#17 = (signed byte*) zr#19 (signed byte*) zr#20 -Alias (signed byte*) pp#17 = (signed byte*) pp#19 (signed byte*) pp#20 -Alias (signed byte*) xp#17 = (signed byte*) xp#19 (signed byte*) xp#20 -Alias (signed byte*) yp#17 = (signed byte*) yp#19 (signed byte*) yp#20 -Alias (signed byte*) PERSP_Z#17 = (signed byte*) PERSP_Z#19 (signed byte*) PERSP_Z#20 Alias (byte*) print_line_cursor#10 = (byte*) print_line_cursor#3 (byte*) print_line_cursor#9 (byte*) print_line_cursor#15 (byte*) print_line_cursor#4 Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#3 (byte*) print_char_cursor#9 (byte*) print_char_cursor#15 (byte*) print_char_cursor#4 Alias (signed byte) sx#0 = (signed byte) sx#6 (signed byte) sx#7 (signed byte) sx#1 Alias (signed byte) sy#0 = (signed byte) sy#6 (signed byte) sy#7 (signed byte) sy#1 -Alias (word*) psp1#0 = (word*) psp1#11 (word*) psp1#9 (word*) psp1#5 -Alias (word*) psp2#0 = (word*) psp2#11 (word*) psp2#9 (word*) psp2#5 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#26 (byte*) SCREEN#24 (byte*) SCREEN#21 -Alias (signed byte*) xr#0 = (signed byte*) xr#23 (signed byte*) xr#22 (signed byte*) xr#21 -Alias (signed byte*) yr#0 = (signed byte*) yr#23 (signed byte*) yr#22 (signed byte*) yr#21 -Alias (signed byte*) zr#0 = (signed byte*) zr#23 (signed byte*) zr#22 (signed byte*) zr#21 -Alias (signed byte*) pp#0 = (signed byte*) pp#23 (signed byte*) pp#22 (signed byte*) pp#21 -Alias (signed byte*) xp#0 = (signed byte*) xp#23 (signed byte*) xp#22 (signed byte*) xp#21 -Alias (signed byte*) yp#0 = (signed byte*) yp#23 (signed byte*) yp#22 (signed byte*) yp#21 Alias (signed byte) sx#10 = (signed byte) sx#28 (signed byte) sx#16 (signed byte) sx#4 Alias (signed byte) sy#10 = (signed byte) sy#31 (signed byte) sy#16 (signed byte) sy#4 -Alias (signed byte) sz#11 = (signed byte) sz#14 Alias (signed byte*) COSH#10 = (signed byte*) COSH#8 -Alias (signed byte*) SINH#10 = (signed byte*) SINH#8 Alias (signed byte*) COSQ#10 = (signed byte*) COSQ#8 -Alias (signed byte*) SINQ#10 = (signed byte*) SINQ#8 -Alias (signed byte*) xr#12 = (signed byte*) xr#14 -Alias (signed byte*) yr#12 = (signed byte*) yr#14 -Alias (signed byte*) zr#12 = (signed byte*) zr#14 -Alias (signed byte*) pp#12 = (signed byte*) pp#14 -Alias (signed byte*) xp#12 = (signed byte*) xp#14 -Alias (signed byte*) yp#12 = (signed byte*) yp#14 -Alias (byte*) mulf_sqr1#14 = (byte*) mulf_sqr1#16 -Alias (byte*) mulf_sqr2#14 = (byte*) mulf_sqr2#16 -Alias (signed byte*) PERSP_Z#12 = (signed byte*) PERSP_Z#14 -Alias (word*) psp1#17 = (word*) psp1#19 -Alias (word*) psp2#17 = (word*) psp2#19 Alias (byte*) print_screen#58 = (byte*) print_screen#60 -Alias (byte*) SCREEN#68 = (byte*) SCREEN#70 Alias (signed byte) sx#25 = (signed byte) sx#29 Alias (signed byte) sy#27 = (signed byte) sy#32 -Alias (signed byte) sz#12 = (signed byte) sz#8 Alias (signed byte*) COSH#6 = (signed byte*) COSH#9 -Alias (signed byte*) SINH#6 = (signed byte*) SINH#9 Alias (signed byte*) COSQ#6 = (signed byte*) COSQ#9 -Alias (signed byte*) SINQ#6 = (signed byte*) SINQ#9 -Alias (signed byte*) xr#10 = (signed byte*) xr#13 -Alias (signed byte*) yr#10 = (signed byte*) yr#13 -Alias (signed byte*) zr#10 = (signed byte*) zr#13 -Alias (signed byte*) pp#10 = (signed byte*) pp#13 -Alias (signed byte*) xp#10 = (signed byte*) xp#13 -Alias (signed byte*) yp#10 = (signed byte*) yp#13 -Alias (byte*) mulf_sqr1#12 = (byte*) mulf_sqr1#15 -Alias (byte*) mulf_sqr2#12 = (byte*) mulf_sqr2#15 -Alias (signed byte*) PERSP_Z#10 = (signed byte*) PERSP_Z#13 -Alias (word*) psp1#15 = (word*) psp1#18 -Alias (word*) psp2#15 = (word*) psp2#18 Alias (byte*) print_screen#56 = (byte*) print_screen#59 -Alias (byte*) SCREEN#66 = (byte*) SCREEN#69 Alias (signed byte) sx#21 = (signed byte) sx#26 Alias (signed byte) sy#22 = (signed byte) sy#28 -Alias (signed byte) sz#6 = (signed byte) sz#9 Alias (signed byte*) COSH#5 = (signed byte*) COSH#7 -Alias (signed byte*) SINH#5 = (signed byte*) SINH#7 Alias (signed byte*) COSQ#5 = (signed byte*) COSQ#7 -Alias (signed byte*) SINQ#5 = (signed byte*) SINQ#7 -Alias (signed byte*) xr#11 = (signed byte*) xr#9 -Alias (signed byte*) yr#11 = (signed byte*) yr#9 -Alias (signed byte*) zr#11 = (signed byte*) zr#9 -Alias (signed byte*) pp#11 = (signed byte*) pp#9 -Alias (signed byte*) xp#11 = (signed byte*) xp#9 -Alias (signed byte*) yp#11 = (signed byte*) yp#9 -Alias (byte*) mulf_sqr1#11 = (byte*) mulf_sqr1#13 -Alias (byte*) mulf_sqr2#11 = (byte*) mulf_sqr2#13 -Alias (signed byte*) PERSP_Z#11 = (signed byte*) PERSP_Z#9 -Alias (word*) psp1#14 = (word*) psp1#16 -Alias (word*) psp2#14 = (word*) psp2#16 Alias (byte*) print_screen#55 = (byte*) print_screen#57 -Alias (byte*) SCREEN#65 = (byte*) SCREEN#67 Alias (signed byte) sx#14 = (signed byte) sx#20 (signed byte) sx#8 (signed byte) sx#31 (signed byte) sx#30 Alias (signed byte) sy#14 = (signed byte) sy#21 (signed byte) sy#8 (signed byte) sy#34 (signed byte) sy#33 -Alias (signed byte) sz#1 = (signed byte) sz#5 (signed byte) sz#3 (signed byte) sz#27 (signed byte) sz#26 Alias (signed byte*) COSH#19 = (signed byte*) COSH#4 (signed byte*) COSH#3 (signed byte*) COSH#2 (signed byte*) COSH#20 -Alias (signed byte*) SINH#19 = (signed byte*) SINH#4 (signed byte*) SINH#3 (signed byte*) SINH#2 (signed byte*) SINH#20 Alias (signed byte*) COSQ#19 = (signed byte*) COSQ#4 (signed byte*) COSQ#3 (signed byte*) COSQ#2 (signed byte*) COSQ#20 -Alias (signed byte*) SINQ#19 = (signed byte*) SINQ#4 (signed byte*) SINQ#3 (signed byte*) SINQ#2 (signed byte*) SINQ#20 -Alias (signed byte*) xr#4 = (signed byte*) xr#8 (signed byte*) xr#7 (signed byte*) xr#6 (signed byte*) xr#5 -Alias (signed byte*) yr#4 = (signed byte*) yr#8 (signed byte*) yr#7 (signed byte*) yr#6 (signed byte*) yr#5 -Alias (signed byte*) zr#4 = (signed byte*) zr#8 (signed byte*) zr#7 (signed byte*) zr#6 (signed byte*) zr#5 -Alias (signed byte*) pp#4 = (signed byte*) pp#8 (signed byte*) pp#7 (signed byte*) pp#6 (signed byte*) pp#5 -Alias (signed byte*) xp#4 = (signed byte*) xp#8 (signed byte*) xp#7 (signed byte*) xp#6 (signed byte*) xp#5 -Alias (signed byte*) yp#4 = (signed byte*) yp#8 (signed byte*) yp#7 (signed byte*) yp#6 (signed byte*) yp#5 -Alias (byte*) mulf_sqr1#10 = (byte*) mulf_sqr1#9 (byte*) mulf_sqr1#8 (byte*) mulf_sqr1#7 (byte*) mulf_sqr1#5 -Alias (byte*) mulf_sqr2#10 = (byte*) mulf_sqr2#9 (byte*) mulf_sqr2#8 (byte*) mulf_sqr2#7 (byte*) mulf_sqr2#5 -Alias (signed byte*) PERSP_Z#3 = (signed byte*) PERSP_Z#8 (signed byte*) PERSP_Z#7 (signed byte*) PERSP_Z#6 (signed byte*) PERSP_Z#5 -Alias (word*) psp1#10 = (word*) psp1#13 (word*) psp1#12 (word*) psp1#8 (word*) psp1#6 -Alias (word*) psp2#10 = (word*) psp2#13 (word*) psp2#12 (word*) psp2#8 (word*) psp2#6 Alias (byte*) print_screen#46 = (byte*) print_screen#54 (byte*) print_screen#53 (byte*) print_screen#51 (byte*) print_screen#48 -Alias (byte*) SCREEN#60 = (byte*) SCREEN#64 (byte*) SCREEN#63 (byte*) SCREEN#62 (byte*) SCREEN#61 -Alias (signed byte*) xr#1 = (signed byte*) xr#3 (signed byte*) xr#18 (signed byte*) xr#16 Alias (byte) anim::i#2 = (byte) anim::i#3 -Alias (signed byte*) yr#1 = (signed byte*) yr#3 (signed byte*) yr#18 (signed byte*) yr#16 -Alias (signed byte*) zr#1 = (signed byte*) zr#3 (signed byte*) zr#18 (signed byte*) zr#16 -Alias (signed byte*) pp#1 = (signed byte*) pp#3 (signed byte*) pp#18 (signed byte*) pp#16 -Alias (signed byte*) xp#1 = (signed byte*) xp#3 (signed byte*) xp#18 (signed byte*) xp#16 -Alias (signed byte*) yp#1 = (signed byte*) yp#3 (signed byte*) yp#18 (signed byte*) yp#16 -Alias (byte*) mulf_sqr1#18 = (byte*) mulf_sqr1#6 (byte*) mulf_sqr1#4 (byte*) mulf_sqr1#20 -Alias (byte*) mulf_sqr2#18 = (byte*) mulf_sqr2#6 (byte*) mulf_sqr2#4 (byte*) mulf_sqr2#20 -Alias (signed byte*) PERSP_Z#16 = (signed byte*) PERSP_Z#4 (signed byte*) PERSP_Z#2 (signed byte*) PERSP_Z#18 -Alias (word*) psp1#21 = (word*) psp1#7 (word*) psp1#4 (word*) psp1#23 -Alias (word*) psp2#21 = (word*) psp2#7 (word*) psp2#4 (word*) psp2#23 Alias (signed byte) sx#15 = (signed byte) sx#22 (signed byte) sx#27 (signed byte) sx#9 Alias (signed byte) sy#15 = (signed byte) sy#23 (signed byte) sy#29 (signed byte) sy#9 Alias (byte*) print_screen#30 = (byte*) print_screen#43 (byte*) print_screen#45 (byte*) print_screen#62 -Alias (signed byte) sz#17 = (signed byte) sz#22 (signed byte) sz#24 (signed byte) sz#20 Alias (signed byte*) COSH#12 = (signed byte*) COSH#16 (signed byte*) COSH#18 (signed byte*) COSH#14 -Alias (signed byte*) SINH#12 = (signed byte*) SINH#16 (signed byte*) SINH#18 (signed byte*) SINH#14 Alias (signed byte*) COSQ#12 = (signed byte*) COSQ#16 (signed byte*) COSQ#18 (signed byte*) COSQ#14 -Alias (signed byte*) SINQ#12 = (signed byte*) SINQ#16 (signed byte*) SINQ#18 (signed byte*) SINQ#14 -Alias (byte*) SCREEN#57 = (byte*) SCREEN#58 (byte*) SCREEN#59 (byte*) SCREEN#72 Alias (byte) anim::i2#0 = (byte~) anim::$6 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#15 (byte*) SCREEN#2 (byte*) SCREEN#3 (byte*) SCREEN#4 (byte*) SCREEN#5 (byte*) SCREEN#6 (byte*) SCREEN#7 (byte*) SCREEN#8 (byte*) SCREEN#9 (byte*) SCREEN#10 (byte*) SCREEN#11 (byte*) SCREEN#12 (byte*) SCREEN#13 Alias (byte*) print_line_cursor#11 = (byte*) print_line_cursor#5 (byte*) print_line_cursor#40 (byte*) print_line_cursor#39 (byte*) print_line_cursor#38 (byte*) print_line_cursor#37 (byte*) print_line_cursor#36 (byte*) print_line_cursor#35 (byte*) print_line_cursor#34 (byte*) print_line_cursor#33 (byte*) print_line_cursor#32 (byte*) print_line_cursor#31 (byte*) print_line_cursor#30 (byte*) print_line_cursor#29 Alias (byte*) print_char_cursor#11 = (byte*) print_char_cursor#5 (byte*) print_char_cursor#40 (byte*) print_char_cursor#39 (byte*) print_char_cursor#38 (byte*) print_char_cursor#37 (byte*) print_char_cursor#36 (byte*) print_char_cursor#35 (byte*) print_char_cursor#34 (byte*) print_char_cursor#33 (byte*) print_char_cursor#32 (byte*) print_char_cursor#31 (byte*) print_char_cursor#30 (byte*) print_char_cursor#29 Alias (byte*) print_str_at::at#1 = (byte*~) debug_print_init::$3 @@ -3606,8 +2753,6 @@ Alias (byte*) print_screen#10 = (byte*) print_screen#4 (byte*) print_screen#17 ( Alias (byte) debug_print::print_sbyte_pos1_col#0 = (byte) debug_print::print_sbyte_pos1_col#1 Alias (signed byte) debug_print::print_sbyte_pos1_sb#0 = (signed byte) debug_print::print_sbyte_pos1_sb#1 Alias (signed byte) sy#11 = (signed byte) sy#24 (signed byte) sy#30 (signed byte) sy#17 -Alias (signed byte) sz#10 = (signed byte) sz#15 (signed byte) sz#18 (signed byte) sz#13 (signed byte) sz#7 (signed byte) sz#4 (signed byte) sz#2 -Alias (byte*) SCREEN#14 = (byte*) SCREEN#55 (byte*) SCREEN#56 (byte*) SCREEN#54 (byte*) SCREEN#53 (byte*) SCREEN#52 (byte*) SCREEN#51 (byte*) SCREEN#50 (byte*) SCREEN#49 (byte*) SCREEN#48 (byte*) SCREEN#47 (byte*) SCREEN#46 (byte*) SCREEN#45 (byte*) SCREEN#44 (byte*) SCREEN#43 (byte*) SCREEN#42 (byte*) SCREEN#41 (byte*) SCREEN#40 (byte*) SCREEN#39 (byte*) SCREEN#38 (byte*) SCREEN#37 (byte*) SCREEN#36 (byte*) SCREEN#35 (byte*) SCREEN#34 (byte*) SCREEN#33 (byte*) SCREEN#32 (byte*) SCREEN#31 (byte*) SCREEN#30 (byte*) SCREEN#29 (byte*) SCREEN#28 (byte*) SCREEN#27 (byte*) SCREEN#25 (byte*) SCREEN#23 (byte*) SCREEN#22 (byte*) SCREEN#20 (byte*) SCREEN#18 (byte*) SCREEN#16 Alias (byte*) print_sbyte_at::at#3 = (byte*) debug_print::print_sbyte_pos1_$2#0 Alias (byte) debug_print::print_sbyte_pos2_row#0 = (byte) debug_print::print_sbyte_pos2_row#1 Alias (byte) debug_print::print_sbyte_pos2_col#0 = (byte) debug_print::print_sbyte_pos2_col#1 @@ -3666,7 +2811,6 @@ Alias (byte*) print_sbyte_at::at#20 = (byte*~) debug_print::$36 Alias (byte*) sprites_init::sprites_ptr#0 = (byte*~) sprites_init::$0 Alias (signed byte) sx#17 = (signed byte) sx#23 (signed byte) sx#2 Alias (signed byte) sy#18 = (signed byte) sy#25 (signed byte) sy#2 -Alias (signed byte) sz#0 = (signed byte) sz#28 (signed byte) sz#25 Alias (signed byte) calculate_matrix::t1#0 = (signed byte~) calculate_matrix::$0 Alias (signed byte) calculate_matrix::t2#0 = (signed byte~) calculate_matrix::$1 Alias (signed byte) calculate_matrix::t3#0 = (signed byte~) calculate_matrix::$2 @@ -3693,84 +2837,24 @@ Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (byte*) print_line_cursor#1 Self Phi Eliminated (signed byte) sx#25 Self Phi Eliminated (signed byte) sy#27 -Self Phi Eliminated (signed byte) sz#12 Self Phi Eliminated (signed byte*) COSH#6 -Self Phi Eliminated (signed byte*) SINH#6 Self Phi Eliminated (signed byte*) COSQ#6 -Self Phi Eliminated (signed byte*) SINQ#6 -Self Phi Eliminated (signed byte*) xr#10 -Self Phi Eliminated (signed byte*) yr#10 -Self Phi Eliminated (signed byte*) zr#10 -Self Phi Eliminated (signed byte*) pp#10 -Self Phi Eliminated (signed byte*) xp#10 -Self Phi Eliminated (signed byte*) yp#10 -Self Phi Eliminated (byte*) mulf_sqr1#12 -Self Phi Eliminated (byte*) mulf_sqr2#12 -Self Phi Eliminated (signed byte*) PERSP_Z#10 -Self Phi Eliminated (word*) psp1#15 -Self Phi Eliminated (word*) psp2#15 Self Phi Eliminated (byte*) print_screen#56 -Self Phi Eliminated (byte*) SCREEN#66 Self Phi Eliminated (signed byte) sx#21 Self Phi Eliminated (signed byte) sy#22 -Self Phi Eliminated (signed byte) sz#6 Self Phi Eliminated (signed byte*) COSH#5 -Self Phi Eliminated (signed byte*) SINH#5 Self Phi Eliminated (signed byte*) COSQ#5 -Self Phi Eliminated (signed byte*) SINQ#5 -Self Phi Eliminated (signed byte*) xr#11 -Self Phi Eliminated (signed byte*) yr#11 -Self Phi Eliminated (signed byte*) zr#11 -Self Phi Eliminated (signed byte*) pp#11 -Self Phi Eliminated (signed byte*) xp#11 -Self Phi Eliminated (signed byte*) yp#11 -Self Phi Eliminated (byte*) mulf_sqr1#11 -Self Phi Eliminated (byte*) mulf_sqr2#11 -Self Phi Eliminated (signed byte*) PERSP_Z#11 -Self Phi Eliminated (word*) psp1#14 -Self Phi Eliminated (word*) psp2#14 Self Phi Eliminated (byte*) print_screen#55 -Self Phi Eliminated (byte*) SCREEN#65 Self Phi Eliminated (signed byte) sx#14 Self Phi Eliminated (signed byte) sy#14 -Self Phi Eliminated (signed byte) sz#1 Self Phi Eliminated (signed byte*) COSH#19 -Self Phi Eliminated (signed byte*) SINH#19 Self Phi Eliminated (signed byte*) COSQ#19 -Self Phi Eliminated (signed byte*) SINQ#19 -Self Phi Eliminated (signed byte*) xr#4 -Self Phi Eliminated (signed byte*) yr#4 -Self Phi Eliminated (signed byte*) zr#4 -Self Phi Eliminated (signed byte*) pp#4 -Self Phi Eliminated (signed byte*) xp#4 -Self Phi Eliminated (signed byte*) yp#4 -Self Phi Eliminated (byte*) mulf_sqr1#10 -Self Phi Eliminated (byte*) mulf_sqr2#10 -Self Phi Eliminated (signed byte*) PERSP_Z#3 -Self Phi Eliminated (word*) psp1#10 -Self Phi Eliminated (word*) psp2#10 Self Phi Eliminated (byte*) print_screen#46 -Self Phi Eliminated (byte*) SCREEN#60 -Self Phi Eliminated (signed byte*) xr#1 -Self Phi Eliminated (signed byte*) yr#1 -Self Phi Eliminated (signed byte*) zr#1 -Self Phi Eliminated (signed byte*) pp#1 -Self Phi Eliminated (signed byte*) xp#1 -Self Phi Eliminated (signed byte*) yp#1 -Self Phi Eliminated (byte*) mulf_sqr1#18 -Self Phi Eliminated (byte*) mulf_sqr2#18 -Self Phi Eliminated (signed byte*) PERSP_Z#16 -Self Phi Eliminated (word*) psp1#21 -Self Phi Eliminated (word*) psp2#21 Self Phi Eliminated (signed byte) sx#15 Self Phi Eliminated (signed byte) sy#15 Self Phi Eliminated (byte*) print_screen#30 -Self Phi Eliminated (signed byte) sz#17 Self Phi Eliminated (signed byte*) COSH#12 -Self Phi Eliminated (signed byte*) SINH#12 Self Phi Eliminated (signed byte*) COSQ#12 -Self Phi Eliminated (signed byte*) SINQ#12 -Self Phi Eliminated (byte*) SCREEN#57 Self Phi Eliminated (byte) debug_print_init::i#5 Self Phi Eliminated (byte*) debug_print_init::at_cols#1 Self Phi Eliminated (byte) debug_print_init::c#5 @@ -3778,144 +2862,51 @@ Self Phi Eliminated (byte*) debug_print_init::at_line#4 Self Phi Eliminated (byte*) print_line_cursor#12 Self Phi Eliminated (byte*) print_char_cursor#12 Self Phi Eliminated (byte*) debug_print::at_line#1 -Self Phi Eliminated (byte*) SPRITE#1 Self Phi Eliminated (byte*) sprites_init::sprites_ptr#1 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (byte) print_byte_at::b#1 (byte) print_byte_at::b#0 Redundant Phi (byte*) print_byte_at::at#1 (byte*) print_byte_at::at#0 Redundant Phi (byte*) print_screen#1 (byte*) print_screen#16 Redundant Phi (byte*) print_line_cursor#1 (byte*) print_screen#1 -Redundant Phi (byte*) mulf_sqr1#1 (byte*) mulf_sqr1#0 -Redundant Phi (word*) psp1#1 (word*) psp1#0 -Redundant Phi (byte*) mulf_sqr2#1 (byte*) mulf_sqr2#0 -Redundant Phi (word*) psp2#1 (word*) psp2#0 Redundant Phi (byte*) print_line_cursor#14 (byte*) print_line_cursor#0 Redundant Phi (byte*) print_char_cursor#14 (byte*) print_line_cursor#0 -Redundant Phi (byte*) SPRITE#3 (byte*) SPRITE#0 Redundant Phi (signed byte) sx#13 (signed byte) sx#17 Redundant Phi (signed byte) sy#13 (signed byte) sy#18 Redundant Phi (byte*) print_screen#29 (byte*) print_line_cursor#0 -Redundant Phi (byte*) SCREEN#17 (byte*) SCREEN#0 -Redundant Phi (signed byte) sz#19 (signed byte) sz#0 Redundant Phi (signed byte*) COSH#13 (signed byte*) COSH#0 -Redundant Phi (signed byte*) SINH#13 (signed byte*) SINH#0 Redundant Phi (signed byte*) COSQ#13 (signed byte*) COSQ#0 -Redundant Phi (signed byte*) SINQ#13 (signed byte*) SINQ#0 -Redundant Phi (signed byte*) xr#17 (signed byte*) xr#0 -Redundant Phi (signed byte*) yr#17 (signed byte*) yr#0 -Redundant Phi (signed byte*) zr#17 (signed byte*) zr#0 -Redundant Phi (signed byte*) pp#17 (signed byte*) pp#0 -Redundant Phi (signed byte*) xp#17 (signed byte*) xp#0 -Redundant Phi (signed byte*) yp#17 (signed byte*) yp#0 -Redundant Phi (signed byte*) PERSP_Z#17 (signed byte*) PERSP_Z#0 Redundant Phi (byte*) print_line_cursor#10 (byte*) print_line_cursor#12 Redundant Phi (byte*) print_char_cursor#10 (byte*) print_char_cursor#12 Redundant Phi (signed byte) sx#0 (signed byte) sx#10 Redundant Phi (signed byte) sy#0 (signed byte) sy#10 Redundant Phi (signed byte) sx#19 (signed byte) sx#13 Redundant Phi (signed byte) sy#20 (signed byte) sy#13 -Redundant Phi (signed byte) sz#16 (signed byte) sz#19 Redundant Phi (signed byte*) COSH#11 (signed byte*) COSH#13 -Redundant Phi (signed byte*) SINH#11 (signed byte*) SINH#13 Redundant Phi (signed byte*) COSQ#11 (signed byte*) COSQ#13 -Redundant Phi (signed byte*) SINQ#11 (signed byte*) SINQ#13 -Redundant Phi (signed byte*) xr#15 (signed byte*) xr#17 -Redundant Phi (signed byte*) yr#15 (signed byte*) yr#17 -Redundant Phi (signed byte*) zr#15 (signed byte*) zr#17 -Redundant Phi (signed byte*) pp#15 (signed byte*) pp#17 -Redundant Phi (signed byte*) xp#15 (signed byte*) xp#17 -Redundant Phi (signed byte*) yp#15 (signed byte*) yp#17 -Redundant Phi (byte*) mulf_sqr1#17 (byte*) mulf_sqr1#1 -Redundant Phi (byte*) mulf_sqr2#17 (byte*) mulf_sqr2#1 -Redundant Phi (signed byte*) PERSP_Z#15 (signed byte*) PERSP_Z#17 -Redundant Phi (word*) psp1#20 (word*) psp1#1 -Redundant Phi (word*) psp2#20 (word*) psp2#1 Redundant Phi (byte*) print_screen#61 (byte*) print_screen#29 -Redundant Phi (byte*) SCREEN#71 (byte*) SCREEN#17 Redundant Phi (signed byte) sx#25 (signed byte) sx#10 Redundant Phi (signed byte) sy#27 (signed byte) sy#10 -Redundant Phi (signed byte) sz#12 (signed byte) sz#11 Redundant Phi (signed byte*) COSH#6 (signed byte*) COSH#10 -Redundant Phi (signed byte*) SINH#6 (signed byte*) SINH#10 Redundant Phi (signed byte*) COSQ#6 (signed byte*) COSQ#10 -Redundant Phi (signed byte*) SINQ#6 (signed byte*) SINQ#10 -Redundant Phi (signed byte*) xr#10 (signed byte*) xr#12 -Redundant Phi (signed byte*) yr#10 (signed byte*) yr#12 -Redundant Phi (signed byte*) zr#10 (signed byte*) zr#12 -Redundant Phi (signed byte*) pp#10 (signed byte*) pp#12 -Redundant Phi (signed byte*) xp#10 (signed byte*) xp#12 -Redundant Phi (signed byte*) yp#10 (signed byte*) yp#12 -Redundant Phi (byte*) mulf_sqr1#12 (byte*) mulf_sqr1#14 -Redundant Phi (byte*) mulf_sqr2#12 (byte*) mulf_sqr2#14 -Redundant Phi (signed byte*) PERSP_Z#10 (signed byte*) PERSP_Z#12 -Redundant Phi (word*) psp1#15 (word*) psp1#17 -Redundant Phi (word*) psp2#15 (word*) psp2#17 Redundant Phi (byte*) print_screen#56 (byte*) print_screen#58 -Redundant Phi (byte*) SCREEN#66 (byte*) SCREEN#68 Redundant Phi (signed byte) sx#21 (signed byte) sx#25 Redundant Phi (signed byte) sy#22 (signed byte) sy#27 -Redundant Phi (signed byte) sz#6 (signed byte) sz#12 Redundant Phi (signed byte*) COSH#5 (signed byte*) COSH#6 -Redundant Phi (signed byte*) SINH#5 (signed byte*) SINH#6 Redundant Phi (signed byte*) COSQ#5 (signed byte*) COSQ#6 -Redundant Phi (signed byte*) SINQ#5 (signed byte*) SINQ#6 -Redundant Phi (signed byte*) xr#11 (signed byte*) xr#10 -Redundant Phi (signed byte*) yr#11 (signed byte*) yr#10 -Redundant Phi (signed byte*) zr#11 (signed byte*) zr#10 -Redundant Phi (signed byte*) pp#11 (signed byte*) pp#10 -Redundant Phi (signed byte*) xp#11 (signed byte*) xp#10 -Redundant Phi (signed byte*) yp#11 (signed byte*) yp#10 -Redundant Phi (byte*) mulf_sqr1#11 (byte*) mulf_sqr1#12 -Redundant Phi (byte*) mulf_sqr2#11 (byte*) mulf_sqr2#12 -Redundant Phi (signed byte*) PERSP_Z#11 (signed byte*) PERSP_Z#10 -Redundant Phi (word*) psp1#14 (word*) psp1#15 -Redundant Phi (word*) psp2#14 (word*) psp2#15 Redundant Phi (byte*) print_screen#55 (byte*) print_screen#56 -Redundant Phi (byte*) SCREEN#65 (byte*) SCREEN#66 Redundant Phi (signed byte) sx#14 (signed byte) sx#21 Redundant Phi (signed byte) sy#14 (signed byte) sy#22 -Redundant Phi (signed byte) sz#1 (signed byte) sz#6 Redundant Phi (signed byte*) COSH#19 (signed byte*) COSH#5 -Redundant Phi (signed byte*) SINH#19 (signed byte*) SINH#5 Redundant Phi (signed byte*) COSQ#19 (signed byte*) COSQ#5 -Redundant Phi (signed byte*) SINQ#19 (signed byte*) SINQ#5 -Redundant Phi (signed byte*) xr#4 (signed byte*) xr#11 -Redundant Phi (signed byte*) yr#4 (signed byte*) yr#11 -Redundant Phi (signed byte*) zr#4 (signed byte*) zr#11 -Redundant Phi (signed byte*) pp#4 (signed byte*) pp#11 -Redundant Phi (signed byte*) xp#4 (signed byte*) xp#11 -Redundant Phi (signed byte*) yp#4 (signed byte*) yp#11 -Redundant Phi (byte*) mulf_sqr1#10 (byte*) mulf_sqr1#11 -Redundant Phi (byte*) mulf_sqr2#10 (byte*) mulf_sqr2#11 -Redundant Phi (signed byte*) PERSP_Z#3 (signed byte*) PERSP_Z#11 -Redundant Phi (word*) psp1#10 (word*) psp1#14 -Redundant Phi (word*) psp2#10 (word*) psp2#14 Redundant Phi (byte*) print_screen#46 (byte*) print_screen#55 -Redundant Phi (byte*) SCREEN#60 (byte*) SCREEN#65 -Redundant Phi (signed byte*) xr#1 (signed byte*) xr#4 -Redundant Phi (signed byte*) yr#1 (signed byte*) yr#4 -Redundant Phi (signed byte*) zr#1 (signed byte*) zr#4 -Redundant Phi (signed byte*) pp#1 (signed byte*) pp#4 -Redundant Phi (signed byte*) xp#1 (signed byte*) xp#4 -Redundant Phi (signed byte*) yp#1 (signed byte*) yp#4 -Redundant Phi (byte*) mulf_sqr1#18 (byte*) mulf_sqr1#10 -Redundant Phi (byte*) mulf_sqr2#18 (byte*) mulf_sqr2#10 -Redundant Phi (signed byte*) PERSP_Z#16 (signed byte*) PERSP_Z#3 -Redundant Phi (word*) psp1#21 (word*) psp1#10 -Redundant Phi (word*) psp2#21 (word*) psp2#10 Redundant Phi (signed byte) sx#15 (signed byte) sx#14 Redundant Phi (signed byte) sy#15 (signed byte) sy#14 Redundant Phi (byte*) print_screen#30 (byte*) print_screen#46 -Redundant Phi (signed byte) sz#17 (signed byte) sz#1 Redundant Phi (signed byte*) COSH#12 (signed byte*) COSH#19 -Redundant Phi (signed byte*) SINH#12 (signed byte*) SINH#19 Redundant Phi (signed byte*) COSQ#12 (signed byte*) COSQ#19 -Redundant Phi (signed byte*) SINQ#12 (signed byte*) SINQ#19 -Redundant Phi (byte*) SCREEN#57 (byte*) SCREEN#60 Redundant Phi (byte*) print_screen#16 (byte*) print_screen#29 Redundant Phi (byte*) print_line_cursor#16 (byte*) print_line_cursor#14 Redundant Phi (byte*) print_char_cursor#16 (byte*) print_char_cursor#14 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#17 Redundant Phi (byte*) print_line_cursor#11 (byte*) print_line_cursor#1 Redundant Phi (byte*) print_char_cursor#11 (byte*) print_line_cursor#1 Redundant Phi (byte) debug_print_init::i#5 (byte) debug_print_init::i#2 @@ -3927,33 +2918,16 @@ Redundant Phi (byte*) print_char_cursor#12 (byte*) print_char_cursor#22 Redundant Phi (signed byte) sx#11 (signed byte) sx#15 Redundant Phi (byte*) print_screen#10 (byte*) print_screen#30 Redundant Phi (signed byte) sy#11 (signed byte) sy#15 -Redundant Phi (signed byte) sz#10 (signed byte) sz#17 -Redundant Phi (byte*) SCREEN#14 (byte*) SCREEN#57 Redundant Phi (byte*) debug_print::at_line#1 (byte*) debug_print::at_line#0 -Redundant Phi (byte*) SPRITE#2 (byte*) SPRITE#3 -Redundant Phi (byte*) SPRITE#1 (byte*) SPRITE#2 Redundant Phi (byte*) sprites_init::sprites_ptr#1 (byte*) sprites_init::sprites_ptr#0 Redundant Phi (signed byte) calculate_matrix::sy#1 (signed byte) calculate_matrix::sy#0 Redundant Phi (signed byte) calculate_matrix::sz#1 (signed byte) calculate_matrix::sz#0 Redundant Phi (signed byte) calculate_matrix::sx#1 (signed byte) calculate_matrix::sx#0 Redundant Phi (signed byte*) COSH#1 (signed byte*) COSH#19 -Redundant Phi (signed byte*) SINH#1 (signed byte*) SINH#19 Redundant Phi (signed byte*) COSQ#1 (signed byte*) COSQ#19 -Redundant Phi (signed byte*) SINQ#1 (signed byte*) SINQ#19 Redundant Phi (signed byte) rotate_matrix::x#1 (signed byte) rotate_matrix::x#0 -Redundant Phi (signed byte*) xr#2 (signed byte*) xr#1 Redundant Phi (signed byte) rotate_matrix::y#1 (signed byte) rotate_matrix::y#0 -Redundant Phi (signed byte*) yr#2 (signed byte*) yr#1 Redundant Phi (signed byte) rotate_matrix::z#1 (signed byte) rotate_matrix::z#0 -Redundant Phi (signed byte*) zr#2 (signed byte*) zr#1 -Redundant Phi (byte*) mulf_sqr1#2 (byte*) mulf_sqr1#18 -Redundant Phi (byte*) mulf_sqr2#2 (byte*) mulf_sqr2#18 -Redundant Phi (signed byte*) PERSP_Z#1 (signed byte*) PERSP_Z#16 -Redundant Phi (signed byte*) pp#2 (signed byte*) pp#1 -Redundant Phi (word*) psp1#2 (word*) psp1#21 -Redundant Phi (word*) psp2#2 (word*) psp2#21 -Redundant Phi (signed byte*) yp#2 (signed byte*) yp#1 -Redundant Phi (signed byte*) xp#2 (signed byte*) xp#1 Redundant Phi (byte*) print_line_cursor#13 (byte*) print_line_cursor#10 Redundant Phi (byte*) print_char_cursor#13 (byte*) print_char_cursor#10 Redundant Phi (signed byte) sx#12 (signed byte) sx#0 @@ -3968,8 +2942,8 @@ Simple Condition (bool~) anim::$2 [210] if(*((byte*) RASTER#0)!=(byte/word/signe Simple Condition (bool~) anim::$11 [245] if((byte) anim::i#1!=rangelast(0,7)) goto anim::@13 Simple Condition (bool~) debug_print_init::$93 [419] if((byte) debug_print_init::j#1!=rangelast(0,3)) goto debug_print_init::@2 Simple Condition (bool~) debug_print_init::$94 [424] if((byte) debug_print_init::i#1!=rangelast(0,7)) goto debug_print_init::@1 -Simple Condition (bool~) debug_print::$38 [625] if((byte) debug_print::i#1!=rangelast(0,7)) goto debug_print::@1 -Simple Condition (bool~) sprites_init::$3 [640] if((byte) sprites_init::i#1!=rangelast(0,7)) goto sprites_init::@1 +Simple Condition (bool~) debug_print::$38 [623] if((byte) debug_print::i#1!=rangelast(0,7)) goto debug_print::@1 +Simple Condition (bool~) sprites_init::$3 [637] if((byte) sprites_init::i#1!=rangelast(0,7)) goto sprites_init::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) PROCPORT_DDR#0 = ((byte*))0 Constant (const byte) PROCPORT_DDR_MEMORY_MASK#0 = 7 @@ -4175,6 +3149,7 @@ Constant (const word) main::$1 = ((word))mulf_sqr1#0 Constant (const word) main::$2 = ((word))mulf_sqr2#0 Constant (const signed byte[8]) xs#0 = { $0, $1, $2, 0, 0, $34, $34, $34 } Constant (const signed byte[8]) ys#0 = { $3, 0, $34, $4, $34, $5, 0, $34 } +Constant (const signed byte) calculate_matrix::sz#0 = sz#0 Constant (const byte*) debug_print_init::$2 = SCREEN#0+debug_print_init::$1 Constant (const byte*) debug_print_init::$6 = SCREEN#0+debug_print_init::$5 Constant (const byte*) debug_print_init::$10 = SCREEN#0+debug_print_init::$9 @@ -4191,6 +3166,7 @@ Constant (const byte*) debug_print_init::at_line#0 = SCREEN#0+debug_print_init:: Constant (const byte*) debug_print_init::at_cols#0 = debug_print_init::COLS#0+debug_print_init::$42 Constant (const byte/signed word/word/dword/signed dword) debug_print::print_sbyte_pos1_$0#0 = debug_print::print_sbyte_pos1_row#0*$28 Constant (const byte/signed word/word/dword/signed dword) debug_print::print_sbyte_pos2_$0#0 = debug_print::print_sbyte_pos2_row#0*$28 +Constant (const signed byte) debug_print::print_sbyte_pos3_sb#0 = sz#0 Constant (const byte/signed word/word/dword/signed dword) debug_print::print_sbyte_pos3_$0#0 = debug_print::print_sbyte_pos3_row#0*$28 Constant (const byte/signed word/word/dword/signed dword) debug_print::print_sbyte_pos4_$0#0 = debug_print::print_sbyte_pos4_row#0*$28 Constant (const byte/signed word/word/dword/signed dword) debug_print::print_sbyte_pos5_$0#0 = debug_print::print_sbyte_pos5_row#0*$28 @@ -4201,6 +3177,7 @@ Constant (const byte/signed word/word/dword/signed dword) debug_print::print_sby Constant (const byte/signed word/word/dword/signed dword) debug_print::print_sbyte_pos10_$0#0 = debug_print::print_sbyte_pos10_row#0*$28 Constant (const byte/signed word/word/dword/signed dword) debug_print::print_sbyte_pos11_$0#0 = debug_print::print_sbyte_pos11_row#0*$28 Constant (const byte/signed word/word/dword/signed dword) debug_print::print_sbyte_pos12_$0#0 = debug_print::print_sbyte_pos12_row#0*$28 +Constant (const byte*) debug_print::at_line#0 = SCREEN#0+debug_print::$12 Constant (const byte*) sprites_init::sprites_ptr#0 = sprites_init::SCREEN#0+$3f8 Constant (const byte*) sprites_init::$1 = SPRITE#0/$40 Constant (const signed byte*) COSH#0 = SINH#0+$40 @@ -4213,6 +3190,13 @@ Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) print_str_at::at#1 = debug_print_init::$2+$22 Constant (const byte*) print_str_at::at#2 = debug_print_init::$6+$22 Constant (const byte*) print_str_at::at#3 = debug_print_init::$10+$22 +Constant (const signed byte) print_sbyte_at::b#6 = debug_print::print_sbyte_pos3_sb#0 +Constant (const byte*) debug_print::$15 = debug_print::at_line#0+debug_print::$14 +Constant (const byte*) debug_print::$19 = debug_print::at_line#0+debug_print::$18 +Constant (const byte*) debug_print::$23 = debug_print::at_line#0+debug_print::$22 +Constant (const byte*) debug_print::$27 = debug_print::at_line#0+debug_print::$26 +Constant (const byte*) debug_print::$31 = debug_print::at_line#0+debug_print::$30 +Constant (const byte*) debug_print::$35 = debug_print::at_line#0+debug_print::$34 Constant (const byte) sprites_init::$2 = ((byte))sprites_init::$1 Successful SSA optimization Pass2ConstantIdentification Consolidated array index constant in *(rotation_matrix#0+0) @@ -4250,8 +3234,8 @@ if() condition always true - replacing block destination [44] if(true) goto anim Successful SSA optimization Pass2ConstantIfs Successful SSA optimization PassNEliminateUnusedVars Eliminating Noop Cast (byte) print_byte_at::b#0 ← ((byte)) (signed byte) print_sbyte_at::b#24 -Eliminating Noop Cast (byte~) anim::$7 ← ((byte)) *((signed byte*) xp#12) -Eliminating Noop Cast (byte~) anim::$9 ← ((byte)) *((signed byte*) yp#12) +Eliminating Noop Cast (byte~) anim::$7 ← ((byte)) *((const signed byte*) xp#0) +Eliminating Noop Cast (byte~) anim::$9 ← ((byte)) *((const signed byte*) yp#0) Successful SSA optimization Pass2NopCastElimination Removing unused block anim::@return Successful SSA optimization Pass2EliminateUnusedBlocks @@ -4281,6 +3265,7 @@ Culled Empty Block (label) debug_print_init::@17 Culled Empty Block (label) debug_print_init::@20 Culled Empty Block (label) debug_print::@15 Culled Empty Block (label) debug_print::@16 +Culled Empty Block (label) debug_print::@4 Culled Empty Block (label) debug_print::@17 Culled Empty Block (label) debug_print::@18 Culled Empty Block (label) debug_print::@19 @@ -4290,53 +3275,22 @@ Culled Empty Block (label) debug_print::@22 Culled Empty Block (label) debug_print::@23 Culled Empty Block (label) debug_print::@24 Culled Empty Block (label) debug_print::@25 -Culled Empty Block (label) debug_print::@26 +Culled Empty Block (label) debug_print::@14 Culled Empty Block (label) @28 Culled Empty Block (label) @34 Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (signed byte) sz#11 Self Phi Eliminated (signed byte*) COSH#10 -Self Phi Eliminated (signed byte*) SINH#10 Self Phi Eliminated (signed byte*) COSQ#10 -Self Phi Eliminated (signed byte*) SINQ#10 -Self Phi Eliminated (signed byte*) xr#12 -Self Phi Eliminated (signed byte*) yr#12 -Self Phi Eliminated (signed byte*) zr#12 -Self Phi Eliminated (signed byte*) pp#12 -Self Phi Eliminated (signed byte*) xp#12 -Self Phi Eliminated (signed byte*) yp#12 -Self Phi Eliminated (byte*) mulf_sqr1#14 -Self Phi Eliminated (byte*) mulf_sqr2#14 -Self Phi Eliminated (signed byte*) PERSP_Z#12 -Self Phi Eliminated (word*) psp1#17 -Self Phi Eliminated (word*) psp2#17 Self Phi Eliminated (byte*) print_screen#58 -Self Phi Eliminated (byte*) SCREEN#68 Self Phi Eliminated (byte*) debug_print_init::at_line#1 Self Phi Eliminated (byte*) debug_print_init::at_cols#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (signed byte) sz#11 (const signed byte) sz#0 Redundant Phi (signed byte*) COSH#10 (const signed byte*) COSH#0 -Redundant Phi (signed byte*) SINH#10 (const signed byte*) SINH#0 Redundant Phi (signed byte*) COSQ#10 (const signed byte*) COSQ#0 -Redundant Phi (signed byte*) SINQ#10 (const signed byte*) SINQ#0 -Redundant Phi (signed byte*) xr#12 (const signed byte*) xr#0 -Redundant Phi (signed byte*) yr#12 (const signed byte*) yr#0 -Redundant Phi (signed byte*) zr#12 (const signed byte*) zr#0 -Redundant Phi (signed byte*) pp#12 (const signed byte*) pp#0 -Redundant Phi (signed byte*) xp#12 (const signed byte*) xp#0 -Redundant Phi (signed byte*) yp#12 (const signed byte*) yp#0 -Redundant Phi (byte*) mulf_sqr1#14 (const byte*) mulf_sqr1#0 -Redundant Phi (byte*) mulf_sqr2#14 (const byte*) mulf_sqr2#0 -Redundant Phi (signed byte*) PERSP_Z#12 (const signed byte*) PERSP_Z#0 -Redundant Phi (word*) psp1#17 (const word*) psp1#0 -Redundant Phi (word*) psp2#17 (const word*) psp2#0 Redundant Phi (byte*) print_screen#58 (const byte*) print_line_cursor#0 -Redundant Phi (byte*) SCREEN#68 (const byte*) SCREEN#0 Redundant Phi (byte*) debug_print_init::at_line#1 (const byte*) debug_print_init::at_line#0 Redundant Phi (byte*) debug_print_init::at_cols#2 (const byte*) debug_print_init::at_cols#0 Successful SSA optimization Pass2RedundantPhiElimination -Constant (const signed byte) calculate_matrix::sz#0 = sz#0 Constant (const byte*) debug_print_init::$45 = debug_print_init::at_line#0+debug_print_init::$44 Constant (const byte*) debug_print_init::$49 = debug_print_init::at_line#0+debug_print_init::$48 Constant (const byte*) debug_print_init::$53 = debug_print_init::at_line#0+debug_print_init::$52 @@ -4351,7 +3305,6 @@ Constant (const byte*) debug_print_init::$86 = debug_print_init::at_cols#0+debug Constant (const byte*) debug_print_init::$90 = debug_print_init::at_cols#0+debug_print_init::$89 Constant (const byte*) debug_print::print_sbyte_pos1_$1#0 = print_line_cursor#0 Constant (const byte*) debug_print::print_sbyte_pos2_$1#0 = print_line_cursor#0 -Constant (const signed byte) debug_print::print_sbyte_pos3_sb#0 = sz#0 Constant (const byte*) debug_print::print_sbyte_pos3_$1#0 = print_line_cursor#0 Constant (const byte*) debug_print::print_sbyte_pos4_$1#0 = print_line_cursor#0 Constant (const byte*) debug_print::print_sbyte_pos5_$1#0 = print_line_cursor#0 @@ -4362,12 +3315,10 @@ Constant (const byte*) debug_print::print_sbyte_pos9_$1#0 = print_line_cursor#0 Constant (const byte*) debug_print::print_sbyte_pos10_$1#0 = print_line_cursor#0 Constant (const byte*) debug_print::print_sbyte_pos11_$1#0 = print_line_cursor#0 Constant (const byte*) debug_print::print_sbyte_pos12_$1#0 = print_line_cursor#0 -Constant (const byte*) debug_print::at_line#0 = SCREEN#0+debug_print::$12 Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) print_sbyte_at::at#3 = debug_print::print_sbyte_pos1_$1#0+debug_print::print_sbyte_pos1_$0#0+debug_print::print_sbyte_pos1_col#0 Constant (const byte*) print_sbyte_at::at#4 = debug_print::print_sbyte_pos2_$1#0+debug_print::print_sbyte_pos2_$0#0+debug_print::print_sbyte_pos2_col#0 Constant (const byte*) print_sbyte_at::at#5 = debug_print::print_sbyte_pos3_$1#0+debug_print::print_sbyte_pos3_$0#0+debug_print::print_sbyte_pos3_col#0 -Constant (const signed byte) print_sbyte_at::b#6 = debug_print::print_sbyte_pos3_sb#0 Constant (const byte*) print_sbyte_at::at#6 = debug_print::print_sbyte_pos4_$1#0+debug_print::print_sbyte_pos4_$0#0+debug_print::print_sbyte_pos4_col#0 Constant (const byte*) print_sbyte_at::at#7 = debug_print::print_sbyte_pos5_$1#0+debug_print::print_sbyte_pos5_$0#0+debug_print::print_sbyte_pos5_col#0 Constant (const byte*) print_sbyte_at::at#8 = debug_print::print_sbyte_pos6_$1#0+debug_print::print_sbyte_pos6_$0#0+debug_print::print_sbyte_pos6_col#0 @@ -4377,16 +3328,7 @@ Constant (const byte*) print_sbyte_at::at#11 = debug_print::print_sbyte_pos9_$1# Constant (const byte*) print_sbyte_at::at#12 = debug_print::print_sbyte_pos10_$1#0+debug_print::print_sbyte_pos10_$0#0+debug_print::print_sbyte_pos10_col#0 Constant (const byte*) print_sbyte_at::at#13 = debug_print::print_sbyte_pos11_$1#0+debug_print::print_sbyte_pos11_$0#0+debug_print::print_sbyte_pos11_col#0 Constant (const byte*) print_sbyte_at::at#14 = debug_print::print_sbyte_pos12_$1#0+debug_print::print_sbyte_pos12_$0#0+debug_print::print_sbyte_pos12_col#0 -Constant (const byte*) debug_print::$15 = debug_print::at_line#0+debug_print::$14 -Constant (const byte*) debug_print::$19 = debug_print::at_line#0+debug_print::$18 -Constant (const byte*) debug_print::$23 = debug_print::at_line#0+debug_print::$22 -Constant (const byte*) debug_print::$27 = debug_print::at_line#0+debug_print::$26 -Constant (const byte*) debug_print::$31 = debug_print::at_line#0+debug_print::$30 -Constant (const byte*) debug_print::$35 = debug_print::at_line#0+debug_print::$34 Successful SSA optimization Pass2ConstantIdentification -Culled Empty Block (label) debug_print::@4 -Culled Empty Block (label) debug_print::@14 -Successful SSA optimization Pass2CullEmptyBlocks Inlining constant with var siblings (const byte*) print_str_at::str#1 Inlining constant with var siblings (const byte*) print_str_at::str#2 Inlining constant with var siblings (const byte*) print_str_at::str#3 @@ -4411,10 +3353,10 @@ Inlining constant with var siblings (const byte*) print_str_at::at#12 Inlining constant with var siblings (const byte*) print_str_at::at#1 Inlining constant with var siblings (const byte*) print_str_at::at#2 Inlining constant with var siblings (const byte*) print_str_at::at#3 +Inlining constant with var siblings (const signed byte) print_sbyte_at::b#6 Inlining constant with var siblings (const byte*) print_sbyte_at::at#3 Inlining constant with var siblings (const byte*) print_sbyte_at::at#4 Inlining constant with var siblings (const byte*) print_sbyte_at::at#5 -Inlining constant with var siblings (const signed byte) print_sbyte_at::b#6 Inlining constant with var siblings (const byte*) print_sbyte_at::at#6 Inlining constant with var siblings (const byte*) print_sbyte_at::at#7 Inlining constant with var siblings (const byte*) print_sbyte_at::at#8 @@ -4450,8 +3392,8 @@ Constant inlined debug_print::$18 = (byte/signed byte/word/signed word/dword/sig Constant inlined debug_print::$19 = (const byte*) debug_print::at_line#0+(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 1 Constant inlined debug_print::$14 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined debug_print::print_sbyte_pos6_$1#0 = (const byte*) print_line_cursor#0 -Constant inlined debug_print::print_sbyte_pos3_$1#0 = (const byte*) print_line_cursor#0 Constant inlined debug_print::$15 = (const byte*) debug_print::at_line#0+(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined debug_print::print_sbyte_pos3_$1#0 = (const byte*) print_line_cursor#0 Constant inlined debug_print::$12 = (byte/signed byte/word/signed word/dword/signed dword) $13*(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined sprites_init::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined debug_print_init::$28 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $15 diff --git a/src/test/ref/examples/3d/perspective.log b/src/test/ref/examples/3d/perspective.log index 7c053b1e8..2675fad7d 100644 --- a/src/test/ref/examples/3d/perspective.log +++ b/src/test/ref/examples/3d/perspective.log @@ -1,6 +1,12 @@ Resolved forward reference mulf_sqr1 to (byte[$200]) mulf_sqr1 Resolved forward reference mulf_sqr2 to (byte[$200]) mulf_sqr2 Resolved forward reference PERSP_Z to (signed byte*) PERSP_Z +Identified constant variable (signed byte*) xr +Identified constant variable (signed byte*) yr +Identified constant variable (signed byte*) zr +Identified constant variable (word*) psp1 +Identified constant variable (word*) psp2 +Identified constant variable (signed byte*) PERSP_Z Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx CONTROL FLOW GRAPH SSA @@ -258,41 +264,23 @@ print_cls::@return: scope:[print_cls] from print_cls::@2 (word*) psp2#0 ← ((word*)) (byte/word/signed word/dword/signed dword) $f5 to:@26 main: scope:[main] from @27 - (signed byte*) PERSP_Z#12 ← phi( @27/(signed byte*) PERSP_Z#0 ) - (signed byte*) zr#12 ← phi( @27/(signed byte*) zr#13 ) - (signed byte*) yr#15 ← phi( @27/(signed byte*) yr#16 ) - (signed byte*) xr#13 ← phi( @27/(signed byte*) xr#14 ) (byte*) print_char_cursor#76 ← phi( @27/(byte*) print_char_cursor#73 ) (byte*) print_line_cursor#25 ← phi( @27/(byte*) print_line_cursor#24 ) (byte*) print_screen#5 ← phi( @27/(byte*) print_screen#6 ) - (word*) psp2#3 ← phi( @27/(word*) psp2#5 ) - (word*) psp1#3 ← phi( @27/(word*) psp1#5 ) asm { sei } call mulf_init to:main::@1 main::@1: scope:[main] from main - (signed byte*) PERSP_Z#11 ← phi( main/(signed byte*) PERSP_Z#12 ) - (signed byte*) zr#11 ← phi( main/(signed byte*) zr#12 ) - (signed byte*) yr#14 ← phi( main/(signed byte*) yr#15 ) - (signed byte*) xr#12 ← phi( main/(signed byte*) xr#13 ) (byte*) print_char_cursor#70 ← phi( main/(byte*) print_char_cursor#76 ) (byte*) print_line_cursor#22 ← phi( main/(byte*) print_line_cursor#25 ) (byte*) print_screen#4 ← phi( main/(byte*) print_screen#5 ) - (word*) psp2#1 ← phi( main/(word*) psp2#3 ) - (word*) psp1#1 ← phi( main/(word*) psp1#3 ) (word~) main::$1 ← ((word)) (byte[$200]) mulf_sqr1#0 - *((word*) psp1#1) ← (word~) main::$1 + *((word*) psp1#0) ← (word~) main::$1 (word~) main::$2 ← ((word)) (byte[$200]) mulf_sqr2#0 - *((word*) psp2#1) ← (word~) main::$2 + *((word*) psp2#0) ← (word~) main::$2 call print_cls to:main::@2 main::@2: scope:[main] from main::@1 - (word*) psp2#14 ← phi( main::@1/(word*) psp2#1 ) - (word*) psp1#14 ← phi( main::@1/(word*) psp1#1 ) - (signed byte*) PERSP_Z#10 ← phi( main::@1/(signed byte*) PERSP_Z#11 ) - (signed byte*) zr#10 ← phi( main::@1/(signed byte*) zr#11 ) - (signed byte*) yr#13 ← phi( main::@1/(signed byte*) yr#14 ) - (signed byte*) xr#11 ← phi( main::@1/(signed byte*) xr#12 ) (byte*) print_char_cursor#47 ← phi( main::@1/(byte*) print_char_cursor#15 ) (byte*) print_line_cursor#15 ← phi( main::@1/(byte*) print_line_cursor#4 ) (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#15 @@ -318,12 +306,6 @@ main::@return: scope:[main] from main::@3 to:@return do_perspective: scope:[do_perspective] from main::@2 (byte*) print_line_cursor#40 ← phi( main::@2/(byte*) print_line_cursor#5 ) - (word*) psp2#13 ← phi( main::@2/(word*) psp2#14 ) - (word*) psp1#13 ← phi( main::@2/(word*) psp1#14 ) - (signed byte*) PERSP_Z#9 ← phi( main::@2/(signed byte*) PERSP_Z#10 ) - (signed byte*) zr#9 ← phi( main::@2/(signed byte*) zr#10 ) - (signed byte*) yr#12 ← phi( main::@2/(signed byte*) yr#13 ) - (signed byte*) xr#10 ← phi( main::@2/(signed byte*) xr#11 ) (signed byte) do_perspective::z#8 ← phi( main::@2/(signed byte) do_perspective::z#0 ) (signed byte) do_perspective::y#7 ← phi( main::@2/(signed byte) do_perspective::y#0 ) (signed byte) do_perspective::x#3 ← phi( main::@2/(signed byte) do_perspective::x#0 ) @@ -333,12 +315,6 @@ do_perspective: scope:[do_perspective] from main::@2 to:do_perspective::@1 do_perspective::@1: scope:[do_perspective] from do_perspective (byte*) print_line_cursor#39 ← phi( do_perspective/(byte*) print_line_cursor#40 ) - (word*) psp2#12 ← phi( do_perspective/(word*) psp2#13 ) - (word*) psp1#12 ← phi( do_perspective/(word*) psp1#13 ) - (signed byte*) PERSP_Z#8 ← phi( do_perspective/(signed byte*) PERSP_Z#9 ) - (signed byte*) zr#8 ← phi( do_perspective/(signed byte*) zr#9 ) - (signed byte*) yr#11 ← phi( do_perspective/(signed byte*) yr#12 ) - (signed byte*) xr#9 ← phi( do_perspective/(signed byte*) xr#10 ) (signed byte) do_perspective::z#7 ← phi( do_perspective/(signed byte) do_perspective::z#8 ) (signed byte) do_perspective::y#5 ← phi( do_perspective/(signed byte) do_perspective::y#7 ) (signed byte) do_perspective::x#1 ← phi( do_perspective/(signed byte) do_perspective::x#3 ) @@ -349,12 +325,6 @@ do_perspective::@1: scope:[do_perspective] from do_perspective to:do_perspective::@2 do_perspective::@2: scope:[do_perspective] from do_perspective::@1 (byte*) print_line_cursor#38 ← phi( do_perspective::@1/(byte*) print_line_cursor#39 ) - (word*) psp2#11 ← phi( do_perspective::@1/(word*) psp2#12 ) - (word*) psp1#11 ← phi( do_perspective::@1/(word*) psp1#12 ) - (signed byte*) PERSP_Z#7 ← phi( do_perspective::@1/(signed byte*) PERSP_Z#8 ) - (signed byte*) zr#7 ← phi( do_perspective::@1/(signed byte*) zr#8 ) - (signed byte*) yr#10 ← phi( do_perspective::@1/(signed byte*) yr#11 ) - (signed byte*) xr#8 ← phi( do_perspective::@1/(signed byte*) xr#9 ) (signed byte) do_perspective::x#8 ← phi( do_perspective::@1/(signed byte) do_perspective::x#1 ) (signed byte) do_perspective::z#6 ← phi( do_perspective::@1/(signed byte) do_perspective::z#7 ) (signed byte) do_perspective::y#3 ← phi( do_perspective::@1/(signed byte) do_perspective::y#5 ) @@ -365,12 +335,6 @@ do_perspective::@2: scope:[do_perspective] from do_perspective::@1 to:do_perspective::@3 do_perspective::@3: scope:[do_perspective] from do_perspective::@2 (byte*) print_line_cursor#37 ← phi( do_perspective::@2/(byte*) print_line_cursor#38 ) - (word*) psp2#10 ← phi( do_perspective::@2/(word*) psp2#11 ) - (word*) psp1#10 ← phi( do_perspective::@2/(word*) psp1#11 ) - (signed byte*) PERSP_Z#6 ← phi( do_perspective::@2/(signed byte*) PERSP_Z#7 ) - (signed byte*) zr#6 ← phi( do_perspective::@2/(signed byte*) zr#7 ) - (signed byte*) yr#9 ← phi( do_perspective::@2/(signed byte*) yr#10 ) - (signed byte*) xr#7 ← phi( do_perspective::@2/(signed byte*) xr#8 ) (signed byte) do_perspective::x#7 ← phi( do_perspective::@2/(signed byte) do_perspective::x#8 ) (signed byte) do_perspective::z#5 ← phi( do_perspective::@2/(signed byte) do_perspective::z#6 ) (signed byte) do_perspective::y#1 ← phi( do_perspective::@2/(signed byte) do_perspective::y#3 ) @@ -381,12 +345,6 @@ do_perspective::@3: scope:[do_perspective] from do_perspective::@2 to:do_perspective::@4 do_perspective::@4: scope:[do_perspective] from do_perspective::@3 (byte*) print_line_cursor#36 ← phi( do_perspective::@3/(byte*) print_line_cursor#37 ) - (word*) psp2#9 ← phi( do_perspective::@3/(word*) psp2#10 ) - (word*) psp1#9 ← phi( do_perspective::@3/(word*) psp1#10 ) - (signed byte*) PERSP_Z#5 ← phi( do_perspective::@3/(signed byte*) PERSP_Z#6 ) - (signed byte*) zr#5 ← phi( do_perspective::@3/(signed byte*) zr#6 ) - (signed byte*) yr#8 ← phi( do_perspective::@3/(signed byte*) yr#9 ) - (signed byte*) xr#6 ← phi( do_perspective::@3/(signed byte*) xr#7 ) (signed byte) do_perspective::y#8 ← phi( do_perspective::@3/(signed byte) do_perspective::y#1 ) (signed byte) do_perspective::x#6 ← phi( do_perspective::@3/(signed byte) do_perspective::x#7 ) (signed byte) do_perspective::z#3 ← phi( do_perspective::@3/(signed byte) do_perspective::z#5 ) @@ -397,12 +355,6 @@ do_perspective::@4: scope:[do_perspective] from do_perspective::@3 to:do_perspective::@5 do_perspective::@5: scope:[do_perspective] from do_perspective::@4 (byte*) print_line_cursor#35 ← phi( do_perspective::@4/(byte*) print_line_cursor#36 ) - (word*) psp2#7 ← phi( do_perspective::@4/(word*) psp2#9 ) - (word*) psp1#7 ← phi( do_perspective::@4/(word*) psp1#9 ) - (signed byte*) PERSP_Z#4 ← phi( do_perspective::@4/(signed byte*) PERSP_Z#5 ) - (signed byte*) zr#4 ← phi( do_perspective::@4/(signed byte*) zr#5 ) - (signed byte*) yr#7 ← phi( do_perspective::@4/(signed byte*) yr#8 ) - (signed byte*) xr#5 ← phi( do_perspective::@4/(signed byte*) xr#6 ) (signed byte) do_perspective::y#6 ← phi( do_perspective::@4/(signed byte) do_perspective::y#8 ) (signed byte) do_perspective::x#5 ← phi( do_perspective::@4/(signed byte) do_perspective::x#6 ) (signed byte) do_perspective::z#1 ← phi( do_perspective::@4/(signed byte) do_perspective::z#3 ) @@ -413,12 +365,6 @@ do_perspective::@5: scope:[do_perspective] from do_perspective::@4 to:do_perspective::@6 do_perspective::@6: scope:[do_perspective] from do_perspective::@5 (byte*) print_line_cursor#34 ← phi( do_perspective::@5/(byte*) print_line_cursor#35 ) - (word*) psp2#6 ← phi( do_perspective::@5/(word*) psp2#7 ) - (word*) psp1#6 ← phi( do_perspective::@5/(word*) psp1#7 ) - (signed byte*) PERSP_Z#3 ← phi( do_perspective::@5/(signed byte*) PERSP_Z#4 ) - (signed byte*) zr#3 ← phi( do_perspective::@5/(signed byte*) zr#4 ) - (signed byte*) yr#5 ← phi( do_perspective::@5/(signed byte*) yr#7 ) - (signed byte*) xr#4 ← phi( do_perspective::@5/(signed byte*) xr#5 ) (signed byte) do_perspective::z#4 ← phi( do_perspective::@5/(signed byte) do_perspective::z#1 ) (signed byte) do_perspective::y#4 ← phi( do_perspective::@5/(signed byte) do_perspective::y#6 ) (signed byte) do_perspective::x#4 ← phi( do_perspective::@5/(signed byte) do_perspective::x#5 ) @@ -429,12 +375,6 @@ do_perspective::@6: scope:[do_perspective] from do_perspective::@5 to:do_perspective::@7 do_perspective::@7: scope:[do_perspective] from do_perspective::@6 (byte*) print_line_cursor#33 ← phi( do_perspective::@6/(byte*) print_line_cursor#34 ) - (word*) psp2#4 ← phi( do_perspective::@6/(word*) psp2#6 ) - (word*) psp1#4 ← phi( do_perspective::@6/(word*) psp1#6 ) - (signed byte*) PERSP_Z#2 ← phi( do_perspective::@6/(signed byte*) PERSP_Z#3 ) - (signed byte*) zr#2 ← phi( do_perspective::@6/(signed byte*) zr#3 ) - (signed byte*) yr#4 ← phi( do_perspective::@6/(signed byte*) yr#5 ) - (signed byte*) xr#3 ← phi( do_perspective::@6/(signed byte*) xr#4 ) (signed byte) do_perspective::z#2 ← phi( do_perspective::@6/(signed byte) do_perspective::z#4 ) (signed byte) do_perspective::y#2 ← phi( do_perspective::@6/(signed byte) do_perspective::y#4 ) (signed byte) do_perspective::x#2 ← phi( do_perspective::@6/(signed byte) do_perspective::x#4 ) @@ -447,16 +387,13 @@ do_perspective::@7: scope:[do_perspective] from do_perspective::@6 to:do_perspective::@8 do_perspective::@8: scope:[do_perspective] from do_perspective::@7 (byte*) print_line_cursor#32 ← phi( do_perspective::@7/(byte*) print_line_cursor#33 ) - (signed byte*) yr#6 ← phi( do_perspective::@7/(signed byte*) yr#4 ) (byte*) print_char_cursor#72 ← phi( do_perspective::@7/(byte*) print_char_cursor#25 ) - (signed byte*) xr#1 ← phi( do_perspective::@7/(signed byte*) xr#3 ) - (byte~) do_perspective::$8 ← ((byte)) *((signed byte*) xr#1) + (byte~) do_perspective::$8 ← ((byte)) *((signed byte*) xr#0) (byte) print_byte::b#1 ← (byte~) do_perspective::$8 call print_byte to:do_perspective::@9 do_perspective::@9: scope:[do_perspective] from do_perspective::@8 (byte*) print_line_cursor#31 ← phi( do_perspective::@8/(byte*) print_line_cursor#32 ) - (signed byte*) yr#3 ← phi( do_perspective::@8/(signed byte*) yr#6 ) (byte*) print_char_cursor#57 ← phi( do_perspective::@8/(byte*) print_char_cursor#11 ) (byte*) print_char_cursor#26 ← (byte*) print_char_cursor#57 (byte*) print_str::str#5 ← (const string) do_perspective::str4 @@ -464,10 +401,9 @@ do_perspective::@9: scope:[do_perspective] from do_perspective::@8 to:do_perspective::@10 do_perspective::@10: scope:[do_perspective] from do_perspective::@9 (byte*) print_line_cursor#28 ← phi( do_perspective::@9/(byte*) print_line_cursor#31 ) - (signed byte*) yr#1 ← phi( do_perspective::@9/(signed byte*) yr#3 ) (byte*) print_char_cursor#58 ← phi( do_perspective::@9/(byte*) print_char_cursor#2 ) (byte*) print_char_cursor#27 ← (byte*) print_char_cursor#58 - (byte~) do_perspective::$11 ← ((byte)) *((signed byte*) yr#1) + (byte~) do_perspective::$11 ← ((byte)) *((signed byte*) yr#0) (byte) print_byte::b#2 ← (byte~) do_perspective::$11 call print_byte to:do_perspective::@11 @@ -498,30 +434,19 @@ do_perspective::@return: scope:[do_perspective] from do_perspective::@13 return to:@return perspective: scope:[perspective] from do_perspective::@7 - (word*) psp2#2 ← phi( do_perspective::@7/(word*) psp2#4 ) - (word*) psp1#2 ← phi( do_perspective::@7/(word*) psp1#4 ) - (signed byte*) PERSP_Z#1 ← phi( do_perspective::@7/(signed byte*) PERSP_Z#2 ) - (signed byte*) zr#1 ← phi( do_perspective::@7/(signed byte*) zr#2 ) (signed byte) perspective::z#1 ← phi( do_perspective::@7/(signed byte) perspective::z#0 ) - (signed byte*) yr#2 ← phi( do_perspective::@7/(signed byte*) yr#4 ) (signed byte) perspective::y#1 ← phi( do_perspective::@7/(signed byte) perspective::y#0 ) - (signed byte*) xr#2 ← phi( do_perspective::@7/(signed byte*) xr#3 ) (signed byte) perspective::x#1 ← phi( do_perspective::@7/(signed byte) perspective::x#0 ) - *((signed byte*) xr#2) ← (signed byte) perspective::x#1 - *((signed byte*) yr#2) ← (signed byte) perspective::y#1 - *((signed byte*) zr#1) ← (signed byte) perspective::z#1 + *((signed byte*) xr#0) ← (signed byte) perspective::x#1 + *((signed byte*) yr#0) ← (signed byte) perspective::y#1 + *((signed byte*) zr#0) ← (signed byte) perspective::z#1 asm { ldazr staPP+1 PP: ldaPERSP_Z stapsp1 eor#$ff stapsp2 clc ldyyr lda(psp1),y sbc(psp2),y adc#$80 stayr clc ldyxr lda(psp1),y sbc(psp2),y adc#$80 staxr } to:perspective::@return perspective::@return: scope:[perspective] from perspective return to:@return @26: scope:[] from @23 - (signed byte*) zr#14 ← phi( @23/(signed byte*) zr#0 ) - (signed byte*) yr#17 ← phi( @23/(signed byte*) yr#0 ) - (signed byte*) xr#15 ← phi( @23/(signed byte*) xr#0 ) (byte*) print_screen#7 ← phi( @23/(byte*) print_screen#8 ) - (word*) psp2#8 ← phi( @23/(word*) psp2#0 ) - (word*) psp1#8 ← phi( @23/(word*) psp1#0 ) (byte*) print_char_cursor#77 ← phi( @23/(byte*) print_char_cursor#78 ) (byte*) print_line_cursor#27 ← phi( @23/(byte*) print_line_cursor#29 ) (byte[$200]) mulf_sqr1#0 ← { fill( $200, 0) } @@ -566,12 +491,7 @@ mulf_init::@return: scope:[mulf_init] from mulf_init::@1 return to:@return @27: scope:[] from @26 - (signed byte*) zr#13 ← phi( @26/(signed byte*) zr#14 ) - (signed byte*) yr#16 ← phi( @26/(signed byte*) yr#17 ) - (signed byte*) xr#14 ← phi( @26/(signed byte*) xr#15 ) (byte*) print_screen#6 ← phi( @26/(byte*) print_screen#7 ) - (word*) psp2#5 ← phi( @26/(word*) psp2#8 ) - (word*) psp1#5 ← phi( @26/(word*) psp1#8 ) (byte*) print_char_cursor#73 ← phi( @26/(byte*) print_char_cursor#77 ) (byte*) print_line_cursor#24 ← phi( @26/(byte*) print_line_cursor#27 ) (signed byte*) PERSP_Z#0 ← ((signed byte*)) (word/signed word/dword/signed dword) $2400 @@ -695,18 +615,6 @@ SYMBOL TABLE SSA (byte) ORANGE#0 (signed byte*) PERSP_Z (signed byte*) PERSP_Z#0 -(signed byte*) PERSP_Z#1 -(signed byte*) PERSP_Z#10 -(signed byte*) PERSP_Z#11 -(signed byte*) PERSP_Z#12 -(signed byte*) PERSP_Z#2 -(signed byte*) PERSP_Z#3 -(signed byte*) PERSP_Z#4 -(signed byte*) PERSP_Z#5 -(signed byte*) PERSP_Z#6 -(signed byte*) PERSP_Z#7 -(signed byte*) PERSP_Z#8 -(signed byte*) PERSP_Z#9 (byte) PINK (byte) PINK#0 (byte*) PROCPORT @@ -1096,88 +1004,14 @@ SYMBOL TABLE SSA (byte*) print_str::str#9 (word*) psp1 (word*) psp1#0 -(word*) psp1#1 -(word*) psp1#10 -(word*) psp1#11 -(word*) psp1#12 -(word*) psp1#13 -(word*) psp1#14 -(word*) psp1#2 -(word*) psp1#3 -(word*) psp1#4 -(word*) psp1#5 -(word*) psp1#6 -(word*) psp1#7 -(word*) psp1#8 -(word*) psp1#9 (word*) psp2 (word*) psp2#0 -(word*) psp2#1 -(word*) psp2#10 -(word*) psp2#11 -(word*) psp2#12 -(word*) psp2#13 -(word*) psp2#14 -(word*) psp2#2 -(word*) psp2#3 -(word*) psp2#4 -(word*) psp2#5 -(word*) psp2#6 -(word*) psp2#7 -(word*) psp2#8 -(word*) psp2#9 (signed byte*) xr (signed byte*) xr#0 -(signed byte*) xr#1 -(signed byte*) xr#10 -(signed byte*) xr#11 -(signed byte*) xr#12 -(signed byte*) xr#13 -(signed byte*) xr#14 -(signed byte*) xr#15 -(signed byte*) xr#2 -(signed byte*) xr#3 -(signed byte*) xr#4 -(signed byte*) xr#5 -(signed byte*) xr#6 -(signed byte*) xr#7 -(signed byte*) xr#8 -(signed byte*) xr#9 (signed byte*) yr (signed byte*) yr#0 -(signed byte*) yr#1 -(signed byte*) yr#10 -(signed byte*) yr#11 -(signed byte*) yr#12 -(signed byte*) yr#13 -(signed byte*) yr#14 -(signed byte*) yr#15 -(signed byte*) yr#16 -(signed byte*) yr#17 -(signed byte*) yr#2 -(signed byte*) yr#3 -(signed byte*) yr#4 -(signed byte*) yr#5 -(signed byte*) yr#6 -(signed byte*) yr#7 -(signed byte*) yr#8 -(signed byte*) yr#9 (signed byte*) zr (signed byte*) zr#0 -(signed byte*) zr#1 -(signed byte*) zr#10 -(signed byte*) zr#11 -(signed byte*) zr#12 -(signed byte*) zr#13 -(signed byte*) zr#14 -(signed byte*) zr#2 -(signed byte*) zr#3 -(signed byte*) zr#4 -(signed byte*) zr#5 -(signed byte*) zr#6 -(signed byte*) zr#7 -(signed byte*) zr#8 -(signed byte*) zr#9 Alias (byte*) print_line_cursor#0 = (byte*) print_screen#0 (byte*) print_char_cursor#0 (byte*) print_line_cursor#30 (byte*) print_char_cursor#79 (byte*) print_screen#9 (byte*) print_line_cursor#29 (byte*) print_char_cursor#78 (byte*) print_screen#8 (byte*) print_line_cursor#27 (byte*) print_char_cursor#77 (byte*) print_screen#7 (byte*) print_line_cursor#24 (byte*) print_char_cursor#73 (byte*) print_screen#6 Alias (byte*) print_str::str#7 = (byte*) print_str::str#8 @@ -1195,15 +1029,9 @@ Alias (byte*) print_char_cursor#41 = (byte*) print_char_cursor#9 Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#42 (byte*) print_char_cursor#43 (byte*) print_char_cursor#11 Alias (byte*) print_char_cursor#12 = (byte*) print_char_cursor#45 (byte*) print_char_cursor#13 Alias (byte*) print_line_cursor#14 = (byte*) print_screen#3 (byte*) print_screen#2 (byte*) print_line_cursor#3 (byte*) print_char_cursor#14 (byte*) print_char_cursor#46 (byte*) print_line_cursor#4 (byte*) print_char_cursor#15 -Alias (word*) psp1#1 = (word*) psp1#3 (word*) psp1#14 -Alias (word*) psp2#1 = (word*) psp2#3 (word*) psp2#14 Alias (byte*) print_screen#4 = (byte*) print_screen#5 Alias (byte*) print_line_cursor#22 = (byte*) print_line_cursor#25 Alias (byte*) print_char_cursor#70 = (byte*) print_char_cursor#76 -Alias (signed byte*) xr#11 = (signed byte*) xr#12 (signed byte*) xr#13 -Alias (signed byte*) yr#13 = (signed byte*) yr#14 (signed byte*) yr#15 -Alias (signed byte*) zr#10 = (signed byte*) zr#11 (signed byte*) zr#12 -Alias (signed byte*) PERSP_Z#10 = (signed byte*) PERSP_Z#11 (signed byte*) PERSP_Z#12 Alias (byte*) print_line_cursor#15 = (byte*) print_line_cursor#5 Alias (byte*) print_char_cursor#16 = (byte*) print_char_cursor#47 Alias (signed byte) do_perspective::y#0 = (signed byte/signed word/signed dword~) main::$4 @@ -1212,12 +1040,6 @@ Alias (byte*) print_line_cursor#16 = (byte*) print_line_cursor#6 (byte*) print_l Alias (signed byte) do_perspective::x#1 = (signed byte) do_perspective::x#3 (signed byte) do_perspective::x#8 (signed byte) do_perspective::x#7 (signed byte) do_perspective::x#6 (signed byte) do_perspective::x#5 (signed byte) do_perspective::x#4 (signed byte) do_perspective::x#2 Alias (signed byte) do_perspective::y#1 = (signed byte) do_perspective::y#5 (signed byte) do_perspective::y#7 (signed byte) do_perspective::y#3 (signed byte) do_perspective::y#8 (signed byte) do_perspective::y#6 (signed byte) do_perspective::y#4 (signed byte) do_perspective::y#2 Alias (signed byte) do_perspective::z#1 = (signed byte) do_perspective::z#7 (signed byte) do_perspective::z#8 (signed byte) do_perspective::z#6 (signed byte) do_perspective::z#5 (signed byte) do_perspective::z#3 (signed byte) do_perspective::z#4 (signed byte) do_perspective::z#2 -Alias (signed byte*) xr#1 = (signed byte*) xr#9 (signed byte*) xr#10 (signed byte*) xr#8 (signed byte*) xr#7 (signed byte*) xr#6 (signed byte*) xr#5 (signed byte*) xr#4 (signed byte*) xr#3 -Alias (signed byte*) yr#1 = (signed byte*) yr#11 (signed byte*) yr#12 (signed byte*) yr#10 (signed byte*) yr#9 (signed byte*) yr#8 (signed byte*) yr#7 (signed byte*) yr#5 (signed byte*) yr#4 (signed byte*) yr#6 (signed byte*) yr#3 -Alias (signed byte*) zr#2 = (signed byte*) zr#8 (signed byte*) zr#9 (signed byte*) zr#7 (signed byte*) zr#6 (signed byte*) zr#5 (signed byte*) zr#4 (signed byte*) zr#3 -Alias (signed byte*) PERSP_Z#2 = (signed byte*) PERSP_Z#8 (signed byte*) PERSP_Z#9 (signed byte*) PERSP_Z#7 (signed byte*) PERSP_Z#6 (signed byte*) PERSP_Z#5 (signed byte*) PERSP_Z#4 (signed byte*) PERSP_Z#3 -Alias (word*) psp1#10 = (word*) psp1#12 (word*) psp1#13 (word*) psp1#11 (word*) psp1#9 (word*) psp1#7 (word*) psp1#6 (word*) psp1#4 -Alias (word*) psp2#10 = (word*) psp2#12 (word*) psp2#13 (word*) psp2#11 (word*) psp2#9 (word*) psp2#7 (word*) psp2#6 (word*) psp2#4 Alias (byte*) print_line_cursor#23 = (byte*) print_line_cursor#39 (byte*) print_line_cursor#40 (byte*) print_line_cursor#38 (byte*) print_line_cursor#37 (byte*) print_line_cursor#36 (byte*) print_line_cursor#35 (byte*) print_line_cursor#34 (byte*) print_line_cursor#33 (byte*) print_line_cursor#32 (byte*) print_line_cursor#31 (byte*) print_line_cursor#28 (byte*) print_line_cursor#26 Alias (byte*) print_char_cursor#19 = (byte*) print_char_cursor#50 Alias (byte*) print_char_cursor#20 = (byte*) print_char_cursor#51 @@ -1234,11 +1056,6 @@ Alias (byte*) print_char_cursor#28 = (byte*) print_char_cursor#59 Alias (byte*) print_char_cursor#29 = (byte*) print_char_cursor#60 Alias (byte*) print_line_cursor#18 = (byte*) print_line_cursor#8 (byte*) print_line_cursor#19 (byte*) print_line_cursor#9 Alias (byte*) print_char_cursor#30 = (byte*) print_char_cursor#61 (byte*) print_char_cursor#62 (byte*) print_char_cursor#31 -Alias (word*) psp1#0 = (word*) psp1#8 (word*) psp1#5 -Alias (word*) psp2#0 = (word*) psp2#8 (word*) psp2#5 -Alias (signed byte*) xr#0 = (signed byte*) xr#15 (signed byte*) xr#14 -Alias (signed byte*) yr#0 = (signed byte*) yr#17 (signed byte*) yr#16 -Alias (signed byte*) zr#0 = (signed byte*) zr#14 (signed byte*) zr#13 Alias (byte) mulf_init::val#0 = (byte~) mulf_init::$0 Alias (byte*) print_line_cursor#10 = (byte*) print_line_cursor#20 Alias (byte*) print_char_cursor#32 = (byte*) print_char_cursor#63 @@ -1256,15 +1073,9 @@ Redundant Phi (byte*) print_char_cursor#41 (byte*) print_char_cursor#12 Redundant Phi (byte*) print_char_cursor#10 (byte*) print_char_cursor#12 Redundant Phi (byte*) print_screen#1 (byte*) print_screen#4 Redundant Phi (byte*) print_line_cursor#14 (byte*) print_screen#1 -Redundant Phi (word*) psp1#1 (word*) psp1#0 -Redundant Phi (word*) psp2#1 (word*) psp2#0 Redundant Phi (byte*) print_screen#4 (byte*) print_line_cursor#0 Redundant Phi (byte*) print_line_cursor#22 (byte*) print_line_cursor#0 Redundant Phi (byte*) print_char_cursor#70 (byte*) print_line_cursor#0 -Redundant Phi (signed byte*) xr#11 (signed byte*) xr#0 -Redundant Phi (signed byte*) yr#13 (signed byte*) yr#0 -Redundant Phi (signed byte*) zr#10 (signed byte*) zr#0 -Redundant Phi (signed byte*) PERSP_Z#10 (signed byte*) PERSP_Z#0 Redundant Phi (byte*) print_line_cursor#15 (byte*) print_line_cursor#14 Redundant Phi (byte*) print_char_cursor#16 (byte*) print_line_cursor#14 Redundant Phi (byte*) print_char_cursor#17 (byte*) print_char_cursor#30 @@ -1273,12 +1084,6 @@ Redundant Phi (byte*) print_char_cursor#71 (byte*) print_char_cursor#16 Redundant Phi (signed byte) do_perspective::x#1 (signed byte) do_perspective::x#0 Redundant Phi (signed byte) do_perspective::y#1 (signed byte) do_perspective::y#0 Redundant Phi (signed byte) do_perspective::z#1 (signed byte) do_perspective::z#0 -Redundant Phi (signed byte*) xr#1 (signed byte*) xr#11 -Redundant Phi (signed byte*) yr#1 (signed byte*) yr#13 -Redundant Phi (signed byte*) zr#2 (signed byte*) zr#10 -Redundant Phi (signed byte*) PERSP_Z#2 (signed byte*) PERSP_Z#10 -Redundant Phi (word*) psp1#10 (word*) psp1#1 -Redundant Phi (word*) psp2#10 (word*) psp2#1 Redundant Phi (byte*) print_line_cursor#23 (byte*) print_line_cursor#15 Redundant Phi (byte*) print_char_cursor#19 (byte*) print_char_cursor#2 Redundant Phi (byte*) print_char_cursor#20 (byte*) print_char_cursor#39 @@ -1294,14 +1099,8 @@ Redundant Phi (byte*) print_char_cursor#29 (byte*) print_char_cursor#2 Redundant Phi (byte*) print_line_cursor#18 (byte*) print_line_cursor#1 Redundant Phi (byte*) print_char_cursor#30 (byte*) print_line_cursor#1 Redundant Phi (signed byte) perspective::x#1 (signed byte) perspective::x#0 -Redundant Phi (signed byte*) xr#2 (signed byte*) xr#1 Redundant Phi (signed byte) perspective::y#1 (signed byte) perspective::y#0 -Redundant Phi (signed byte*) yr#2 (signed byte*) yr#1 Redundant Phi (signed byte) perspective::z#1 (signed byte) perspective::z#0 -Redundant Phi (signed byte*) zr#1 (signed byte*) zr#2 -Redundant Phi (signed byte*) PERSP_Z#1 (signed byte*) PERSP_Z#2 -Redundant Phi (word*) psp1#2 (word*) psp1#10 -Redundant Phi (word*) psp2#2 (word*) psp2#10 Redundant Phi (byte*) print_line_cursor#10 (byte*) print_line_cursor#16 Redundant Phi (byte*) print_char_cursor#32 (byte*) print_char_cursor#17 Successful SSA optimization Pass2RedundantPhiElimination diff --git a/src/test/ref/examples/bresenham/bitmap-bresenham.log b/src/test/ref/examples/bresenham/bitmap-bresenham.log index 3242a3467..04a8a7c0d 100644 --- a/src/test/ref/examples/bresenham/bitmap-bresenham.log +++ b/src/test/ref/examples/bresenham/bitmap-bresenham.log @@ -1,3 +1,4 @@ +Identified constant variable (byte) lines_cnt Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx CONTROL FLOW GRAPH SSA @@ -642,7 +643,6 @@ bitmap_line_ydxd::@return: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@2 (byte) lines_cnt#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8 to:@15 main: scope:[main] from @15 - (byte) lines_cnt#9 ← phi( @15/(byte) lines_cnt#10 ) *((byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 *((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte~) main::$0 ← (byte) VIC_BMM#0 | (byte) VIC_DEN#0 @@ -662,33 +662,26 @@ main: scope:[main] from @15 call bitmap_init to:main::@3 main::@3: scope:[main] from main - (byte) lines_cnt#8 ← phi( main/(byte) lines_cnt#9 ) call bitmap_clear to:main::@4 main::@4: scope:[main] from main::@3 - (byte) lines_cnt#7 ← phi( main::@3/(byte) lines_cnt#8 ) call init_screen to:main::@5 main::@5: scope:[main] from main::@4 - (byte) lines_cnt#5 ← phi( main::@4/(byte) lines_cnt#7 ) to:main::@1 main::@1: scope:[main] from main::@5 main::@6 - (byte) lines_cnt#4 ← phi( main::@5/(byte) lines_cnt#5 main::@6/(byte) lines_cnt#6 ) call lines to:main::@6 main::@6: scope:[main] from main::@1 - (byte) lines_cnt#6 ← phi( main::@1/(byte) lines_cnt#4 ) if(true) goto main::@1 to:main::@return main::@return: scope:[main] from main::@6 return to:@return lines: scope:[lines] from main::@1 - (byte) lines_cnt#3 ← phi( main::@1/(byte) lines_cnt#4 ) (byte) lines::l#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:lines::@1 lines::@1: scope:[lines] from lines lines::@3 - (byte) lines_cnt#2 ← phi( lines/(byte) lines_cnt#3 lines::@3/(byte) lines_cnt#1 ) (byte) lines::l#2 ← phi( lines/(byte) lines::l#0 lines::@3/(byte) lines::l#1 ) (byte/signed word/word/dword/signed dword~) lines::$0 ← (byte) lines::l#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 (byte/signed word/word/dword/signed dword~) lines::$1 ← (byte) lines::l#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 @@ -699,10 +692,9 @@ lines::@1: scope:[lines] from lines lines::@3 call bitmap_line to:lines::@3 lines::@3: scope:[lines] from lines::@1 - (byte) lines_cnt#1 ← phi( lines::@1/(byte) lines_cnt#2 ) (byte) lines::l#3 ← phi( lines::@1/(byte) lines::l#2 ) (byte) lines::l#1 ← ++ (byte) lines::l#3 - (bool~) lines::$3 ← (byte) lines::l#1 < (byte) lines_cnt#1 + (bool~) lines::$3 ← (byte) lines::l#1 < (byte) lines_cnt#0 if((bool~) lines::$3) goto lines::@1 to:lines::@return lines::@return: scope:[lines] from lines::@3 @@ -723,7 +715,6 @@ init_screen::@return: scope:[init_screen] from init_screen::@1 return to:@return @15: scope:[] from @12 - (byte) lines_cnt#10 ← phi( @12/(byte) lines_cnt#0 ) call main to:@16 @16: scope:[] from @15 @@ -1413,16 +1404,6 @@ SYMBOL TABLE SSA (byte) lines::l#3 (byte) lines_cnt (byte) lines_cnt#0 -(byte) lines_cnt#1 -(byte) lines_cnt#10 -(byte) lines_cnt#2 -(byte) lines_cnt#3 -(byte) lines_cnt#4 -(byte) lines_cnt#5 -(byte) lines_cnt#6 -(byte) lines_cnt#7 -(byte) lines_cnt#8 -(byte) lines_cnt#9 (byte[]) lines_x (byte[]) lines_x#0 (byte[]) lines_y @@ -1454,6 +1435,7 @@ Culled Empty Block (label) bitmap_line::@33 Culled Empty Block (label) bitmap_line::@34 Culled Empty Block (label) bitmap_line::@35 Culled Empty Block (label) bitmap_line::@36 +Culled Empty Block (label) main::@5 Culled Empty Block (label) @16 Successful SSA optimization Pass2CullEmptyBlocks Inversing boolean not [96] (bool~) bitmap_init::$4 ← (byte) bitmap_init::bits#1 != (byte/signed byte/word/signed word/dword/signed dword) 0 from [95] (bool~) bitmap_init::$3 ← (byte) bitmap_init::bits#1 == (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -1522,11 +1504,7 @@ Alias (byte) bitmap_line_ydxd::x#3 = (byte) bitmap_line_ydxd::x#7 (byte) bitmap_ Alias (byte) bitmap_line_ydxd::e#1 = (byte~) bitmap_line_ydxd::$2 (byte) bitmap_line_ydxd::e#4 Alias (byte) bitmap_line_ydxd::y#3 = (byte) bitmap_line_ydxd::y#8 Alias (byte) bitmap_line_ydxd::e#2 = (byte~) bitmap_line_ydxd::$5 -Alias (byte) lines_cnt#5 = (byte) lines_cnt#8 (byte) lines_cnt#9 (byte) lines_cnt#7 -Alias (byte) lines_cnt#4 = (byte) lines_cnt#6 Alias (byte) lines::l#2 = (byte) lines::l#3 -Alias (byte) lines_cnt#1 = (byte) lines_cnt#2 -Alias (byte) lines_cnt#0 = (byte) lines_cnt#10 Successful SSA optimization Pass2AliasElimination Alias (byte) bitmap_init::x#2 = (byte) bitmap_init::x#3 Alias (byte*) bitmap_init::bitmap#1 = (byte*) bitmap_init::bitmap#3 @@ -1562,8 +1540,6 @@ Self Phi Eliminated (byte) bitmap_line_ydxi::y1#2 Self Phi Eliminated (byte) bitmap_line_ydxd::xd#3 Self Phi Eliminated (byte) bitmap_line_ydxd::yd#2 Self Phi Eliminated (byte) bitmap_line_ydxd::y1#2 -Self Phi Eliminated (byte) lines_cnt#4 -Self Phi Eliminated (byte) lines_cnt#1 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (byte*) bitmap_init::bitmap#2 (byte*) bitmap_init::bitmap#0 Redundant Phi (byte*) bitmap_init::bitmap#1 (byte*) bitmap_init::bitmap#2 @@ -1584,10 +1560,6 @@ Redundant Phi (byte) bitmap_line_ydxi::y1#2 (byte) bitmap_line_ydxi::y1#6 Redundant Phi (byte) bitmap_line_ydxd::xd#3 (byte) bitmap_line_ydxd::xd#2 Redundant Phi (byte) bitmap_line_ydxd::yd#2 (byte) bitmap_line_ydxd::yd#5 Redundant Phi (byte) bitmap_line_ydxd::y1#2 (byte) bitmap_line_ydxd::y1#6 -Redundant Phi (byte) lines_cnt#5 (byte) lines_cnt#0 -Redundant Phi (byte) lines_cnt#4 (byte) lines_cnt#5 -Redundant Phi (byte) lines_cnt#3 (byte) lines_cnt#4 -Redundant Phi (byte) lines_cnt#1 (byte) lines_cnt#3 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) bitmap_init::$4 [97] if((byte) bitmap_init::bits#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto bitmap_init::@2 Simple Condition (bool~) bitmap_init::$5 [101] if((byte) bitmap_init::x#1!=rangelast(0,$ff)) goto bitmap_init::@1 @@ -1610,8 +1582,8 @@ Simple Condition (bool~) bitmap_line_ydxi::$4 [301] if((byte) bitmap_line_ydxi:: Simple Condition (bool~) bitmap_line_ydxi::$7 [305] if((byte) bitmap_line_ydxi::y#2!=(byte/signed word/word/dword/signed dword~) bitmap_line_ydxi::$6) goto bitmap_line_ydxi::@1 Simple Condition (bool~) bitmap_line_ydxd::$4 [325] if((byte) bitmap_line_ydxd::yd#5>=(byte) bitmap_line_ydxd::e#1) goto bitmap_line_ydxd::@2 Simple Condition (bool~) bitmap_line_ydxd::$7 [329] if((byte) bitmap_line_ydxd::y#3!=(byte/signed word/word/dword/signed dword~) bitmap_line_ydxd::$6) goto bitmap_line_ydxd::@1 -Simple Condition (bool~) lines::$3 [381] if((byte) lines::l#1<(byte) lines_cnt#0) goto lines::@1 -Simple Condition (bool~) init_screen::$1 [389] if((byte*) init_screen::c#1!=(byte*~) init_screen::$0) goto init_screen::@1 +Simple Condition (bool~) lines::$3 [374] if((byte) lines::l#1<(byte) lines_cnt#0) goto lines::@1 +Simple Condition (bool~) init_screen::$1 [382] if((byte*) init_screen::c#1!=(byte*~) init_screen::$0) goto init_screen::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) PROCPORT_DDR#0 = ((byte*))0 Constant (const byte) PROCPORT_DDR_MEMORY_MASK#0 = 7 @@ -1764,7 +1736,6 @@ Resolved ranged comparison value if(bitmap_clear::y#1!=rangelast(0,$27)) goto bi Culled Empty Block (label) @4 Culled Empty Block (label) bitmap_init::@6 Culled Empty Block (label) @12 -Culled Empty Block (label) main::@5 Culled Empty Block (label) main::@6 Successful SSA optimization Pass2CullEmptyBlocks Alias (word) bitmap_plot::plotter_x#0 = (word~) bitmap_plot::$2 diff --git a/src/test/ref/examples/chargen/chargen-analysis.log b/src/test/ref/examples/chargen/chargen-analysis.log index a97327117..e40a2c40b 100644 --- a/src/test/ref/examples/chargen/chargen-analysis.log +++ b/src/test/ref/examples/chargen/chargen-analysis.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) SCREEN Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx CONTROL FLOW GRAPH SSA @@ -257,55 +258,47 @@ keyboard_get_keycode::@return: scope:[keyboard_get_keycode] from keyboard_get_k (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@19 main: scope:[main] from @19 - (byte*) SCREEN#1 ← phi( @19/(byte*) SCREEN#8 ) - (byte*) main::sc#0 ← (byte*) SCREEN#1 + (byte*) main::sc#0 ← (byte*) SCREEN#0 to:main::@1 main::@1: scope:[main] from main main::@1 - (byte*) SCREEN#2 ← phi( main/(byte*) SCREEN#1 main::@1/(byte*) SCREEN#2 ) (byte*) main::sc#2 ← phi( main/(byte*) main::sc#0 main::@1/(byte*) main::sc#1 ) *((byte*) main::sc#2) ← (byte) ' ' (byte*) main::sc#1 ← ++ (byte*) main::sc#2 - (byte*~) main::$0 ← (byte*) SCREEN#2 + (word/signed word/dword/signed dword) $3e8 + (byte*~) main::$0 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) $3e8 (bool~) main::$1 ← (byte*) main::sc#1 < (byte*~) main::$0 if((bool~) main::$1) goto main::@1 to:main::@13 main::@13: scope:[main] from main::@1 - (byte*) SCREEN#3 ← phi( main::@1/(byte*) SCREEN#2 ) - (byte*~) main::$2 ← (byte*) SCREEN#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte*~) main::$2 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1 (byte*) print_str_at::str#0 ← (const string) main::str (byte*) print_str_at::at#0 ← (byte*~) main::$2 call print_str_at to:main::@25 main::@25: scope:[main] from main::@13 - (byte*) SCREEN#4 ← phi( main::@13/(byte*) SCREEN#3 ) - (byte*~) main::$4 ← (byte*) SCREEN#4 + (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte*~) main::$4 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1 (byte*~) main::$5 ← (byte*~) main::$4 + (byte/signed byte/word/signed word/dword/signed dword) $a (byte*) print_str_at::str#1 ← (const string) main::str1 (byte*) print_str_at::at#1 ← (byte*~) main::$5 call print_str_at to:main::@26 main::@26: scope:[main] from main::@25 - (byte*) SCREEN#5 ← phi( main::@25/(byte*) SCREEN#4 ) - (byte*~) main::$7 ← (byte*) SCREEN#5 + (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte*~) main::$7 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1 (byte*~) main::$8 ← (byte*~) main::$7 + (byte/signed byte/word/signed word/dword/signed dword) $14 (byte*) print_str_at::str#2 ← (const string) main::str2 (byte*) print_str_at::at#2 ← (byte*~) main::$8 call print_str_at to:main::@27 main::@27: scope:[main] from main::@26 - (byte*) SCREEN#6 ← phi( main::@26/(byte*) SCREEN#5 ) - (byte*~) main::$10 ← (byte*) SCREEN#6 + (byte/signed byte/word/signed word/dword/signed dword) 1 + (byte*~) main::$10 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1 (byte*~) main::$11 ← (byte*~) main::$10 + (byte/signed byte/word/signed word/dword/signed dword) $1e (byte*) print_str_at::str#3 ← (const string) main::str3 (byte*) print_str_at::at#3 ← (byte*~) main::$11 call print_str_at to:main::@28 main::@28: scope:[main] from main::@27 - (byte*) SCREEN#13 ← phi( main::@27/(byte*) SCREEN#6 ) (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@2 main::@2: scope:[main] from main::@28 main::@29 - (byte*) SCREEN#11 ← phi( main::@28/(byte*) SCREEN#13 main::@29/(byte*) SCREEN#14 ) (byte) main::i#2 ← phi( main::@28/(byte) main::i#0 main::@29/(byte) main::i#1 ) (byte) plot_chargen::pos#0 ← (byte) main::i#2 (byte) plot_chargen::ch#0 ← (byte/signed byte/word/signed word/dword/signed dword) $20 @@ -313,26 +306,22 @@ main::@2: scope:[main] from main::@28 main::@29 call plot_chargen to:main::@29 main::@29: scope:[main] from main::@2 - (byte*) SCREEN#14 ← phi( main::@2/(byte*) SCREEN#11 ) (byte) main::i#3 ← phi( main::@2/(byte) main::i#2 ) (byte) main::i#1 ← (byte) main::i#3 + rangenext(0,3) (bool~) main::$14 ← (byte) main::i#1 != rangelast(0,3) if((bool~) main::$14) goto main::@2 to:main::@14 main::@14: scope:[main] from main::@29 - (byte*) SCREEN#39 ← phi( main::@29/(byte*) SCREEN#14 ) (byte) main::cur_pos#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::shift#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@3 main::@3: scope:[main] from main::@14 main::@23 - (byte*) SCREEN#38 ← phi( main::@14/(byte*) SCREEN#39 main::@23/(byte*) SCREEN#40 ) (byte) main::cur_pos#25 ← phi( main::@14/(byte) main::cur_pos#0 main::@23/(byte) main::cur_pos#26 ) (byte) keyboard_key_pressed::key#0 ← (byte) KEY_F1#0 call keyboard_key_pressed (byte) keyboard_key_pressed::return#2 ← (byte) keyboard_key_pressed::return#1 to:main::@30 main::@30: scope:[main] from main::@3 - (byte*) SCREEN#37 ← phi( main::@3/(byte*) SCREEN#38 ) (byte) main::cur_pos#24 ← phi( main::@3/(byte) main::cur_pos#25 ) (byte) keyboard_key_pressed::return#9 ← phi( main::@3/(byte) keyboard_key_pressed::return#2 ) (byte~) main::$15 ← (byte) keyboard_key_pressed::return#9 @@ -341,14 +330,12 @@ main::@30: scope:[main] from main::@3 if((bool~) main::$17) goto main::@4 to:main::@15 main::@4: scope:[main] from main::@15 main::@30 - (byte*) SCREEN#35 ← phi( main::@15/(byte*) SCREEN#36 main::@30/(byte*) SCREEN#37 ) (byte) main::cur_pos#23 ← phi( main::@15/(byte) main::cur_pos#1 main::@30/(byte) main::cur_pos#24 ) (byte) keyboard_key_pressed::key#1 ← (byte) KEY_F3#0 call keyboard_key_pressed (byte) keyboard_key_pressed::return#3 ← (byte) keyboard_key_pressed::return#1 to:main::@31 main::@31: scope:[main] from main::@4 - (byte*) SCREEN#34 ← phi( main::@4/(byte*) SCREEN#35 ) (byte) main::cur_pos#22 ← phi( main::@4/(byte) main::cur_pos#23 ) (byte) keyboard_key_pressed::return#10 ← phi( main::@4/(byte) keyboard_key_pressed::return#3 ) (byte~) main::$18 ← (byte) keyboard_key_pressed::return#10 @@ -357,18 +344,15 @@ main::@31: scope:[main] from main::@4 if((bool~) main::$20) goto main::@5 to:main::@16 main::@15: scope:[main] from main::@30 - (byte*) SCREEN#36 ← phi( main::@30/(byte*) SCREEN#37 ) (byte) main::cur_pos#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@4 main::@5: scope:[main] from main::@16 main::@31 - (byte*) SCREEN#32 ← phi( main::@16/(byte*) SCREEN#33 main::@31/(byte*) SCREEN#34 ) (byte) main::cur_pos#21 ← phi( main::@16/(byte) main::cur_pos#2 main::@31/(byte) main::cur_pos#22 ) (byte) keyboard_key_pressed::key#2 ← (byte) KEY_F5#0 call keyboard_key_pressed (byte) keyboard_key_pressed::return#4 ← (byte) keyboard_key_pressed::return#1 to:main::@32 main::@32: scope:[main] from main::@5 - (byte*) SCREEN#31 ← phi( main::@5/(byte*) SCREEN#32 ) (byte) main::cur_pos#20 ← phi( main::@5/(byte) main::cur_pos#21 ) (byte) keyboard_key_pressed::return#11 ← phi( main::@5/(byte) keyboard_key_pressed::return#4 ) (byte~) main::$21 ← (byte) keyboard_key_pressed::return#11 @@ -377,18 +361,15 @@ main::@32: scope:[main] from main::@5 if((bool~) main::$23) goto main::@6 to:main::@17 main::@16: scope:[main] from main::@31 - (byte*) SCREEN#33 ← phi( main::@31/(byte*) SCREEN#34 ) (byte) main::cur_pos#2 ← (byte/signed byte/word/signed word/dword/signed dword) 1 to:main::@5 main::@6: scope:[main] from main::@17 main::@32 - (byte*) SCREEN#29 ← phi( main::@17/(byte*) SCREEN#30 main::@32/(byte*) SCREEN#31 ) (byte) main::cur_pos#19 ← phi( main::@17/(byte) main::cur_pos#3 main::@32/(byte) main::cur_pos#20 ) (byte) keyboard_key_pressed::key#3 ← (byte) KEY_F7#0 call keyboard_key_pressed (byte) keyboard_key_pressed::return#5 ← (byte) keyboard_key_pressed::return#1 to:main::@33 main::@33: scope:[main] from main::@6 - (byte*) SCREEN#28 ← phi( main::@6/(byte*) SCREEN#29 ) (byte) main::cur_pos#18 ← phi( main::@6/(byte) main::cur_pos#19 ) (byte) keyboard_key_pressed::return#12 ← phi( main::@6/(byte) keyboard_key_pressed::return#5 ) (byte~) main::$24 ← (byte) keyboard_key_pressed::return#12 @@ -397,18 +378,15 @@ main::@33: scope:[main] from main::@6 if((bool~) main::$26) goto main::@7 to:main::@18 main::@17: scope:[main] from main::@32 - (byte*) SCREEN#30 ← phi( main::@32/(byte*) SCREEN#31 ) (byte) main::cur_pos#3 ← (byte/signed byte/word/signed word/dword/signed dword) 2 to:main::@6 main::@7: scope:[main] from main::@18 main::@33 - (byte*) SCREEN#26 ← phi( main::@18/(byte*) SCREEN#27 main::@33/(byte*) SCREEN#28 ) (byte) main::cur_pos#17 ← phi( main::@18/(byte) main::cur_pos#4 main::@33/(byte) main::cur_pos#18 ) (byte) keyboard_key_pressed::key#4 ← (byte) KEY_LSHIFT#0 call keyboard_key_pressed (byte) keyboard_key_pressed::return#6 ← (byte) keyboard_key_pressed::return#1 to:main::@34 main::@34: scope:[main] from main::@7 - (byte*) SCREEN#25 ← phi( main::@7/(byte*) SCREEN#26 ) (byte) main::cur_pos#16 ← phi( main::@7/(byte) main::cur_pos#17 ) (byte) keyboard_key_pressed::return#13 ← phi( main::@7/(byte) keyboard_key_pressed::return#6 ) (byte~) main::$27 ← (byte) keyboard_key_pressed::return#13 @@ -416,27 +394,22 @@ main::@34: scope:[main] from main::@7 if((bool~) main::$28) goto main::@8 to:main::@19 main::@18: scope:[main] from main::@33 - (byte*) SCREEN#27 ← phi( main::@33/(byte*) SCREEN#28 ) (byte) main::cur_pos#4 ← (byte/signed byte/word/signed word/dword/signed dword) 3 to:main::@7 main::@8: scope:[main] from main::@34 - (byte*) SCREEN#23 ← phi( main::@34/(byte*) SCREEN#25 ) (byte) main::cur_pos#14 ← phi( main::@34/(byte) main::cur_pos#16 ) (byte) main::shift#1 ← (byte/signed byte/word/signed word/dword/signed dword) 1 to:main::@9 main::@19: scope:[main] from main::@34 - (byte*) SCREEN#22 ← phi( main::@34/(byte*) SCREEN#25 ) (byte) main::cur_pos#13 ← phi( main::@34/(byte) main::cur_pos#16 ) (byte) main::shift#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@9 main::@9: scope:[main] from main::@19 main::@8 - (byte*) SCREEN#21 ← phi( main::@19/(byte*) SCREEN#22 main::@8/(byte*) SCREEN#23 ) (byte) main::shift#10 ← phi( main::@19/(byte) main::shift#2 main::@8/(byte) main::shift#1 ) (byte) main::cur_pos#12 ← phi( main::@19/(byte) main::cur_pos#13 main::@8/(byte) main::cur_pos#14 ) (byte) main::ch#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@10 main::@10: scope:[main] from main::@12 main::@9 - (byte*) SCREEN#18 ← phi( main::@12/(byte*) SCREEN#20 main::@9/(byte*) SCREEN#21 ) (byte) main::shift#7 ← phi( main::@12/(byte) main::shift#9 main::@9/(byte) main::shift#10 ) (byte) main::cur_pos#9 ← phi( main::@12/(byte) main::cur_pos#11 main::@9/(byte) main::cur_pos#12 ) (byte) main::ch#2 ← phi( main::@12/(byte) main::ch#1 main::@9/(byte) main::ch#0 ) @@ -446,7 +419,6 @@ main::@10: scope:[main] from main::@12 main::@9 (byte) keyboard_get_keycode::return#2 ← (byte) keyboard_get_keycode::return#1 to:main::@35 main::@35: scope:[main] from main::@10 - (byte*) SCREEN#16 ← phi( main::@10/(byte*) SCREEN#18 ) (byte) main::shift#5 ← phi( main::@10/(byte) main::shift#7 ) (byte) main::cur_pos#7 ← phi( main::@10/(byte) main::cur_pos#9 ) (byte) main::ch#7 ← phi( main::@10/(byte) main::ch#2 ) @@ -459,7 +431,6 @@ main::@35: scope:[main] from main::@10 if((bool~) main::$31) goto main::@11 to:main::@21 main::@11: scope:[main] from main::@35 main::@36 - (byte*) SCREEN#15 ← phi( main::@35/(byte*) SCREEN#16 main::@36/(byte*) SCREEN#17 ) (byte) main::shift#4 ← phi( main::@35/(byte) main::shift#5 main::@36/(byte) main::shift#6 ) (byte) main::cur_pos#6 ← phi( main::@35/(byte) main::cur_pos#7 main::@36/(byte) main::cur_pos#8 ) (byte) main::ch#5 ← phi( main::@35/(byte) main::ch#7 main::@36/(byte) main::ch#8 ) @@ -469,7 +440,6 @@ main::@11: scope:[main] from main::@35 main::@36 if((bool~) main::$34) goto main::@12 to:main::@22 main::@21: scope:[main] from main::@35 - (byte*) SCREEN#19 ← phi( main::@35/(byte*) SCREEN#16 ) (byte) main::shift#8 ← phi( main::@35/(byte) main::shift#5 ) (byte) main::cur_pos#10 ← phi( main::@35/(byte) main::cur_pos#7 ) (byte) main::ch#9 ← phi( main::@35/(byte) main::ch#7 ) @@ -479,7 +449,6 @@ main::@21: scope:[main] from main::@35 (byte) keyboard_key_pressed::return#7 ← (byte) keyboard_key_pressed::return#1 to:main::@36 main::@36: scope:[main] from main::@21 - (byte*) SCREEN#17 ← phi( main::@21/(byte*) SCREEN#19 ) (byte) main::shift#6 ← phi( main::@21/(byte) main::shift#8 ) (byte) main::cur_pos#8 ← phi( main::@21/(byte) main::cur_pos#10 ) (byte) main::ch#8 ← phi( main::@21/(byte) main::ch#9 ) @@ -488,7 +457,6 @@ main::@36: scope:[main] from main::@21 (byte) main::pressed#1 ← (byte~) main::$32 to:main::@11 main::@12: scope:[main] from main::@11 main::@37 - (byte*) SCREEN#20 ← phi( main::@11/(byte*) SCREEN#15 main::@37/(byte*) SCREEN#24 ) (byte) main::shift#9 ← phi( main::@11/(byte) main::shift#4 main::@37/(byte) main::shift#11 ) (byte) main::cur_pos#11 ← phi( main::@11/(byte) main::cur_pos#6 main::@37/(byte) main::cur_pos#15 ) (byte) main::ch#3 ← phi( main::@11/(byte) main::ch#5 main::@37/(byte) main::ch#6 ) @@ -497,7 +465,6 @@ main::@12: scope:[main] from main::@11 main::@37 if((bool~) main::$36) goto main::@10 to:main::@23 main::@22: scope:[main] from main::@11 - (byte*) SCREEN#12 ← phi( main::@11/(byte*) SCREEN#15 ) (byte) main::shift#3 ← phi( main::@11/(byte) main::shift#4 ) (byte) main::ch#4 ← phi( main::@11/(byte) main::ch#5 ) (byte) main::cur_pos#5 ← phi( main::@11/(byte) main::cur_pos#6 ) @@ -507,13 +474,11 @@ main::@22: scope:[main] from main::@11 call plot_chargen to:main::@37 main::@37: scope:[main] from main::@22 - (byte*) SCREEN#24 ← phi( main::@22/(byte*) SCREEN#12 ) (byte) main::shift#11 ← phi( main::@22/(byte) main::shift#3 ) (byte) main::cur_pos#15 ← phi( main::@22/(byte) main::cur_pos#5 ) (byte) main::ch#6 ← phi( main::@22/(byte) main::ch#4 ) to:main::@12 main::@23: scope:[main] from main::@12 - (byte*) SCREEN#40 ← phi( main::@12/(byte*) SCREEN#20 ) (byte) main::cur_pos#26 ← phi( main::@12/(byte) main::cur_pos#11 ) if(true) goto main::@3 to:main::@return @@ -542,7 +507,6 @@ print_str_at::@return: scope:[print_str_at] from print_str_at::@1 to:@return plot_chargen: scope:[plot_chargen] from main::@2 main::@22 (byte) plot_chargen::pos#3 ← phi( main::@2/(byte) plot_chargen::pos#0 main::@22/(byte) plot_chargen::pos#1 ) - (byte*) SCREEN#9 ← phi( main::@2/(byte*) SCREEN#11 main::@22/(byte*) SCREEN#12 ) (byte) plot_chargen::shift#2 ← phi( main::@2/(byte) plot_chargen::shift#0 main::@22/(byte) plot_chargen::shift#1 ) (byte) plot_chargen::ch#2 ← phi( main::@2/(byte) plot_chargen::ch#0 main::@22/(byte) plot_chargen::ch#1 ) asm { sei } @@ -557,9 +521,8 @@ plot_chargen: scope:[plot_chargen] from main::@2 main::@22 plot_chargen::@1: scope:[plot_chargen] from plot_chargen plot_chargen::@5 (byte*) plot_chargen::chargen#6 ← phi( plot_chargen/(byte*) plot_chargen::chargen#0 plot_chargen::@5/(byte*) plot_chargen::chargen#1 ) (byte) plot_chargen::pos#2 ← phi( plot_chargen/(byte) plot_chargen::pos#3 plot_chargen::@5/(byte) plot_chargen::pos#4 ) - (byte*) SCREEN#7 ← phi( plot_chargen/(byte*) SCREEN#9 plot_chargen::@5/(byte*) SCREEN#10 ) *((byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $32 - (byte*~) plot_chargen::$6 ← (byte*) SCREEN#7 + (byte/signed byte/word/signed word/dword/signed dword) $28 + (byte*~) plot_chargen::$6 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) $28 (byte*~) plot_chargen::$7 ← (byte*~) plot_chargen::$6 + (byte/signed byte/word/signed word/dword/signed dword) 1 (byte) mul8u::a#1 ← (byte) plot_chargen::pos#2 (byte) mul8u::b#0 ← (byte/signed byte/word/signed word/dword/signed dword) $a @@ -576,7 +539,6 @@ plot_chargen::@9: scope:[plot_chargen] from plot_chargen::@1 to:plot_chargen::@2 plot_chargen::@5: scope:[plot_chargen] from plot_chargen (byte) plot_chargen::pos#4 ← phi( plot_chargen/(byte) plot_chargen::pos#3 ) - (byte*) SCREEN#10 ← phi( plot_chargen/(byte*) SCREEN#9 ) (byte*) plot_chargen::chargen#2 ← phi( plot_chargen/(byte*) plot_chargen::chargen#0 ) (byte*~) plot_chargen::$5 ← (byte*) plot_chargen::chargen#2 + (word/signed word/dword/signed dword) $800 (byte*) plot_chargen::chargen#1 ← (byte*~) plot_chargen::$5 @@ -641,7 +603,6 @@ plot_chargen::@return: scope:[plot_chargen] from plot_chargen::@8 return to:@return @19: scope:[] from @16 - (byte*) SCREEN#8 ← phi( @16/(byte*) SCREEN#0 ) call main to:@20 @20: scope:[] from @19 @@ -907,46 +868,6 @@ SYMBOL TABLE SSA (byte) RED#0 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#11 -(byte*) SCREEN#12 -(byte*) SCREEN#13 -(byte*) SCREEN#14 -(byte*) SCREEN#15 -(byte*) SCREEN#16 -(byte*) SCREEN#17 -(byte*) SCREEN#18 -(byte*) SCREEN#19 -(byte*) SCREEN#2 -(byte*) SCREEN#20 -(byte*) SCREEN#21 -(byte*) SCREEN#22 -(byte*) SCREEN#23 -(byte*) SCREEN#24 -(byte*) SCREEN#25 -(byte*) SCREEN#26 -(byte*) SCREEN#27 -(byte*) SCREEN#28 -(byte*) SCREEN#29 -(byte*) SCREEN#3 -(byte*) SCREEN#30 -(byte*) SCREEN#31 -(byte*) SCREEN#32 -(byte*) SCREEN#33 -(byte*) SCREEN#34 -(byte*) SCREEN#35 -(byte*) SCREEN#36 -(byte*) SCREEN#37 -(byte*) SCREEN#38 -(byte*) SCREEN#39 -(byte*) SCREEN#4 -(byte*) SCREEN#40 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (byte*) SPRITES_COLS (byte*) SPRITES_COLS#0 (byte*) SPRITES_ENABLE @@ -1370,14 +1291,14 @@ SYMBOL TABLE SSA Culled Empty Block (label) @20 Successful SSA optimization Pass2CullEmptyBlocks Inversing boolean not [88] (bool~) mul8u::$3 ← (byte~) mul8u::$1 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [87] (bool~) mul8u::$2 ← (byte~) mul8u::$1 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [261] (bool~) main::$17 ← (byte~) main::$15 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [260] (bool~) main::$16 ← (byte~) main::$15 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [270] (bool~) main::$20 ← (byte~) main::$18 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [269] (bool~) main::$19 ← (byte~) main::$18 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [281] (bool~) main::$23 ← (byte~) main::$21 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [280] (bool~) main::$22 ← (byte~) main::$21 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [292] (bool~) main::$26 ← (byte~) main::$24 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [291] (bool~) main::$25 ← (byte~) main::$24 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [321] (bool~) main::$31 ← (byte) main::key#0 == (byte/signed byte/word/signed word/dword/signed dword) $3f from [320] (bool~) main::$30 ← (byte) main::key#0 != (byte/signed byte/word/signed word/dword/signed dword) $3f -Inversing boolean not [325] (bool~) main::$34 ← (byte) main::pressed#2 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [324] (bool~) main::$33 ← (byte) main::pressed#2 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [363] (bool~) plot_chargen::$4 ← (byte) plot_chargen::shift#2 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [362] (bool~) plot_chargen::$3 ← (byte) plot_chargen::shift#2 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [388] (bool~) plot_chargen::$12 ← (byte~) plot_chargen::$10 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [387] (bool~) plot_chargen::$11 ← (byte~) plot_chargen::$10 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [254] (bool~) main::$17 ← (byte~) main::$15 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [253] (bool~) main::$16 ← (byte~) main::$15 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [263] (bool~) main::$20 ← (byte~) main::$18 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [262] (bool~) main::$19 ← (byte~) main::$18 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [273] (bool~) main::$23 ← (byte~) main::$21 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [272] (bool~) main::$22 ← (byte~) main::$21 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [283] (bool~) main::$26 ← (byte~) main::$24 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [282] (bool~) main::$25 ← (byte~) main::$24 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [310] (bool~) main::$31 ← (byte) main::key#0 == (byte/signed byte/word/signed word/dword/signed dword) $3f from [309] (bool~) main::$30 ← (byte) main::key#0 != (byte/signed byte/word/signed word/dword/signed dword) $3f +Inversing boolean not [314] (bool~) main::$34 ← (byte) main::pressed#2 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [313] (bool~) main::$33 ← (byte) main::pressed#2 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [352] (bool~) plot_chargen::$4 ← (byte) plot_chargen::shift#2 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [351] (bool~) plot_chargen::$3 ← (byte) plot_chargen::shift#2 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [377] (bool~) plot_chargen::$12 ← (byte~) plot_chargen::$10 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [376] (bool~) plot_chargen::$11 ← (byte~) plot_chargen::$10 != (byte/signed byte/word/signed word/dword/signed dword) 0 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) mul8u::a#2 = (byte) mul8u::a#3 (byte) mul8u::a#6 Alias (word) mul8u::mb#3 = (word) mul8u::mb#4 (word) mul8u::mb#5 @@ -1392,50 +1313,39 @@ Alias (byte) keyboard_matrix_read::return#2 = (byte) keyboard_matrix_read::retur Alias (byte) keyboard_key_pressed::return#0 = (byte~) keyboard_key_pressed::$3 (byte) keyboard_key_pressed::return#8 (byte) keyboard_key_pressed::return#1 Alias (byte) keyboard_get_keycode::return#0 = (byte) keyboard_get_keycode::return#3 (byte) keyboard_get_keycode::return#1 Alias (byte) KEY_MODIFIER_SHIFT#0 = (byte~) $0 -Alias (byte*) SCREEN#13 = (byte*) SCREEN#3 (byte*) SCREEN#2 (byte*) SCREEN#4 (byte*) SCREEN#5 (byte*) SCREEN#6 Alias (byte*) print_str_at::at#0 = (byte*~) main::$2 Alias (byte*) print_str_at::at#1 = (byte*~) main::$5 Alias (byte*) print_str_at::at#2 = (byte*~) main::$8 Alias (byte*) print_str_at::at#3 = (byte*~) main::$11 Alias (byte) main::i#2 = (byte) main::i#3 -Alias (byte*) SCREEN#11 = (byte*) SCREEN#14 (byte*) SCREEN#39 Alias (byte) keyboard_key_pressed::return#2 = (byte) keyboard_key_pressed::return#9 Alias (byte) main::cur_pos#24 = (byte) main::cur_pos#25 -Alias (byte*) SCREEN#36 = (byte*) SCREEN#37 (byte*) SCREEN#38 Alias (byte) keyboard_key_pressed::return#10 = (byte) keyboard_key_pressed::return#3 Alias (byte) main::cur_pos#22 = (byte) main::cur_pos#23 -Alias (byte*) SCREEN#33 = (byte*) SCREEN#34 (byte*) SCREEN#35 Alias (byte) keyboard_key_pressed::return#11 = (byte) keyboard_key_pressed::return#4 Alias (byte) main::cur_pos#20 = (byte) main::cur_pos#21 -Alias (byte*) SCREEN#30 = (byte*) SCREEN#31 (byte*) SCREEN#32 Alias (byte) keyboard_key_pressed::return#12 = (byte) keyboard_key_pressed::return#5 Alias (byte) main::cur_pos#18 = (byte) main::cur_pos#19 -Alias (byte*) SCREEN#27 = (byte*) SCREEN#28 (byte*) SCREEN#29 Alias (byte) keyboard_key_pressed::return#13 = (byte) keyboard_key_pressed::return#6 Alias (byte) main::cur_pos#13 = (byte) main::cur_pos#16 (byte) main::cur_pos#17 (byte) main::cur_pos#14 -Alias (byte*) SCREEN#22 = (byte*) SCREEN#25 (byte*) SCREEN#26 (byte*) SCREEN#23 Alias (byte) keyboard_get_keycode::return#2 = (byte) keyboard_get_keycode::return#4 Alias (byte) main::pressed#0 = (byte) main::pressed#3 Alias (byte) main::ch#2 = (byte) main::ch#7 (byte) main::ch#9 (byte) main::ch#8 Alias (byte) main::cur_pos#10 = (byte) main::cur_pos#7 (byte) main::cur_pos#9 (byte) main::cur_pos#8 Alias (byte) main::shift#5 = (byte) main::shift#7 (byte) main::shift#8 (byte) main::shift#6 -Alias (byte*) SCREEN#16 = (byte*) SCREEN#18 (byte*) SCREEN#19 (byte*) SCREEN#17 Alias (byte) main::key#0 = (byte~) main::$29 (byte) main::key#1 Alias (byte) keyboard_key_pressed::return#14 = (byte) keyboard_key_pressed::return#7 Alias (byte) main::pressed#1 = (byte~) main::$32 Alias (byte) main::cur_pos#15 = (byte) main::cur_pos#5 (byte) main::cur_pos#6 Alias (byte) main::ch#4 = (byte) main::ch#5 (byte) main::ch#6 Alias (byte) main::shift#11 = (byte) main::shift#3 (byte) main::shift#4 -Alias (byte*) SCREEN#12 = (byte*) SCREEN#15 (byte*) SCREEN#24 Alias (byte) main::cur_pos#11 = (byte) main::cur_pos#26 -Alias (byte*) SCREEN#20 = (byte*) SCREEN#40 Alias (byte*) print_str_at::str#5 = (byte*) print_str_at::str#6 Alias (byte*) print_str_at::at#5 = (byte*) print_str_at::at#6 Alias (byte*) plot_chargen::chargen#0 = (byte*~) plot_chargen::$2 (byte*) plot_chargen::chargen#2 Alias (word) mul8u::return#2 = (word) mul8u::return#4 Alias (byte*) plot_chargen::chargen#5 = (byte*) plot_chargen::chargen#6 Alias (byte*) plot_chargen::sc#0 = (byte*~) plot_chargen::$9 -Alias (byte*) SCREEN#10 = (byte*) SCREEN#9 Alias (byte) plot_chargen::pos#3 = (byte) plot_chargen::pos#4 Alias (byte*) plot_chargen::chargen#1 = (byte*~) plot_chargen::$5 Alias (byte) plot_chargen::bits#1 = (byte~) plot_chargen::$13 @@ -1448,17 +1358,13 @@ Alias (byte*) plot_chargen::sc#1 = (byte*) plot_chargen::sc#4 Alias (byte) plot_chargen::y#3 = (byte) plot_chargen::y#4 Alias (byte*) plot_chargen::chargen#4 = (byte*) plot_chargen::chargen#7 Alias (byte*) plot_chargen::sc#2 = (byte*~) plot_chargen::$15 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#8 Successful SSA optimization Pass2AliasElimination Alias (byte) mul8u::a#2 = (byte) mul8u::a#4 Alias (word) mul8u::mb#2 = (word) mul8u::mb#3 -Alias (byte*) SCREEN#21 = (byte*) SCREEN#33 (byte*) SCREEN#36 (byte*) SCREEN#30 (byte*) SCREEN#27 (byte*) SCREEN#22 Alias (byte) main::cur_pos#12 = (byte) main::cur_pos#13 Alias (byte) main::ch#2 = (byte) main::ch#4 (byte) main::ch#3 Alias (byte) main::cur_pos#10 = (byte) main::cur_pos#15 (byte) main::cur_pos#11 Alias (byte) main::shift#11 = (byte) main::shift#5 (byte) main::shift#9 -Alias (byte*) SCREEN#12 = (byte*) SCREEN#16 (byte*) SCREEN#20 -Alias (byte*) SCREEN#10 = (byte*) SCREEN#7 Alias (byte) plot_chargen::pos#2 = (byte) plot_chargen::pos#3 Alias (byte*) plot_chargen::sc#3 = (byte*) plot_chargen::sc#5 Alias (byte) plot_chargen::bits#2 = (byte) plot_chargen::bits#3 @@ -1466,11 +1372,8 @@ Alias (byte) plot_chargen::x#2 = (byte) plot_chargen::x#3 Alias (byte) plot_chargen::y#3 = (byte) plot_chargen::y#5 Alias (byte*) plot_chargen::chargen#4 = (byte*) plot_chargen::chargen#8 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#13 -Self Phi Eliminated (byte*) SCREEN#11 Self Phi Eliminated (byte) main::cur_pos#10 Self Phi Eliminated (byte) main::shift#11 -Self Phi Eliminated (byte*) SCREEN#12 Self Phi Eliminated (byte) plot_chargen::y#3 Self Phi Eliminated (byte*) plot_chargen::chargen#4 Successful SSA optimization Pass2SelfPhiElimination @@ -1478,32 +1381,28 @@ Redundant Phi (byte) mul8u::b#1 (byte) mul8u::b#0 Redundant Phi (byte) mul8u::a#5 (byte) mul8u::a#1 Redundant Phi (byte) keyboard_matrix_read::rowid#1 (byte) keyboard_matrix_read::rowid#0 Redundant Phi (byte) keyboard_get_keycode::ch#1 (byte) keyboard_get_keycode::ch#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#13 (byte*) SCREEN#1 -Redundant Phi (byte*) SCREEN#11 (byte*) SCREEN#13 Redundant Phi (byte) main::cur_pos#10 (byte) main::cur_pos#12 Redundant Phi (byte) main::shift#11 (byte) main::shift#10 -Redundant Phi (byte*) SCREEN#12 (byte*) SCREEN#21 Redundant Phi (byte) plot_chargen::y#3 (byte) plot_chargen::y#2 Redundant Phi (byte*) plot_chargen::chargen#4 (byte*) plot_chargen::chargen#3 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) mul8u::$0 [84] if((byte) mul8u::a#2!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul8u::@2 Simple Condition (bool~) mul8u::$3 [89] if((byte~) mul8u::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto mul8u::@4 -Simple Condition (bool~) main::$1 [216] if((byte*) main::sc#1<(byte*~) main::$0) goto main::@1 -Simple Condition (bool~) main::$14 [250] if((byte) main::i#1!=rangelast(0,3)) goto main::@2 -Simple Condition (bool~) main::$17 [262] if((byte~) main::$15==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@4 -Simple Condition (bool~) main::$20 [271] if((byte~) main::$18==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@5 -Simple Condition (bool~) main::$23 [282] if((byte~) main::$21==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@6 -Simple Condition (bool~) main::$26 [293] if((byte~) main::$24==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@7 -Simple Condition (bool~) main::$28 [303] if((byte~) main::$27!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@8 -Simple Condition (bool~) main::$31 [322] if((byte) main::key#0==(byte/signed byte/word/signed word/dword/signed dword) $3f) goto main::@11 -Simple Condition (bool~) main::$34 [326] if((byte) main::pressed#2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@12 -Simple Condition (bool~) main::$36 [337] if((byte) main::ch#1!=rangelast(0,$3f)) goto main::@10 -Simple Condition (bool~) print_str_at::$0 [350] if(*((byte*) print_str_at::str#5)!=(byte) '@') goto print_str_at::@2 -Simple Condition (bool~) plot_chargen::$4 [364] if((byte) plot_chargen::shift#2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto plot_chargen::@1 -Simple Condition (bool~) plot_chargen::$12 [389] if((byte~) plot_chargen::$10==(byte/signed byte/word/signed word/dword/signed dword) 0) goto plot_chargen::@4 -Simple Condition (bool~) plot_chargen::$14 [397] if((byte) plot_chargen::x#1!=rangelast(0,7)) goto plot_chargen::@3 -Simple Condition (bool~) plot_chargen::$16 [405] if((byte) plot_chargen::y#1!=rangelast(0,7)) goto plot_chargen::@2 +Simple Condition (bool~) main::$1 [215] if((byte*) main::sc#1<(byte*~) main::$0) goto main::@1 +Simple Condition (bool~) main::$14 [244] if((byte) main::i#1!=rangelast(0,3)) goto main::@2 +Simple Condition (bool~) main::$17 [255] if((byte~) main::$15==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@4 +Simple Condition (bool~) main::$20 [264] if((byte~) main::$18==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@5 +Simple Condition (bool~) main::$23 [274] if((byte~) main::$21==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@6 +Simple Condition (bool~) main::$26 [284] if((byte~) main::$24==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@7 +Simple Condition (bool~) main::$28 [293] if((byte~) main::$27!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@8 +Simple Condition (bool~) main::$31 [311] if((byte) main::key#0==(byte/signed byte/word/signed word/dword/signed dword) $3f) goto main::@11 +Simple Condition (bool~) main::$34 [315] if((byte) main::pressed#2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@12 +Simple Condition (bool~) main::$36 [326] if((byte) main::ch#1!=rangelast(0,$3f)) goto main::@10 +Simple Condition (bool~) print_str_at::$0 [339] if(*((byte*) print_str_at::str#5)!=(byte) '@') goto print_str_at::@2 +Simple Condition (bool~) plot_chargen::$4 [353] if((byte) plot_chargen::shift#2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto plot_chargen::@1 +Simple Condition (bool~) plot_chargen::$12 [378] if((byte~) plot_chargen::$10==(byte/signed byte/word/signed word/dword/signed dword) 0) goto plot_chargen::@4 +Simple Condition (bool~) plot_chargen::$14 [386] if((byte) plot_chargen::x#1!=rangelast(0,7)) goto plot_chargen::@3 +Simple Condition (bool~) plot_chargen::$16 [394] if((byte) plot_chargen::y#1!=rangelast(0,7)) goto plot_chargen::@2 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) PROCPORT_DDR#0 = ((byte*))0 Constant (const byte) PROCPORT_DDR_MEMORY_MASK#0 = 7 @@ -1697,13 +1596,13 @@ Constant (const byte) keyboard_key_pressed::key#1 = KEY_F3#0 Constant (const byte) keyboard_key_pressed::key#2 = KEY_F5#0 Constant (const byte) keyboard_key_pressed::key#3 = KEY_F7#0 Constant (const byte) keyboard_key_pressed::key#4 = KEY_LSHIFT#0 +Constant (const byte*) plot_chargen::$6 = SCREEN#0+$28 Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) print_str_at::at#1 = main::$4+$a Constant (const byte*) print_str_at::at#2 = main::$7+$14 Constant (const byte*) print_str_at::at#3 = main::$10+$1e +Constant (const byte*) plot_chargen::$7 = plot_chargen::$6+1 Successful SSA optimization Pass2ConstantIdentification -Consolidated constant in assignment plot_chargen::$7 -Successful SSA optimization Pass2ConstantAdditionElimination if() condition always true - replacing block destination [80] if(true) goto main::@3 Successful SSA optimization Pass2ConstantIfs Successful SSA optimization PassNEliminateUnusedVars @@ -1728,18 +1627,10 @@ Culled Empty Block (label) main::@8 Culled Empty Block (label) main::@37 Culled Empty Block (label) main::@23 Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte*) SCREEN#21 Self Phi Eliminated (byte*) plot_chargen::chargen#3 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#21 (const byte*) SCREEN#0 Redundant Phi (byte*) plot_chargen::chargen#3 (byte*) plot_chargen::chargen#5 Successful SSA optimization Pass2RedundantPhiElimination -Redundant Phi (byte*) SCREEN#10 (const byte*) SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination -Constant (const byte*) plot_chargen::$6 = SCREEN#0 -Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) plot_chargen::$7 = plot_chargen::$6+$28+1 -Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const word) mul8u::res#0 Inlining constant with var siblings (const word) mul8u::mb#0 Inlining constant with var siblings (const byte) keyboard_key_pressed::key#0 @@ -1787,7 +1678,7 @@ Constant inlined main::$10 = (const byte*) SCREEN#0+(byte/signed byte/word/signe Constant inlined main::shift#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined plot_chargen::$7 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28+(byte/signed byte/word/signed word/dword/signed dword) 1 Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined plot_chargen::$6 = (const byte*) SCREEN#0 +Constant inlined plot_chargen::$6 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined plot_chargen::shift#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined main::ch#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined keyboard_key_pressed::key#0 = (const byte) KEY_F1#0 diff --git a/src/test/ref/examples/fastmultiply/fastmultiply8.log b/src/test/ref/examples/fastmultiply/fastmultiply8.log index bc39c180a..e5dd23b92 100644 --- a/src/test/ref/examples/fastmultiply/fastmultiply8.log +++ b/src/test/ref/examples/fastmultiply/fastmultiply8.log @@ -1,5 +1,11 @@ Resolved forward reference mulf_sqr1 to (byte*) mulf_sqr1 Resolved forward reference mulf_sqr2 to (byte*) mulf_sqr2 +Identified constant variable (byte) init_screen::WHITE +Identified constant variable (signed byte*) ap +Identified constant variable (signed byte*) bp +Identified constant variable (signed byte*) cp +Identified constant variable (byte*) mulf_sqr1 +Identified constant variable (byte*) mulf_sqr2 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -123,22 +129,12 @@ print_cls::@return: scope:[print_cls] from print_cls::@2 (signed byte[]) vals#0 ← { (signed byte/signed word/signed dword~) $0, (signed byte/signed word/signed dword~) $1, (signed byte/signed word/signed dword~) $2, (signed byte/signed word/signed dword~) $3, (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) $10, (byte/signed byte/word/signed word/dword/signed dword) $20, (byte/signed byte/word/signed word/dword/signed dword) $40, (byte/signed byte/word/signed word/dword/signed dword) $5f } to:@21 main: scope:[main] from @22 - (signed byte*) cp#12 ← phi( @22/(signed byte*) cp#13 ) - (byte*) mulf_sqr2#12 ← phi( @22/(byte*) mulf_sqr2#0 ) - (byte*) mulf_sqr1#12 ← phi( @22/(byte*) mulf_sqr1#0 ) - (signed byte*) bp#12 ← phi( @22/(signed byte*) bp#13 ) - (signed byte*) ap#12 ← phi( @22/(signed byte*) ap#13 ) (byte*) print_screen#5 ← phi( @22/(byte*) print_screen#6 ) (byte*) print_char_cursor#14 ← phi( @22/(byte*) print_char_cursor#18 ) (byte*) print_line_cursor#14 ← phi( @22/(byte*) print_line_cursor#18 ) call init_screen to:main::@7 main::@7: scope:[main] from main - (signed byte*) cp#11 ← phi( main/(signed byte*) cp#12 ) - (byte*) mulf_sqr2#11 ← phi( main/(byte*) mulf_sqr2#12 ) - (byte*) mulf_sqr1#11 ← phi( main/(byte*) mulf_sqr1#12 ) - (signed byte*) bp#11 ← phi( main/(signed byte*) bp#12 ) - (signed byte*) ap#11 ← phi( main/(signed byte*) ap#12 ) (byte*) print_char_cursor#9 ← phi( main/(byte*) print_char_cursor#6 ) (byte*) print_line_cursor#9 ← phi( main/(byte*) print_line_cursor#6 ) (byte*) print_line_cursor#3 ← (byte*) print_line_cursor#9 @@ -151,11 +147,6 @@ main::@7: scope:[main] from main main::@1: scope:[main] from main::@7 main::@8 (byte*) print_char_cursor#31 ← phi( main::@7/(byte*) print_char_cursor#3 main::@8/(byte*) print_char_cursor#30 ) (byte*) print_line_cursor#31 ← phi( main::@7/(byte*) print_line_cursor#3 main::@8/(byte*) print_line_cursor#30 ) - (signed byte*) cp#10 ← phi( main::@7/(signed byte*) cp#11 main::@8/(signed byte*) cp#9 ) - (byte*) mulf_sqr2#10 ← phi( main::@7/(byte*) mulf_sqr2#11 main::@8/(byte*) mulf_sqr2#9 ) - (byte*) mulf_sqr1#10 ← phi( main::@7/(byte*) mulf_sqr1#11 main::@8/(byte*) mulf_sqr1#9 ) - (signed byte*) bp#10 ← phi( main::@7/(signed byte*) bp#11 main::@8/(signed byte*) bp#9 ) - (signed byte*) ap#10 ← phi( main::@7/(signed byte*) ap#11 main::@8/(signed byte*) ap#9 ) (byte*) main::at_line#7 ← phi( main::@7/(byte*) main::at_line#0 main::@8/(byte*) main::at_line#5 ) (byte*) main::at#4 ← phi( main::@7/(byte*) main::at#0 main::@8/(byte*) main::at#1 ) (byte) main::k#2 ← phi( main::@7/(byte) main::k#0 main::@8/(byte) main::k#1 ) @@ -166,11 +157,6 @@ main::@1: scope:[main] from main::@7 main::@8 main::@8: scope:[main] from main::@1 (byte*) print_char_cursor#30 ← phi( main::@1/(byte*) print_char_cursor#31 ) (byte*) print_line_cursor#30 ← phi( main::@1/(byte*) print_line_cursor#31 ) - (signed byte*) cp#9 ← phi( main::@1/(signed byte*) cp#10 ) - (byte*) mulf_sqr2#9 ← phi( main::@1/(byte*) mulf_sqr2#10 ) - (byte*) mulf_sqr1#9 ← phi( main::@1/(byte*) mulf_sqr1#10 ) - (signed byte*) bp#9 ← phi( main::@1/(signed byte*) bp#10 ) - (signed byte*) ap#9 ← phi( main::@1/(signed byte*) ap#10 ) (byte*) main::at_line#5 ← phi( main::@1/(byte*) main::at_line#7 ) (byte) main::k#3 ← phi( main::@1/(byte) main::k#2 ) (byte*) main::at#5 ← phi( main::@1/(byte*) main::at#4 ) @@ -182,22 +168,12 @@ main::@8: scope:[main] from main::@1 main::@4: scope:[main] from main::@8 (byte*) print_char_cursor#29 ← phi( main::@8/(byte*) print_char_cursor#30 ) (byte*) print_line_cursor#29 ← phi( main::@8/(byte*) print_line_cursor#30 ) - (signed byte*) cp#7 ← phi( main::@8/(signed byte*) cp#9 ) - (byte*) mulf_sqr2#7 ← phi( main::@8/(byte*) mulf_sqr2#9 ) - (byte*) mulf_sqr1#7 ← phi( main::@8/(byte*) mulf_sqr1#9 ) - (signed byte*) bp#7 ← phi( main::@8/(signed byte*) bp#9 ) - (signed byte*) ap#7 ← phi( main::@8/(signed byte*) ap#9 ) (byte*) main::at_line#3 ← phi( main::@8/(byte*) main::at_line#5 ) (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@2 main::@2: scope:[main] from main::@4 main::@5 (byte*) print_char_cursor#28 ← phi( main::@4/(byte*) print_char_cursor#29 main::@5/(byte*) print_char_cursor#15 ) (byte*) print_line_cursor#28 ← phi( main::@4/(byte*) print_line_cursor#29 main::@5/(byte*) print_line_cursor#15 ) - (signed byte*) cp#5 ← phi( main::@4/(signed byte*) cp#7 main::@5/(signed byte*) cp#8 ) - (byte*) mulf_sqr2#5 ← phi( main::@4/(byte*) mulf_sqr2#7 main::@5/(byte*) mulf_sqr2#8 ) - (byte*) mulf_sqr1#5 ← phi( main::@4/(byte*) mulf_sqr1#7 main::@5/(byte*) mulf_sqr1#8 ) - (signed byte*) bp#5 ← phi( main::@4/(signed byte*) bp#7 main::@5/(signed byte*) bp#8 ) - (signed byte*) ap#5 ← phi( main::@4/(signed byte*) ap#7 main::@5/(signed byte*) ap#8 ) (byte) main::i#2 ← phi( main::@4/(byte) main::i#0 main::@5/(byte) main::i#1 ) (byte*) main::at_line#2 ← phi( main::@4/(byte*) main::at_line#3 main::@5/(byte*) main::at_line#4 ) (byte*) main::at_line#1 ← (byte*) main::at_line#2 + (byte/signed byte/word/signed word/dword/signed dword) $28 @@ -210,11 +186,6 @@ main::@9: scope:[main] from main::@2 (byte*) print_char_cursor#27 ← phi( main::@2/(byte*) print_char_cursor#28 ) (byte*) print_line_cursor#27 ← phi( main::@2/(byte*) print_line_cursor#28 ) (byte*) main::at_line#10 ← phi( main::@2/(byte*) main::at_line#1 ) - (signed byte*) cp#4 ← phi( main::@2/(signed byte*) cp#5 ) - (byte*) mulf_sqr2#4 ← phi( main::@2/(byte*) mulf_sqr2#5 ) - (byte*) mulf_sqr1#4 ← phi( main::@2/(byte*) mulf_sqr1#5 ) - (signed byte*) bp#4 ← phi( main::@2/(signed byte*) bp#5 ) - (signed byte*) ap#4 ← phi( main::@2/(signed byte*) ap#5 ) (byte) main::i#6 ← phi( main::@2/(byte) main::i#2 ) (byte*) main::at#9 ← phi( main::@2/(byte*) main::at#2 ) (byte) main::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -223,11 +194,6 @@ main::@3: scope:[main] from main::@11 main::@9 (byte*) print_char_cursor#26 ← phi( main::@11/(byte*) print_char_cursor#19 main::@9/(byte*) print_char_cursor#27 ) (byte*) print_line_cursor#26 ← phi( main::@11/(byte*) print_line_cursor#19 main::@9/(byte*) print_line_cursor#27 ) (byte*) main::at_line#9 ← phi( main::@11/(byte*) main::at_line#6 main::@9/(byte*) main::at_line#10 ) - (signed byte*) cp#2 ← phi( main::@11/(signed byte*) cp#3 main::@9/(signed byte*) cp#4 ) - (byte*) mulf_sqr2#2 ← phi( main::@11/(byte*) mulf_sqr2#3 main::@9/(byte*) mulf_sqr2#4 ) - (byte*) mulf_sqr1#2 ← phi( main::@11/(byte*) mulf_sqr1#3 main::@9/(byte*) mulf_sqr1#4 ) - (signed byte*) bp#2 ← phi( main::@11/(signed byte*) bp#3 main::@9/(signed byte*) bp#4 ) - (signed byte*) ap#2 ← phi( main::@11/(signed byte*) ap#3 main::@9/(signed byte*) ap#4 ) (byte) main::j#2 ← phi( main::@11/(byte) main::j#1 main::@9/(byte) main::j#0 ) (byte) main::i#3 ← phi( main::@11/(byte) main::i#5 main::@9/(byte) main::i#6 ) (byte*) main::at#6 ← phi( main::@11/(byte*) main::at#8 main::@9/(byte*) main::at#9 ) @@ -241,11 +207,6 @@ main::@10: scope:[main] from main::@3 (byte*) print_char_cursor#22 ← phi( main::@3/(byte*) print_char_cursor#26 ) (byte*) print_line_cursor#22 ← phi( main::@3/(byte*) print_line_cursor#26 ) (byte*) main::at_line#8 ← phi( main::@3/(byte*) main::at_line#9 ) - (signed byte*) cp#6 ← phi( main::@3/(signed byte*) cp#2 ) - (byte*) mulf_sqr2#6 ← phi( main::@3/(byte*) mulf_sqr2#2 ) - (byte*) mulf_sqr1#6 ← phi( main::@3/(byte*) mulf_sqr1#2 ) - (signed byte*) bp#6 ← phi( main::@3/(signed byte*) bp#2 ) - (signed byte*) ap#6 ← phi( main::@3/(signed byte*) ap#2 ) (byte) main::i#7 ← phi( main::@3/(byte) main::i#3 ) (byte) main::j#4 ← phi( main::@3/(byte) main::j#2 ) (byte*) main::at#7 ← phi( main::@3/(byte*) main::at#3 ) @@ -260,11 +221,6 @@ main::@11: scope:[main] from main::@10 (byte*) print_char_cursor#19 ← phi( main::@10/(byte*) print_char_cursor#22 ) (byte*) print_line_cursor#19 ← phi( main::@10/(byte*) print_line_cursor#22 ) (byte*) main::at_line#6 ← phi( main::@10/(byte*) main::at_line#8 ) - (signed byte*) cp#3 ← phi( main::@10/(signed byte*) cp#6 ) - (byte*) mulf_sqr2#3 ← phi( main::@10/(byte*) mulf_sqr2#6 ) - (byte*) mulf_sqr1#3 ← phi( main::@10/(byte*) mulf_sqr1#6 ) - (signed byte*) bp#3 ← phi( main::@10/(signed byte*) bp#6 ) - (signed byte*) ap#3 ← phi( main::@10/(signed byte*) ap#6 ) (byte) main::i#5 ← phi( main::@10/(byte) main::i#7 ) (byte*) main::at#8 ← phi( main::@10/(byte*) main::at#7 ) (byte) main::j#3 ← phi( main::@10/(byte) main::j#4 ) @@ -273,11 +229,6 @@ main::@11: scope:[main] from main::@10 if((bool~) main::$7) goto main::@3 to:main::@5 main::@5: scope:[main] from main::@11 - (signed byte*) cp#8 ← phi( main::@11/(signed byte*) cp#3 ) - (byte*) mulf_sqr2#8 ← phi( main::@11/(byte*) mulf_sqr2#3 ) - (byte*) mulf_sqr1#8 ← phi( main::@11/(byte*) mulf_sqr1#3 ) - (signed byte*) bp#8 ← phi( main::@11/(signed byte*) bp#3 ) - (signed byte*) ap#8 ← phi( main::@11/(signed byte*) ap#3 ) (byte*) print_char_cursor#15 ← phi( main::@11/(byte*) print_char_cursor#19 ) (byte*) print_line_cursor#15 ← phi( main::@11/(byte*) print_line_cursor#19 ) (byte*) main::at_line#4 ← phi( main::@11/(byte*) main::at_line#6 ) @@ -313,8 +264,7 @@ init_screen::@1: scope:[init_screen] from init_screen::@1 init_screen::@5 (byte*) print_line_cursor#23 ← phi( init_screen::@1/(byte*) print_line_cursor#23 init_screen::@5/(byte*) print_line_cursor#5 ) (byte) init_screen::l#2 ← phi( init_screen::@1/(byte) init_screen::l#1 init_screen::@5/(byte) init_screen::l#0 ) (byte*) init_screen::COLS#2 ← phi( init_screen::@1/(byte*) init_screen::COLS#2 init_screen::@5/(byte*) init_screen::COLS#0 ) - (byte) init_screen::WHITE#1 ← phi( init_screen::@1/(byte) init_screen::WHITE#1 init_screen::@5/(byte) init_screen::WHITE#0 ) - *((byte*) init_screen::COLS#2 + (byte) init_screen::l#2) ← (byte) init_screen::WHITE#1 + *((byte*) init_screen::COLS#2 + (byte) init_screen::l#2) ← (byte) init_screen::WHITE#0 (byte) init_screen::l#1 ← (byte) init_screen::l#2 + rangenext(0,$27) (bool~) init_screen::$1 ← (byte) init_screen::l#1 != rangelast(0,$27) if((bool~) init_screen::$1) goto init_screen::@1 @@ -323,7 +273,6 @@ init_screen::@3: scope:[init_screen] from init_screen::@1 (byte*) print_char_cursor#20 ← phi( init_screen::@1/(byte*) print_char_cursor#23 ) (byte*) print_line_cursor#20 ← phi( init_screen::@1/(byte*) print_line_cursor#23 ) (byte*) init_screen::COLS#4 ← phi( init_screen::@1/(byte*) init_screen::COLS#2 ) - (byte) init_screen::WHITE#3 ← phi( init_screen::@1/(byte) init_screen::WHITE#1 ) (byte) init_screen::m#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:init_screen::@2 init_screen::@2: scope:[init_screen] from init_screen::@2 init_screen::@3 @@ -331,11 +280,10 @@ init_screen::@2: scope:[init_screen] from init_screen::@2 init_screen::@3 (byte*) print_line_cursor#17 ← phi( init_screen::@2/(byte*) print_line_cursor#17 init_screen::@3/(byte*) print_line_cursor#20 ) (byte) init_screen::m#2 ← phi( init_screen::@2/(byte) init_screen::m#1 init_screen::@3/(byte) init_screen::m#0 ) (byte*) init_screen::COLS#3 ← phi( init_screen::@2/(byte*) init_screen::COLS#1 init_screen::@3/(byte*) init_screen::COLS#4 ) - (byte) init_screen::WHITE#2 ← phi( init_screen::@2/(byte) init_screen::WHITE#2 init_screen::@3/(byte) init_screen::WHITE#3 ) - *((byte*) init_screen::COLS#3 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) init_screen::WHITE#2 - *((byte*) init_screen::COLS#3 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) init_screen::WHITE#2 - *((byte*) init_screen::COLS#3 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) init_screen::WHITE#2 - *((byte*) init_screen::COLS#3 + (byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte) init_screen::WHITE#2 + *((byte*) init_screen::COLS#3 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) init_screen::WHITE#0 + *((byte*) init_screen::COLS#3 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) init_screen::WHITE#0 + *((byte*) init_screen::COLS#3 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) init_screen::WHITE#0 + *((byte*) init_screen::COLS#3 + (byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte) init_screen::WHITE#0 (byte*) init_screen::COLS#1 ← (byte*) init_screen::COLS#3 + (byte/signed byte/word/signed word/dword/signed dword) $28 (byte) init_screen::m#1 ← (byte) init_screen::m#2 + rangenext(0,$18) (bool~) init_screen::$2 ← (byte) init_screen::m#1 != rangelast(0,$18) @@ -357,17 +305,12 @@ init_screen::@return: scope:[init_screen] from init_screen::@2 (signed byte*) cp#0 ← ((signed byte*)) (byte/word/signed word/dword/signed dword) $ff to:@22 fmul8: scope:[fmul8] from main::@3 - (signed byte*) cp#1 ← phi( main::@3/(signed byte*) cp#2 ) - (byte*) mulf_sqr2#1 ← phi( main::@3/(byte*) mulf_sqr2#2 ) - (byte*) mulf_sqr1#1 ← phi( main::@3/(byte*) mulf_sqr1#2 ) - (signed byte*) bp#1 ← phi( main::@3/(signed byte*) bp#2 ) (signed byte) fmul8::b#1 ← phi( main::@3/(signed byte) fmul8::b#0 ) - (signed byte*) ap#1 ← phi( main::@3/(signed byte*) ap#2 ) (signed byte) fmul8::a#1 ← phi( main::@3/(signed byte) fmul8::a#0 ) - *((signed byte*) ap#1) ← (signed byte) fmul8::a#1 - *((signed byte*) bp#1) ← (signed byte) fmul8::b#1 + *((signed byte*) ap#0) ← (signed byte) fmul8::a#1 + *((signed byte*) bp#0) ← (signed byte) fmul8::b#1 asm { ldaap staA1+1 eor#$ff staA2+1 ldxbp sec A1: ldamulf_sqr1,x A2: sbcmulf_sqr2,x stacp } - (signed byte) fmul8::return#1 ← *((signed byte*) cp#1) + (signed byte) fmul8::return#1 ← *((signed byte*) cp#0) to:fmul8::@return fmul8::@return: scope:[fmul8] from fmul8 (signed byte) fmul8::return#4 ← phi( fmul8/(signed byte) fmul8::return#1 ) @@ -375,9 +318,6 @@ fmul8::@return: scope:[fmul8] from fmul8 return to:@return @22: scope:[] from @21 - (signed byte*) cp#13 ← phi( @21/(signed byte*) cp#0 ) - (signed byte*) bp#13 ← phi( @21/(signed byte*) bp#0 ) - (signed byte*) ap#13 ← phi( @21/(signed byte*) ap#0 ) (byte*) print_screen#6 ← phi( @21/(byte*) print_screen#7 ) (byte*) print_char_cursor#18 ← phi( @21/(byte*) print_char_cursor#21 ) (byte*) print_line_cursor#18 ← phi( @21/(byte*) print_line_cursor#21 ) @@ -420,49 +360,10 @@ SYMBOL TABLE SSA (label) @end (signed byte*) ap (signed byte*) ap#0 -(signed byte*) ap#1 -(signed byte*) ap#10 -(signed byte*) ap#11 -(signed byte*) ap#12 -(signed byte*) ap#13 -(signed byte*) ap#2 -(signed byte*) ap#3 -(signed byte*) ap#4 -(signed byte*) ap#5 -(signed byte*) ap#6 -(signed byte*) ap#7 -(signed byte*) ap#8 -(signed byte*) ap#9 (signed byte*) bp (signed byte*) bp#0 -(signed byte*) bp#1 -(signed byte*) bp#10 -(signed byte*) bp#11 -(signed byte*) bp#12 -(signed byte*) bp#13 -(signed byte*) bp#2 -(signed byte*) bp#3 -(signed byte*) bp#4 -(signed byte*) bp#5 -(signed byte*) bp#6 -(signed byte*) bp#7 -(signed byte*) bp#8 -(signed byte*) bp#9 (signed byte*) cp (signed byte*) cp#0 -(signed byte*) cp#1 -(signed byte*) cp#10 -(signed byte*) cp#11 -(signed byte*) cp#12 -(signed byte*) cp#13 -(signed byte*) cp#2 -(signed byte*) cp#3 -(signed byte*) cp#4 -(signed byte*) cp#5 -(signed byte*) cp#6 -(signed byte*) cp#7 -(signed byte*) cp#8 -(signed byte*) cp#9 (signed byte()) fmul8((signed byte) fmul8::a , (signed byte) fmul8::b) (label) fmul8::@return (signed byte) fmul8::a @@ -493,9 +394,6 @@ SYMBOL TABLE SSA (byte*) init_screen::COLS#4 (byte) init_screen::WHITE (byte) init_screen::WHITE#0 -(byte) init_screen::WHITE#1 -(byte) init_screen::WHITE#2 -(byte) init_screen::WHITE#3 (byte) init_screen::l (byte) init_screen::l#0 (byte) init_screen::l#1 @@ -568,32 +466,8 @@ SYMBOL TABLE SSA (signed byte) main::r#0 (byte*) mulf_sqr1 (byte*) mulf_sqr1#0 -(byte*) mulf_sqr1#1 -(byte*) mulf_sqr1#10 -(byte*) mulf_sqr1#11 -(byte*) mulf_sqr1#12 -(byte*) mulf_sqr1#2 -(byte*) mulf_sqr1#3 -(byte*) mulf_sqr1#4 -(byte*) mulf_sqr1#5 -(byte*) mulf_sqr1#6 -(byte*) mulf_sqr1#7 -(byte*) mulf_sqr1#8 -(byte*) mulf_sqr1#9 (byte*) mulf_sqr2 (byte*) mulf_sqr2#0 -(byte*) mulf_sqr2#1 -(byte*) mulf_sqr2#10 -(byte*) mulf_sqr2#11 -(byte*) mulf_sqr2#12 -(byte*) mulf_sqr2#2 -(byte*) mulf_sqr2#3 -(byte*) mulf_sqr2#4 -(byte*) mulf_sqr2#5 -(byte*) mulf_sqr2#6 -(byte*) mulf_sqr2#7 -(byte*) mulf_sqr2#8 -(byte*) mulf_sqr2#9 (void()) print_byte_at((byte) print_byte_at::b , (byte*) print_byte_at::at) (byte~) print_byte_at::$0 (byte~) print_byte_at::$2 @@ -761,58 +635,34 @@ Alias (byte) print_byte_at::b#1 = (byte) print_byte_at::b#2 Alias (byte*) print_byte_at::at#1 = (byte*) print_byte_at::at#2 Alias (byte*) print_char_at::at#3 = (byte*~) print_byte_at::$3 Alias (byte*) print_line_cursor#1 = (byte*) print_screen#3 (byte*) print_screen#2 (byte*) print_char_cursor#1 (byte*) print_line_cursor#8 (byte*) print_char_cursor#8 (byte*) print_line_cursor#2 (byte*) print_char_cursor#2 -Alias (signed byte*) ap#11 = (signed byte*) ap#12 -Alias (signed byte*) bp#11 = (signed byte*) bp#12 -Alias (byte*) mulf_sqr1#11 = (byte*) mulf_sqr1#12 -Alias (byte*) mulf_sqr2#11 = (byte*) mulf_sqr2#12 -Alias (signed byte*) cp#11 = (signed byte*) cp#12 Alias (byte*) print_line_cursor#3 = (byte*) print_line_cursor#9 Alias (byte*) print_char_cursor#3 = (byte*) print_char_cursor#9 Alias (byte*) main::at#0 = (byte*~) main::$1 Alias (byte*) main::at#4 = (byte*) main::at#5 Alias (byte) main::k#2 = (byte) main::k#3 Alias (byte*) main::at_line#3 = (byte*) main::at_line#5 (byte*) main::at_line#7 -Alias (signed byte*) ap#10 = (signed byte*) ap#9 (signed byte*) ap#7 -Alias (signed byte*) bp#10 = (signed byte*) bp#9 (signed byte*) bp#7 -Alias (byte*) mulf_sqr1#10 = (byte*) mulf_sqr1#9 (byte*) mulf_sqr1#7 -Alias (byte*) mulf_sqr2#10 = (byte*) mulf_sqr2#9 (byte*) mulf_sqr2#7 -Alias (signed byte*) cp#10 = (signed byte*) cp#9 (signed byte*) cp#7 Alias (byte*) print_line_cursor#29 = (byte*) print_line_cursor#30 (byte*) print_line_cursor#31 Alias (byte*) print_char_cursor#29 = (byte*) print_char_cursor#30 (byte*) print_char_cursor#31 Alias (byte*) main::at#2 = (byte*) main::at_line#1 (byte*) main::at#9 (byte*) main::at_line#10 Alias (byte) main::i#2 = (byte) main::i#6 -Alias (signed byte*) ap#4 = (signed byte*) ap#5 -Alias (signed byte*) bp#4 = (signed byte*) bp#5 -Alias (byte*) mulf_sqr1#4 = (byte*) mulf_sqr1#5 -Alias (byte*) mulf_sqr2#4 = (byte*) mulf_sqr2#5 -Alias (signed byte*) cp#4 = (signed byte*) cp#5 Alias (byte*) print_line_cursor#27 = (byte*) print_line_cursor#28 Alias (byte*) print_char_cursor#27 = (byte*) print_char_cursor#28 Alias (signed byte) fmul8::return#0 = (signed byte) fmul8::return#3 Alias (byte*) main::at#3 = (byte*) main::at#7 (byte*) main::at#8 Alias (byte) main::j#2 = (byte) main::j#4 (byte) main::j#3 Alias (byte) main::i#3 = (byte) main::i#7 (byte) main::i#5 (byte) main::i#4 -Alias (signed byte*) ap#2 = (signed byte*) ap#6 (signed byte*) ap#3 (signed byte*) ap#8 -Alias (signed byte*) bp#2 = (signed byte*) bp#6 (signed byte*) bp#3 (signed byte*) bp#8 -Alias (byte*) mulf_sqr1#2 = (byte*) mulf_sqr1#6 (byte*) mulf_sqr1#3 (byte*) mulf_sqr1#8 -Alias (byte*) mulf_sqr2#2 = (byte*) mulf_sqr2#6 (byte*) mulf_sqr2#3 (byte*) mulf_sqr2#8 -Alias (signed byte*) cp#2 = (signed byte*) cp#6 (signed byte*) cp#3 (signed byte*) cp#8 Alias (byte*) main::at_line#4 = (byte*) main::at_line#8 (byte*) main::at_line#9 (byte*) main::at_line#6 Alias (byte*) print_line_cursor#10 = (byte*) print_line_cursor#22 (byte*) print_line_cursor#26 (byte*) print_line_cursor#19 (byte*) print_line_cursor#15 (byte*) print_line_cursor#4 Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#22 (byte*) print_char_cursor#26 (byte*) print_char_cursor#19 (byte*) print_char_cursor#15 (byte*) print_char_cursor#4 Alias (signed byte) main::r#0 = (signed byte~) main::$5 Alias (byte*) print_line_cursor#11 = (byte*) print_line_cursor#5 Alias (byte*) print_char_cursor#11 = (byte*) print_char_cursor#5 -Alias (byte) init_screen::WHITE#1 = (byte) init_screen::WHITE#3 Alias (byte*) init_screen::COLS#2 = (byte*) init_screen::COLS#4 Alias (byte*) print_line_cursor#20 = (byte*) print_line_cursor#23 Alias (byte*) print_char_cursor#20 = (byte*) print_char_cursor#23 Alias (byte*) print_line_cursor#12 = (byte*) print_line_cursor#17 (byte*) print_line_cursor#6 Alias (byte*) print_char_cursor#12 = (byte*) print_char_cursor#17 (byte*) print_char_cursor#6 Alias (signed byte) fmul8::return#1 = (signed byte) fmul8::return#4 (signed byte) fmul8::return#2 -Alias (signed byte*) ap#0 = (signed byte*) ap#13 -Alias (signed byte*) bp#0 = (signed byte*) bp#13 -Alias (signed byte*) cp#0 = (signed byte*) cp#13 Alias (byte*) print_line_cursor#13 = (byte*) print_line_cursor#7 Alias (byte*) print_char_cursor#13 = (byte*) print_char_cursor#7 Successful SSA optimization Pass2AliasElimination @@ -820,27 +670,15 @@ Alias (byte*) print_sbyte_at::at#3 = (byte*) print_sbyte_at::at#5 Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (byte*) print_line_cursor#1 Self Phi Eliminated (byte*) main::at_line#3 -Self Phi Eliminated (signed byte*) ap#10 -Self Phi Eliminated (signed byte*) bp#10 -Self Phi Eliminated (byte*) mulf_sqr1#10 -Self Phi Eliminated (byte*) mulf_sqr2#10 -Self Phi Eliminated (signed byte*) cp#10 Self Phi Eliminated (byte*) print_line_cursor#29 Self Phi Eliminated (byte*) print_char_cursor#29 Self Phi Eliminated (byte) main::i#3 -Self Phi Eliminated (signed byte*) ap#2 -Self Phi Eliminated (signed byte*) bp#2 -Self Phi Eliminated (byte*) mulf_sqr1#2 -Self Phi Eliminated (byte*) mulf_sqr2#2 -Self Phi Eliminated (signed byte*) cp#2 Self Phi Eliminated (byte*) main::at_line#4 Self Phi Eliminated (byte*) print_line_cursor#10 Self Phi Eliminated (byte*) print_char_cursor#10 -Self Phi Eliminated (byte) init_screen::WHITE#1 Self Phi Eliminated (byte*) init_screen::COLS#2 Self Phi Eliminated (byte*) print_line_cursor#20 Self Phi Eliminated (byte*) print_char_cursor#20 -Self Phi Eliminated (byte) init_screen::WHITE#2 Self Phi Eliminated (byte*) print_line_cursor#12 Self Phi Eliminated (byte*) print_char_cursor#12 Successful SSA optimization Pass2SelfPhiElimination @@ -851,27 +689,12 @@ Redundant Phi (byte*) print_line_cursor#1 (byte*) print_screen#1 Redundant Phi (byte*) print_line_cursor#14 (byte*) print_line_cursor#0 Redundant Phi (byte*) print_char_cursor#14 (byte*) print_line_cursor#0 Redundant Phi (byte*) print_screen#5 (byte*) print_line_cursor#0 -Redundant Phi (signed byte*) ap#11 (signed byte*) ap#0 -Redundant Phi (signed byte*) bp#11 (signed byte*) bp#0 -Redundant Phi (byte*) mulf_sqr1#11 (byte*) mulf_sqr1#0 -Redundant Phi (byte*) mulf_sqr2#11 (byte*) mulf_sqr2#0 -Redundant Phi (signed byte*) cp#11 (signed byte*) cp#0 Redundant Phi (byte*) print_line_cursor#3 (byte*) print_line_cursor#12 Redundant Phi (byte*) print_char_cursor#3 (byte*) print_char_cursor#12 Redundant Phi (byte*) main::at_line#3 (byte*) main::at_line#0 -Redundant Phi (signed byte*) ap#10 (signed byte*) ap#11 -Redundant Phi (signed byte*) bp#10 (signed byte*) bp#11 -Redundant Phi (byte*) mulf_sqr1#10 (byte*) mulf_sqr1#11 -Redundant Phi (byte*) mulf_sqr2#10 (byte*) mulf_sqr2#11 -Redundant Phi (signed byte*) cp#10 (signed byte*) cp#11 Redundant Phi (byte*) print_line_cursor#29 (byte*) print_line_cursor#3 Redundant Phi (byte*) print_char_cursor#29 (byte*) print_char_cursor#3 Redundant Phi (byte) main::i#3 (byte) main::i#2 -Redundant Phi (signed byte*) ap#2 (signed byte*) ap#4 -Redundant Phi (signed byte*) bp#2 (signed byte*) bp#4 -Redundant Phi (byte*) mulf_sqr1#2 (byte*) mulf_sqr1#4 -Redundant Phi (byte*) mulf_sqr2#2 (byte*) mulf_sqr2#4 -Redundant Phi (signed byte*) cp#2 (signed byte*) cp#4 Redundant Phi (byte*) main::at_line#4 (byte*) main::at#2 Redundant Phi (byte*) print_line_cursor#10 (byte*) print_line_cursor#27 Redundant Phi (byte*) print_char_cursor#10 (byte*) print_char_cursor#27 @@ -880,20 +703,13 @@ Redundant Phi (byte*) print_line_cursor#16 (byte*) print_line_cursor#14 Redundant Phi (byte*) print_char_cursor#16 (byte*) print_char_cursor#14 Redundant Phi (byte*) print_line_cursor#11 (byte*) print_line_cursor#1 Redundant Phi (byte*) print_char_cursor#11 (byte*) print_line_cursor#1 -Redundant Phi (byte) init_screen::WHITE#1 (byte) init_screen::WHITE#0 Redundant Phi (byte*) init_screen::COLS#2 (byte*) init_screen::COLS#0 Redundant Phi (byte*) print_line_cursor#20 (byte*) print_line_cursor#11 Redundant Phi (byte*) print_char_cursor#20 (byte*) print_char_cursor#11 -Redundant Phi (byte) init_screen::WHITE#2 (byte) init_screen::WHITE#1 Redundant Phi (byte*) print_line_cursor#12 (byte*) print_line_cursor#20 Redundant Phi (byte*) print_char_cursor#12 (byte*) print_char_cursor#20 Redundant Phi (signed byte) fmul8::a#1 (signed byte) fmul8::a#0 -Redundant Phi (signed byte*) ap#1 (signed byte*) ap#2 Redundant Phi (signed byte) fmul8::b#1 (signed byte) fmul8::b#0 -Redundant Phi (signed byte*) bp#1 (signed byte*) bp#2 -Redundant Phi (byte*) mulf_sqr1#1 (byte*) mulf_sqr1#2 -Redundant Phi (byte*) mulf_sqr2#1 (byte*) mulf_sqr2#2 -Redundant Phi (signed byte*) cp#1 (signed byte*) cp#2 Redundant Phi (byte*) print_line_cursor#13 (byte*) print_line_cursor#10 Redundant Phi (byte*) print_char_cursor#13 (byte*) print_char_cursor#10 Successful SSA optimization Pass2RedundantPhiElimination @@ -957,18 +773,6 @@ Culled Empty Block (label) init_screen::@3 Culled Empty Block (label) @21 Culled Empty Block (label) @23 Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (signed byte*) ap#4 -Self Phi Eliminated (signed byte*) bp#4 -Self Phi Eliminated (byte*) mulf_sqr1#4 -Self Phi Eliminated (byte*) mulf_sqr2#4 -Self Phi Eliminated (signed byte*) cp#4 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (signed byte*) ap#4 (const signed byte*) ap#0 -Redundant Phi (signed byte*) bp#4 (const signed byte*) bp#0 -Redundant Phi (byte*) mulf_sqr1#4 (const byte*) mulf_sqr1#0 -Redundant Phi (byte*) mulf_sqr2#4 (const byte*) mulf_sqr2#0 -Redundant Phi (signed byte*) cp#4 (const signed byte*) cp#0 -Successful SSA optimization Pass2RedundantPhiElimination Inlining constant with var siblings (const byte) print_char_at::ch#0 Inlining constant with var siblings (const byte) print_char_at::ch#1 Inlining constant with var siblings (const byte*) print_cls::sc#0 diff --git a/src/test/ref/examples/multiplexer/simple-multiplexer.log b/src/test/ref/examples/multiplexer/simple-multiplexer.log index f6c1ebddc..60d226d0d 100644 --- a/src/test/ref/examples/multiplexer/simple-multiplexer.log +++ b/src/test/ref/examples/multiplexer/simple-multiplexer.log @@ -1,3 +1,6 @@ +Identified constant variable (byte*) SCREEN +Identified constant variable (byte*) SPRITE +Identified constant variable (byte*) YSIN Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx Inlined call call plexSetScreen (byte*) plexInit::screen Inlined call call plexFreePrepare @@ -332,19 +335,15 @@ plexShowSprite::@return: scope:[plexShowSprite] from plexShowSprite::@3 plexSho }} to:@15 main: scope:[main] from @15 - (byte*) YSIN#11 ← phi( @15/(byte*) YSIN#13 ) - (byte*) SPRITE#4 ← phi( @15/(byte*) SPRITE#5 ) (byte) plex_free_next#31 ← phi( @15/(byte) plex_free_next#29 ) (byte) plex_sprite_msb#33 ← phi( @15/(byte) plex_sprite_msb#30 ) (byte) plex_sprite_idx#34 ← phi( @15/(byte) plex_sprite_idx#32 ) (byte) plex_show_idx#34 ← phi( @15/(byte) plex_show_idx#32 ) - (byte*) SCREEN#2 ← phi( @15/(byte*) SCREEN#3 ) (byte*) PLEX_SCREEN_PTR#17 ← phi( @15/(byte*) PLEX_SCREEN_PTR#21 ) asm { sei } call init to:main::@1 main::@1: scope:[main] from main - (byte*) YSIN#9 ← phi( main/(byte*) YSIN#11 ) (byte) plex_free_next#24 ← phi( main/(byte) plex_free_next#31 ) (byte) plex_sprite_msb#26 ← phi( main/(byte) plex_sprite_msb#33 ) (byte) plex_sprite_idx#29 ← phi( main/(byte) plex_sprite_idx#34 ) @@ -378,17 +377,14 @@ main::@return: scope:[main] from main::@2 return to:@return init: scope:[init] from main - (byte*) SPRITE#3 ← phi( main/(byte*) SPRITE#4 ) (byte*) PLEX_SCREEN_PTR#19 ← phi( main/(byte*) PLEX_SCREEN_PTR#17 ) - (byte*) SCREEN#1 ← phi( main/(byte*) SCREEN#2 ) (byte~) init::$0 ← (byte) VIC_DEN#0 | (byte) VIC_RSEL#0 (byte/word/dword~) init::$1 ← (byte~) init::$0 | (byte/signed byte/word/signed word/dword/signed dword) 3 *((byte*) D011#0) ← (byte/word/dword~) init::$1 - (byte*) plexInit::screen#0 ← (byte*) SCREEN#1 + (byte*) plexInit::screen#0 ← (byte*) SCREEN#0 call plexInit to:init::@5 init::@5: scope:[init] from init - (byte*) SPRITE#2 ← phi( init/(byte*) SPRITE#3 ) (byte*) PLEX_SCREEN_PTR#12 ← phi( init/(byte*) PLEX_SCREEN_PTR#2 ) (byte*) PLEX_SCREEN_PTR#5 ← (byte*) PLEX_SCREEN_PTR#12 (word) init::xp#0 ← (byte/signed byte/word/signed word/dword/signed dword) $20 @@ -399,8 +395,7 @@ init::@1: scope:[init] from init::@1 init::@5 (byte*) PLEX_SCREEN_PTR#28 ← phi( init::@1/(byte*) PLEX_SCREEN_PTR#28 init::@5/(byte*) PLEX_SCREEN_PTR#5 ) (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init::@5/(word) init::xp#0 ) (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init::@5/(byte) init::sx#0 ) - (byte*) SPRITE#1 ← phi( init::@1/(byte*) SPRITE#1 init::@5/(byte*) SPRITE#2 ) - (byte*~) init::$4 ← (byte*) SPRITE#1 / (byte/signed byte/word/signed word/dword/signed dword) $40 + (byte*~) init::$4 ← (byte*) SPRITE#0 / (byte/signed byte/word/signed word/dword/signed dword) $40 (byte~) init::$5 ← ((byte)) (byte*~) init::$4 *((byte[PLEX_COUNT#0]) PLEX_PTR#0 + (byte) init::sx#2) ← (byte~) init::$5 (byte~) init::$6 ← (byte) init::sx#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 @@ -430,7 +425,6 @@ init::@return: scope:[init] from init::@2 to:@return loop: scope:[loop] from main::@1 (byte*) PLEX_SCREEN_PTR#47 ← phi( main::@1/(byte*) PLEX_SCREEN_PTR#3 ) - (byte*) YSIN#7 ← phi( main::@1/(byte*) YSIN#9 ) (byte) plex_free_next#32 ← phi( main::@1/(byte) plex_free_next#24 ) (byte) plex_sprite_msb#34 ← phi( main::@1/(byte) plex_sprite_msb#26 ) (byte) plex_sprite_idx#35 ← phi( main::@1/(byte) plex_sprite_idx#29 ) @@ -439,7 +433,6 @@ loop: scope:[loop] from main::@1 to:loop::@1 loop::@1: scope:[loop] from loop loop::@27 (byte*) PLEX_SCREEN_PTR#46 ← phi( loop/(byte*) PLEX_SCREEN_PTR#47 loop::@27/(byte*) PLEX_SCREEN_PTR#48 ) - (byte*) YSIN#6 ← phi( loop/(byte*) YSIN#7 loop::@27/(byte*) YSIN#8 ) (byte) loop::sin_idx#8 ← phi( loop/(byte) loop::sin_idx#0 loop::@27/(byte) loop::sin_idx#9 ) (byte) plex_free_next#28 ← phi( loop/(byte) plex_free_next#32 loop::@27/(byte) plex_free_next#33 ) (byte) plex_sprite_msb#29 ← phi( loop/(byte) plex_sprite_msb#34 loop::@27/(byte) plex_sprite_msb#35 ) @@ -453,7 +446,6 @@ loop::@2: scope:[loop] from loop::@1 (byte) plex_sprite_msb#47 ← phi( loop::@1/(byte) plex_sprite_msb#29 ) (byte) plex_sprite_idx#47 ← phi( loop::@1/(byte) plex_sprite_idx#31 ) (byte) plex_show_idx#47 ← phi( loop::@1/(byte) plex_show_idx#31 ) - (byte*) YSIN#4 ← phi( loop::@1/(byte*) YSIN#6 ) (byte) loop::sin_idx#6 ← phi( loop::@1/(byte) loop::sin_idx#8 ) to:loop::@4 loop::@4: scope:[loop] from loop::@2 loop::@5 @@ -462,7 +454,6 @@ loop::@4: scope:[loop] from loop::@2 loop::@5 (byte) plex_sprite_msb#45 ← phi( loop::@2/(byte) plex_sprite_msb#47 loop::@5/(byte) plex_sprite_msb#48 ) (byte) plex_sprite_idx#45 ← phi( loop::@2/(byte) plex_sprite_idx#47 loop::@5/(byte) plex_sprite_idx#48 ) (byte) plex_show_idx#45 ← phi( loop::@2/(byte) plex_show_idx#47 loop::@5/(byte) plex_show_idx#48 ) - (byte*) YSIN#3 ← phi( loop::@2/(byte*) YSIN#4 loop::@5/(byte*) YSIN#5 ) (byte) loop::sin_idx#4 ← phi( loop::@2/(byte) loop::sin_idx#6 loop::@5/(byte) loop::sin_idx#7 ) (bool~) loop::$0 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $ff if((bool~) loop::$0) goto loop::@5 @@ -473,7 +464,6 @@ loop::@5: scope:[loop] from loop::@4 (byte) plex_sprite_msb#48 ← phi( loop::@4/(byte) plex_sprite_msb#45 ) (byte) plex_sprite_idx#48 ← phi( loop::@4/(byte) plex_sprite_idx#45 ) (byte) plex_show_idx#48 ← phi( loop::@4/(byte) plex_show_idx#45 ) - (byte*) YSIN#5 ← phi( loop::@4/(byte*) YSIN#3 ) (byte) loop::sin_idx#7 ← phi( loop::@4/(byte) loop::sin_idx#4 ) to:loop::@4 loop::@6: scope:[loop] from loop::@4 @@ -482,7 +472,6 @@ loop::@6: scope:[loop] from loop::@4 (byte) plex_sprite_msb#42 ← phi( loop::@4/(byte) plex_sprite_msb#45 ) (byte) plex_sprite_idx#42 ← phi( loop::@4/(byte) plex_sprite_idx#45 ) (byte) plex_show_idx#42 ← phi( loop::@4/(byte) plex_show_idx#45 ) - (byte*) YSIN#2 ← phi( loop::@4/(byte*) YSIN#3 ) (byte) loop::sin_idx#2 ← phi( loop::@4/(byte) loop::sin_idx#4 ) *((byte*) BORDERCOL#0) ← ++ *((byte*) BORDERCOL#0) (byte) loop::y_idx#0 ← (byte) loop::sin_idx#2 @@ -498,15 +487,13 @@ loop::@7: scope:[loop] from loop::@6 loop::@7 (byte) loop::sin_idx#5 ← phi( loop::@6/(byte) loop::sin_idx#2 loop::@7/(byte) loop::sin_idx#5 ) (byte) loop::sy#2 ← phi( loop::@6/(byte) loop::sy#0 loop::@7/(byte) loop::sy#1 ) (byte) loop::y_idx#2 ← phi( loop::@6/(byte) loop::y_idx#0 loop::@7/(byte) loop::y_idx#1 ) - (byte*) YSIN#1 ← phi( loop::@6/(byte*) YSIN#2 loop::@7/(byte*) YSIN#1 ) - *((byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) loop::sy#2) ← *((byte*) YSIN#1 + (byte) loop::y_idx#2) + *((byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) loop::sy#2) ← *((byte*) YSIN#0 + (byte) loop::y_idx#2) (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte/signed byte/word/signed word/dword/signed dword) 8 (byte) loop::sy#1 ← (byte) loop::sy#2 + rangenext(0,loop::$1) (bool~) loop::$2 ← (byte) loop::sy#1 != rangelast(0,loop::$1) if((bool~) loop::$2) goto loop::@7 to:loop::@20 loop::@20: scope:[loop] from loop::@7 - (byte*) YSIN#24 ← phi( loop::@7/(byte*) YSIN#1 ) (byte*) PLEX_SCREEN_PTR#40 ← phi( loop::@7/(byte*) PLEX_SCREEN_PTR#41 ) (byte) plex_free_next#25 ← phi( loop::@7/(byte) plex_free_next#34 ) (byte) plex_sprite_msb#27 ← phi( loop::@7/(byte) plex_sprite_msb#36 ) @@ -518,7 +505,6 @@ loop::@20: scope:[loop] from loop::@7 call plexSort to:loop::@30 loop::@30: scope:[loop] from loop::@20 - (byte*) YSIN#22 ← phi( loop::@20/(byte*) YSIN#24 ) (byte) loop::sin_idx#20 ← phi( loop::@20/(byte) loop::sin_idx#1 ) (byte*) PLEX_SCREEN_PTR#38 ← phi( loop::@20/(byte*) PLEX_SCREEN_PTR#40 ) (byte) plex_free_next#16 ← phi( loop::@20/(byte) plex_free_next#1 ) @@ -532,7 +518,6 @@ loop::@30: scope:[loop] from loop::@20 *((byte*) BORDERCOL#0) ← (byte) BLACK#0 to:loop::@8 loop::@8: scope:[loop] from loop::@30 loop::@9 - (byte*) YSIN#21 ← phi( loop::@30/(byte*) YSIN#22 loop::@9/(byte*) YSIN#23 ) (byte) loop::sin_idx#19 ← phi( loop::@30/(byte) loop::sin_idx#20 loop::@9/(byte) loop::sin_idx#21 ) (byte*) PLEX_SCREEN_PTR#37 ← phi( loop::@30/(byte*) PLEX_SCREEN_PTR#38 loop::@9/(byte*) PLEX_SCREEN_PTR#39 ) (byte) plex_sprite_msb#52 ← phi( loop::@30/(byte) plex_sprite_msb#8 loop::@9/(byte) plex_sprite_msb#53 ) @@ -544,7 +529,6 @@ loop::@8: scope:[loop] from loop::@30 loop::@9 if((bool~) loop::$5) goto loop::@9 to:loop::@10 loop::@9: scope:[loop] from loop::@8 - (byte*) YSIN#23 ← phi( loop::@8/(byte*) YSIN#21 ) (byte) loop::sin_idx#21 ← phi( loop::@8/(byte) loop::sin_idx#19 ) (byte*) PLEX_SCREEN_PTR#39 ← phi( loop::@8/(byte*) PLEX_SCREEN_PTR#37 ) (byte) plex_sprite_msb#53 ← phi( loop::@8/(byte) plex_sprite_msb#52 ) @@ -553,7 +537,6 @@ loop::@9: scope:[loop] from loop::@8 (byte) plex_free_next#46 ← phi( loop::@8/(byte) plex_free_next#41 ) to:loop::@8 loop::@10: scope:[loop] from loop::@8 - (byte*) YSIN#20 ← phi( loop::@8/(byte*) YSIN#21 ) (byte) loop::sin_idx#18 ← phi( loop::@8/(byte) loop::sin_idx#19 ) (byte*) PLEX_SCREEN_PTR#35 ← phi( loop::@8/(byte*) PLEX_SCREEN_PTR#37 ) (byte) plex_sprite_msb#51 ← phi( loop::@8/(byte) plex_sprite_msb#52 ) @@ -564,7 +547,6 @@ loop::@10: scope:[loop] from loop::@8 (byte) loop::ss#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:loop::@11 loop::@11: scope:[loop] from loop::@10 loop::@31 - (byte*) YSIN#19 ← phi( loop::@10/(byte*) YSIN#20 loop::@31/(byte*) YSIN#10 ) (byte) loop::sin_idx#17 ← phi( loop::@10/(byte) loop::sin_idx#18 loop::@31/(byte) loop::sin_idx#10 ) (byte*) PLEX_SCREEN_PTR#34 ← phi( loop::@10/(byte*) PLEX_SCREEN_PTR#35 loop::@31/(byte*) PLEX_SCREEN_PTR#36 ) (byte) loop::ss#9 ← phi( loop::@10/(byte) loop::ss#0 loop::@31/(byte) loop::ss#1 ) @@ -575,7 +557,6 @@ loop::@11: scope:[loop] from loop::@10 loop::@31 *((byte*) BORDERCOL#0) ← (byte) BLACK#0 to:loop::plexFreeNextYpos1 loop::plexFreeNextYpos1: scope:[loop] from loop::@11 - (byte*) YSIN#18 ← phi( loop::@11/(byte*) YSIN#19 ) (byte) loop::sin_idx#16 ← phi( loop::@11/(byte) loop::sin_idx#17 ) (byte*) PLEX_SCREEN_PTR#33 ← phi( loop::@11/(byte*) PLEX_SCREEN_PTR#34 ) (byte) loop::ss#8 ← phi( loop::@11/(byte) loop::ss#9 ) @@ -586,7 +567,6 @@ loop::plexFreeNextYpos1: scope:[loop] from loop::@11 (byte) loop::plexFreeNextYpos1_return#0 ← *((byte[8]) PLEX_FREE_YPOS#0 + (byte) plex_free_next#17) to:loop::plexFreeNextYpos1_@return loop::plexFreeNextYpos1_@return: scope:[loop] from loop::plexFreeNextYpos1 - (byte*) YSIN#17 ← phi( loop::plexFreeNextYpos1/(byte*) YSIN#18 ) (byte) loop::sin_idx#15 ← phi( loop::plexFreeNextYpos1/(byte) loop::sin_idx#16 ) (byte*) PLEX_SCREEN_PTR#32 ← phi( loop::plexFreeNextYpos1/(byte*) PLEX_SCREEN_PTR#33 ) (byte) loop::ss#7 ← phi( loop::plexFreeNextYpos1/(byte) loop::ss#8 ) @@ -598,7 +578,6 @@ loop::plexFreeNextYpos1_@return: scope:[loop] from loop::plexFreeNextYpos1 (byte) loop::plexFreeNextYpos1_return#1 ← (byte) loop::plexFreeNextYpos1_return#2 to:loop::@29 loop::@29: scope:[loop] from loop::plexFreeNextYpos1_@return - (byte*) YSIN#16 ← phi( loop::plexFreeNextYpos1_@return/(byte*) YSIN#17 ) (byte) loop::sin_idx#14 ← phi( loop::plexFreeNextYpos1_@return/(byte) loop::sin_idx#15 ) (byte*) PLEX_SCREEN_PTR#31 ← phi( loop::plexFreeNextYpos1_@return/(byte*) PLEX_SCREEN_PTR#32 ) (byte) loop::ss#6 ← phi( loop::plexFreeNextYpos1_@return/(byte) loop::ss#7 ) @@ -611,7 +590,6 @@ loop::@29: scope:[loop] from loop::plexFreeNextYpos1_@return (byte) loop::rasterY#0 ← (byte~) loop::$7 to:loop::@12 loop::@12: scope:[loop] from loop::@13 loop::@29 - (byte*) YSIN#14 ← phi( loop::@13/(byte*) YSIN#15 loop::@29/(byte*) YSIN#16 ) (byte) loop::sin_idx#12 ← phi( loop::@13/(byte) loop::sin_idx#13 loop::@29/(byte) loop::sin_idx#14 ) (byte*) PLEX_SCREEN_PTR#29 ← phi( loop::@13/(byte*) PLEX_SCREEN_PTR#30 loop::@29/(byte*) PLEX_SCREEN_PTR#31 ) (byte) loop::ss#4 ← phi( loop::@13/(byte) loop::ss#5 loop::@29/(byte) loop::ss#6 ) @@ -624,7 +602,6 @@ loop::@12: scope:[loop] from loop::@13 loop::@29 if((bool~) loop::$8) goto loop::@13 to:loop::@14 loop::@13: scope:[loop] from loop::@12 - (byte*) YSIN#15 ← phi( loop::@12/(byte*) YSIN#14 ) (byte) loop::sin_idx#13 ← phi( loop::@12/(byte) loop::sin_idx#12 ) (byte*) PLEX_SCREEN_PTR#30 ← phi( loop::@12/(byte*) PLEX_SCREEN_PTR#29 ) (byte) loop::ss#5 ← phi( loop::@12/(byte) loop::ss#4 ) @@ -635,7 +612,6 @@ loop::@13: scope:[loop] from loop::@12 (byte) loop::rasterY#2 ← phi( loop::@12/(byte) loop::rasterY#1 ) to:loop::@12 loop::@14: scope:[loop] from loop::@12 - (byte*) YSIN#12 ← phi( loop::@12/(byte*) YSIN#14 ) (byte) loop::sin_idx#11 ← phi( loop::@12/(byte) loop::sin_idx#12 ) (byte*) PLEX_SCREEN_PTR#26 ← phi( loop::@12/(byte*) PLEX_SCREEN_PTR#29 ) (byte) loop::ss#3 ← phi( loop::@12/(byte) loop::ss#4 ) @@ -648,7 +624,6 @@ loop::@14: scope:[loop] from loop::@12 to:loop::@31 loop::@31: scope:[loop] from loop::@14 (byte*) PLEX_SCREEN_PTR#36 ← phi( loop::@14/(byte*) PLEX_SCREEN_PTR#26 ) - (byte*) YSIN#10 ← phi( loop::@14/(byte*) YSIN#12 ) (byte) loop::sin_idx#10 ← phi( loop::@14/(byte) loop::sin_idx#11 ) (byte) loop::ss#2 ← phi( loop::@14/(byte) loop::ss#3 ) (byte) plex_sprite_msb#20 ← phi( loop::@14/(byte) plex_sprite_msb#5 ) @@ -665,7 +640,6 @@ loop::@31: scope:[loop] from loop::@14 to:loop::@27 loop::@27: scope:[loop] from loop::@31 (byte*) PLEX_SCREEN_PTR#48 ← phi( loop::@31/(byte*) PLEX_SCREEN_PTR#36 ) - (byte*) YSIN#8 ← phi( loop::@31/(byte*) YSIN#10 ) (byte) loop::sin_idx#9 ← phi( loop::@31/(byte) loop::sin_idx#10 ) (byte) plex_free_next#33 ← phi( loop::@31/(byte) plex_free_next#8 ) (byte) plex_sprite_msb#35 ← phi( loop::@31/(byte) plex_sprite_msb#9 ) @@ -685,9 +659,6 @@ loop::@return: scope:[loop] from loop::@1 return to:@return @15: scope:[] from @12 - (byte*) YSIN#13 ← phi( @12/(byte*) YSIN#0 ) - (byte*) SPRITE#5 ← phi( @12/(byte*) SPRITE#0 ) - (byte*) SCREEN#3 ← phi( @12/(byte*) SCREEN#0 ) (byte) plex_free_next#29 ← phi( @12/(byte) plex_free_next#37 ) (byte) plex_sprite_msb#30 ← phi( @12/(byte) plex_sprite_msb#38 ) (byte) plex_sprite_idx#32 ← phi( @12/(byte) plex_sprite_idx#39 ) @@ -892,16 +863,8 @@ SYMBOL TABLE SSA (byte) RED#0 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 (byte*) SPRITE (byte*) SPRITE#0 -(byte*) SPRITE#1 -(byte*) SPRITE#2 -(byte*) SPRITE#3 -(byte*) SPRITE#4 -(byte*) SPRITE#5 (byte*) SPRITES_COLS (byte*) SPRITES_COLS#0 (byte*) SPRITES_ENABLE @@ -952,30 +915,6 @@ SYMBOL TABLE SSA (byte) YELLOW#0 (byte*) YSIN (byte*) YSIN#0 -(byte*) YSIN#1 -(byte*) YSIN#10 -(byte*) YSIN#11 -(byte*) YSIN#12 -(byte*) YSIN#13 -(byte*) YSIN#14 -(byte*) YSIN#15 -(byte*) YSIN#16 -(byte*) YSIN#17 -(byte*) YSIN#18 -(byte*) YSIN#19 -(byte*) YSIN#2 -(byte*) YSIN#20 -(byte*) YSIN#21 -(byte*) YSIN#22 -(byte*) YSIN#23 -(byte*) YSIN#24 -(byte*) YSIN#3 -(byte*) YSIN#4 -(byte*) YSIN#5 -(byte*) YSIN#6 -(byte*) YSIN#7 -(byte*) YSIN#8 -(byte*) YSIN#9 (void()) init() (byte~) init::$0 (byte/word/dword~) init::$1 @@ -1454,25 +1393,21 @@ Alias (byte) plex_show_idx#29 = (byte) plex_show_idx#34 Alias (byte) plex_sprite_idx#29 = (byte) plex_sprite_idx#34 Alias (byte) plex_sprite_msb#26 = (byte) plex_sprite_msb#33 Alias (byte) plex_free_next#24 = (byte) plex_free_next#31 -Alias (byte*) YSIN#11 = (byte*) YSIN#9 Alias (byte*) PLEX_SCREEN_PTR#10 = (byte*) PLEX_SCREEN_PTR#3 (byte*) PLEX_SCREEN_PTR#18 (byte*) PLEX_SCREEN_PTR#11 (byte*) PLEX_SCREEN_PTR#4 Alias (byte) plex_show_idx#16 = (byte) plex_show_idx#5 (byte) plex_show_idx#17 (byte) plex_show_idx#6 Alias (byte) plex_sprite_idx#16 = (byte) plex_sprite_idx#5 (byte) plex_sprite_idx#17 (byte) plex_sprite_idx#6 Alias (byte) plex_sprite_msb#17 = (byte) plex_sprite_msb#6 (byte) plex_sprite_msb#18 (byte) plex_sprite_msb#7 Alias (byte) plex_free_next#14 = (byte) plex_free_next#5 (byte) plex_free_next#15 (byte) plex_free_next#6 -Alias (byte*) SPRITE#2 = (byte*) SPRITE#3 Alias (byte*) PLEX_SCREEN_PTR#12 = (byte*) PLEX_SCREEN_PTR#5 Alias (byte*) PLEX_SCREEN_PTR#24 = (byte*) PLEX_SCREEN_PTR#28 Alias (byte*) PLEX_SCREEN_PTR#13 = (byte*) PLEX_SCREEN_PTR#20 (byte*) PLEX_SCREEN_PTR#6 Alias (byte) loop::sin_idx#6 = (byte) loop::sin_idx#8 -Alias (byte*) YSIN#4 = (byte*) YSIN#6 Alias (byte) plex_show_idx#20 = (byte) plex_show_idx#47 (byte) plex_show_idx#31 (byte) plex_show_idx#9 Alias (byte) plex_sprite_idx#20 = (byte) plex_sprite_idx#47 (byte) plex_sprite_idx#31 (byte) plex_sprite_idx#9 Alias (byte) plex_sprite_msb#10 = (byte) plex_sprite_msb#47 (byte) plex_sprite_msb#29 (byte) plex_sprite_msb#21 Alias (byte) plex_free_next#19 = (byte) plex_free_next#48 (byte) plex_free_next#28 (byte) plex_free_next#9 Alias (byte*) PLEX_SCREEN_PTR#44 = (byte*) PLEX_SCREEN_PTR#46 Alias (byte) loop::sin_idx#2 = (byte) loop::sin_idx#7 (byte) loop::sin_idx#4 (byte) loop::y_idx#0 -Alias (byte*) YSIN#2 = (byte*) YSIN#5 (byte*) YSIN#3 Alias (byte) plex_show_idx#42 = (byte) plex_show_idx#48 (byte) plex_show_idx#45 Alias (byte) plex_sprite_idx#42 = (byte) plex_sprite_idx#48 (byte) plex_sprite_idx#45 Alias (byte) plex_sprite_msb#42 = (byte) plex_sprite_msb#48 (byte) plex_sprite_msb#45 @@ -1484,7 +1419,6 @@ Alias (byte) plex_sprite_idx#30 = (byte) plex_sprite_idx#37 Alias (byte) plex_sprite_msb#27 = (byte) plex_sprite_msb#36 Alias (byte) plex_free_next#25 = (byte) plex_free_next#34 Alias (byte*) PLEX_SCREEN_PTR#38 = (byte*) PLEX_SCREEN_PTR#40 (byte*) PLEX_SCREEN_PTR#41 -Alias (byte*) YSIN#1 = (byte*) YSIN#24 (byte*) YSIN#22 Alias (byte) loop::sin_idx#1 = (byte) loop::sin_idx#20 Alias (byte) plex_show_idx#18 = (byte) plex_show_idx#7 Alias (byte) plex_sprite_idx#18 = (byte) plex_sprite_idx#7 @@ -1496,7 +1430,6 @@ Alias (byte) plex_show_idx#51 = (byte) plex_show_idx#53 (byte) plex_show_idx#52 Alias (byte) plex_sprite_msb#51 = (byte) plex_sprite_msb#53 (byte) plex_sprite_msb#52 Alias (byte*) PLEX_SCREEN_PTR#35 = (byte*) PLEX_SCREEN_PTR#39 (byte*) PLEX_SCREEN_PTR#37 Alias (byte) loop::sin_idx#18 = (byte) loop::sin_idx#21 (byte) loop::sin_idx#19 -Alias (byte*) YSIN#20 = (byte*) YSIN#23 (byte*) YSIN#21 Alias (byte) plex_free_next#17 = (byte) plex_free_next#26 (byte) plex_free_next#47 (byte) plex_free_next#43 Alias (byte) plex_sprite_idx#44 = (byte) plex_sprite_idx#49 (byte) plex_sprite_idx#50 (byte) plex_sprite_idx#46 Alias (byte) plex_show_idx#44 = (byte) plex_show_idx#49 (byte) plex_show_idx#50 (byte) plex_show_idx#46 @@ -1504,7 +1437,6 @@ Alias (byte) plex_sprite_msb#44 = (byte) plex_sprite_msb#49 (byte) plex_sprite_m Alias (byte) loop::ss#6 = (byte) loop::ss#8 (byte) loop::ss#9 (byte) loop::ss#7 Alias (byte*) PLEX_SCREEN_PTR#31 = (byte*) PLEX_SCREEN_PTR#33 (byte*) PLEX_SCREEN_PTR#34 (byte*) PLEX_SCREEN_PTR#32 Alias (byte) loop::sin_idx#14 = (byte) loop::sin_idx#16 (byte) loop::sin_idx#17 (byte) loop::sin_idx#15 -Alias (byte*) YSIN#16 = (byte*) YSIN#18 (byte*) YSIN#19 (byte*) YSIN#17 Alias (byte) loop::plexFreeNextYpos1_return#0 = (byte) loop::plexFreeNextYpos1_return#2 (byte) loop::plexFreeNextYpos1_return#1 (byte) loop::plexFreeNextYpos1_return#3 (byte~) loop::$7 (byte) loop::rasterY#0 Alias (byte) loop::rasterY#1 = (byte) loop::rasterY#2 Alias (byte) plex_sprite_idx#23 = (byte) plex_sprite_idx#43 (byte) plex_sprite_idx#38 @@ -1514,14 +1446,10 @@ Alias (byte) plex_sprite_msb#28 = (byte) plex_sprite_msb#43 (byte) plex_sprite_m Alias (byte) loop::ss#2 = (byte) loop::ss#5 (byte) loop::ss#4 (byte) loop::ss#3 Alias (byte*) PLEX_SCREEN_PTR#26 = (byte*) PLEX_SCREEN_PTR#30 (byte*) PLEX_SCREEN_PTR#29 (byte*) PLEX_SCREEN_PTR#36 (byte*) PLEX_SCREEN_PTR#48 Alias (byte) loop::sin_idx#10 = (byte) loop::sin_idx#13 (byte) loop::sin_idx#12 (byte) loop::sin_idx#11 (byte) loop::sin_idx#9 -Alias (byte*) YSIN#10 = (byte*) YSIN#15 (byte*) YSIN#14 (byte*) YSIN#12 (byte*) YSIN#8 Alias (byte) plex_free_next#18 = (byte) plex_free_next#8 (byte) plex_free_next#33 Alias (byte) plex_sprite_idx#19 = (byte) plex_sprite_idx#8 (byte) plex_sprite_idx#36 Alias (byte) plex_show_idx#19 = (byte) plex_show_idx#8 (byte) plex_show_idx#36 Alias (byte) plex_sprite_msb#20 = (byte) plex_sprite_msb#9 (byte) plex_sprite_msb#35 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#3 -Alias (byte*) SPRITE#0 = (byte*) SPRITE#5 -Alias (byte*) YSIN#0 = (byte*) YSIN#13 Alias (byte*) PLEX_SCREEN_PTR#14 = (byte*) PLEX_SCREEN_PTR#7 Alias (byte) plex_show_idx#10 = (byte) plex_show_idx#21 Alias (byte) plex_sprite_idx#10 = (byte) plex_sprite_idx#21 @@ -1542,17 +1470,14 @@ Self Phi Eliminated (byte) plexSort::m#5 Self Phi Eliminated (byte) plex_show_idx#11 Self Phi Eliminated (byte) plex_sprite_idx#11 Self Phi Eliminated (byte) plex_sprite_msb#12 -Self Phi Eliminated (byte*) SPRITE#1 Self Phi Eliminated (byte*) PLEX_SCREEN_PTR#24 Self Phi Eliminated (byte*) PLEX_SCREEN_PTR#13 Self Phi Eliminated (byte) loop::sin_idx#2 -Self Phi Eliminated (byte*) YSIN#2 Self Phi Eliminated (byte) plex_show_idx#42 Self Phi Eliminated (byte) plex_sprite_idx#42 Self Phi Eliminated (byte) plex_sprite_msb#42 Self Phi Eliminated (byte) plex_free_next#40 Self Phi Eliminated (byte*) PLEX_SCREEN_PTR#42 -Self Phi Eliminated (byte*) YSIN#1 Self Phi Eliminated (byte) loop::sin_idx#3 Self Phi Eliminated (byte) plex_show_idx#30 Self Phi Eliminated (byte) plex_sprite_idx#30 @@ -1565,7 +1490,6 @@ Self Phi Eliminated (byte) plex_show_idx#51 Self Phi Eliminated (byte) plex_sprite_msb#51 Self Phi Eliminated (byte*) PLEX_SCREEN_PTR#35 Self Phi Eliminated (byte) loop::sin_idx#18 -Self Phi Eliminated (byte*) YSIN#20 Self Phi Eliminated (byte) loop::rasterY#1 Self Phi Eliminated (byte) plex_sprite_idx#23 Self Phi Eliminated (byte) plex_show_idx#23 @@ -1574,7 +1498,6 @@ Self Phi Eliminated (byte) plex_sprite_msb#28 Self Phi Eliminated (byte) loop::ss#2 Self Phi Eliminated (byte*) PLEX_SCREEN_PTR#26 Self Phi Eliminated (byte) loop::sin_idx#10 -Self Phi Eliminated (byte*) YSIN#10 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (byte*) plexInit::plexSetScreen1_screen#0 (byte*) plexInit::screen#0 Redundant Phi (byte*) PLEX_SCREEN_PTR#15 (byte*) PLEX_SCREEN_PTR#1 @@ -1590,39 +1513,30 @@ Redundant Phi (byte) plex_free_next#12 (byte) plex_free_next#27 Redundant Phi (byte*) PLEX_SCREEN_PTR#16 (byte*) PLEX_SCREEN_PTR#26 Redundant Phi (byte) plex_sprite_msb#13 (byte) plex_sprite_msb#28 Redundant Phi (byte*) PLEX_SCREEN_PTR#17 (byte*) PLEX_SCREEN_PTR#0 -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#0 Redundant Phi (byte) plex_show_idx#29 (byte) plex_show_idx#0 Redundant Phi (byte) plex_sprite_idx#29 (byte) plex_sprite_idx#0 Redundant Phi (byte) plex_sprite_msb#26 (byte) plex_sprite_msb#0 Redundant Phi (byte) plex_free_next#24 (byte) plex_free_next#29 -Redundant Phi (byte*) SPRITE#4 (byte*) SPRITE#0 -Redundant Phi (byte*) YSIN#11 (byte*) YSIN#0 Redundant Phi (byte*) PLEX_SCREEN_PTR#10 (byte*) PLEX_SCREEN_PTR#13 Redundant Phi (byte) plex_show_idx#16 (byte) plex_show_idx#20 Redundant Phi (byte) plex_sprite_idx#16 (byte) plex_sprite_idx#20 Redundant Phi (byte) plex_sprite_msb#17 (byte) plex_sprite_msb#10 Redundant Phi (byte) plex_free_next#14 (byte) plex_free_next#19 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2 Redundant Phi (byte*) PLEX_SCREEN_PTR#19 (byte*) PLEX_SCREEN_PTR#17 -Redundant Phi (byte*) SPRITE#2 (byte*) SPRITE#4 Redundant Phi (byte*) PLEX_SCREEN_PTR#12 (byte*) PLEX_SCREEN_PTR#15 -Redundant Phi (byte*) SPRITE#1 (byte*) SPRITE#2 Redundant Phi (byte*) PLEX_SCREEN_PTR#24 (byte*) PLEX_SCREEN_PTR#12 Redundant Phi (byte*) PLEX_SCREEN_PTR#13 (byte*) PLEX_SCREEN_PTR#24 Redundant Phi (byte) plex_show_idx#35 (byte) plex_show_idx#29 Redundant Phi (byte) plex_sprite_idx#35 (byte) plex_sprite_idx#29 Redundant Phi (byte) plex_sprite_msb#34 (byte) plex_sprite_msb#26 Redundant Phi (byte) plex_free_next#32 (byte) plex_free_next#24 -Redundant Phi (byte*) YSIN#7 (byte*) YSIN#11 Redundant Phi (byte*) PLEX_SCREEN_PTR#47 (byte*) PLEX_SCREEN_PTR#10 Redundant Phi (byte) loop::sin_idx#2 (byte) loop::sin_idx#6 -Redundant Phi (byte*) YSIN#2 (byte*) YSIN#4 Redundant Phi (byte) plex_show_idx#42 (byte) plex_show_idx#20 Redundant Phi (byte) plex_sprite_idx#42 (byte) plex_sprite_idx#20 Redundant Phi (byte) plex_sprite_msb#42 (byte) plex_sprite_msb#10 Redundant Phi (byte) plex_free_next#40 (byte) plex_free_next#19 Redundant Phi (byte*) PLEX_SCREEN_PTR#42 (byte*) PLEX_SCREEN_PTR#44 -Redundant Phi (byte*) YSIN#1 (byte*) YSIN#2 Redundant Phi (byte) loop::sin_idx#3 (byte) loop::sin_idx#2 Redundant Phi (byte) plex_show_idx#30 (byte) plex_show_idx#42 Redundant Phi (byte) plex_sprite_idx#30 (byte) plex_sprite_idx#42 @@ -1639,7 +1553,6 @@ Redundant Phi (byte) plex_show_idx#51 (byte) plex_show_idx#18 Redundant Phi (byte) plex_sprite_msb#51 (byte) plex_sprite_msb#19 Redundant Phi (byte*) PLEX_SCREEN_PTR#35 (byte*) PLEX_SCREEN_PTR#38 Redundant Phi (byte) loop::sin_idx#18 (byte) loop::sin_idx#1 -Redundant Phi (byte*) YSIN#20 (byte*) YSIN#1 Redundant Phi (byte) loop::rasterY#1 (byte) loop::plexFreeNextYpos1_return#0 Redundant Phi (byte) plex_sprite_idx#23 (byte) plex_sprite_idx#44 Redundant Phi (byte) plex_show_idx#23 (byte) plex_show_idx#44 @@ -1648,7 +1561,6 @@ Redundant Phi (byte) plex_sprite_msb#28 (byte) plex_sprite_msb#44 Redundant Phi (byte) loop::ss#2 (byte) loop::ss#6 Redundant Phi (byte*) PLEX_SCREEN_PTR#26 (byte*) PLEX_SCREEN_PTR#31 Redundant Phi (byte) loop::sin_idx#10 (byte) loop::sin_idx#14 -Redundant Phi (byte*) YSIN#10 (byte*) YSIN#16 Redundant Phi (byte) plex_free_next#18 (byte) plex_free_next#13 Redundant Phi (byte) plex_sprite_idx#19 (byte) plex_sprite_idx#15 Redundant Phi (byte) plex_show_idx#19 (byte) plex_show_idx#15 @@ -1847,19 +1759,15 @@ Alias (byte) plexSort::s#3 = (byte~) plexSort::$4 Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (byte*) PLEX_SCREEN_PTR#31 Self Phi Eliminated (byte) loop::sin_idx#14 -Self Phi Eliminated (byte*) YSIN#16 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (byte*) PLEX_SCREEN_PTR#31 (byte*) PLEX_SCREEN_PTR#44 Redundant Phi (byte) loop::sin_idx#14 (byte) loop::sin_idx#1 -Redundant Phi (byte*) YSIN#16 (byte*) YSIN#4 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) plexSort::$5 [18] if((byte) plexSort::s#1!=(byte/word/signed word/dword/signed dword) $ff) goto plexSort::@8 Simple Condition (bool~) plexSort::$6 [94] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#1))) goto plexSort::@3 Successful SSA optimization Pass2ConditionalJumpSimplification -Self Phi Eliminated (byte*) YSIN#4 Self Phi Eliminated (byte*) PLEX_SCREEN_PTR#44 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) YSIN#4 (const byte*) YSIN#0 Redundant Phi (byte*) PLEX_SCREEN_PTR#44 (const byte*) PLEX_SCREEN_PTR#1 Successful SSA optimization Pass2RedundantPhiElimination Inlining constant with var siblings (const byte) plexInit::i#0 diff --git a/src/test/ref/examples/rotate/rotate.log b/src/test/ref/examples/rotate/rotate.log index 2fd2c1be5..005a99a84 100644 --- a/src/test/ref/examples/rotate/rotate.log +++ b/src/test/ref/examples/rotate/rotate.log @@ -1,4 +1,7 @@ Resolved forward reference SPRITE to (byte*) SPRITE +Identified constant variable (byte*) SCREEN +Identified constant variable (byte*) COS +Identified constant variable (byte*) SPRITE Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx Inlined call call mulf8s_prepare (signed byte) mulf8s::a Inlined call call mulf8s_prepare (signed byte) anim::cos_a @@ -280,15 +283,11 @@ mulf8s_prepared::@return: scope:[mulf8s_prepared] from mulf8s_prepared::@2 to:@15 main: scope:[main] from @16 (byte*) SIN#10 ← phi( @16/(byte*) SIN#13 ) - (byte*) COS#10 ← phi( @16/(byte*) COS#13 ) - (byte*) SPRITE#4 ← phi( @16/(byte*) SPRITE#0 ) - (byte*) SCREEN#3 ← phi( @16/(byte*) SCREEN#4 ) asm { sei } call init to:main::@1 main::@1: scope:[main] from main (byte*) SIN#8 ← phi( main/(byte*) SIN#10 ) - (byte*) COS#8 ← phi( main/(byte*) COS#10 ) call anim to:main::@2 main::@2: scope:[main] from main::@1 @@ -297,23 +296,18 @@ main::@return: scope:[main] from main::@2 return to:@return init: scope:[init] from main - (byte*) SPRITE#3 ← phi( main/(byte*) SPRITE#4 ) - (byte*) SCREEN#2 ← phi( main/(byte*) SCREEN#3 ) call mulf_init to:init::@3 init::@3: scope:[init] from init - (byte*) SPRITE#2 ← phi( init/(byte*) SPRITE#3 ) - (byte*) SCREEN#1 ← phi( init/(byte*) SCREEN#2 ) *((byte*) SPRITES_ENABLE#0) ← (byte/word/signed word/dword/signed dword) $ff - (byte*~) init::$1 ← (byte*) SCREEN#1 + (word/signed word/dword/signed dword) $3f8 + (byte*~) init::$1 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) $3f8 (byte*) init::sprites_ptr#0 ← (byte*~) init::$1 (byte) init::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:init::@1 init::@1: scope:[init] from init::@1 init::@3 (byte) init::i#2 ← phi( init::@1/(byte) init::i#1 init::@3/(byte) init::i#0 ) (byte*) init::sprites_ptr#1 ← phi( init::@1/(byte*) init::sprites_ptr#1 init::@3/(byte*) init::sprites_ptr#0 ) - (byte*) SPRITE#1 ← phi( init::@1/(byte*) SPRITE#1 init::@3/(byte*) SPRITE#2 ) - (byte*~) init::$2 ← (byte*) SPRITE#1 / (byte/signed byte/word/signed word/dword/signed dword) $40 + (byte*~) init::$2 ← (byte*) SPRITE#0 / (byte/signed byte/word/signed word/dword/signed dword) $40 (byte~) init::$3 ← ((byte)) (byte*~) init::$2 *((byte*) init::sprites_ptr#1 + (byte) init::i#2) ← (byte~) init::$3 *((byte*) SPRITES_COLS#0 + (byte) init::i#2) ← (byte) GREEN#0 @@ -326,8 +320,6 @@ init::@return: scope:[init] from init::@1 to:@return @15: scope:[] from @13 (byte*) SIN#16 ← phi( @13/(byte*) SIN#0 ) - (byte*) COS#16 ← phi( @13/(byte*) COS#0 ) - (byte*) SCREEN#5 ← phi( @13/(byte*) SCREEN#0 ) (signed byte/signed word/signed dword~) $1 ← - (byte/signed byte/word/signed word/dword/signed dword) $46 (signed byte/signed word/signed dword~) $2 ← - (byte/signed byte/word/signed word/dword/signed dword) $46 (signed byte/signed word/signed dword~) $3 ← - (byte/signed byte/word/signed word/dword/signed dword) $46 @@ -339,38 +331,32 @@ init::@return: scope:[init] from init::@1 to:@16 anim: scope:[anim] from main::@1 (byte*) SIN#6 ← phi( main::@1/(byte*) SIN#8 ) - (byte*) COS#6 ← phi( main::@1/(byte*) COS#8 ) (byte) anim::angle#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:anim::@1 anim::@1: scope:[anim] from anim anim::@15 (byte*) SIN#5 ← phi( anim/(byte*) SIN#6 anim::@15/(byte*) SIN#7 ) (byte) anim::angle#10 ← phi( anim/(byte) anim::angle#0 anim::@15/(byte) anim::angle#1 ) - (byte*) COS#5 ← phi( anim/(byte*) COS#6 anim::@15/(byte*) COS#7 ) if(true) goto anim::@2 to:anim::@return anim::@2: scope:[anim] from anim::@1 (byte*) SIN#3 ← phi( anim::@1/(byte*) SIN#5 ) (byte) anim::angle#6 ← phi( anim::@1/(byte) anim::angle#10 ) - (byte*) COS#3 ← phi( anim::@1/(byte*) COS#5 ) to:anim::@4 anim::@4: scope:[anim] from anim::@2 anim::@5 (byte*) SIN#2 ← phi( anim::@2/(byte*) SIN#3 anim::@5/(byte*) SIN#4 ) (byte) anim::angle#4 ← phi( anim::@2/(byte) anim::angle#6 anim::@5/(byte) anim::angle#7 ) - (byte*) COS#2 ← phi( anim::@2/(byte*) COS#3 anim::@5/(byte*) COS#4 ) (bool~) anim::$0 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $ff if((bool~) anim::$0) goto anim::@5 to:anim::@6 anim::@5: scope:[anim] from anim::@4 (byte*) SIN#4 ← phi( anim::@4/(byte*) SIN#2 ) (byte) anim::angle#7 ← phi( anim::@4/(byte) anim::angle#4 ) - (byte*) COS#4 ← phi( anim::@4/(byte*) COS#2 ) to:anim::@4 anim::@6: scope:[anim] from anim::@4 (byte*) SIN#1 ← phi( anim::@4/(byte*) SIN#2 ) (byte) anim::angle#2 ← phi( anim::@4/(byte) anim::angle#4 ) - (byte*) COS#1 ← phi( anim::@4/(byte*) COS#2 ) *((byte*) BORDERCOL#0) ← ++ *((byte*) BORDERCOL#0) - (signed byte~) anim::$1 ← ((signed byte)) *((byte*) COS#1 + (byte) anim::angle#2) + (signed byte~) anim::$1 ← ((signed byte)) *((byte*) COS#0 + (byte) anim::angle#2) (signed byte) anim::cos_a#0 ← (signed byte~) anim::$1 (signed byte~) anim::$2 ← ((signed byte)) *((byte*) SIN#1 + (byte) anim::angle#2) (signed byte) anim::sin_a#0 ← (signed byte~) anim::$2 @@ -379,7 +365,6 @@ anim::@6: scope:[anim] from anim::@4 to:anim::@7 anim::@7: scope:[anim] from anim::@6 anim::@8 (byte*) SIN#24 ← phi( anim::@6/(byte*) SIN#1 anim::@8/(byte*) SIN#9 ) - (byte*) COS#24 ← phi( anim::@6/(byte*) COS#1 anim::@8/(byte*) COS#9 ) (byte) anim::angle#20 ← phi( anim::@6/(byte) anim::angle#2 anim::@8/(byte) anim::angle#5 ) (byte) anim::sprite_msb#16 ← phi( anim::@6/(byte) anim::sprite_msb#0 anim::@8/(byte) anim::sprite_msb#7 ) (signed byte) anim::sin_a#6 ← phi( anim::@6/(signed byte) anim::sin_a#0 anim::@8/(signed byte) anim::sin_a#7 ) @@ -391,7 +376,6 @@ anim::@7: scope:[anim] from anim::@6 anim::@8 to:anim::mulf8s_prepare1 anim::mulf8s_prepare1: scope:[anim] from anim::@7 (byte*) SIN#23 ← phi( anim::@7/(byte*) SIN#24 ) - (byte*) COS#23 ← phi( anim::@7/(byte*) COS#24 ) (byte) anim::angle#19 ← phi( anim::@7/(byte) anim::angle#20 ) (signed byte) anim::cos_a#13 ← phi( anim::@7/(signed byte) anim::cos_a#1 ) (byte) anim::i#14 ← phi( anim::@7/(byte) anim::i#2 ) @@ -406,7 +390,6 @@ anim::mulf8s_prepare1: scope:[anim] from anim::@7 to:anim::@19 anim::@19: scope:[anim] from anim::mulf8s_prepare1 (byte*) SIN#22 ← phi( anim::mulf8s_prepare1/(byte*) SIN#23 ) - (byte*) COS#22 ← phi( anim::mulf8s_prepare1/(byte*) COS#23 ) (byte) anim::angle#18 ← phi( anim::mulf8s_prepare1/(byte) anim::angle#19 ) (signed byte) anim::cos_a#12 ← phi( anim::mulf8s_prepare1/(signed byte) anim::cos_a#13 ) (byte) anim::i#13 ← phi( anim::mulf8s_prepare1/(byte) anim::i#14 ) @@ -417,7 +400,6 @@ anim::@19: scope:[anim] from anim::mulf8s_prepare1 to:anim::@17 anim::@17: scope:[anim] from anim::@19 (byte*) SIN#21 ← phi( anim::@19/(byte*) SIN#22 ) - (byte*) COS#21 ← phi( anim::@19/(byte*) COS#22 ) (byte) anim::angle#17 ← phi( anim::@19/(byte) anim::angle#18 ) (signed byte) anim::cos_a#11 ← phi( anim::@19/(signed byte) anim::cos_a#12 ) (byte) anim::i#12 ← phi( anim::@19/(byte) anim::i#13 ) @@ -431,7 +413,6 @@ anim::@17: scope:[anim] from anim::@19 to:anim::@20 anim::@20: scope:[anim] from anim::@17 (byte*) SIN#20 ← phi( anim::@17/(byte*) SIN#21 ) - (byte*) COS#20 ← phi( anim::@17/(byte*) COS#21 ) (byte) anim::angle#16 ← phi( anim::@17/(byte) anim::angle#17 ) (signed byte) anim::cos_a#10 ← phi( anim::@17/(signed byte) anim::cos_a#11 ) (byte) anim::i#11 ← phi( anim::@17/(byte) anim::i#12 ) @@ -449,7 +430,6 @@ anim::@20: scope:[anim] from anim::@17 to:anim::@21 anim::@21: scope:[anim] from anim::@20 (byte*) SIN#19 ← phi( anim::@20/(byte*) SIN#20 ) - (byte*) COS#19 ← phi( anim::@20/(byte*) COS#20 ) (byte) anim::angle#15 ← phi( anim::@20/(byte) anim::angle#16 ) (signed byte) anim::cos_a#9 ← phi( anim::@20/(signed byte) anim::cos_a#10 ) (byte) anim::i#10 ← phi( anim::@20/(byte) anim::i#11 ) @@ -467,7 +447,6 @@ anim::@21: scope:[anim] from anim::@20 anim::mulf8s_prepare2: scope:[anim] from anim::@21 (signed byte) anim::sin_a#13 ← phi( anim::@21/(signed byte) anim::sin_a#1 ) (byte*) SIN#18 ← phi( anim::@21/(byte*) SIN#19 ) - (byte*) COS#18 ← phi( anim::@21/(byte*) COS#19 ) (byte) anim::angle#14 ← phi( anim::@21/(byte) anim::angle#15 ) (signed byte) anim::cos_a#8 ← phi( anim::@21/(signed byte) anim::cos_a#9 ) (byte) anim::i#9 ← phi( anim::@21/(byte) anim::i#10 ) @@ -484,7 +463,6 @@ anim::mulf8s_prepare2: scope:[anim] from anim::@21 anim::@22: scope:[anim] from anim::mulf8s_prepare2 (signed byte) anim::sin_a#12 ← phi( anim::mulf8s_prepare2/(signed byte) anim::sin_a#13 ) (byte*) SIN#17 ← phi( anim::mulf8s_prepare2/(byte*) SIN#18 ) - (byte*) COS#17 ← phi( anim::mulf8s_prepare2/(byte*) COS#18 ) (byte) anim::angle#13 ← phi( anim::mulf8s_prepare2/(byte) anim::angle#14 ) (signed byte) anim::cos_a#7 ← phi( anim::mulf8s_prepare2/(signed byte) anim::cos_a#8 ) (byte) anim::i#8 ← phi( anim::mulf8s_prepare2/(byte) anim::i#9 ) @@ -497,7 +475,6 @@ anim::@22: scope:[anim] from anim::mulf8s_prepare2 anim::@18: scope:[anim] from anim::@22 (signed byte) anim::sin_a#11 ← phi( anim::@22/(signed byte) anim::sin_a#12 ) (byte*) SIN#15 ← phi( anim::@22/(byte*) SIN#17 ) - (byte*) COS#15 ← phi( anim::@22/(byte*) COS#17 ) (byte) anim::angle#12 ← phi( anim::@22/(byte) anim::angle#13 ) (signed byte) anim::cos_a#6 ← phi( anim::@22/(signed byte) anim::cos_a#7 ) (byte) anim::i#7 ← phi( anim::@22/(byte) anim::i#8 ) @@ -513,7 +490,6 @@ anim::@18: scope:[anim] from anim::@22 anim::@23: scope:[anim] from anim::@18 (signed byte) anim::sin_a#10 ← phi( anim::@18/(signed byte) anim::sin_a#11 ) (byte*) SIN#14 ← phi( anim::@18/(byte*) SIN#15 ) - (byte*) COS#14 ← phi( anim::@18/(byte*) COS#15 ) (byte) anim::angle#11 ← phi( anim::@18/(byte) anim::angle#12 ) (signed byte) anim::cos_a#5 ← phi( anim::@18/(signed byte) anim::cos_a#6 ) (byte) anim::i#6 ← phi( anim::@18/(byte) anim::i#7 ) @@ -532,7 +508,6 @@ anim::@23: scope:[anim] from anim::@18 anim::@24: scope:[anim] from anim::@23 (signed byte) anim::sin_a#9 ← phi( anim::@23/(signed byte) anim::sin_a#10 ) (byte*) SIN#12 ← phi( anim::@23/(byte*) SIN#14 ) - (byte*) COS#12 ← phi( anim::@23/(byte*) COS#14 ) (byte) anim::angle#9 ← phi( anim::@23/(byte) anim::angle#11 ) (signed byte) anim::cos_a#4 ← phi( anim::@23/(signed byte) anim::cos_a#5 ) (byte) anim::i#5 ← phi( anim::@23/(byte) anim::i#6 ) @@ -558,7 +533,6 @@ anim::@24: scope:[anim] from anim::@23 anim::@8: scope:[anim] from anim::@14 anim::@24 (signed byte) anim::sin_a#7 ← phi( anim::@14/(signed byte) anim::sin_a#8 anim::@24/(signed byte) anim::sin_a#9 ) (byte*) SIN#9 ← phi( anim::@14/(byte*) SIN#11 anim::@24/(byte*) SIN#12 ) - (byte*) COS#9 ← phi( anim::@14/(byte*) COS#11 anim::@24/(byte*) COS#12 ) (byte) anim::angle#5 ← phi( anim::@14/(byte) anim::angle#8 anim::@24/(byte) anim::angle#9 ) (byte) anim::sprite_msb#7 ← phi( anim::@14/(byte) anim::sprite_msb#2 anim::@24/(byte) anim::sprite_msb#1 ) (signed byte) anim::cos_a#2 ← phi( anim::@14/(signed byte) anim::cos_a#3 anim::@24/(signed byte) anim::cos_a#4 ) @@ -581,7 +555,6 @@ anim::@8: scope:[anim] from anim::@14 anim::@24 anim::@14: scope:[anim] from anim::@24 (signed byte) anim::sin_a#8 ← phi( anim::@24/(signed byte) anim::sin_a#9 ) (byte*) SIN#11 ← phi( anim::@24/(byte*) SIN#12 ) - (byte*) COS#11 ← phi( anim::@24/(byte*) COS#12 ) (byte) anim::angle#8 ← phi( anim::@24/(byte) anim::angle#9 ) (signed byte) anim::cos_a#3 ← phi( anim::@24/(signed byte) anim::cos_a#4 ) (signed word) anim::xpos#2 ← phi( anim::@24/(signed word) anim::xpos#0 ) @@ -592,7 +565,6 @@ anim::@14: scope:[anim] from anim::@24 to:anim::@8 anim::@15: scope:[anim] from anim::@8 (byte*) SIN#7 ← phi( anim::@8/(byte*) SIN#9 ) - (byte*) COS#7 ← phi( anim::@8/(byte*) COS#9 ) (byte) anim::angle#3 ← phi( anim::@8/(byte) anim::angle#5 ) (byte) anim::sprite_msb#5 ← phi( anim::@8/(byte) anim::sprite_msb#7 ) *((byte*) SPRITES_XMSB#0) ← (byte) anim::sprite_msb#5 @@ -604,8 +576,6 @@ anim::@return: scope:[anim] from anim::@1 to:@return @16: scope:[] from @15 (byte*) SIN#13 ← phi( @15/(byte*) SIN#16 ) - (byte*) COS#13 ← phi( @15/(byte*) COS#16 ) - (byte*) SCREEN#4 ← phi( @15/(byte*) SCREEN#5 ) (byte*) SPRITE#0 ← ((byte*)) (word/signed word/dword/signed dword) $3000 kickasm(location (byte*) SPRITE#0) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff)) .for (var y=0; y<21; y++) @@ -679,30 +649,6 @@ SYMBOL TABLE SSA (byte*) COLS#0 (byte*) COS (byte*) COS#0 -(byte*) COS#1 -(byte*) COS#10 -(byte*) COS#11 -(byte*) COS#12 -(byte*) COS#13 -(byte*) COS#14 -(byte*) COS#15 -(byte*) COS#16 -(byte*) COS#17 -(byte*) COS#18 -(byte*) COS#19 -(byte*) COS#2 -(byte*) COS#20 -(byte*) COS#21 -(byte*) COS#22 -(byte*) COS#23 -(byte*) COS#24 -(byte*) COS#3 -(byte*) COS#4 -(byte*) COS#5 -(byte*) COS#6 -(byte*) COS#7 -(byte*) COS#8 -(byte*) COS#9 (byte) CYAN (byte) CYAN#0 (byte*) D011 @@ -771,11 +717,6 @@ SYMBOL TABLE SSA (byte) RED#0 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 (byte*) SIN (byte*) SIN#0 (byte*) SIN#1 @@ -804,10 +745,6 @@ SYMBOL TABLE SSA (byte*) SIN#9 (byte*) SPRITE (byte*) SPRITE#0 -(byte*) SPRITE#1 -(byte*) SPRITE#2 -(byte*) SPRITE#3 -(byte*) SPRITE#4 (byte*) SPRITES_COLS (byte*) SPRITES_COLS#0 (byte*) SPRITES_ENABLE @@ -1246,7 +1183,7 @@ Inversing boolean not [94] (bool~) mulf_init::$4 ← (byte~) mulf_init::$2 != (b Inversing boolean not [124] (bool~) mulf_init::$14 ← (byte) mulf_init::x_255#1 != (byte/signed byte/word/signed word/dword/signed dword) 0 from [123] (bool~) mulf_init::$13 ← (byte) mulf_init::x_255#1 == (byte/signed byte/word/signed word/dword/signed dword) 0 Inversing boolean not [164] (bool~) mulf8s_prepared::$3 ← *((signed byte*) mulf8s_prepared::memA#0) >= (byte/signed byte/word/signed word/dword/signed dword) 0 from [163] (bool~) mulf8s_prepared::$2 ← *((signed byte*) mulf8s_prepared::memA#0) < (byte/signed byte/word/signed word/dword/signed dword) 0 Inversing boolean not [168] (bool~) mulf8s_prepared::$9 ← (signed byte) mulf8s_prepared::b#5 >= (byte/signed byte/word/signed word/dword/signed dword) 0 from [167] (bool~) mulf8s_prepared::$8 ← (signed byte) mulf8s_prepared::b#5 < (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [295] (bool~) anim::$20 ← (byte~) anim::$18 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [294] (bool~) anim::$19 ← (byte~) anim::$18 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [293] (bool~) anim::$20 ← (byte~) anim::$18 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [292] (bool~) anim::$19 ← (byte~) anim::$18 != (byte/signed byte/word/signed word/dword/signed dword) 0 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte*) mulf_init::sqr1_hi#0 = (byte*~) mulf_init::$0 Alias (byte*) mulf_init::sqr1_lo#0 = (byte*~) mulf_init::$1 @@ -1270,17 +1207,10 @@ Alias (signed word) mulf8s_prepared::return#0 = (signed word~) mulf8s_prepared:: Alias (word) mulf8s_prepared::m#5 = (word) mulf8s_prepared::m#6 Alias (byte~) mulf8s_prepared::$16 = (byte~) mulf8s_prepared::$13 Alias (byte*) SIN#0 = (byte*~) $0 (byte*) SIN#16 (byte*) SIN#13 -Alias (byte*) COS#10 = (byte*) COS#8 Alias (byte*) SIN#10 = (byte*) SIN#8 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#2 -Alias (byte*) SPRITE#2 = (byte*) SPRITE#3 Alias (byte*) init::sprites_ptr#0 = (byte*~) init::$1 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#5 (byte*) SCREEN#4 -Alias (byte*) COS#0 = (byte*) COS#16 (byte*) COS#13 -Alias (byte*) COS#3 = (byte*) COS#5 Alias (byte) anim::angle#10 = (byte) anim::angle#6 Alias (byte*) SIN#3 = (byte*) SIN#5 -Alias (byte*) COS#1 = (byte*) COS#4 (byte*) COS#2 Alias (byte) anim::angle#2 = (byte) anim::angle#7 (byte) anim::angle#4 Alias (byte*) SIN#1 = (byte*) SIN#4 (byte*) SIN#2 Alias (signed byte) anim::cos_a#0 = (signed byte~) anim::$1 @@ -1292,7 +1222,6 @@ Alias (signed byte) anim::sin_a#1 = (signed byte) anim::sin_a#5 (signed byte) an Alias (byte) anim::sprite_msb#10 = (byte) anim::sprite_msb#15 (byte) anim::sprite_msb#16 (byte) anim::sprite_msb#14 (byte) anim::sprite_msb#13 (byte) anim::sprite_msb#12 (byte) anim::sprite_msb#11 (byte) anim::sprite_msb#9 (byte) anim::sprite_msb#8 (byte) anim::sprite_msb#6 (byte) anim::sprite_msb#3 Alias (byte) anim::i#10 = (byte) anim::i#14 (byte) anim::i#2 (byte) anim::i#13 (byte) anim::i#12 (byte) anim::i#11 (byte) anim::i#9 (byte) anim::i#8 (byte) anim::i#7 (byte) anim::i#6 (byte) anim::i#5 (byte) anim::i#4 Alias (byte) anim::angle#11 = (byte) anim::angle#19 (byte) anim::angle#20 (byte) anim::angle#18 (byte) anim::angle#17 (byte) anim::angle#16 (byte) anim::angle#15 (byte) anim::angle#14 (byte) anim::angle#13 (byte) anim::angle#12 (byte) anim::angle#9 (byte) anim::angle#8 -Alias (byte*) COS#11 = (byte*) COS#23 (byte*) COS#24 (byte*) COS#22 (byte*) COS#21 (byte*) COS#20 (byte*) COS#19 (byte*) COS#18 (byte*) COS#17 (byte*) COS#15 (byte*) COS#14 (byte*) COS#12 Alias (byte*) SIN#11 = (byte*) SIN#23 (byte*) SIN#24 (byte*) SIN#22 (byte*) SIN#21 (byte*) SIN#20 (byte*) SIN#19 (byte*) SIN#18 (byte*) SIN#17 (byte*) SIN#15 (byte*) SIN#14 (byte*) SIN#12 Alias (byte) mulf8u_prepare::a#0 = (byte) anim::mulf8s_prepare1_$0#0 Alias (signed word) mulf8s_prepared::return#2 = (signed word) mulf8s_prepared::return#7 @@ -1310,7 +1239,6 @@ Alias (byte) anim::i2#0 = (byte~) anim::$24 Alias (signed word) anim::yr#1 = (signed word) anim::yr#5 Alias (byte) anim::sprite_msb#5 = (byte) anim::sprite_msb#7 Alias (byte) anim::angle#3 = (byte) anim::angle#5 -Alias (byte*) COS#7 = (byte*) COS#9 Alias (byte*) SIN#7 = (byte*) SIN#9 Successful SSA optimization Pass2AliasElimination Alias (byte*) mulf_init::sqr1_lo#2 = (byte*) mulf_init::sqr1_lo#3 @@ -1325,39 +1253,26 @@ Alias (byte) anim::i#10 = (byte) anim::i#3 Alias (signed word) anim::xpos#0 = (signed word) anim::xpos#1 Alias (signed byte) anim::cos_a#1 = (signed byte) anim::cos_a#2 Alias (byte) anim::angle#11 = (byte) anim::angle#3 -Alias (byte*) COS#11 = (byte*) COS#7 Alias (byte*) SIN#11 = (byte*) SIN#7 Alias (signed byte) anim::sin_a#1 = (signed byte) anim::sin_a#7 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SPRITE#1 Self Phi Eliminated (byte*) init::sprites_ptr#1 -Self Phi Eliminated (byte*) COS#1 Self Phi Eliminated (byte) anim::angle#2 Self Phi Eliminated (byte*) SIN#1 Self Phi Eliminated (signed byte) anim::cos_a#1 Self Phi Eliminated (signed byte) anim::sin_a#1 Self Phi Eliminated (byte) anim::angle#11 -Self Phi Eliminated (byte*) COS#11 Self Phi Eliminated (byte*) SIN#11 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (byte) mulf8u_prepared::b#1 (byte) mulf8u_prepared::b#0 -Redundant Phi (byte*) SCREEN#3 (byte*) SCREEN#0 -Redundant Phi (byte*) SPRITE#4 (byte*) SPRITE#0 -Redundant Phi (byte*) COS#10 (byte*) COS#0 Redundant Phi (byte*) SIN#10 (byte*) SIN#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#3 -Redundant Phi (byte*) SPRITE#2 (byte*) SPRITE#4 -Redundant Phi (byte*) SPRITE#1 (byte*) SPRITE#2 Redundant Phi (byte*) init::sprites_ptr#1 (byte*) init::sprites_ptr#0 -Redundant Phi (byte*) COS#6 (byte*) COS#10 Redundant Phi (byte*) SIN#6 (byte*) SIN#10 -Redundant Phi (byte*) COS#1 (byte*) COS#3 Redundant Phi (byte) anim::angle#2 (byte) anim::angle#10 Redundant Phi (byte*) SIN#1 (byte*) SIN#3 Redundant Phi (signed byte) anim::cos_a#1 (signed byte) anim::cos_a#0 Redundant Phi (signed byte) anim::sin_a#1 (signed byte) anim::sin_a#0 Redundant Phi (byte) anim::angle#11 (byte) anim::angle#2 -Redundant Phi (byte*) COS#11 (byte*) COS#1 Redundant Phi (byte*) SIN#11 (byte*) SIN#1 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) mulf_init::$4 [95] if((byte~) mulf_init::$2!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mulf_init::@2 @@ -1366,10 +1281,10 @@ Simple Condition (bool~) mulf_init::$14 [125] if((byte) mulf_init::x_255#1!=(byt Simple Condition (bool~) mulf_init::$16 [130] if((byte*) mulf_init::sqr2_lo#1!=(byte*~) mulf_init::$15) goto mulf_init::@3 Simple Condition (bool~) mulf8s_prepared::$3 [165] if(*((signed byte*) mulf8s_prepared::memA#0)>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mulf8s_prepared::@1 Simple Condition (bool~) mulf8s_prepared::$9 [169] if((signed byte) mulf8s_prepared::b#4>=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mulf8s_prepared::@2 -Simple Condition (bool~) init::$4 [213] if((byte) init::i#1!=rangelast(0,7)) goto init::@1 -Simple Condition (bool~) anim::$0 [231] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto anim::@5 -Simple Condition (bool~) anim::$20 [296] if((byte~) anim::$18==(byte/signed byte/word/signed word/dword/signed dword) 0) goto anim::@8 -Simple Condition (bool~) anim::$26 [309] if((byte) anim::i#1!=rangelast(0,7)) goto anim::@7 +Simple Condition (bool~) init::$4 [211] if((byte) init::i#1!=rangelast(0,7)) goto init::@1 +Simple Condition (bool~) anim::$0 [229] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto anim::@5 +Simple Condition (bool~) anim::$20 [294] if((byte~) anim::$18==(byte/signed byte/word/signed word/dword/signed dword) 0) goto anim::@8 +Simple Condition (bool~) anim::$26 [307] if((byte) anim::i#1!=rangelast(0,7)) goto anim::@7 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) PROCPORT_DDR#0 = ((byte*))0 Constant (const byte) PROCPORT_DDR_MEMORY_MASK#0 = 7 @@ -1511,7 +1426,7 @@ Eliminating Noop Cast (byte) mulf8u_prepared::b#0 ← ((byte)) (signed byte) mul Eliminating Noop Cast (byte~) mulf8s_prepared::$6 ← ((byte)) (signed byte) mulf8s_prepared::b#4 Eliminating Noop Cast (signed word) mulf8s_prepared::return#0 ← ((signed word)) (word) mulf8s_prepared::m#4 Eliminating Noop Cast (byte~) mulf8s_prepared::$12 ← ((byte)) *((const signed byte*) mulf8s_prepared::memA#0) -Eliminating Noop Cast (signed byte) anim::cos_a#0 ← ((signed byte)) *((byte*) COS#3 + (byte) anim::angle#10) +Eliminating Noop Cast (signed byte) anim::cos_a#0 ← ((signed byte)) *((const byte*) COS#0 + (byte) anim::angle#10) Eliminating Noop Cast (signed byte) anim::sin_a#0 ← ((signed byte)) *((byte*) SIN#3 + (byte) anim::angle#10) Eliminating Noop Cast (byte) mulf8u_prepare::a#0 ← ((byte)) (signed byte) anim::cos_a#0 Eliminating Noop Cast (byte) mulf8u_prepare::a#1 ← ((byte)) (signed byte) anim::sin_a#0 @@ -1534,10 +1449,8 @@ Successful SSA optimization Pass2CullEmptyBlocks Alias (word) mulf8u_prepared::return#0 = (word~) mulf8u_prepared::$0 Alias (byte~) anim::$22 = (byte~) anim::$21 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) COS#3 Self Phi Eliminated (byte*) SIN#3 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) COS#3 (const byte*) COS#0 Redundant Phi (byte*) SIN#3 (const byte*) SIN#0 Successful SSA optimization Pass2RedundantPhiElimination Inlining constant with var siblings (const word) mulf_init::sqr#0 diff --git a/src/test/ref/examples/scroll/scroll.log b/src/test/ref/examples/scroll/scroll.log index 992ea64b6..25395e61c 100644 --- a/src/test/ref/examples/scroll/scroll.log +++ b/src/test/ref/examples/scroll/scroll.log @@ -1,3 +1,8 @@ +Identified constant variable (byte*) SCREEN +Identified constant variable (byte*) RASTER +Identified constant variable (byte*) BGCOL +Identified constant variable (byte*) SCROLL +Identified constant variable (byte*) TEXT CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -8,93 +13,55 @@ CONTROL FLOW GRAPH SSA (byte*) TEXT#0 ← (const string) $0 to:@2 main: scope:[main] from @2 - (byte*) SCROLL#12 ← phi( @2/(byte*) SCROLL#13 ) - (byte*) BGCOL#11 ← phi( @2/(byte*) BGCOL#13 ) - (byte*) RASTER#5 ← phi( @2/(byte*) RASTER#7 ) - (byte*) TEXT#3 ← phi( @2/(byte*) TEXT#5 ) - (byte*) SCREEN#1 ← phi( @2/(byte*) SCREEN#3 ) - (byte*) fillscreen::screen#0 ← (byte*) SCREEN#1 + (byte*) fillscreen::screen#0 ← (byte*) SCREEN#0 (byte) fillscreen::fill#0 ← (byte/signed byte/word/signed word/dword/signed dword) $20 call fillscreen to:main::@13 main::@13: scope:[main] from main - (byte*) SCROLL#10 ← phi( main/(byte*) SCROLL#12 ) - (byte*) BGCOL#9 ← phi( main/(byte*) BGCOL#11 ) - (byte*) RASTER#4 ← phi( main/(byte*) RASTER#5 ) - (byte*) SCREEN#2 ← phi( main/(byte*) SCREEN#1 ) - (byte*) TEXT#1 ← phi( main/(byte*) TEXT#3 ) (byte) main::scroll#0 ← (byte/signed byte/word/signed word/dword/signed dword) 7 - (byte*) main::nxt#0 ← (byte*) TEXT#1 - (byte*~) main::$1 ← (byte*) SCREEN#2 + (byte/signed byte/word/signed word/dword/signed dword) $28 + (byte*) main::nxt#0 ← (byte*) TEXT#0 + (byte*~) main::$1 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) $28 (byte[]) main::line#0 ← (byte*~) main::$1 to:main::@2 main::@1: scope:[main] from main::@4 - (byte*) TEXT#11 ← phi( main::@4/(byte*) TEXT#12 ) (byte*) main::nxt#10 ← phi( main::@4/(byte*) main::nxt#11 ) - (byte*) SCROLL#9 ← phi( main::@4/(byte*) SCROLL#1 ) (byte) main::scroll#10 ← phi( main::@4/(byte) main::scroll#4 ) - (byte*) BGCOL#8 ← phi( main::@4/(byte*) BGCOL#2 ) - (byte*) RASTER#3 ← phi( main::@4/(byte*) RASTER#6 ) to:main::@2 main::@2: scope:[main] from main::@1 main::@13 main::@2 - (byte*) TEXT#10 ← phi( main::@1/(byte*) TEXT#11 main::@13/(byte*) TEXT#1 main::@2/(byte*) TEXT#10 ) (byte*) main::nxt#9 ← phi( main::@1/(byte*) main::nxt#10 main::@13/(byte*) main::nxt#0 main::@2/(byte*) main::nxt#9 ) - (byte*) SCROLL#7 ← phi( main::@1/(byte*) SCROLL#9 main::@13/(byte*) SCROLL#10 main::@2/(byte*) SCROLL#7 ) (byte) main::scroll#7 ← phi( main::@1/(byte) main::scroll#10 main::@13/(byte) main::scroll#0 main::@2/(byte) main::scroll#7 ) - (byte*) BGCOL#5 ← phi( main::@1/(byte*) BGCOL#8 main::@13/(byte*) BGCOL#9 main::@2/(byte*) BGCOL#5 ) - (byte*) RASTER#1 ← phi( main::@1/(byte*) RASTER#3 main::@13/(byte*) RASTER#4 main::@2/(byte*) RASTER#1 ) - (bool~) main::$2 ← *((byte*) RASTER#1) != (byte/word/signed word/dword/signed dword) $fe + (bool~) main::$2 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $fe if((bool~) main::$2) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@2 main::@3 - (byte*) TEXT#9 ← phi( main::@2/(byte*) TEXT#10 main::@3/(byte*) TEXT#9 ) (byte*) main::nxt#8 ← phi( main::@2/(byte*) main::nxt#9 main::@3/(byte*) main::nxt#8 ) - (byte*) SCROLL#4 ← phi( main::@2/(byte*) SCROLL#7 main::@3/(byte*) SCROLL#4 ) (byte) main::scroll#5 ← phi( main::@2/(byte) main::scroll#7 main::@3/(byte) main::scroll#5 ) - (byte*) BGCOL#3 ← phi( main::@2/(byte*) BGCOL#5 main::@3/(byte*) BGCOL#3 ) - (byte*) RASTER#2 ← phi( main::@2/(byte*) RASTER#1 main::@3/(byte*) RASTER#2 ) - (bool~) main::$3 ← *((byte*) RASTER#2) != (byte/word/signed word/dword/signed dword) $ff + (bool~) main::$3 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $ff if((bool~) main::$3) goto main::@3 to:main::@8 main::@8: scope:[main] from main::@3 - (byte*) TEXT#8 ← phi( main::@3/(byte*) TEXT#9 ) (byte*) main::nxt#7 ← phi( main::@3/(byte*) main::nxt#8 ) - (byte*) RASTER#9 ← phi( main::@3/(byte*) RASTER#2 ) - (byte*) SCROLL#3 ← phi( main::@3/(byte*) SCROLL#4 ) (byte) main::scroll#3 ← phi( main::@3/(byte) main::scroll#5 ) - (byte*) BGCOL#1 ← phi( main::@3/(byte*) BGCOL#3 ) - *((byte*) BGCOL#1) ← ++ *((byte*) BGCOL#1) + *((byte*) BGCOL#0) ← ++ *((byte*) BGCOL#0) (byte) main::scroll#1 ← -- (byte) main::scroll#3 (bool~) main::$4 ← (byte) main::scroll#1 == (byte/word/signed word/dword/signed dword) $ff (bool~) main::$5 ← ! (bool~) main::$4 if((bool~) main::$5) goto main::@4 to:main::@9 main::@4: scope:[main] from main::@6 main::@8 - (byte*) TEXT#12 ← phi( main::@6/(byte*) TEXT#13 main::@8/(byte*) TEXT#8 ) (byte*) main::nxt#11 ← phi( main::@6/(byte*) main::nxt#1 main::@8/(byte*) main::nxt#7 ) - (byte*) RASTER#6 ← phi( main::@6/(byte*) RASTER#8 main::@8/(byte*) RASTER#9 ) - (byte*) BGCOL#2 ← phi( main::@6/(byte*) BGCOL#4 main::@8/(byte*) BGCOL#1 ) - (byte*) SCROLL#1 ← phi( main::@6/(byte*) SCROLL#2 main::@8/(byte*) SCROLL#3 ) (byte) main::scroll#4 ← phi( main::@6/(byte) main::scroll#6 main::@8/(byte) main::scroll#1 ) - *((byte*) SCROLL#1) ← (byte) main::scroll#4 - *((byte*) BGCOL#2) ← -- *((byte*) BGCOL#2) + *((byte*) SCROLL#0) ← (byte) main::scroll#4 + *((byte*) BGCOL#0) ← -- *((byte*) BGCOL#0) if(true) goto main::@1 to:main::@return main::@9: scope:[main] from main::@8 - (byte*) RASTER#13 ← phi( main::@8/(byte*) RASTER#9 ) - (byte*) BGCOL#12 ← phi( main::@8/(byte*) BGCOL#1 ) - (byte*) SCROLL#11 ← phi( main::@8/(byte*) SCROLL#3 ) - (byte*) TEXT#7 ← phi( main::@8/(byte*) TEXT#8 ) (byte*) main::nxt#6 ← phi( main::@8/(byte*) main::nxt#7 ) (byte) main::scroll#2 ← (byte/signed byte/word/signed word/dword/signed dword) 7 (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@5 main::@5: scope:[main] from main::@5 main::@9 - (byte*) RASTER#12 ← phi( main::@5/(byte*) RASTER#12 main::@9/(byte*) RASTER#13 ) - (byte*) BGCOL#10 ← phi( main::@5/(byte*) BGCOL#10 main::@9/(byte*) BGCOL#12 ) - (byte*) SCROLL#8 ← phi( main::@5/(byte*) SCROLL#8 main::@9/(byte*) SCROLL#11 ) (byte) main::scroll#11 ← phi( main::@5/(byte) main::scroll#11 main::@9/(byte) main::scroll#2 ) - (byte*) TEXT#6 ← phi( main::@5/(byte*) TEXT#6 main::@9/(byte*) TEXT#7 ) (byte*) main::nxt#5 ← phi( main::@5/(byte*) main::nxt#5 main::@9/(byte*) main::nxt#6 ) (byte) main::i#2 ← phi( main::@5/(byte) main::i#1 main::@9/(byte) main::i#0 ) (byte/signed word/word/dword/signed dword~) main::$6 ← (byte) main::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 @@ -104,11 +71,7 @@ main::@5: scope:[main] from main::@5 main::@9 if((bool~) main::$7) goto main::@5 to:main::@10 main::@10: scope:[main] from main::@5 - (byte*) RASTER#10 ← phi( main::@5/(byte*) RASTER#12 ) - (byte*) BGCOL#6 ← phi( main::@5/(byte*) BGCOL#10 ) - (byte*) SCROLL#5 ← phi( main::@5/(byte*) SCROLL#8 ) (byte) main::scroll#8 ← phi( main::@5/(byte) main::scroll#11 ) - (byte*) TEXT#4 ← phi( main::@5/(byte*) TEXT#6 ) (byte*) main::nxt#3 ← phi( main::@5/(byte*) main::nxt#5 ) (byte) main::c#0 ← *((byte*) main::nxt#3) (bool~) main::$8 ← (byte) main::c#0 == (byte) '@' @@ -116,10 +79,6 @@ main::@10: scope:[main] from main::@5 if((bool~) main::$9) goto main::@6 to:main::@11 main::@6: scope:[main] from main::@10 main::@11 - (byte*) TEXT#13 ← phi( main::@10/(byte*) TEXT#4 main::@11/(byte*) TEXT#2 ) - (byte*) RASTER#8 ← phi( main::@10/(byte*) RASTER#10 main::@11/(byte*) RASTER#11 ) - (byte*) BGCOL#4 ← phi( main::@10/(byte*) BGCOL#6 main::@11/(byte*) BGCOL#7 ) - (byte*) SCROLL#2 ← phi( main::@10/(byte*) SCROLL#5 main::@11/(byte*) SCROLL#6 ) (byte) main::scroll#6 ← phi( main::@10/(byte) main::scroll#8 main::@11/(byte) main::scroll#9 ) (byte*) main::nxt#4 ← phi( main::@10/(byte*) main::nxt#3 main::@11/(byte*) main::nxt#2 ) (byte) main::c#2 ← phi( main::@10/(byte) main::c#0 main::@11/(byte) main::c#1 ) @@ -127,12 +86,8 @@ main::@6: scope:[main] from main::@10 main::@11 (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 to:main::@4 main::@11: scope:[main] from main::@10 - (byte*) RASTER#11 ← phi( main::@10/(byte*) RASTER#10 ) - (byte*) BGCOL#7 ← phi( main::@10/(byte*) BGCOL#6 ) - (byte*) SCROLL#6 ← phi( main::@10/(byte*) SCROLL#5 ) (byte) main::scroll#9 ← phi( main::@10/(byte) main::scroll#8 ) - (byte*) TEXT#2 ← phi( main::@10/(byte*) TEXT#4 ) - (byte*) main::nxt#2 ← (byte*) TEXT#2 + (byte*) main::nxt#2 ← (byte*) TEXT#0 (byte) main::c#1 ← *((byte*) main::nxt#2) to:main::@6 main::@return: scope:[main] from main::@4 @@ -157,11 +112,6 @@ fillscreen::@return: scope:[fillscreen] from fillscreen::@1 return to:@return @2: scope:[] from @begin - (byte*) SCROLL#13 ← phi( @begin/(byte*) SCROLL#0 ) - (byte*) BGCOL#13 ← phi( @begin/(byte*) BGCOL#0 ) - (byte*) RASTER#7 ← phi( @begin/(byte*) RASTER#0 ) - (byte*) TEXT#5 ← phi( @begin/(byte*) TEXT#0 ) - (byte*) SCREEN#3 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@3 @3: scope:[] from @2 @@ -176,69 +126,14 @@ SYMBOL TABLE SSA (label) @end (byte*) BGCOL (byte*) BGCOL#0 -(byte*) BGCOL#1 -(byte*) BGCOL#10 -(byte*) BGCOL#11 -(byte*) BGCOL#12 -(byte*) BGCOL#13 -(byte*) BGCOL#2 -(byte*) BGCOL#3 -(byte*) BGCOL#4 -(byte*) BGCOL#5 -(byte*) BGCOL#6 -(byte*) BGCOL#7 -(byte*) BGCOL#8 -(byte*) BGCOL#9 (byte*) RASTER (byte*) RASTER#0 -(byte*) RASTER#1 -(byte*) RASTER#10 -(byte*) RASTER#11 -(byte*) RASTER#12 -(byte*) RASTER#13 -(byte*) RASTER#2 -(byte*) RASTER#3 -(byte*) RASTER#4 -(byte*) RASTER#5 -(byte*) RASTER#6 -(byte*) RASTER#7 -(byte*) RASTER#8 -(byte*) RASTER#9 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 (byte*) SCROLL (byte*) SCROLL#0 -(byte*) SCROLL#1 -(byte*) SCROLL#10 -(byte*) SCROLL#11 -(byte*) SCROLL#12 -(byte*) SCROLL#13 -(byte*) SCROLL#2 -(byte*) SCROLL#3 -(byte*) SCROLL#4 -(byte*) SCROLL#5 -(byte*) SCROLL#6 -(byte*) SCROLL#7 -(byte*) SCROLL#8 -(byte*) SCROLL#9 (byte*) TEXT (byte*) TEXT#0 -(byte*) TEXT#1 -(byte*) TEXT#10 -(byte*) TEXT#11 -(byte*) TEXT#12 -(byte*) TEXT#13 -(byte*) TEXT#2 -(byte*) TEXT#3 -(byte*) TEXT#4 -(byte*) TEXT#5 -(byte*) TEXT#6 -(byte*) TEXT#7 -(byte*) TEXT#8 -(byte*) TEXT#9 (void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill) (byte*~) fillscreen::$0 (bool~) fillscreen::$1 @@ -317,100 +212,44 @@ SYMBOL TABLE SSA Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [25] (bool~) main::$5 ← (byte) main::scroll#1 != (byte/word/signed word/dword/signed dword) $ff from [24] (bool~) main::$4 ← (byte) main::scroll#1 == (byte/word/signed word/dword/signed dword) $ff -Inversing boolean not [43] (bool~) main::$9 ← (byte) main::c#0 != (byte) '@' from [42] (bool~) main::$8 ← (byte) main::c#0 == (byte) '@' +Inversing boolean not [23] (bool~) main::$5 ← (byte) main::scroll#1 != (byte/word/signed word/dword/signed dword) $ff from [22] (bool~) main::$4 ← (byte) main::scroll#1 == (byte/word/signed word/dword/signed dword) $ff +Inversing boolean not [41] (bool~) main::$9 ← (byte) main::c#0 != (byte) '@' from [40] (bool~) main::$8 ← (byte) main::c#0 == (byte) '@' Successful SSA optimization Pass2UnaryNotSimplification -Alias (byte*) TEXT#1 = (byte*) TEXT#3 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#2 -Alias (byte*) RASTER#4 = (byte*) RASTER#5 -Alias (byte*) BGCOL#11 = (byte*) BGCOL#9 -Alias (byte*) SCROLL#10 = (byte*) SCROLL#12 Alias (byte[]) main::line#0 = (byte*~) main::$1 -Alias (byte*) RASTER#3 = (byte*) RASTER#6 -Alias (byte*) BGCOL#2 = (byte*) BGCOL#8 Alias (byte) main::scroll#10 = (byte) main::scroll#4 -Alias (byte*) SCROLL#1 = (byte*) SCROLL#9 Alias (byte*) main::nxt#10 = (byte*) main::nxt#11 -Alias (byte*) TEXT#11 = (byte*) TEXT#12 -Alias (byte*) BGCOL#1 = (byte*) BGCOL#3 (byte*) BGCOL#12 Alias (byte) main::scroll#3 = (byte) main::scroll#5 -Alias (byte*) SCROLL#11 = (byte*) SCROLL#3 (byte*) SCROLL#4 -Alias (byte*) RASTER#13 = (byte*) RASTER#9 (byte*) RASTER#2 Alias (byte*) main::nxt#6 = (byte*) main::nxt#7 (byte*) main::nxt#8 -Alias (byte*) TEXT#7 = (byte*) TEXT#8 (byte*) TEXT#9 Alias (byte*) main::nxt#3 = (byte*) main::nxt#5 -Alias (byte*) TEXT#2 = (byte*) TEXT#4 (byte*) TEXT#6 Alias (byte) main::scroll#11 = (byte) main::scroll#8 (byte) main::scroll#9 -Alias (byte*) SCROLL#5 = (byte*) SCROLL#8 (byte*) SCROLL#6 -Alias (byte*) BGCOL#10 = (byte*) BGCOL#6 (byte*) BGCOL#7 -Alias (byte*) RASTER#10 = (byte*) RASTER#12 (byte*) RASTER#11 Alias (byte*) fillscreen::cursor#0 = (byte*) fillscreen::screen#1 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#3 -Alias (byte*) TEXT#0 = (byte*) TEXT#5 -Alias (byte*) RASTER#0 = (byte*) RASTER#7 -Alias (byte*) BGCOL#0 = (byte*) BGCOL#13 -Alias (byte*) SCROLL#0 = (byte*) SCROLL#13 Successful SSA optimization Pass2AliasElimination Alias (byte) main::scroll#11 = (byte) main::scroll#6 -Alias (byte*) SCROLL#2 = (byte*) SCROLL#5 -Alias (byte*) BGCOL#10 = (byte*) BGCOL#4 -Alias (byte*) RASTER#10 = (byte*) RASTER#8 -Alias (byte*) TEXT#13 = (byte*) TEXT#2 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) RASTER#1 -Self Phi Eliminated (byte*) BGCOL#5 Self Phi Eliminated (byte) main::scroll#7 -Self Phi Eliminated (byte*) SCROLL#7 Self Phi Eliminated (byte*) main::nxt#9 -Self Phi Eliminated (byte*) TEXT#10 -Self Phi Eliminated (byte*) RASTER#13 -Self Phi Eliminated (byte*) BGCOL#1 Self Phi Eliminated (byte) main::scroll#3 -Self Phi Eliminated (byte*) SCROLL#11 Self Phi Eliminated (byte*) main::nxt#6 -Self Phi Eliminated (byte*) TEXT#7 Self Phi Eliminated (byte*) main::nxt#3 -Self Phi Eliminated (byte*) TEXT#13 Self Phi Eliminated (byte) main::scroll#11 -Self Phi Eliminated (byte*) SCROLL#2 -Self Phi Eliminated (byte*) BGCOL#10 -Self Phi Eliminated (byte*) RASTER#10 Self Phi Eliminated (byte) fillscreen::fill#1 Self Phi Eliminated (byte*) fillscreen::screen#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte*) TEXT#1 (byte*) TEXT#0 -Redundant Phi (byte*) RASTER#4 (byte*) RASTER#0 -Redundant Phi (byte*) BGCOL#11 (byte*) BGCOL#0 -Redundant Phi (byte*) SCROLL#10 (byte*) SCROLL#0 -Redundant Phi (byte*) RASTER#13 (byte*) RASTER#1 -Redundant Phi (byte*) BGCOL#1 (byte*) BGCOL#5 Redundant Phi (byte) main::scroll#3 (byte) main::scroll#7 -Redundant Phi (byte*) SCROLL#11 (byte*) SCROLL#7 Redundant Phi (byte*) main::nxt#6 (byte*) main::nxt#9 -Redundant Phi (byte*) TEXT#7 (byte*) TEXT#10 Redundant Phi (byte*) main::nxt#3 (byte*) main::nxt#6 -Redundant Phi (byte*) TEXT#13 (byte*) TEXT#7 Redundant Phi (byte) main::scroll#11 (byte) main::scroll#2 -Redundant Phi (byte*) SCROLL#2 (byte*) SCROLL#11 -Redundant Phi (byte*) BGCOL#10 (byte*) BGCOL#1 -Redundant Phi (byte*) RASTER#10 (byte*) RASTER#13 Redundant Phi (byte*) fillscreen::cursor#0 (byte*) fillscreen::screen#0 Redundant Phi (byte) fillscreen::fill#2 (byte) fillscreen::fill#0 Redundant Phi (byte) fillscreen::fill#1 (byte) fillscreen::fill#2 Redundant Phi (byte*) fillscreen::screen#2 (byte*) fillscreen::cursor#0 Successful SSA optimization Pass2RedundantPhiElimination -Redundant Phi (byte*) SCROLL#1 (byte*) SCROLL#7 -Redundant Phi (byte*) BGCOL#2 (byte*) BGCOL#5 -Redundant Phi (byte*) RASTER#3 (byte*) RASTER#1 -Redundant Phi (byte*) TEXT#11 (byte*) TEXT#10 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$2 [17] if(*((byte*) RASTER#1)!=(byte/word/signed word/dword/signed dword) $fe) goto main::@2 -Simple Condition (bool~) main::$3 [20] if(*((byte*) RASTER#1)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@3 -Simple Condition (bool~) main::$5 [26] if((byte) main::scroll#1!=(byte/word/signed word/dword/signed dword) $ff) goto main::@4 -Simple Condition (bool~) main::$7 [39] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $27) goto main::@5 -Simple Condition (bool~) main::$9 [44] if((byte) main::c#0!=(byte) '@') goto main::@6 -Simple Condition (bool~) fillscreen::$1 [59] if((byte*) fillscreen::cursor#1<(byte*~) fillscreen::$0) goto fillscreen::@1 +Simple Condition (bool~) main::$2 [15] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $fe) goto main::@2 +Simple Condition (bool~) main::$3 [18] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@3 +Simple Condition (bool~) main::$5 [24] if((byte) main::scroll#1!=(byte/word/signed word/dword/signed dword) $ff) goto main::@4 +Simple Condition (bool~) main::$7 [37] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $27) goto main::@5 +Simple Condition (bool~) main::$9 [42] if((byte) main::c#0!=(byte) '@') goto main::@6 +Simple Condition (bool~) fillscreen::$1 [57] if((byte*) fillscreen::cursor#1<(byte*~) fillscreen::$0) goto fillscreen::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte*) RASTER#0 = ((byte*))$d012 @@ -425,6 +264,7 @@ Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) fillscreen::screen#0 = SCREEN#0 Constant (const byte*) main::nxt#0 = TEXT#0 Constant (const byte[]) main::line#0 = SCREEN#0+$28 +Constant (const byte*) main::nxt#2 = TEXT#0 Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) fillscreen::$0 = fillscreen::screen#0+$3e8 Successful SSA optimization Pass2ConstantIdentification @@ -442,18 +282,6 @@ Culled Empty Block (label) main::@9 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::i#2 = (byte~) main::$6 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) RASTER#1 -Self Phi Eliminated (byte*) BGCOL#5 -Self Phi Eliminated (byte*) SCROLL#7 -Self Phi Eliminated (byte*) TEXT#10 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) RASTER#1 (const byte*) RASTER#0 -Redundant Phi (byte*) BGCOL#5 (const byte*) BGCOL#0 -Redundant Phi (byte*) SCROLL#7 (const byte*) SCROLL#0 -Redundant Phi (byte*) TEXT#10 (const byte*) TEXT#0 -Successful SSA optimization Pass2RedundantPhiElimination -Constant (const byte*) main::nxt#2 = TEXT#0 -Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const byte) main::scroll#0 Inlining constant with var siblings (const byte) main::scroll#2 Inlining constant with var siblings (const byte) main::i#0 diff --git a/src/test/ref/examples/scrollbig/scrollbig.log b/src/test/ref/examples/scrollbig/scrollbig.log index 7b0827039..2be3990c3 100644 --- a/src/test/ref/examples/scrollbig/scrollbig.log +++ b/src/test/ref/examples/scrollbig/scrollbig.log @@ -1,3 +1,10 @@ +Identified constant variable (byte*) PROCPORT +Identified constant variable (byte*) CHARGEN +Identified constant variable (byte*) SCREEN +Identified constant variable (byte*) RASTER +Identified constant variable (byte*) BGCOL +Identified constant variable (byte*) SCROLL +Identified constant variable (byte*) TEXT CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -10,100 +17,51 @@ CONTROL FLOW GRAPH SSA (byte*) TEXT#0 ← (const string) $0 to:@1 main: scope:[main] from @6 - (byte*) TEXT#15 ← phi( @6/(byte*) TEXT#17 ) - (byte*) CHARGEN#13 ← phi( @6/(byte*) CHARGEN#15 ) - (byte*) PROCPORT#17 ← phi( @6/(byte*) PROCPORT#19 ) - (byte*) SCROLL#10 ← phi( @6/(byte*) SCROLL#12 ) (byte*) current_chargen#31 ← phi( @6/(byte*) current_chargen#21 ) (byte*) nxt#37 ← phi( @6/(byte*) nxt#26 ) (byte) current_bit#32 ← phi( @6/(byte) current_bit#23 ) (byte) scroll#22 ← phi( @6/(byte) scroll#15 ) - (byte*) BGCOL#7 ← phi( @6/(byte*) BGCOL#8 ) - (byte*) RASTER#5 ← phi( @6/(byte*) RASTER#7 ) - (byte*) SCREEN#1 ← phi( @6/(byte*) SCREEN#4 ) - (byte*) fillscreen::screen#0 ← (byte*) SCREEN#1 + (byte*) fillscreen::screen#0 ← (byte*) SCREEN#0 (byte) fillscreen::fill#0 ← (byte/signed byte/word/signed word/dword/signed dword) $20 call fillscreen to:main::@7 main::@7: scope:[main] from main - (byte*) TEXT#14 ← phi( main/(byte*) TEXT#15 ) - (byte*) CHARGEN#12 ← phi( main/(byte*) CHARGEN#13 ) - (byte*) SCREEN#19 ← phi( main/(byte*) SCREEN#1 ) - (byte*) PROCPORT#16 ← phi( main/(byte*) PROCPORT#17 ) - (byte*) SCROLL#9 ← phi( main/(byte*) SCROLL#10 ) (byte*) current_chargen#30 ← phi( main/(byte*) current_chargen#31 ) (byte*) nxt#35 ← phi( main/(byte*) nxt#37 ) (byte) current_bit#31 ← phi( main/(byte) current_bit#32 ) (byte) scroll#21 ← phi( main/(byte) scroll#22 ) - (byte*) BGCOL#6 ← phi( main/(byte*) BGCOL#7 ) - (byte*) RASTER#4 ← phi( main/(byte*) RASTER#5 ) to:main::@2 main::@1: scope:[main] from main::@8 - (byte*) TEXT#13 ← phi( main::@8/(byte*) TEXT#16 ) - (byte*) CHARGEN#11 ← phi( main::@8/(byte*) CHARGEN#14 ) - (byte*) SCREEN#18 ← phi( main::@8/(byte*) SCREEN#20 ) - (byte*) PROCPORT#15 ← phi( main::@8/(byte*) PROCPORT#18 ) - (byte*) SCROLL#8 ← phi( main::@8/(byte*) SCROLL#11 ) (byte*) current_chargen#29 ← phi( main::@8/(byte*) current_chargen#0 ) (byte*) nxt#34 ← phi( main::@8/(byte*) nxt#0 ) (byte) current_bit#30 ← phi( main::@8/(byte) current_bit#0 ) (byte) scroll#20 ← phi( main::@8/(byte) scroll#0 ) - (byte*) BGCOL#5 ← phi( main::@8/(byte*) BGCOL#2 ) - (byte*) RASTER#3 ← phi( main::@8/(byte*) RASTER#6 ) to:main::@2 main::@2: scope:[main] from main::@1 main::@2 main::@7 - (byte*) TEXT#12 ← phi( main::@1/(byte*) TEXT#13 main::@2/(byte*) TEXT#12 main::@7/(byte*) TEXT#14 ) - (byte*) CHARGEN#10 ← phi( main::@1/(byte*) CHARGEN#11 main::@2/(byte*) CHARGEN#10 main::@7/(byte*) CHARGEN#12 ) - (byte*) SCREEN#17 ← phi( main::@1/(byte*) SCREEN#18 main::@2/(byte*) SCREEN#17 main::@7/(byte*) SCREEN#19 ) - (byte*) PROCPORT#14 ← phi( main::@1/(byte*) PROCPORT#15 main::@2/(byte*) PROCPORT#14 main::@7/(byte*) PROCPORT#16 ) - (byte*) SCROLL#7 ← phi( main::@1/(byte*) SCROLL#8 main::@2/(byte*) SCROLL#7 main::@7/(byte*) SCROLL#9 ) (byte*) current_chargen#27 ← phi( main::@1/(byte*) current_chargen#29 main::@2/(byte*) current_chargen#27 main::@7/(byte*) current_chargen#30 ) (byte*) nxt#31 ← phi( main::@1/(byte*) nxt#34 main::@2/(byte*) nxt#31 main::@7/(byte*) nxt#35 ) (byte) current_bit#29 ← phi( main::@1/(byte) current_bit#30 main::@2/(byte) current_bit#29 main::@7/(byte) current_bit#31 ) (byte) scroll#18 ← phi( main::@1/(byte) scroll#20 main::@2/(byte) scroll#18 main::@7/(byte) scroll#21 ) - (byte*) BGCOL#4 ← phi( main::@1/(byte*) BGCOL#5 main::@2/(byte*) BGCOL#4 main::@7/(byte*) BGCOL#6 ) - (byte*) RASTER#1 ← phi( main::@1/(byte*) RASTER#3 main::@2/(byte*) RASTER#1 main::@7/(byte*) RASTER#4 ) - (bool~) main::$1 ← *((byte*) RASTER#1) != (byte/word/signed word/dword/signed dword) $fe + (bool~) main::$1 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $fe if((bool~) main::$1) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@2 main::@3 - (byte*) TEXT#11 ← phi( main::@2/(byte*) TEXT#12 main::@3/(byte*) TEXT#11 ) - (byte*) CHARGEN#9 ← phi( main::@2/(byte*) CHARGEN#10 main::@3/(byte*) CHARGEN#9 ) - (byte*) SCREEN#16 ← phi( main::@2/(byte*) SCREEN#17 main::@3/(byte*) SCREEN#16 ) - (byte*) PROCPORT#13 ← phi( main::@2/(byte*) PROCPORT#14 main::@3/(byte*) PROCPORT#13 ) - (byte*) SCROLL#6 ← phi( main::@2/(byte*) SCROLL#7 main::@3/(byte*) SCROLL#6 ) (byte*) current_chargen#22 ← phi( main::@2/(byte*) current_chargen#27 main::@3/(byte*) current_chargen#22 ) (byte*) nxt#27 ← phi( main::@2/(byte*) nxt#31 main::@3/(byte*) nxt#27 ) (byte) current_bit#24 ← phi( main::@2/(byte) current_bit#29 main::@3/(byte) current_bit#24 ) (byte) scroll#16 ← phi( main::@2/(byte) scroll#18 main::@3/(byte) scroll#16 ) - (byte*) BGCOL#3 ← phi( main::@2/(byte*) BGCOL#4 main::@3/(byte*) BGCOL#3 ) - (byte*) RASTER#2 ← phi( main::@2/(byte*) RASTER#1 main::@3/(byte*) RASTER#2 ) - (bool~) main::$2 ← *((byte*) RASTER#2) != (byte/word/signed word/dword/signed dword) $ff + (bool~) main::$2 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $ff if((bool~) main::$2) goto main::@3 to:main::@5 main::@5: scope:[main] from main::@3 - (byte*) TEXT#10 ← phi( main::@3/(byte*) TEXT#11 ) - (byte*) CHARGEN#8 ← phi( main::@3/(byte*) CHARGEN#9 ) - (byte*) SCREEN#15 ← phi( main::@3/(byte*) SCREEN#16 ) - (byte*) PROCPORT#12 ← phi( main::@3/(byte*) PROCPORT#13 ) - (byte*) RASTER#8 ← phi( main::@3/(byte*) RASTER#2 ) - (byte*) SCROLL#4 ← phi( main::@3/(byte*) SCROLL#6 ) (byte*) current_chargen#15 ← phi( main::@3/(byte*) current_chargen#22 ) (byte*) nxt#21 ← phi( main::@3/(byte*) nxt#27 ) (byte) current_bit#17 ← phi( main::@3/(byte) current_bit#24 ) (byte) scroll#13 ← phi( main::@3/(byte) scroll#16 ) - (byte*) BGCOL#1 ← phi( main::@3/(byte*) BGCOL#3 ) - *((byte*) BGCOL#1) ← ++ *((byte*) BGCOL#1) + *((byte*) BGCOL#0) ← ++ *((byte*) BGCOL#0) call scroll_soft to:main::@8 main::@8: scope:[main] from main::@5 - (byte*) TEXT#16 ← phi( main::@5/(byte*) TEXT#10 ) - (byte*) CHARGEN#14 ← phi( main::@5/(byte*) CHARGEN#8 ) - (byte*) SCREEN#20 ← phi( main::@5/(byte*) SCREEN#15 ) - (byte*) PROCPORT#18 ← phi( main::@5/(byte*) PROCPORT#12 ) - (byte*) SCROLL#11 ← phi( main::@5/(byte*) SCROLL#4 ) - (byte*) RASTER#6 ← phi( main::@5/(byte*) RASTER#8 ) - (byte*) BGCOL#2 ← phi( main::@5/(byte*) BGCOL#1 ) (byte*) current_chargen#8 ← phi( main::@5/(byte*) current_chargen#3 ) (byte*) nxt#11 ← phi( main::@5/(byte*) nxt#3 ) (byte) current_bit#9 ← phi( main::@5/(byte) current_bit#3 ) @@ -112,7 +70,7 @@ main::@8: scope:[main] from main::@5 (byte) current_bit#0 ← (byte) current_bit#9 (byte*) nxt#0 ← (byte*) nxt#11 (byte*) current_chargen#0 ← (byte*) current_chargen#8 - *((byte*) BGCOL#2) ← -- *((byte*) BGCOL#2) + *((byte*) BGCOL#0) ← -- *((byte*) BGCOL#0) if(true) goto main::@1 to:main::@return main::@return: scope:[main] from main::@8 @@ -127,24 +85,12 @@ main::@return: scope:[main] from main::@8 return to:@return @1: scope:[] from @begin - (byte*) PROCPORT#22 ← phi( @begin/(byte*) PROCPORT#0 ) - (byte*) SCROLL#15 ← phi( @begin/(byte*) SCROLL#0 ) - (byte*) BGCOL#11 ← phi( @begin/(byte*) BGCOL#0 ) - (byte*) RASTER#11 ← phi( @begin/(byte*) RASTER#0 ) - (byte*) SCREEN#14 ← phi( @begin/(byte*) SCREEN#0 ) - (byte*) TEXT#5 ← phi( @begin/(byte*) TEXT#0 ) - (byte*) CHARGEN#3 ← phi( @begin/(byte*) CHARGEN#0 ) (byte) scroll#2 ← (byte/signed byte/word/signed word/dword/signed dword) 7 to:@2 scroll_soft: scope:[scroll_soft] from main::@5 - (byte*) TEXT#9 ← phi( main::@5/(byte*) TEXT#10 ) - (byte*) CHARGEN#7 ← phi( main::@5/(byte*) CHARGEN#8 ) - (byte*) SCREEN#13 ← phi( main::@5/(byte*) SCREEN#15 ) - (byte*) PROCPORT#11 ← phi( main::@5/(byte*) PROCPORT#12 ) (byte*) current_chargen#23 ← phi( main::@5/(byte*) current_chargen#15 ) (byte*) nxt#28 ← phi( main::@5/(byte*) nxt#21 ) (byte) current_bit#25 ← phi( main::@5/(byte) current_bit#17 ) - (byte*) SCROLL#2 ← phi( main::@5/(byte*) SCROLL#4 ) (byte) scroll#9 ← phi( main::@5/(byte) scroll#13 ) (byte) scroll#3 ← -- (byte) scroll#9 (bool~) scroll_soft::$0 ← (byte) scroll#3 == (byte/word/signed word/dword/signed dword) $ff @@ -155,16 +101,10 @@ scroll_soft::@1: scope:[scroll_soft] from scroll_soft scroll_soft::@3 (byte*) current_chargen#17 ← phi( scroll_soft/(byte*) current_chargen#23 scroll_soft::@3/(byte*) current_chargen#2 ) (byte*) nxt#23 ← phi( scroll_soft/(byte*) nxt#28 scroll_soft::@3/(byte*) nxt#2 ) (byte) current_bit#19 ← phi( scroll_soft/(byte) current_bit#25 scroll_soft::@3/(byte) current_bit#2 ) - (byte*) SCROLL#1 ← phi( scroll_soft/(byte*) SCROLL#2 scroll_soft::@3/(byte*) SCROLL#3 ) (byte) scroll#10 ← phi( scroll_soft/(byte) scroll#3 scroll_soft::@3/(byte) scroll#14 ) - *((byte*) SCROLL#1) ← (byte) scroll#10 + *((byte*) SCROLL#0) ← (byte) scroll#10 to:scroll_soft::@return scroll_soft::@2: scope:[scroll_soft] from scroll_soft - (byte*) TEXT#8 ← phi( scroll_soft/(byte*) TEXT#9 ) - (byte*) CHARGEN#6 ← phi( scroll_soft/(byte*) CHARGEN#7 ) - (byte*) SCREEN#10 ← phi( scroll_soft/(byte*) SCREEN#13 ) - (byte*) PROCPORT#9 ← phi( scroll_soft/(byte*) PROCPORT#11 ) - (byte*) SCROLL#5 ← phi( scroll_soft/(byte*) SCROLL#2 ) (byte*) current_chargen#16 ← phi( scroll_soft/(byte*) current_chargen#23 ) (byte*) nxt#22 ← phi( scroll_soft/(byte*) nxt#28 ) (byte) current_bit#18 ← phi( scroll_soft/(byte) current_bit#25 ) @@ -172,7 +112,6 @@ scroll_soft::@2: scope:[scroll_soft] from scroll_soft call scroll_bit to:scroll_soft::@3 scroll_soft::@3: scope:[scroll_soft] from scroll_soft::@2 - (byte*) SCROLL#3 ← phi( scroll_soft::@2/(byte*) SCROLL#5 ) (byte) scroll#14 ← phi( scroll_soft::@2/(byte) scroll#4 ) (byte*) current_chargen#10 ← phi( scroll_soft::@2/(byte*) current_chargen#6 ) (byte*) nxt#13 ← phi( scroll_soft::@2/(byte*) nxt#5 ) @@ -193,24 +132,13 @@ scroll_soft::@return: scope:[scroll_soft] from scroll_soft::@1 return to:@return @2: scope:[] from @1 - (byte*) PROCPORT#21 ← phi( @1/(byte*) PROCPORT#22 ) - (byte*) SCROLL#14 ← phi( @1/(byte*) SCROLL#15 ) - (byte*) BGCOL#10 ← phi( @1/(byte*) BGCOL#11 ) - (byte*) RASTER#10 ← phi( @1/(byte*) RASTER#11 ) (byte) scroll#19 ← phi( @1/(byte) scroll#2 ) - (byte*) SCREEN#12 ← phi( @1/(byte*) SCREEN#14 ) - (byte*) TEXT#3 ← phi( @1/(byte*) TEXT#5 ) - (byte*) CHARGEN#1 ← phi( @1/(byte*) CHARGEN#3 ) - (byte*) current_chargen#4 ← (byte*) CHARGEN#1 + (byte*) current_chargen#4 ← (byte*) CHARGEN#0 (byte) current_bit#4 ← (byte/signed byte/word/signed word/dword/signed dword) 1 to:@3 scroll_bit: scope:[scroll_bit] from scroll_soft::@2 - (byte*) TEXT#7 ← phi( scroll_soft::@2/(byte*) TEXT#8 ) (byte*) current_chargen#28 ← phi( scroll_soft::@2/(byte*) current_chargen#16 ) - (byte*) CHARGEN#5 ← phi( scroll_soft::@2/(byte*) CHARGEN#6 ) (byte*) nxt#29 ← phi( scroll_soft::@2/(byte*) nxt#22 ) - (byte*) SCREEN#7 ← phi( scroll_soft::@2/(byte*) SCREEN#10 ) - (byte*) PROCPORT#5 ← phi( scroll_soft::@2/(byte*) PROCPORT#9 ) (byte) current_bit#13 ← phi( scroll_soft::@2/(byte) current_bit#18 ) (byte~) scroll_bit::$0 ← (byte) current_bit#13 >> (byte/signed byte/word/signed word/dword/signed dword) 1 (byte) current_bit#5 ← (byte~) scroll_bit::$0 @@ -222,49 +150,37 @@ scroll_bit::@1: scope:[scroll_bit] from scroll_bit scroll_bit::@8 (byte*) nxt#38 ← phi( scroll_bit/(byte*) nxt#29 scroll_bit::@8/(byte*) nxt#4 ) (byte) current_bit#26 ← phi( scroll_bit/(byte) current_bit#5 scroll_bit::@8/(byte) current_bit#6 ) (byte*) current_chargen#24 ← phi( scroll_bit/(byte*) current_chargen#28 scroll_bit::@8/(byte*) current_chargen#5 ) - (byte*) SCREEN#5 ← phi( scroll_bit/(byte*) SCREEN#7 scroll_bit::@8/(byte*) SCREEN#8 ) - (byte*) PROCPORT#3 ← phi( scroll_bit/(byte*) PROCPORT#5 scroll_bit::@8/(byte*) PROCPORT#6 ) call scroll_hard to:scroll_bit::@7 scroll_bit::@7: scope:[scroll_bit] from scroll_bit::@1 (byte*) nxt#36 ← phi( scroll_bit::@1/(byte*) nxt#38 ) (byte) current_bit#21 ← phi( scroll_bit::@1/(byte) current_bit#26 ) (byte*) current_chargen#19 ← phi( scroll_bit::@1/(byte*) current_chargen#24 ) - (byte*) SCREEN#2 ← phi( scroll_bit::@1/(byte*) SCREEN#5 ) - (byte*) PROCPORT#1 ← phi( scroll_bit::@1/(byte*) PROCPORT#3 ) asm { sei } - *((byte*) PROCPORT#1) ← (byte/signed byte/word/signed word/dword/signed dword) $32 - (byte*~) scroll_bit::$7 ← (byte*) SCREEN#2 + (byte/signed byte/word/signed word/dword/signed dword) $28 + *((byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $32 + (byte*~) scroll_bit::$7 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) $28 (byte*~) scroll_bit::$8 ← (byte*~) scroll_bit::$7 + (byte/signed byte/word/signed word/dword/signed dword) $27 (byte*) scroll_bit::sc#0 ← (byte*~) scroll_bit::$8 (byte) scroll_bit::r#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:scroll_bit::@2 scroll_bit::@4: scope:[scroll_bit] from scroll_bit - (byte*) SCREEN#11 ← phi( scroll_bit/(byte*) SCREEN#7 ) - (byte*) PROCPORT#10 ← phi( scroll_bit/(byte*) PROCPORT#5 ) - (byte*) TEXT#6 ← phi( scroll_bit/(byte*) TEXT#7 ) - (byte*) CHARGEN#4 ← phi( scroll_bit/(byte*) CHARGEN#5 ) (byte*) nxt#24 ← phi( scroll_bit/(byte*) nxt#29 ) call next_char (byte) next_char::return#0 ← (byte) next_char::return#2 to:scroll_bit::@8 scroll_bit::@8: scope:[scroll_bit] from scroll_bit::@4 - (byte*) SCREEN#8 ← phi( scroll_bit::@4/(byte*) SCREEN#11 ) - (byte*) PROCPORT#6 ← phi( scroll_bit::@4/(byte*) PROCPORT#10 ) - (byte*) CHARGEN#2 ← phi( scroll_bit::@4/(byte*) CHARGEN#4 ) (byte*) nxt#15 ← phi( scroll_bit::@4/(byte*) nxt#9 ) (byte) next_char::return#3 ← phi( scroll_bit::@4/(byte) next_char::return#0 ) (byte~) scroll_bit::$3 ← (byte) next_char::return#3 (byte*) nxt#4 ← (byte*) nxt#15 (word) scroll_bit::c#0 ← ((word)) (byte~) scroll_bit::$3 (word~) scroll_bit::$4 ← (word) scroll_bit::c#0 << (byte/signed byte/word/signed word/dword/signed dword) 3 - (byte*~) scroll_bit::$5 ← (byte*) CHARGEN#2 + (word~) scroll_bit::$4 + (byte*~) scroll_bit::$5 ← (byte*) CHARGEN#0 + (word~) scroll_bit::$4 (byte*) current_chargen#5 ← (byte*~) scroll_bit::$5 (byte) current_bit#6 ← (byte/word/signed word/dword/signed dword) $80 to:scroll_bit::@1 scroll_bit::@2: scope:[scroll_bit] from scroll_bit::@3 scroll_bit::@7 (byte*) nxt#32 ← phi( scroll_bit::@3/(byte*) nxt#30 scroll_bit::@7/(byte*) nxt#36 ) - (byte*) PROCPORT#7 ← phi( scroll_bit::@3/(byte*) PROCPORT#4 scroll_bit::@7/(byte*) PROCPORT#1 ) (byte*) scroll_bit::sc#3 ← phi( scroll_bit::@3/(byte*) scroll_bit::sc#1 scroll_bit::@7/(byte*) scroll_bit::sc#0 ) (byte) current_bit#14 ← phi( scroll_bit::@3/(byte) current_bit#20 scroll_bit::@7/(byte) current_bit#21 ) (byte) scroll_bit::r#2 ← phi( scroll_bit::@3/(byte) scroll_bit::r#1 scroll_bit::@7/(byte) scroll_bit::r#0 ) @@ -278,7 +194,6 @@ scroll_bit::@2: scope:[scroll_bit] from scroll_bit::@3 scroll_bit::@7 to:scroll_bit::@5 scroll_bit::@3: scope:[scroll_bit] from scroll_bit::@2 scroll_bit::@5 (byte*) nxt#30 ← phi( scroll_bit::@2/(byte*) nxt#32 scroll_bit::@5/(byte*) nxt#33 ) - (byte*) PROCPORT#4 ← phi( scroll_bit::@2/(byte*) PROCPORT#7 scroll_bit::@5/(byte*) PROCPORT#8 ) (byte) current_bit#20 ← phi( scroll_bit::@2/(byte) current_bit#14 scroll_bit::@5/(byte) current_bit#27 ) (byte*) current_chargen#18 ← phi( scroll_bit::@2/(byte*) current_chargen#12 scroll_bit::@5/(byte*) current_chargen#25 ) (byte) scroll_bit::r#3 ← phi( scroll_bit::@2/(byte) scroll_bit::r#2 scroll_bit::@5/(byte) scroll_bit::r#4 ) @@ -293,7 +208,6 @@ scroll_bit::@3: scope:[scroll_bit] from scroll_bit::@2 scroll_bit::@5 to:scroll_bit::@6 scroll_bit::@5: scope:[scroll_bit] from scroll_bit::@2 (byte*) nxt#33 ← phi( scroll_bit::@2/(byte*) nxt#32 ) - (byte*) PROCPORT#8 ← phi( scroll_bit::@2/(byte*) PROCPORT#7 ) (byte) current_bit#27 ← phi( scroll_bit::@2/(byte) current_bit#14 ) (byte*) current_chargen#25 ← phi( scroll_bit::@2/(byte*) current_chargen#12 ) (byte) scroll_bit::r#4 ← phi( scroll_bit::@2/(byte) scroll_bit::r#2 ) @@ -305,8 +219,7 @@ scroll_bit::@6: scope:[scroll_bit] from scroll_bit::@3 (byte*) current_chargen#20 ← phi( scroll_bit::@3/(byte*) current_chargen#18 ) (byte*) nxt#25 ← phi( scroll_bit::@3/(byte*) nxt#30 ) (byte) current_bit#22 ← phi( scroll_bit::@3/(byte) current_bit#20 ) - (byte*) PROCPORT#2 ← phi( scroll_bit::@3/(byte*) PROCPORT#4 ) - *((byte*) PROCPORT#2) ← (byte/signed byte/word/signed word/dword/signed dword) $37 + *((byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $37 asm { cli } to:scroll_bit::@return scroll_bit::@return: scope:[scroll_bit] from scroll_bit::@6 @@ -319,20 +232,12 @@ scroll_bit::@return: scope:[scroll_bit] from scroll_bit::@6 return to:@return @3: scope:[] from @2 - (byte*) CHARGEN#16 ← phi( @2/(byte*) CHARGEN#1 ) - (byte*) PROCPORT#20 ← phi( @2/(byte*) PROCPORT#21 ) - (byte*) SCROLL#13 ← phi( @2/(byte*) SCROLL#14 ) - (byte*) BGCOL#9 ← phi( @2/(byte*) BGCOL#10 ) - (byte*) RASTER#9 ← phi( @2/(byte*) RASTER#10 ) (byte*) current_chargen#26 ← phi( @2/(byte*) current_chargen#4 ) (byte) current_bit#28 ← phi( @2/(byte) current_bit#4 ) (byte) scroll#17 ← phi( @2/(byte) scroll#19 ) - (byte*) SCREEN#9 ← phi( @2/(byte*) SCREEN#12 ) - (byte*) TEXT#1 ← phi( @2/(byte*) TEXT#3 ) - (byte*) nxt#6 ← (byte*) TEXT#1 + (byte*) nxt#6 ← (byte*) TEXT#0 to:@6 next_char: scope:[next_char] from scroll_bit::@4 - (byte*) TEXT#4 ← phi( scroll_bit::@4/(byte*) TEXT#6 ) (byte*) nxt#17 ← phi( scroll_bit::@4/(byte*) nxt#24 ) (byte) next_char::c#0 ← *((byte*) nxt#17) (bool~) next_char::$0 ← (byte) next_char::c#0 == (byte) '@' @@ -346,8 +251,7 @@ next_char::@1: scope:[next_char] from next_char next_char::@2 (byte) next_char::return#1 ← (byte) next_char::c#2 to:next_char::@return next_char::@2: scope:[next_char] from next_char - (byte*) TEXT#2 ← phi( next_char/(byte*) TEXT#4 ) - (byte*) nxt#8 ← (byte*) TEXT#2 + (byte*) nxt#8 ← (byte*) TEXT#0 (byte) next_char::c#1 ← *((byte*) nxt#8) to:next_char::@1 next_char::@return: scope:[next_char] from next_char::@1 @@ -358,58 +262,56 @@ next_char::@return: scope:[next_char] from next_char::@1 return to:@return scroll_hard: scope:[scroll_hard] from scroll_bit::@1 - (byte*) SCREEN#6 ← phi( scroll_bit::@1/(byte*) SCREEN#5 ) (byte) scroll_hard::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:scroll_hard::@1 scroll_hard::@1: scope:[scroll_hard] from scroll_hard scroll_hard::@1 (byte) scroll_hard::i#2 ← phi( scroll_hard/(byte) scroll_hard::i#0 scroll_hard::@1/(byte) scroll_hard::i#1 ) - (byte*) SCREEN#3 ← phi( scroll_hard/(byte*) SCREEN#6 scroll_hard::@1/(byte*) SCREEN#3 ) (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$0 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 0 - (byte*~) scroll_hard::$1 ← (byte*) SCREEN#3 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$0 + (byte*~) scroll_hard::$1 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$0 (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$2 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 0 - (byte*~) scroll_hard::$3 ← (byte*) SCREEN#3 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$2 + (byte*~) scroll_hard::$3 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$2 (byte/signed word/word/dword/signed dword~) scroll_hard::$4 ← (byte) scroll_hard::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 *((byte*~) scroll_hard::$1 + (byte) scroll_hard::i#2) ← *((byte*~) scroll_hard::$3 + (byte/signed word/word/dword/signed dword~) scroll_hard::$4) (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$5 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 1 - (byte*~) scroll_hard::$6 ← (byte*) SCREEN#3 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$5 + (byte*~) scroll_hard::$6 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$5 (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$7 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 1 - (byte*~) scroll_hard::$8 ← (byte*) SCREEN#3 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$7 + (byte*~) scroll_hard::$8 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$7 (byte/signed word/word/dword/signed dword~) scroll_hard::$9 ← (byte) scroll_hard::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 *((byte*~) scroll_hard::$6 + (byte) scroll_hard::i#2) ← *((byte*~) scroll_hard::$8 + (byte/signed word/word/dword/signed dword~) scroll_hard::$9) (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$10 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte*~) scroll_hard::$11 ← (byte*) SCREEN#3 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$10 + (byte*~) scroll_hard::$11 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$10 (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$12 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte*~) scroll_hard::$13 ← (byte*) SCREEN#3 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$12 + (byte*~) scroll_hard::$13 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$12 (byte/signed word/word/dword/signed dword~) scroll_hard::$14 ← (byte) scroll_hard::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 *((byte*~) scroll_hard::$11 + (byte) scroll_hard::i#2) ← *((byte*~) scroll_hard::$13 + (byte/signed word/word/dword/signed dword~) scroll_hard::$14) (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$15 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 3 - (byte*~) scroll_hard::$16 ← (byte*) SCREEN#3 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$15 + (byte*~) scroll_hard::$16 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$15 (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$17 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 3 - (byte*~) scroll_hard::$18 ← (byte*) SCREEN#3 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$17 + (byte*~) scroll_hard::$18 ← (byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword~) scroll_hard::$17 (byte/signed word/word/dword/signed dword~) scroll_hard::$19 ← (byte) scroll_hard::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 *((byte*~) scroll_hard::$16 + (byte) scroll_hard::i#2) ← *((byte*~) scroll_hard::$18 + (byte/signed word/word/dword/signed dword~) scroll_hard::$19) (byte/word/signed word/dword/signed dword~) scroll_hard::$20 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 4 - (byte*~) scroll_hard::$21 ← (byte*) SCREEN#3 + (byte/word/signed word/dword/signed dword~) scroll_hard::$20 + (byte*~) scroll_hard::$21 ← (byte*) SCREEN#0 + (byte/word/signed word/dword/signed dword~) scroll_hard::$20 (byte/word/signed word/dword/signed dword~) scroll_hard::$22 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 4 - (byte*~) scroll_hard::$23 ← (byte*) SCREEN#3 + (byte/word/signed word/dword/signed dword~) scroll_hard::$22 + (byte*~) scroll_hard::$23 ← (byte*) SCREEN#0 + (byte/word/signed word/dword/signed dword~) scroll_hard::$22 (byte/signed word/word/dword/signed dword~) scroll_hard::$24 ← (byte) scroll_hard::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 *((byte*~) scroll_hard::$21 + (byte) scroll_hard::i#2) ← *((byte*~) scroll_hard::$23 + (byte/signed word/word/dword/signed dword~) scroll_hard::$24) (byte/word/signed word/dword/signed dword~) scroll_hard::$25 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 5 - (byte*~) scroll_hard::$26 ← (byte*) SCREEN#3 + (byte/word/signed word/dword/signed dword~) scroll_hard::$25 + (byte*~) scroll_hard::$26 ← (byte*) SCREEN#0 + (byte/word/signed word/dword/signed dword~) scroll_hard::$25 (byte/word/signed word/dword/signed dword~) scroll_hard::$27 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 5 - (byte*~) scroll_hard::$28 ← (byte*) SCREEN#3 + (byte/word/signed word/dword/signed dword~) scroll_hard::$27 + (byte*~) scroll_hard::$28 ← (byte*) SCREEN#0 + (byte/word/signed word/dword/signed dword~) scroll_hard::$27 (byte/signed word/word/dword/signed dword~) scroll_hard::$29 ← (byte) scroll_hard::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 *((byte*~) scroll_hard::$26 + (byte) scroll_hard::i#2) ← *((byte*~) scroll_hard::$28 + (byte/signed word/word/dword/signed dword~) scroll_hard::$29) (byte/word/signed word/dword/signed dword~) scroll_hard::$30 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 6 - (byte*~) scroll_hard::$31 ← (byte*) SCREEN#3 + (byte/word/signed word/dword/signed dword~) scroll_hard::$30 + (byte*~) scroll_hard::$31 ← (byte*) SCREEN#0 + (byte/word/signed word/dword/signed dword~) scroll_hard::$30 (byte/word/signed word/dword/signed dword~) scroll_hard::$32 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 6 - (byte*~) scroll_hard::$33 ← (byte*) SCREEN#3 + (byte/word/signed word/dword/signed dword~) scroll_hard::$32 + (byte*~) scroll_hard::$33 ← (byte*) SCREEN#0 + (byte/word/signed word/dword/signed dword~) scroll_hard::$32 (byte/signed word/word/dword/signed dword~) scroll_hard::$34 ← (byte) scroll_hard::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 *((byte*~) scroll_hard::$31 + (byte) scroll_hard::i#2) ← *((byte*~) scroll_hard::$33 + (byte/signed word/word/dword/signed dword~) scroll_hard::$34) (word/signed word/dword/signed dword~) scroll_hard::$35 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 7 - (byte*~) scroll_hard::$36 ← (byte*) SCREEN#3 + (word/signed word/dword/signed dword~) scroll_hard::$35 + (byte*~) scroll_hard::$36 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) scroll_hard::$35 (word/signed word/dword/signed dword~) scroll_hard::$37 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) 7 - (byte*~) scroll_hard::$38 ← (byte*) SCREEN#3 + (word/signed word/dword/signed dword~) scroll_hard::$37 + (byte*~) scroll_hard::$38 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword~) scroll_hard::$37 (byte/signed word/word/dword/signed dword~) scroll_hard::$39 ← (byte) scroll_hard::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 *((byte*~) scroll_hard::$36 + (byte) scroll_hard::i#2) ← *((byte*~) scroll_hard::$38 + (byte/signed word/word/dword/signed dword~) scroll_hard::$39) (byte) scroll_hard::i#1 ← ++ (byte) scroll_hard::i#2 @@ -438,17 +340,10 @@ fillscreen::@return: scope:[fillscreen] from fillscreen::@1 return to:@return @6: scope:[] from @3 - (byte*) TEXT#17 ← phi( @3/(byte*) TEXT#1 ) - (byte*) CHARGEN#15 ← phi( @3/(byte*) CHARGEN#16 ) - (byte*) PROCPORT#19 ← phi( @3/(byte*) PROCPORT#20 ) - (byte*) SCROLL#12 ← phi( @3/(byte*) SCROLL#13 ) - (byte*) BGCOL#8 ← phi( @3/(byte*) BGCOL#9 ) - (byte*) RASTER#7 ← phi( @3/(byte*) RASTER#9 ) (byte*) current_chargen#21 ← phi( @3/(byte*) current_chargen#26 ) (byte*) nxt#26 ← phi( @3/(byte*) nxt#6 ) (byte) current_bit#23 ← phi( @3/(byte) current_bit#28 ) (byte) scroll#15 ← phi( @3/(byte) scroll#17 ) - (byte*) SCREEN#4 ← phi( @3/(byte*) SCREEN#9 ) call main to:@7 @7: scope:[] from @6 @@ -474,130 +369,18 @@ SYMBOL TABLE SSA (label) @end (byte*) BGCOL (byte*) BGCOL#0 -(byte*) BGCOL#1 -(byte*) BGCOL#10 -(byte*) BGCOL#11 -(byte*) BGCOL#2 -(byte*) BGCOL#3 -(byte*) BGCOL#4 -(byte*) BGCOL#5 -(byte*) BGCOL#6 -(byte*) BGCOL#7 -(byte*) BGCOL#8 -(byte*) BGCOL#9 (byte*) CHARGEN (byte*) CHARGEN#0 -(byte*) CHARGEN#1 -(byte*) CHARGEN#10 -(byte*) CHARGEN#11 -(byte*) CHARGEN#12 -(byte*) CHARGEN#13 -(byte*) CHARGEN#14 -(byte*) CHARGEN#15 -(byte*) CHARGEN#16 -(byte*) CHARGEN#2 -(byte*) CHARGEN#3 -(byte*) CHARGEN#4 -(byte*) CHARGEN#5 -(byte*) CHARGEN#6 -(byte*) CHARGEN#7 -(byte*) CHARGEN#8 -(byte*) CHARGEN#9 (byte*) PROCPORT (byte*) PROCPORT#0 -(byte*) PROCPORT#1 -(byte*) PROCPORT#10 -(byte*) PROCPORT#11 -(byte*) PROCPORT#12 -(byte*) PROCPORT#13 -(byte*) PROCPORT#14 -(byte*) PROCPORT#15 -(byte*) PROCPORT#16 -(byte*) PROCPORT#17 -(byte*) PROCPORT#18 -(byte*) PROCPORT#19 -(byte*) PROCPORT#2 -(byte*) PROCPORT#20 -(byte*) PROCPORT#21 -(byte*) PROCPORT#22 -(byte*) PROCPORT#3 -(byte*) PROCPORT#4 -(byte*) PROCPORT#5 -(byte*) PROCPORT#6 -(byte*) PROCPORT#7 -(byte*) PROCPORT#8 -(byte*) PROCPORT#9 (byte*) RASTER (byte*) RASTER#0 -(byte*) RASTER#1 -(byte*) RASTER#10 -(byte*) RASTER#11 -(byte*) RASTER#2 -(byte*) RASTER#3 -(byte*) RASTER#4 -(byte*) RASTER#5 -(byte*) RASTER#6 -(byte*) RASTER#7 -(byte*) RASTER#8 -(byte*) RASTER#9 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#11 -(byte*) SCREEN#12 -(byte*) SCREEN#13 -(byte*) SCREEN#14 -(byte*) SCREEN#15 -(byte*) SCREEN#16 -(byte*) SCREEN#17 -(byte*) SCREEN#18 -(byte*) SCREEN#19 -(byte*) SCREEN#2 -(byte*) SCREEN#20 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (byte*) SCROLL (byte*) SCROLL#0 -(byte*) SCROLL#1 -(byte*) SCROLL#10 -(byte*) SCROLL#11 -(byte*) SCROLL#12 -(byte*) SCROLL#13 -(byte*) SCROLL#14 -(byte*) SCROLL#15 -(byte*) SCROLL#2 -(byte*) SCROLL#3 -(byte*) SCROLL#4 -(byte*) SCROLL#5 -(byte*) SCROLL#6 -(byte*) SCROLL#7 -(byte*) SCROLL#8 -(byte*) SCROLL#9 (byte*) TEXT (byte*) TEXT#0 -(byte*) TEXT#1 -(byte*) TEXT#10 -(byte*) TEXT#11 -(byte*) TEXT#12 -(byte*) TEXT#13 -(byte*) TEXT#14 -(byte*) TEXT#15 -(byte*) TEXT#16 -(byte*) TEXT#17 -(byte*) TEXT#2 -(byte*) TEXT#3 -(byte*) TEXT#4 -(byte*) TEXT#5 -(byte*) TEXT#6 -(byte*) TEXT#7 -(byte*) TEXT#8 -(byte*) TEXT#9 (byte) current_bit (byte) current_bit#0 (byte) current_bit#1 @@ -872,52 +655,26 @@ SYMBOL TABLE SSA (label) scroll_soft::@3 (label) scroll_soft::@return -Inversing boolean not [40] (bool~) scroll_soft::$1 ← (byte) scroll#3 != (byte/word/signed word/dword/signed dword) $ff from [39] (bool~) scroll_soft::$0 ← (byte) scroll#3 == (byte/word/signed word/dword/signed dword) $ff -Inversing boolean not [64] (bool~) scroll_bit::$2 ← (byte) current_bit#5 != (byte/signed byte/word/signed word/dword/signed dword) 0 from [63] (bool~) scroll_bit::$1 ← (byte) current_bit#5 == (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [91] (bool~) scroll_bit::$11 ← (byte~) scroll_bit::$9 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [90] (bool~) scroll_bit::$10 ← (byte~) scroll_bit::$9 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [116] (bool~) next_char::$1 ← (byte) next_char::c#0 != (byte) '@' from [115] (bool~) next_char::$0 ← (byte) next_char::c#0 == (byte) '@' +Inversing boolean not [39] (bool~) scroll_soft::$1 ← (byte) scroll#3 != (byte/word/signed word/dword/signed dword) $ff from [38] (bool~) scroll_soft::$0 ← (byte) scroll#3 == (byte/word/signed word/dword/signed dword) $ff +Inversing boolean not [63] (bool~) scroll_bit::$2 ← (byte) current_bit#5 != (byte/signed byte/word/signed word/dword/signed dword) 0 from [62] (bool~) scroll_bit::$1 ← (byte) current_bit#5 == (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [90] (bool~) scroll_bit::$11 ← (byte~) scroll_bit::$9 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [89] (bool~) scroll_bit::$10 ← (byte~) scroll_bit::$9 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [115] (bool~) next_char::$1 ← (byte) next_char::c#0 != (byte) '@' from [114] (bool~) next_char::$0 ← (byte) next_char::c#0 == (byte) '@' Successful SSA optimization Pass2UnaryNotSimplification -Alias (byte*) RASTER#4 = (byte*) RASTER#5 -Alias (byte*) BGCOL#6 = (byte*) BGCOL#7 Alias (byte) scroll#21 = (byte) scroll#22 Alias (byte) current_bit#31 = (byte) current_bit#32 Alias (byte*) nxt#35 = (byte*) nxt#37 Alias (byte*) current_chargen#30 = (byte*) current_chargen#31 -Alias (byte*) SCROLL#10 = (byte*) SCROLL#9 -Alias (byte*) PROCPORT#16 = (byte*) PROCPORT#17 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#19 -Alias (byte*) CHARGEN#12 = (byte*) CHARGEN#13 -Alias (byte*) TEXT#14 = (byte*) TEXT#15 -Alias (byte*) RASTER#2 = (byte*) RASTER#3 (byte*) RASTER#6 (byte*) RASTER#8 -Alias (byte*) BGCOL#1 = (byte*) BGCOL#5 (byte*) BGCOL#2 (byte*) BGCOL#3 Alias (byte) scroll#0 = (byte) scroll#20 (byte) scroll#7 (byte) scroll#8 (byte) scroll#1 Alias (byte) current_bit#0 = (byte) current_bit#30 (byte) current_bit#9 (byte) current_bit#10 (byte) current_bit#1 Alias (byte*) nxt#0 = (byte*) nxt#34 (byte*) nxt#11 (byte*) nxt#12 (byte*) nxt#1 Alias (byte*) current_chargen#0 = (byte*) current_chargen#29 (byte*) current_chargen#8 (byte*) current_chargen#9 (byte*) current_chargen#1 -Alias (byte*) SCROLL#11 = (byte*) SCROLL#8 (byte*) SCROLL#4 (byte*) SCROLL#6 -Alias (byte*) PROCPORT#12 = (byte*) PROCPORT#15 (byte*) PROCPORT#18 (byte*) PROCPORT#13 -Alias (byte*) SCREEN#15 = (byte*) SCREEN#18 (byte*) SCREEN#20 (byte*) SCREEN#16 -Alias (byte*) CHARGEN#11 = (byte*) CHARGEN#14 (byte*) CHARGEN#8 (byte*) CHARGEN#9 -Alias (byte*) TEXT#10 = (byte*) TEXT#13 (byte*) TEXT#16 (byte*) TEXT#11 Alias (byte) scroll#13 = (byte) scroll#16 Alias (byte) current_bit#17 = (byte) current_bit#24 Alias (byte*) nxt#21 = (byte*) nxt#27 Alias (byte*) current_chargen#15 = (byte*) current_chargen#22 -Alias (byte*) CHARGEN#0 = (byte*) CHARGEN#3 (byte*) CHARGEN#1 (byte*) current_chargen#4 (byte*) current_chargen#26 (byte*) CHARGEN#16 (byte*) current_chargen#21 (byte*) CHARGEN#15 -Alias (byte*) TEXT#0 = (byte*) TEXT#5 (byte*) TEXT#3 (byte*) TEXT#1 (byte*) nxt#6 (byte*) nxt#26 (byte*) TEXT#17 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#14 (byte*) SCREEN#12 (byte*) SCREEN#9 (byte*) SCREEN#4 -Alias (byte*) RASTER#0 = (byte*) RASTER#11 (byte*) RASTER#10 (byte*) RASTER#9 (byte*) RASTER#7 -Alias (byte*) BGCOL#0 = (byte*) BGCOL#11 (byte*) BGCOL#10 (byte*) BGCOL#9 (byte*) BGCOL#8 -Alias (byte*) SCROLL#0 = (byte*) SCROLL#15 (byte*) SCROLL#14 (byte*) SCROLL#13 (byte*) SCROLL#12 -Alias (byte*) PROCPORT#0 = (byte*) PROCPORT#22 (byte*) PROCPORT#21 (byte*) PROCPORT#20 (byte*) PROCPORT#19 Alias (byte) current_bit#18 = (byte) current_bit#25 Alias (byte*) nxt#22 = (byte*) nxt#28 Alias (byte*) current_chargen#16 = (byte*) current_chargen#23 -Alias (byte*) SCROLL#2 = (byte*) SCROLL#5 (byte*) SCROLL#3 -Alias (byte*) PROCPORT#11 = (byte*) PROCPORT#9 -Alias (byte*) SCREEN#10 = (byte*) SCREEN#13 -Alias (byte*) CHARGEN#6 = (byte*) CHARGEN#7 -Alias (byte*) TEXT#8 = (byte*) TEXT#9 Alias (byte) scroll#14 = (byte) scroll#4 Alias (byte) current_bit#11 = (byte) current_bit#2 Alias (byte*) nxt#13 = (byte*) nxt#2 @@ -927,18 +684,13 @@ Alias (byte) current_bit#12 = (byte) current_bit#19 (byte) current_bit#3 Alias (byte*) nxt#14 = (byte*) nxt#23 (byte*) nxt#3 Alias (byte*) current_chargen#11 = (byte*) current_chargen#17 (byte*) current_chargen#3 Alias (byte) scroll#15 = (byte) scroll#19 (byte) scroll#2 (byte) scroll#17 +Alias (byte*) CHARGEN#0 = (byte*) current_chargen#4 (byte*) current_chargen#26 (byte*) current_chargen#21 Alias (byte) current_bit#5 = (byte~) scroll_bit::$0 -Alias (byte*) PROCPORT#1 = (byte*) PROCPORT#3 -Alias (byte*) SCREEN#2 = (byte*) SCREEN#5 Alias (byte*) current_chargen#19 = (byte*) current_chargen#24 Alias (byte) current_bit#21 = (byte) current_bit#26 Alias (byte*) nxt#36 = (byte*) nxt#38 Alias (byte*) scroll_bit::sc#0 = (byte*~) scroll_bit::$8 Alias (byte*) nxt#24 = (byte*) nxt#29 -Alias (byte*) CHARGEN#2 = (byte*) CHARGEN#4 (byte*) CHARGEN#5 -Alias (byte*) TEXT#6 = (byte*) TEXT#7 -Alias (byte*) PROCPORT#10 = (byte*) PROCPORT#5 (byte*) PROCPORT#6 -Alias (byte*) SCREEN#11 = (byte*) SCREEN#7 (byte*) SCREEN#8 Alias (byte) next_char::return#0 = (byte) next_char::return#3 Alias (byte*) nxt#15 = (byte*) nxt#4 Alias (byte*) current_chargen#5 = (byte*~) scroll_bit::$5 @@ -947,16 +699,14 @@ Alias (byte*) scroll_bit::sc#3 = (byte*) scroll_bit::sc#4 Alias (byte) scroll_bit::r#2 = (byte) scroll_bit::r#4 Alias (byte*) current_chargen#12 = (byte*) current_chargen#25 Alias (byte) current_bit#14 = (byte) current_bit#27 -Alias (byte*) PROCPORT#7 = (byte*) PROCPORT#8 Alias (byte*) nxt#32 = (byte*) nxt#33 Alias (byte) scroll_bit::b#1 = (byte/word/signed word/dword/signed dword~) scroll_bit::$12 -Alias (byte*) PROCPORT#2 = (byte*) PROCPORT#4 Alias (byte) current_bit#15 = (byte) current_bit#22 (byte) current_bit#20 (byte) current_bit#7 Alias (byte*) nxt#16 = (byte*) nxt#25 (byte*) nxt#30 (byte*) nxt#5 Alias (byte*) current_chargen#13 = (byte*) current_chargen#20 (byte*) current_chargen#18 (byte*) current_chargen#6 Alias (byte) current_bit#23 = (byte) current_bit#28 (byte) current_bit#4 +Alias (byte*) TEXT#0 = (byte*) nxt#6 (byte*) nxt#26 Alias (byte) next_char::return#1 = (byte) next_char::c#2 (byte) next_char::return#4 (byte) next_char::return#2 -Alias (byte*) TEXT#2 = (byte*) TEXT#4 (byte*) nxt#8 Alias (byte*) nxt#19 = (byte*) nxt#7 (byte*) nxt#9 Alias (byte*) fillscreen::cursor#0 = (byte*) fillscreen::screen#1 Alias (byte) scroll#12 = (byte) scroll#6 @@ -964,100 +714,53 @@ Alias (byte) current_bit#16 = (byte) current_bit#8 Alias (byte*) nxt#10 = (byte*) nxt#20 Alias (byte*) current_chargen#14 = (byte*) current_chargen#7 Successful SSA optimization Pass2AliasElimination -Alias (byte*) SCROLL#1 = (byte*) SCROLL#2 -Alias (byte*) PROCPORT#1 = (byte*) PROCPORT#10 -Alias (byte*) SCREEN#11 = (byte*) SCREEN#2 Alias (byte*) scroll_bit::sc#2 = (byte*) scroll_bit::sc#3 Alias (byte) scroll_bit::r#2 = (byte) scroll_bit::r#3 Alias (byte*) current_chargen#12 = (byte*) current_chargen#13 Alias (byte) current_bit#14 = (byte) current_bit#15 -Alias (byte*) PROCPORT#2 = (byte*) PROCPORT#7 Alias (byte*) nxt#16 = (byte*) nxt#32 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) RASTER#1 -Self Phi Eliminated (byte*) BGCOL#4 Self Phi Eliminated (byte) scroll#18 Self Phi Eliminated (byte) current_bit#29 Self Phi Eliminated (byte*) nxt#31 Self Phi Eliminated (byte*) current_chargen#27 -Self Phi Eliminated (byte*) SCROLL#7 -Self Phi Eliminated (byte*) PROCPORT#14 -Self Phi Eliminated (byte*) SCREEN#17 -Self Phi Eliminated (byte*) CHARGEN#10 -Self Phi Eliminated (byte*) TEXT#12 -Self Phi Eliminated (byte*) RASTER#2 -Self Phi Eliminated (byte*) BGCOL#1 Self Phi Eliminated (byte) scroll#13 Self Phi Eliminated (byte) current_bit#17 Self Phi Eliminated (byte*) nxt#21 Self Phi Eliminated (byte*) current_chargen#15 -Self Phi Eliminated (byte*) SCROLL#11 -Self Phi Eliminated (byte*) PROCPORT#12 -Self Phi Eliminated (byte*) SCREEN#15 -Self Phi Eliminated (byte*) CHARGEN#11 -Self Phi Eliminated (byte*) TEXT#10 Self Phi Eliminated (byte*) current_chargen#12 Self Phi Eliminated (byte) current_bit#14 -Self Phi Eliminated (byte*) PROCPORT#2 Self Phi Eliminated (byte*) nxt#16 -Self Phi Eliminated (byte*) SCREEN#3 Self Phi Eliminated (byte) fillscreen::fill#1 Self Phi Eliminated (byte*) fillscreen::screen#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte*) RASTER#4 (byte*) RASTER#0 -Redundant Phi (byte*) BGCOL#6 (byte*) BGCOL#0 Redundant Phi (byte) scroll#21 (byte) scroll#15 Redundant Phi (byte) current_bit#31 (byte) current_bit#23 Redundant Phi (byte*) nxt#35 (byte*) TEXT#0 Redundant Phi (byte*) current_chargen#30 (byte*) CHARGEN#0 -Redundant Phi (byte*) SCROLL#10 (byte*) SCROLL#0 -Redundant Phi (byte*) PROCPORT#16 (byte*) PROCPORT#0 -Redundant Phi (byte*) CHARGEN#12 (byte*) CHARGEN#0 -Redundant Phi (byte*) TEXT#14 (byte*) TEXT#0 -Redundant Phi (byte*) RASTER#2 (byte*) RASTER#1 -Redundant Phi (byte*) BGCOL#1 (byte*) BGCOL#4 Redundant Phi (byte) scroll#13 (byte) scroll#18 Redundant Phi (byte) current_bit#17 (byte) current_bit#29 Redundant Phi (byte*) nxt#21 (byte*) nxt#31 Redundant Phi (byte*) current_chargen#15 (byte*) current_chargen#27 -Redundant Phi (byte*) SCROLL#11 (byte*) SCROLL#7 -Redundant Phi (byte*) PROCPORT#12 (byte*) PROCPORT#14 -Redundant Phi (byte*) SCREEN#15 (byte*) SCREEN#17 -Redundant Phi (byte*) CHARGEN#11 (byte*) CHARGEN#10 -Redundant Phi (byte*) TEXT#10 (byte*) TEXT#12 Redundant Phi (byte) scroll#0 (byte) scroll#10 Redundant Phi (byte) current_bit#0 (byte) current_bit#12 Redundant Phi (byte*) nxt#0 (byte*) nxt#14 Redundant Phi (byte*) current_chargen#0 (byte*) current_chargen#11 Redundant Phi (byte) scroll#9 (byte) scroll#13 -Redundant Phi (byte*) SCROLL#1 (byte*) SCROLL#11 Redundant Phi (byte) current_bit#18 (byte) current_bit#17 Redundant Phi (byte*) nxt#22 (byte*) nxt#21 Redundant Phi (byte*) current_chargen#16 (byte*) current_chargen#15 -Redundant Phi (byte*) PROCPORT#11 (byte*) PROCPORT#12 -Redundant Phi (byte*) SCREEN#10 (byte*) SCREEN#15 -Redundant Phi (byte*) CHARGEN#6 (byte*) CHARGEN#11 -Redundant Phi (byte*) TEXT#8 (byte*) TEXT#10 Redundant Phi (byte) current_bit#11 (byte) current_bit#14 Redundant Phi (byte*) nxt#13 (byte*) nxt#16 Redundant Phi (byte*) current_chargen#10 (byte*) current_chargen#12 Redundant Phi (byte) current_bit#13 (byte) current_bit#18 -Redundant Phi (byte*) PROCPORT#1 (byte*) PROCPORT#11 -Redundant Phi (byte*) SCREEN#11 (byte*) SCREEN#10 Redundant Phi (byte*) nxt#24 (byte*) nxt#22 -Redundant Phi (byte*) CHARGEN#2 (byte*) CHARGEN#6 Redundant Phi (byte*) current_chargen#28 (byte*) current_chargen#16 -Redundant Phi (byte*) TEXT#6 (byte*) TEXT#8 Redundant Phi (byte*) nxt#15 (byte*) nxt#19 Redundant Phi (byte*) current_chargen#12 (byte*) current_chargen#19 Redundant Phi (byte) current_bit#14 (byte) current_bit#21 -Redundant Phi (byte*) PROCPORT#2 (byte*) PROCPORT#1 Redundant Phi (byte*) nxt#16 (byte*) nxt#36 Redundant Phi (byte*) nxt#17 (byte*) nxt#24 -Redundant Phi (byte*) TEXT#2 (byte*) TEXT#6 -Redundant Phi (byte*) SCREEN#6 (byte*) SCREEN#11 -Redundant Phi (byte*) SCREEN#3 (byte*) SCREEN#6 Redundant Phi (byte*) fillscreen::cursor#0 (byte*) fillscreen::screen#0 Redundant Phi (byte) fillscreen::fill#2 (byte) fillscreen::fill#0 Redundant Phi (byte) fillscreen::fill#1 (byte) fillscreen::fill#2 @@ -1067,15 +770,15 @@ Redundant Phi (byte) current_bit#16 (byte) current_bit#0 Redundant Phi (byte*) nxt#10 (byte*) nxt#0 Redundant Phi (byte*) current_chargen#14 (byte*) current_chargen#0 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [15] if(*((byte*) RASTER#1)!=(byte/word/signed word/dword/signed dword) $fe) goto main::@2 -Simple Condition (bool~) main::$2 [18] if(*((byte*) RASTER#1)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@3 -Simple Condition (bool~) scroll_soft::$1 [41] if((byte) scroll#3!=(byte/word/signed word/dword/signed dword) $ff) goto scroll_soft::@1 -Simple Condition (bool~) scroll_bit::$2 [65] if((byte) current_bit#5!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto scroll_bit::@1 -Simple Condition (bool~) scroll_bit::$11 [92] if((byte~) scroll_bit::$9==(byte/signed byte/word/signed word/dword/signed dword) 0) goto scroll_bit::@3 -Simple Condition (bool~) scroll_bit::$14 [99] if((byte) scroll_bit::r#1!=rangelast(0,7)) goto scroll_bit::@2 -Simple Condition (bool~) next_char::$1 [117] if((byte) next_char::c#0!=(byte) '@') goto next_char::@1 -Simple Condition (bool~) scroll_hard::$40 [181] if((byte) scroll_hard::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $27) goto scroll_hard::@1 -Simple Condition (bool~) fillscreen::$1 [190] if((byte*) fillscreen::cursor#1<(byte*~) fillscreen::$0) goto fillscreen::@1 +Simple Condition (bool~) main::$1 [15] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $fe) goto main::@2 +Simple Condition (bool~) main::$2 [18] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@3 +Simple Condition (bool~) scroll_soft::$1 [40] if((byte) scroll#3!=(byte/word/signed word/dword/signed dword) $ff) goto scroll_soft::@1 +Simple Condition (bool~) scroll_bit::$2 [64] if((byte) current_bit#5!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto scroll_bit::@1 +Simple Condition (bool~) scroll_bit::$11 [91] if((byte~) scroll_bit::$9==(byte/signed byte/word/signed word/dword/signed dword) 0) goto scroll_bit::@3 +Simple Condition (bool~) scroll_bit::$14 [98] if((byte) scroll_bit::r#1!=rangelast(0,7)) goto scroll_bit::@2 +Simple Condition (bool~) next_char::$1 [116] if((byte) next_char::c#0!=(byte) '@') goto next_char::@1 +Simple Condition (bool~) scroll_hard::$40 [178] if((byte) scroll_hard::i#1!=(byte/signed byte/word/signed word/dword/signed dword) $27) goto scroll_hard::@1 +Simple Condition (bool~) fillscreen::$1 [187] if((byte*) fillscreen::cursor#1<(byte*~) fillscreen::$0) goto fillscreen::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) PROCPORT#0 = ((byte*))1 Constant (const byte*) CHARGEN#0 = ((byte*))$d000 @@ -1111,42 +814,8 @@ Constant (const word/signed word/dword/signed dword) scroll_hard::$35 = $28*7 Constant (const word/signed word/dword/signed dword) scroll_hard::$37 = $28*7 Successful SSA optimization Pass2ConstantIdentification Constant (const byte*) fillscreen::screen#0 = SCREEN#0 -Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) fillscreen::$0 = fillscreen::screen#0+$3e8 -Successful SSA optimization Pass2ConstantIdentification -Consolidated constant in assignment scroll_bit::sc#0 -Successful SSA optimization Pass2ConstantAdditionElimination -if() condition always true - replacing block destination [7] if(true) goto main::@1 -Successful SSA optimization Pass2ConstantIfs -Removing unused block main::@return -Successful SSA optimization Pass2EliminateUnusedBlocks -Resolved ranged next value scroll_bit::r#1 ← ++ scroll_bit::r#2 to ++ -Resolved ranged comparison value if(scroll_bit::r#1!=rangelast(0,7)) goto scroll_bit::@2 to (byte/signed byte/word/signed word/dword/signed dword) 8 -Culled Empty Block (label) main::@7 -Culled Empty Block (label) main::@1 -Culled Empty Block (label) @1 -Culled Empty Block (label) scroll_soft::@3 -Culled Empty Block (label) @2 -Culled Empty Block (label) @3 -Culled Empty Block (label) @7 -Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte*) RASTER#1 -Self Phi Eliminated (byte*) BGCOL#4 -Self Phi Eliminated (byte*) SCROLL#7 -Self Phi Eliminated (byte*) PROCPORT#14 -Self Phi Eliminated (byte*) SCREEN#17 -Self Phi Eliminated (byte*) CHARGEN#10 -Self Phi Eliminated (byte*) TEXT#12 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) RASTER#1 (const byte*) RASTER#0 -Redundant Phi (byte*) BGCOL#4 (const byte*) BGCOL#0 -Redundant Phi (byte*) SCROLL#7 (const byte*) SCROLL#0 -Redundant Phi (byte*) PROCPORT#14 (const byte*) PROCPORT#0 -Redundant Phi (byte*) SCREEN#17 (const byte*) SCREEN#0 -Redundant Phi (byte*) CHARGEN#10 (const byte*) CHARGEN#0 -Redundant Phi (byte*) TEXT#12 (const byte*) TEXT#0 -Successful SSA optimization Pass2RedundantPhiElimination -Constant (const byte*) scroll_bit::$7 = SCREEN#0 +Constant (const byte*) scroll_bit::$7 = SCREEN#0+$28 +Constant (const byte*) nxt#8 = TEXT#0 Constant (const byte*) scroll_hard::$1 = SCREEN#0+scroll_hard::$0 Constant (const byte*) scroll_hard::$3 = SCREEN#0+scroll_hard::$2 Constant (const byte*) scroll_hard::$6 = SCREEN#0+scroll_hard::$5 @@ -1164,7 +833,8 @@ Constant (const byte*) scroll_hard::$33 = SCREEN#0+scroll_hard::$32 Constant (const byte*) scroll_hard::$36 = SCREEN#0+scroll_hard::$35 Constant (const byte*) scroll_hard::$38 = SCREEN#0+scroll_hard::$37 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) scroll_bit::sc#0 = scroll_bit::$7+$28+$27 +Constant (const byte*) scroll_bit::sc#0 = scroll_bit::$7+$27 +Constant (const byte*) fillscreen::$0 = fillscreen::screen#0+$3e8 Successful SSA optimization Pass2ConstantIdentification Consolidated array index constant in assignment *(scroll_hard::$3+1 + scroll_hard::$4) Consolidated array index constant in assignment *(scroll_hard::$8+1 + scroll_hard::$9) @@ -1175,14 +845,28 @@ Consolidated array index constant in assignment *(scroll_hard::$28+1 + scroll_ha Consolidated array index constant in assignment *(scroll_hard::$33+1 + scroll_hard::$34) Consolidated array index constant in assignment *(scroll_hard::$38+1 + scroll_hard::$39) Successful SSA optimization Pass2ConstantAdditionElimination -Inferred type updated to byte in [44] (byte/signed word/word/dword/signed dword~) scroll_hard::$4 ← (byte) scroll_hard::i#2 -Inferred type updated to byte in [46] (byte/signed word/word/dword/signed dword~) scroll_hard::$9 ← (byte) scroll_hard::i#2 -Inferred type updated to byte in [48] (byte/signed word/word/dword/signed dword~) scroll_hard::$14 ← (byte) scroll_hard::i#2 -Inferred type updated to byte in [50] (byte/signed word/word/dword/signed dword~) scroll_hard::$19 ← (byte) scroll_hard::i#2 -Inferred type updated to byte in [52] (byte/signed word/word/dword/signed dword~) scroll_hard::$24 ← (byte) scroll_hard::i#2 -Inferred type updated to byte in [54] (byte/signed word/word/dword/signed dword~) scroll_hard::$29 ← (byte) scroll_hard::i#2 -Inferred type updated to byte in [56] (byte/signed word/word/dword/signed dword~) scroll_hard::$34 ← (byte) scroll_hard::i#2 -Inferred type updated to byte in [58] (byte/signed word/word/dword/signed dword~) scroll_hard::$39 ← (byte) scroll_hard::i#2 +if() condition always true - replacing block destination [7] if(true) goto main::@1 +Successful SSA optimization Pass2ConstantIfs +Inferred type updated to byte in [46] (byte/signed word/word/dword/signed dword~) scroll_hard::$4 ← (byte) scroll_hard::i#2 +Inferred type updated to byte in [48] (byte/signed word/word/dword/signed dword~) scroll_hard::$9 ← (byte) scroll_hard::i#2 +Inferred type updated to byte in [50] (byte/signed word/word/dword/signed dword~) scroll_hard::$14 ← (byte) scroll_hard::i#2 +Inferred type updated to byte in [52] (byte/signed word/word/dword/signed dword~) scroll_hard::$19 ← (byte) scroll_hard::i#2 +Inferred type updated to byte in [54] (byte/signed word/word/dword/signed dword~) scroll_hard::$24 ← (byte) scroll_hard::i#2 +Inferred type updated to byte in [56] (byte/signed word/word/dword/signed dword~) scroll_hard::$29 ← (byte) scroll_hard::i#2 +Inferred type updated to byte in [58] (byte/signed word/word/dword/signed dword~) scroll_hard::$34 ← (byte) scroll_hard::i#2 +Inferred type updated to byte in [60] (byte/signed word/word/dword/signed dword~) scroll_hard::$39 ← (byte) scroll_hard::i#2 +Removing unused block main::@return +Successful SSA optimization Pass2EliminateUnusedBlocks +Resolved ranged next value scroll_bit::r#1 ← ++ scroll_bit::r#2 to ++ +Resolved ranged comparison value if(scroll_bit::r#1!=rangelast(0,7)) goto scroll_bit::@2 to (byte/signed byte/word/signed word/dword/signed dword) 8 +Culled Empty Block (label) main::@7 +Culled Empty Block (label) main::@1 +Culled Empty Block (label) @1 +Culled Empty Block (label) scroll_soft::@3 +Culled Empty Block (label) @2 +Culled Empty Block (label) @3 +Culled Empty Block (label) @7 +Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) scroll_hard::i#2 = (byte~) scroll_hard::$4 (byte~) scroll_hard::$9 (byte~) scroll_hard::$14 (byte~) scroll_hard::$19 (byte~) scroll_hard::$24 (byte~) scroll_hard::$29 (byte~) scroll_hard::$34 (byte~) scroll_hard::$39 Successful SSA optimization Pass2AliasElimination Inlining constant with var siblings (const byte) scroll_bit::r#0 @@ -1194,6 +878,7 @@ Inlining constant with var siblings (const byte) scroll#15 Inlining constant with var siblings (const byte) scroll#14 Inlining constant with var siblings (const byte) current_bit#23 Inlining constant with var siblings (const byte) current_bit#6 +Inlining constant with var siblings (const byte*) nxt#8 Constant inlined scroll_hard::$3 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined scroll_hard::$6 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 1 Constant inlined scroll_hard::$5 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 1 @@ -1210,6 +895,7 @@ Constant inlined scroll_hard::$28 = (const byte*) SCREEN#0+(byte/signed byte/wor Constant inlined scroll_bit::r#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined current_bit#23 = (byte/signed byte/word/signed word/dword/signed dword) 1 Constant inlined fillscreen::screen#0 = (const byte*) SCREEN#0 +Constant inlined nxt#8 = (const byte*) TEXT#0 Constant inlined scroll_hard::$8 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 1 Constant inlined scroll_hard::$7 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 1 Constant inlined scroll_hard::$20 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 4 @@ -1217,7 +903,7 @@ Constant inlined scroll_hard::$21 = (const byte*) SCREEN#0+(byte/signed byte/wor Constant inlined scroll_hard::$22 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined scroll_hard::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined scroll_bit::b#0 = (byte) ' ' -Constant inlined scroll_bit::$7 = (const byte*) SCREEN#0 +Constant inlined scroll_bit::$7 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined fillscreen::$0 = (const byte*) SCREEN#0+(word/signed word/dword/signed dword) $3e8 Constant inlined scroll_bit::b#1 = (byte/word/signed word/dword/signed dword) $80+(byte) ' ' Constant inlined scroll_hard::$12 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 2 diff --git a/src/test/ref/examples/scrolllogo/scrolllogo.log b/src/test/ref/examples/scrolllogo/scrolllogo.log index 1b167eb4a..7da998769 100644 --- a/src/test/ref/examples/scrolllogo/scrolllogo.log +++ b/src/test/ref/examples/scrolllogo/scrolllogo.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) SCREEN +Identified constant variable (byte*) LOGO Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx Inlined call (byte~) main::$0 ← call toD018 (byte*) SCREEN (byte*) LOGO @@ -598,20 +600,17 @@ fill::@return: scope:[fill] from fill::@1 main: scope:[main] from @28 (word) xsin_idx#28 ← phi( @28/(word) xsin_idx#16 ) (word) rem16u#39 ← phi( @28/(word) rem16u#25 ) - (byte*) LOGO#1 ← phi( @28/(byte*) LOGO#2 ) - (byte*) SCREEN#1 ← phi( @28/(byte*) SCREEN#8 ) asm { sei } *((byte*) BORDERCOL#0) ← (byte) WHITE#0 *((byte*) BGCOL2#0) ← (byte) DARK_GREY#0 *((byte*) BGCOL#0) ← *((byte*) BGCOL2#0) *((byte*) BGCOL3#0) ← (byte) BLACK#0 - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#1 - (byte*) main::toD0181_gfx#0 ← (byte*) LOGO#1 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 + (byte*) main::toD0181_gfx#0 ← (byte*) LOGO#0 to:main::toD0181 main::toD0181: scope:[main] from main (word) xsin_idx#27 ← phi( main/(word) xsin_idx#28 ) (word) rem16u#38 ← phi( main/(word) rem16u#39 ) - (byte*) SCREEN#15 ← phi( main/(byte*) SCREEN#1 ) (byte*) main::toD0181_gfx#1 ← phi( main/(byte*) main::toD0181_gfx#0 ) (byte*) main::toD0181_screen#1 ← phi( main/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 @@ -628,19 +627,17 @@ main::toD0181: scope:[main] from main main::toD0181_@return: scope:[main] from main::toD0181 (word) xsin_idx#26 ← phi( main::toD0181/(word) xsin_idx#27 ) (word) rem16u#37 ← phi( main::toD0181/(word) rem16u#38 ) - (byte*) SCREEN#9 ← phi( main::toD0181/(byte*) SCREEN#15 ) (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 ) (byte) main::toD0181_return#1 ← (byte) main::toD0181_return#2 to:main::@3 main::@3: scope:[main] from main::toD0181_@return (word) xsin_idx#25 ← phi( main::toD0181_@return/(word) xsin_idx#26 ) (word) rem16u#35 ← phi( main::toD0181_@return/(word) rem16u#37 ) - (byte*) SCREEN#2 ← phi( main::toD0181_@return/(byte*) SCREEN#9 ) (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) (byte~) main::$0 ← (byte) main::toD0181_return#3 *((byte*) D018#0) ← (byte~) main::$0 *((byte*) D016#0) ← (byte) VIC_MCM#0 - (byte*) fill::start#0 ← (byte*) SCREEN#2 + (byte*) fill::start#0 ← (byte*) SCREEN#0 (word) fill::size#0 ← (word/signed word/dword/signed dword) $3e8 (byte) fill::val#0 ← (byte) BLACK#0 call fill @@ -648,7 +645,6 @@ main::@3: scope:[main] from main::toD0181_@return main::@4: scope:[main] from main::@3 (word) xsin_idx#24 ← phi( main::@3/(word) xsin_idx#25 ) (word) rem16u#33 ← phi( main::@3/(word) rem16u#35 ) - (byte*) SCREEN#16 ← phi( main::@3/(byte*) SCREEN#2 ) (byte/word/dword~) main::$2 ← (byte) WHITE#0 | (byte/signed byte/word/signed word/dword/signed dword) 8 (byte*) fill::start#1 ← (byte*) COLS#0 (word) fill::size#1 ← (word/signed word/dword/signed dword) $3e8 @@ -658,21 +654,18 @@ main::@4: scope:[main] from main::@3 main::@5: scope:[main] from main::@4 (word) xsin_idx#23 ← phi( main::@4/(word) xsin_idx#24 ) (word) rem16u#30 ← phi( main::@4/(word) rem16u#33 ) - (byte*) SCREEN#10 ← phi( main::@4/(byte*) SCREEN#16 ) (byte) main::ch#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main::@1 main::@5 (word) xsin_idx#22 ← phi( main::@1/(word) xsin_idx#22 main::@5/(word) xsin_idx#23 ) (word) rem16u#27 ← phi( main::@1/(word) rem16u#27 main::@5/(word) rem16u#30 ) - (byte*) SCREEN#3 ← phi( main::@1/(byte*) SCREEN#3 main::@5/(byte*) SCREEN#10 ) (byte) main::ch#2 ← phi( main::@1/(byte) main::ch#1 main::@5/(byte) main::ch#0 ) - *((byte*) SCREEN#3 + (byte) main::ch#2) ← (byte) main::ch#2 + *((byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 (byte) main::ch#1 ← (byte) main::ch#2 + rangenext(0,$ef) (bool~) main::$4 ← (byte) main::ch#1 != rangelast(0,$ef) if((bool~) main::$4) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 - (byte*) SCREEN#40 ← phi( main::@1/(byte*) SCREEN#3 ) (word) xsin_idx#17 ← phi( main::@1/(word) xsin_idx#22 ) (word) rem16u#23 ← phi( main::@1/(word) rem16u#27 ) (signed word/signed dword~) main::$5 ← - (word/signed word/dword/signed dword) $140 @@ -683,7 +676,6 @@ main::@2: scope:[main] from main::@1 call sin16s_gen2 to:main::@6 main::@6: scope:[main] from main::@2 - (byte*) SCREEN#37 ← phi( main::@2/(byte*) SCREEN#40 ) (word) xsin_idx#13 ← phi( main::@2/(word) xsin_idx#17 ) (word) rem16u#17 ← phi( main::@2/(word) rem16u#7 ) (word) rem16u#8 ← (word) rem16u#17 @@ -703,35 +695,27 @@ main::@return: scope:[main] from main::@7 to:@return @26: scope:[] from @25 (word) rem16u#28 ← phi( @25/(word) rem16u#31 ) - (byte*) LOGO#3 ← phi( @25/(byte*) LOGO#0 ) - (byte*) SCREEN#21 ← phi( @25/(byte*) SCREEN#0 ) (word) xsin_idx#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:@28 loop: scope:[loop] from main::@6 - (byte*) SCREEN#35 ← phi( main::@6/(byte*) SCREEN#37 ) (word) xsin_idx#18 ← phi( main::@6/(word) xsin_idx#13 ) to:loop::@1 loop::@1: scope:[loop] from loop loop::@7 - (byte*) SCREEN#34 ← phi( loop/(byte*) SCREEN#35 loop::@7/(byte*) SCREEN#36 ) (word) xsin_idx#15 ← phi( loop/(word) xsin_idx#18 loop::@7/(word) xsin_idx#19 ) if(true) goto loop::@2 to:loop::@return loop::@2: scope:[loop] from loop::@1 - (byte*) SCREEN#32 ← phi( loop::@1/(byte*) SCREEN#34 ) (word) xsin_idx#20 ← phi( loop::@1/(word) xsin_idx#15 ) to:loop::@4 loop::@4: scope:[loop] from loop::@2 loop::@5 - (byte*) SCREEN#31 ← phi( loop::@2/(byte*) SCREEN#32 loop::@5/(byte*) SCREEN#33 ) (word) xsin_idx#14 ← phi( loop::@2/(word) xsin_idx#20 loop::@5/(word) xsin_idx#21 ) (bool~) loop::$0 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $ff if((bool~) loop::$0) goto loop::@5 to:loop::@6 loop::@5: scope:[loop] from loop::@4 - (byte*) SCREEN#33 ← phi( loop::@4/(byte*) SCREEN#31 ) (word) xsin_idx#21 ← phi( loop::@4/(word) xsin_idx#14 ) to:loop::@4 loop::@6: scope:[loop] from loop::@4 - (byte*) SCREEN#30 ← phi( loop::@4/(byte*) SCREEN#31 ) (word) xsin_idx#9 ← phi( loop::@4/(word) xsin_idx#14 ) *((byte*) BORDERCOL#0) ← ++ *((byte*) BORDERCOL#0) (signed word*~) loop::$1 ← (signed word[XSIN_SIZE#0]) xsin#0 + (word) xsin_idx#9 @@ -740,7 +724,6 @@ loop::@6: scope:[loop] from loop::@4 call render_logo to:loop::@15 loop::@15: scope:[loop] from loop::@6 - (byte*) SCREEN#39 ← phi( loop::@6/(byte*) SCREEN#30 ) (word) xsin_idx#10 ← phi( loop::@6/(word) xsin_idx#9 ) (word) xsin_idx#3 ← (word) xsin_idx#10 + (byte/signed byte/word/signed word/dword/signed dword) 2 (word/signed dword/dword~) loop::$3 ← (word) XSIN_SIZE#0 * (byte/signed byte/word/signed word/dword/signed dword) 2 @@ -749,12 +732,10 @@ loop::@15: scope:[loop] from loop::@6 if((bool~) loop::$5) goto loop::@7 to:loop::@13 loop::@7: scope:[loop] from loop::@13 loop::@15 - (byte*) SCREEN#36 ← phi( loop::@13/(byte*) SCREEN#38 loop::@15/(byte*) SCREEN#39 ) (word) xsin_idx#19 ← phi( loop::@13/(word) xsin_idx#4 loop::@15/(word) xsin_idx#3 ) *((byte*) BORDERCOL#0) ← -- *((byte*) BORDERCOL#0) to:loop::@1 loop::@13: scope:[loop] from loop::@15 - (byte*) SCREEN#38 ← phi( loop::@15/(byte*) SCREEN#39 ) (word) xsin_idx#4 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:loop::@7 loop::@return: scope:[loop] from loop::@1 @@ -763,7 +744,6 @@ loop::@return: scope:[loop] from loop::@1 return to:@return render_logo: scope:[render_logo] from loop::@6 - (byte*) SCREEN#29 ← phi( loop::@6/(byte*) SCREEN#30 ) (signed word) render_logo::xpos#1 ← phi( loop::@6/(signed word) render_logo::xpos#0 ) (byte) render_logo::logo_idx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) render_logo::screen_idx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -779,7 +759,6 @@ render_logo: scope:[render_logo] from loop::@6 if((bool~) render_logo::$5) goto render_logo::@1 to:render_logo::@19 render_logo::@1: scope:[render_logo] from render_logo - (byte*) SCREEN#26 ← phi( render_logo/(byte*) SCREEN#29 ) (signed byte) render_logo::x_char#1 ← phi( render_logo/(signed byte) render_logo::x_char#0 ) (signed byte~) render_logo::$17 ← - (signed byte) render_logo::x_char#1 (byte~) render_logo::$18 ← ((byte)) (signed byte~) render_logo::$17 @@ -787,14 +766,12 @@ render_logo::@1: scope:[render_logo] from render_logo (byte) render_logo::screen_idx#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:render_logo::@11 render_logo::@19: scope:[render_logo] from render_logo - (byte*) SCREEN#22 ← phi( render_logo/(byte*) SCREEN#29 ) (signed byte) render_logo::x_char#2 ← phi( render_logo/(signed byte) render_logo::x_char#0 ) (byte~) render_logo::$6 ← ((byte)) (signed byte) render_logo::x_char#2 (byte) render_logo::logo_start#0 ← (byte~) render_logo::$6 (byte) render_logo::screen_idx#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:render_logo::@2 render_logo::@2: scope:[render_logo] from render_logo::@19 render_logo::@22 - (byte*) SCREEN#17 ← phi( render_logo::@19/(byte*) SCREEN#22 render_logo::@22/(byte*) SCREEN#23 ) (byte) render_logo::logo_start#1 ← phi( render_logo::@19/(byte) render_logo::logo_start#0 render_logo::@22/(byte) render_logo::logo_start#2 ) (byte) render_logo::screen_idx#7 ← phi( render_logo::@19/(byte) render_logo::screen_idx#2 render_logo::@22/(byte) render_logo::screen_idx#3 ) (bool~) render_logo::$7 ← (byte) render_logo::screen_idx#7 != (byte) render_logo::logo_start#1 @@ -803,35 +780,30 @@ render_logo::@2: scope:[render_logo] from render_logo::@19 render_logo::@22 render_logo::@3: scope:[render_logo] from render_logo::@2 (byte) render_logo::logo_start#4 ← phi( render_logo::@2/(byte) render_logo::logo_start#1 ) (byte) render_logo::screen_idx#18 ← phi( render_logo::@2/(byte) render_logo::screen_idx#7 ) - (byte*) SCREEN#11 ← phi( render_logo::@2/(byte*) SCREEN#17 ) (byte) render_logo::line#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:render_logo::@5 render_logo::@4: scope:[render_logo] from render_logo::@2 - (byte*) SCREEN#25 ← phi( render_logo::@2/(byte*) SCREEN#17 ) (byte) render_logo::screen_idx#19 ← phi( render_logo::@2/(byte) render_logo::screen_idx#7 ) (byte) render_logo::logo_idx#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:render_logo::@6 render_logo::@5: scope:[render_logo] from render_logo::@3 render_logo::@5 (byte) render_logo::logo_start#3 ← phi( render_logo::@3/(byte) render_logo::logo_start#4 render_logo::@5/(byte) render_logo::logo_start#3 ) (byte) render_logo::screen_idx#8 ← phi( render_logo::@3/(byte) render_logo::screen_idx#18 render_logo::@5/(byte) render_logo::screen_idx#8 ) - (byte*) SCREEN#4 ← phi( render_logo::@3/(byte*) SCREEN#11 render_logo::@5/(byte*) SCREEN#4 ) (byte) render_logo::line#9 ← phi( render_logo::@3/(byte) render_logo::line#1 render_logo::@5/(byte) render_logo::line#2 ) (byte/signed word/word/dword/signed dword~) render_logo::$8 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte) render_logo::line#9 - (byte*~) render_logo::$9 ← (byte*) SCREEN#4 + (byte/signed word/word/dword/signed dword~) render_logo::$8 + (byte*~) render_logo::$9 ← (byte*) SCREEN#0 + (byte/signed word/word/dword/signed dword~) render_logo::$8 *((byte*~) render_logo::$9 + (byte) render_logo::screen_idx#8) ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) render_logo::line#2 ← (byte) render_logo::line#9 + rangenext(0,5) (bool~) render_logo::$10 ← (byte) render_logo::line#2 != rangelast(0,5) unroll if((bool~) render_logo::$10) goto render_logo::@5 to:render_logo::@22 render_logo::@22: scope:[render_logo] from render_logo::@5 - (byte*) SCREEN#23 ← phi( render_logo::@5/(byte*) SCREEN#4 ) (byte) render_logo::logo_start#2 ← phi( render_logo::@5/(byte) render_logo::logo_start#3 ) (byte) render_logo::screen_idx#9 ← phi( render_logo::@5/(byte) render_logo::screen_idx#8 ) (byte) render_logo::screen_idx#3 ← ++ (byte) render_logo::screen_idx#9 to:render_logo::@2 render_logo::@6: scope:[render_logo] from render_logo::@26 render_logo::@4 (byte) render_logo::logo_idx#12 ← phi( render_logo::@26/(byte) render_logo::logo_idx#3 render_logo::@4/(byte) render_logo::logo_idx#2 ) - (byte*) SCREEN#18 ← phi( render_logo::@26/(byte*) SCREEN#24 render_logo::@4/(byte*) SCREEN#25 ) (byte) render_logo::screen_idx#10 ← phi( render_logo::@26/(byte) render_logo::screen_idx#4 render_logo::@4/(byte) render_logo::screen_idx#19 ) (bool~) render_logo::$11 ← (byte) render_logo::screen_idx#10 != (byte/signed byte/word/signed word/dword/signed dword) $28 if((bool~) render_logo::$11) goto render_logo::@7 @@ -839,16 +811,14 @@ render_logo::@6: scope:[render_logo] from render_logo::@26 render_logo::@4 render_logo::@7: scope:[render_logo] from render_logo::@6 (byte) render_logo::screen_idx#20 ← phi( render_logo::@6/(byte) render_logo::screen_idx#10 ) (byte) render_logo::logo_idx#10 ← phi( render_logo::@6/(byte) render_logo::logo_idx#12 ) - (byte*) SCREEN#12 ← phi( render_logo::@6/(byte*) SCREEN#18 ) (byte) render_logo::line#3 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:render_logo::@9 render_logo::@9: scope:[render_logo] from render_logo::@7 render_logo::@9 (byte) render_logo::screen_idx#11 ← phi( render_logo::@7/(byte) render_logo::screen_idx#20 render_logo::@9/(byte) render_logo::screen_idx#11 ) (byte) render_logo::logo_idx#5 ← phi( render_logo::@7/(byte) render_logo::logo_idx#10 render_logo::@9/(byte) render_logo::logo_idx#5 ) - (byte*) SCREEN#5 ← phi( render_logo::@7/(byte*) SCREEN#12 render_logo::@9/(byte*) SCREEN#5 ) (byte) render_logo::line#10 ← phi( render_logo::@7/(byte) render_logo::line#3 render_logo::@9/(byte) render_logo::line#4 ) (byte/signed word/word/dword/signed dword~) render_logo::$12 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte) render_logo::line#10 - (byte*~) render_logo::$13 ← (byte*) SCREEN#5 + (byte/signed word/word/dword/signed dword~) render_logo::$12 + (byte*~) render_logo::$13 ← (byte*) SCREEN#0 + (byte/signed word/word/dword/signed dword~) render_logo::$12 (byte/signed word/word/dword/signed dword~) render_logo::$14 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte) render_logo::line#10 (byte/signed word/word/dword/signed dword~) render_logo::$15 ← (byte) render_logo::logo_idx#5 + (byte/signed word/word/dword/signed dword~) render_logo::$14 *((byte*~) render_logo::$13 + (byte) render_logo::screen_idx#11) ← (byte/signed word/word/dword/signed dword~) render_logo::$15 @@ -857,14 +827,12 @@ render_logo::@9: scope:[render_logo] from render_logo::@7 render_logo::@9 unroll if((bool~) render_logo::$16) goto render_logo::@9 to:render_logo::@26 render_logo::@26: scope:[render_logo] from render_logo::@9 - (byte*) SCREEN#24 ← phi( render_logo::@9/(byte*) SCREEN#5 ) (byte) render_logo::logo_idx#6 ← phi( render_logo::@9/(byte) render_logo::logo_idx#5 ) (byte) render_logo::screen_idx#12 ← phi( render_logo::@9/(byte) render_logo::screen_idx#11 ) (byte) render_logo::screen_idx#4 ← ++ (byte) render_logo::screen_idx#12 (byte) render_logo::logo_idx#3 ← ++ (byte) render_logo::logo_idx#6 to:render_logo::@6 render_logo::@11: scope:[render_logo] from render_logo::@1 render_logo::@31 - (byte*) SCREEN#19 ← phi( render_logo::@1/(byte*) SCREEN#26 render_logo::@31/(byte*) SCREEN#27 ) (byte) render_logo::screen_idx#22 ← phi( render_logo::@1/(byte) render_logo::screen_idx#1 render_logo::@31/(byte) render_logo::screen_idx#5 ) (byte) render_logo::logo_idx#7 ← phi( render_logo::@1/(byte) render_logo::logo_idx#1 render_logo::@31/(byte) render_logo::logo_idx#4 ) (bool~) render_logo::$19 ← (byte) render_logo::logo_idx#7 != (byte/signed byte/word/signed word/dword/signed dword) $28 @@ -873,16 +841,14 @@ render_logo::@11: scope:[render_logo] from render_logo::@1 render_logo::@31 render_logo::@12: scope:[render_logo] from render_logo::@11 (byte) render_logo::screen_idx#21 ← phi( render_logo::@11/(byte) render_logo::screen_idx#22 ) (byte) render_logo::logo_idx#11 ← phi( render_logo::@11/(byte) render_logo::logo_idx#7 ) - (byte*) SCREEN#13 ← phi( render_logo::@11/(byte*) SCREEN#19 ) (byte) render_logo::line#5 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:render_logo::@14 render_logo::@14: scope:[render_logo] from render_logo::@12 render_logo::@14 (byte) render_logo::screen_idx#13 ← phi( render_logo::@12/(byte) render_logo::screen_idx#21 render_logo::@14/(byte) render_logo::screen_idx#13 ) (byte) render_logo::logo_idx#8 ← phi( render_logo::@12/(byte) render_logo::logo_idx#11 render_logo::@14/(byte) render_logo::logo_idx#8 ) - (byte*) SCREEN#6 ← phi( render_logo::@12/(byte*) SCREEN#13 render_logo::@14/(byte*) SCREEN#6 ) (byte) render_logo::line#11 ← phi( render_logo::@12/(byte) render_logo::line#5 render_logo::@14/(byte) render_logo::line#6 ) (byte/signed word/word/dword/signed dword~) render_logo::$20 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte) render_logo::line#11 - (byte*~) render_logo::$21 ← (byte*) SCREEN#6 + (byte/signed word/word/dword/signed dword~) render_logo::$20 + (byte*~) render_logo::$21 ← (byte*) SCREEN#0 + (byte/signed word/word/dword/signed dword~) render_logo::$20 (byte/signed word/word/dword/signed dword~) render_logo::$22 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte) render_logo::line#11 (byte/signed word/word/dword/signed dword~) render_logo::$23 ← (byte) render_logo::logo_idx#8 + (byte/signed word/word/dword/signed dword~) render_logo::$22 *((byte*~) render_logo::$21 + (byte) render_logo::screen_idx#13) ← (byte/signed word/word/dword/signed dword~) render_logo::$23 @@ -891,36 +857,31 @@ render_logo::@14: scope:[render_logo] from render_logo::@12 render_logo::@14 unroll if((bool~) render_logo::$24) goto render_logo::@14 to:render_logo::@31 render_logo::@31: scope:[render_logo] from render_logo::@14 - (byte*) SCREEN#27 ← phi( render_logo::@14/(byte*) SCREEN#6 ) (byte) render_logo::logo_idx#9 ← phi( render_logo::@14/(byte) render_logo::logo_idx#8 ) (byte) render_logo::screen_idx#14 ← phi( render_logo::@14/(byte) render_logo::screen_idx#13 ) (byte) render_logo::screen_idx#5 ← ++ (byte) render_logo::screen_idx#14 (byte) render_logo::logo_idx#4 ← ++ (byte) render_logo::logo_idx#9 to:render_logo::@11 render_logo::@15: scope:[render_logo] from render_logo::@11 render_logo::@35 - (byte*) SCREEN#20 ← phi( render_logo::@11/(byte*) SCREEN#19 render_logo::@35/(byte*) SCREEN#28 ) (byte) render_logo::screen_idx#15 ← phi( render_logo::@11/(byte) render_logo::screen_idx#22 render_logo::@35/(byte) render_logo::screen_idx#6 ) (bool~) render_logo::$25 ← (byte) render_logo::screen_idx#15 != (byte/signed byte/word/signed word/dword/signed dword) $28 if((bool~) render_logo::$25) goto render_logo::@16 to:render_logo::@return render_logo::@16: scope:[render_logo] from render_logo::@15 (byte) render_logo::screen_idx#23 ← phi( render_logo::@15/(byte) render_logo::screen_idx#15 ) - (byte*) SCREEN#14 ← phi( render_logo::@15/(byte*) SCREEN#20 ) (byte) render_logo::line#7 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:render_logo::@18 render_logo::@18: scope:[render_logo] from render_logo::@16 render_logo::@18 (byte) render_logo::screen_idx#16 ← phi( render_logo::@16/(byte) render_logo::screen_idx#23 render_logo::@18/(byte) render_logo::screen_idx#16 ) - (byte*) SCREEN#7 ← phi( render_logo::@16/(byte*) SCREEN#14 render_logo::@18/(byte*) SCREEN#7 ) (byte) render_logo::line#12 ← phi( render_logo::@16/(byte) render_logo::line#7 render_logo::@18/(byte) render_logo::line#8 ) (byte/signed word/word/dword/signed dword~) render_logo::$26 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte) render_logo::line#12 - (byte*~) render_logo::$27 ← (byte*) SCREEN#7 + (byte/signed word/word/dword/signed dword~) render_logo::$26 + (byte*~) render_logo::$27 ← (byte*) SCREEN#0 + (byte/signed word/word/dword/signed dword~) render_logo::$26 *((byte*~) render_logo::$27 + (byte) render_logo::screen_idx#16) ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) render_logo::line#8 ← (byte) render_logo::line#12 + rangenext(0,5) (bool~) render_logo::$28 ← (byte) render_logo::line#8 != rangelast(0,5) unroll if((bool~) render_logo::$28) goto render_logo::@18 to:render_logo::@35 render_logo::@35: scope:[render_logo] from render_logo::@18 - (byte*) SCREEN#28 ← phi( render_logo::@18/(byte*) SCREEN#7 ) (byte) render_logo::screen_idx#17 ← phi( render_logo::@18/(byte) render_logo::screen_idx#16 ) (byte) render_logo::screen_idx#6 ← ++ (byte) render_logo::screen_idx#17 to:render_logo::@15 @@ -930,8 +891,6 @@ render_logo::@return: scope:[render_logo] from render_logo::@15 render_logo::@6 @28: scope:[] from @26 (word) xsin_idx#16 ← phi( @26/(word) xsin_idx#2 ) (word) rem16u#25 ← phi( @26/(word) rem16u#28 ) - (byte*) LOGO#2 ← phi( @26/(byte*) LOGO#3 ) - (byte*) SCREEN#8 ← phi( @26/(byte*) SCREEN#21 ) call main to:@29 @29: scope:[] from @28 @@ -1042,9 +1001,6 @@ SYMBOL TABLE SSA (byte) LIGHT_GREY#0 (byte*) LOGO (byte*) LOGO#0 -(byte*) LOGO#1 -(byte*) LOGO#2 -(byte*) LOGO#3 (byte) ORANGE (byte) ORANGE#0 (word) PI2_u4f12 @@ -1085,46 +1041,6 @@ SYMBOL TABLE SSA (byte) RED#0 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#11 -(byte*) SCREEN#12 -(byte*) SCREEN#13 -(byte*) SCREEN#14 -(byte*) SCREEN#15 -(byte*) SCREEN#16 -(byte*) SCREEN#17 -(byte*) SCREEN#18 -(byte*) SCREEN#19 -(byte*) SCREEN#2 -(byte*) SCREEN#20 -(byte*) SCREEN#21 -(byte*) SCREEN#22 -(byte*) SCREEN#23 -(byte*) SCREEN#24 -(byte*) SCREEN#25 -(byte*) SCREEN#26 -(byte*) SCREEN#27 -(byte*) SCREEN#28 -(byte*) SCREEN#29 -(byte*) SCREEN#3 -(byte*) SCREEN#30 -(byte*) SCREEN#31 -(byte*) SCREEN#32 -(byte*) SCREEN#33 -(byte*) SCREEN#34 -(byte*) SCREEN#35 -(byte*) SCREEN#36 -(byte*) SCREEN#37 -(byte*) SCREEN#38 -(byte*) SCREEN#39 -(byte*) SCREEN#4 -(byte*) SCREEN#40 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (byte*) SPRITES_COLS (byte*) SPRITES_COLS#0 (byte*) SPRITES_ENABLE @@ -1973,49 +1889,34 @@ Alias (byte*) fill::end#0 = (byte*~) fill::$0 Alias (byte*) fill::addr#0 = (byte*) fill::start#2 Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#15 (byte*) SCREEN#9 (byte*) SCREEN#2 (byte*) SCREEN#16 (byte*) SCREEN#10 Alias (word) rem16u#30 = (word) rem16u#38 (word) rem16u#39 (word) rem16u#37 (word) rem16u#35 (word) rem16u#33 Alias (word) xsin_idx#23 = (word) xsin_idx#27 (word) xsin_idx#28 (word) xsin_idx#26 (word) xsin_idx#25 (word) xsin_idx#24 Alias (byte) main::toD0181_return#0 = (byte) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$0 Alias (byte) fill::val#1 = (byte/word/dword~) main::$2 Alias (word) rem16u#23 = (word) rem16u#27 Alias (word) xsin_idx#13 = (word) xsin_idx#17 (word) xsin_idx#22 -Alias (byte*) SCREEN#3 = (byte*) SCREEN#40 (byte*) SCREEN#37 Alias (signed word) sin16s_gen2::min#0 = (signed word/signed dword~) main::$5 Alias (word) rem16u#17 = (word) rem16u#8 (word) rem16u#24 (word) rem16u#18 (word) rem16u#9 Alias (word) xsin_idx#0 = (word) xsin_idx#7 (word) xsin_idx#8 (word) xsin_idx#1 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#21 (byte*) SCREEN#8 -Alias (byte*) LOGO#0 = (byte*) LOGO#3 (byte*) LOGO#2 Alias (word) xsin_idx#11 = (word) xsin_idx#20 (word) xsin_idx#15 (word) xsin_idx#5 -Alias (byte*) SCREEN#32 = (byte*) SCREEN#34 Alias (word) xsin_idx#10 = (word) xsin_idx#21 (word) xsin_idx#14 (word) xsin_idx#9 -Alias (byte*) SCREEN#30 = (byte*) SCREEN#33 (byte*) SCREEN#31 (byte*) SCREEN#39 (byte*) SCREEN#38 Alias (signed byte) render_logo::x_char#0 = (signed byte~) render_logo::$4 (signed byte) render_logo::x_char#1 (signed byte) render_logo::x_char#2 -Alias (byte*) SCREEN#22 = (byte*) SCREEN#26 (byte*) SCREEN#29 Alias (byte) render_logo::logo_idx#1 = (byte~) render_logo::$18 Alias (byte) render_logo::logo_start#0 = (byte~) render_logo::$6 -Alias (byte*) SCREEN#11 = (byte*) SCREEN#17 (byte*) SCREEN#25 Alias (byte) render_logo::screen_idx#18 = (byte) render_logo::screen_idx#7 (byte) render_logo::screen_idx#19 Alias (byte) render_logo::logo_start#1 = (byte) render_logo::logo_start#4 Alias (byte) render_logo::screen_idx#8 = (byte) render_logo::screen_idx#9 Alias (byte) render_logo::logo_start#2 = (byte) render_logo::logo_start#3 -Alias (byte*) SCREEN#23 = (byte*) SCREEN#4 -Alias (byte*) SCREEN#12 = (byte*) SCREEN#18 Alias (byte) render_logo::logo_idx#10 = (byte) render_logo::logo_idx#12 Alias (byte) render_logo::screen_idx#10 = (byte) render_logo::screen_idx#20 Alias (byte) render_logo::screen_idx#11 = (byte) render_logo::screen_idx#12 Alias (byte) render_logo::logo_idx#5 = (byte) render_logo::logo_idx#6 -Alias (byte*) SCREEN#24 = (byte*) SCREEN#5 -Alias (byte*) SCREEN#13 = (byte*) SCREEN#19 Alias (byte) render_logo::logo_idx#11 = (byte) render_logo::logo_idx#7 Alias (byte) render_logo::screen_idx#21 = (byte) render_logo::screen_idx#22 Alias (byte) render_logo::screen_idx#13 = (byte) render_logo::screen_idx#14 Alias (byte) render_logo::logo_idx#8 = (byte) render_logo::logo_idx#9 -Alias (byte*) SCREEN#27 = (byte*) SCREEN#6 -Alias (byte*) SCREEN#14 = (byte*) SCREEN#20 Alias (byte) render_logo::screen_idx#15 = (byte) render_logo::screen_idx#23 Alias (byte) render_logo::screen_idx#16 = (byte) render_logo::screen_idx#17 -Alias (byte*) SCREEN#28 = (byte*) SCREEN#7 Alias (word) xsin_idx#16 = (word) xsin_idx#2 Alias (word) rem16u#10 = (word) rem16u#19 Alias (word) xsin_idx#12 = (word) xsin_idx#6 @@ -2030,7 +1931,6 @@ Alias (dword) mul16u::mb#2 = (dword) mul16u::mb#3 Alias (signed word) mul16s::b#1 = (signed word) mul16s::b#2 Alias (signed word) mul16s::a#1 = (signed word) mul16s::a#3 Alias (byte) sin16s::isUpper#2 = (byte) sin16s::isUpper#8 -Alias (byte*) SCREEN#30 = (byte*) SCREEN#36 Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (word) divr16u::divisor#2 Self Phi Eliminated (signed word) sin16s_gen2::ampl#1 @@ -2040,21 +1940,15 @@ Self Phi Eliminated (word) sin16s_gen2::wavelength#2 Self Phi Eliminated (word) rem16u#16 Self Phi Eliminated (byte) fill::val#2 Self Phi Eliminated (byte*) fill::end#1 -Self Phi Eliminated (byte*) SCREEN#3 Self Phi Eliminated (word) rem16u#23 Self Phi Eliminated (word) xsin_idx#13 Self Phi Eliminated (word) xsin_idx#10 -Self Phi Eliminated (byte*) SCREEN#30 -Self Phi Eliminated (byte*) SCREEN#23 Self Phi Eliminated (byte) render_logo::screen_idx#8 Self Phi Eliminated (byte) render_logo::logo_start#2 -Self Phi Eliminated (byte*) SCREEN#24 Self Phi Eliminated (byte) render_logo::logo_idx#5 Self Phi Eliminated (byte) render_logo::screen_idx#11 -Self Phi Eliminated (byte*) SCREEN#27 Self Phi Eliminated (byte) render_logo::logo_idx#8 Self Phi Eliminated (byte) render_logo::screen_idx#13 -Self Phi Eliminated (byte*) SCREEN#28 Self Phi Eliminated (byte) render_logo::screen_idx#16 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (word) divr16u::divisor#2 (word) divr16u::divisor#6 @@ -2079,31 +1973,21 @@ Redundant Phi (word) rem16u#16 (word) rem16u#15 Redundant Phi (dword) sin16s::x#3 (dword) sin16s::x#0 Redundant Phi (byte) fill::val#2 (byte) fill::val#3 Redundant Phi (byte*) fill::end#1 (byte*) fill::end#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte*) LOGO#1 (byte*) LOGO#0 Redundant Phi (word) rem16u#30 (word) rem16u#0 Redundant Phi (word) xsin_idx#23 (word) xsin_idx#16 -Redundant Phi (byte*) SCREEN#3 (byte*) SCREEN#1 Redundant Phi (word) rem16u#23 (word) rem16u#30 Redundant Phi (word) xsin_idx#13 (word) xsin_idx#23 Redundant Phi (word) rem16u#17 (word) rem16u#16 Redundant Phi (word) xsin_idx#0 (word) xsin_idx#11 Redundant Phi (word) xsin_idx#18 (word) xsin_idx#13 -Redundant Phi (byte*) SCREEN#35 (byte*) SCREEN#3 Redundant Phi (word) xsin_idx#10 (word) xsin_idx#11 -Redundant Phi (byte*) SCREEN#30 (byte*) SCREEN#32 Redundant Phi (signed word) render_logo::xpos#1 (signed word) render_logo::xpos#0 -Redundant Phi (byte*) SCREEN#22 (byte*) SCREEN#30 -Redundant Phi (byte*) SCREEN#23 (byte*) SCREEN#11 Redundant Phi (byte) render_logo::screen_idx#8 (byte) render_logo::screen_idx#18 Redundant Phi (byte) render_logo::logo_start#2 (byte) render_logo::logo_start#1 -Redundant Phi (byte*) SCREEN#24 (byte*) SCREEN#12 Redundant Phi (byte) render_logo::logo_idx#5 (byte) render_logo::logo_idx#10 Redundant Phi (byte) render_logo::screen_idx#11 (byte) render_logo::screen_idx#10 -Redundant Phi (byte*) SCREEN#27 (byte*) SCREEN#13 Redundant Phi (byte) render_logo::logo_idx#8 (byte) render_logo::logo_idx#11 Redundant Phi (byte) render_logo::screen_idx#13 (byte) render_logo::screen_idx#21 -Redundant Phi (byte*) SCREEN#28 (byte*) SCREEN#14 Redundant Phi (byte) render_logo::screen_idx#16 (byte) render_logo::screen_idx#15 Redundant Phi (word) rem16u#10 (word) rem16u#17 Redundant Phi (word) xsin_idx#12 (word) xsin_idx#0 @@ -2123,15 +2007,15 @@ Simple Condition (bool~) fill::$1 [359] if((byte*) fill::addr#1!=(byte*) fill::e Simple Condition (bool~) main::$4 [410] if((byte) main::ch#1!=rangelast(0,$ef)) goto main::@1 Simple Condition (bool~) loop::$0 [435] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto loop::@5 Simple Condition (bool~) loop::$5 [448] if((word) xsin_idx#3!=(word/signed dword/dword~) loop::$3) goto loop::@7 -Simple Condition (bool~) render_logo::$5 [468] if((signed word) render_logo::xpos#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto render_logo::@1 -Simple Condition (bool~) render_logo::$7 [480] if((byte) render_logo::screen_idx#18!=(byte) render_logo::logo_start#1) goto render_logo::@3 -Simple Condition (bool~) render_logo::$10 [491] unroll if((byte) render_logo::line#2!=rangelast(0,5)) goto render_logo::@5 -Simple Condition (bool~) render_logo::$11 [496] if((byte) render_logo::screen_idx#10!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto render_logo::@7 -Simple Condition (bool~) render_logo::$16 [507] unroll if((byte) render_logo::line#4!=rangelast(0,5)) goto render_logo::@9 -Simple Condition (bool~) render_logo::$19 [513] if((byte) render_logo::logo_idx#11!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto render_logo::@12 -Simple Condition (bool~) render_logo::$24 [524] unroll if((byte) render_logo::line#6!=rangelast(0,5)) goto render_logo::@14 -Simple Condition (bool~) render_logo::$25 [530] if((byte) render_logo::screen_idx#15!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto render_logo::@16 -Simple Condition (bool~) render_logo::$28 [539] unroll if((byte) render_logo::line#8!=rangelast(0,5)) goto render_logo::@18 +Simple Condition (bool~) render_logo::$5 [467] if((signed word) render_logo::xpos#0<(byte/signed byte/word/signed word/dword/signed dword) 0) goto render_logo::@1 +Simple Condition (bool~) render_logo::$7 [479] if((byte) render_logo::screen_idx#18!=(byte) render_logo::logo_start#1) goto render_logo::@3 +Simple Condition (bool~) render_logo::$10 [490] unroll if((byte) render_logo::line#2!=rangelast(0,5)) goto render_logo::@5 +Simple Condition (bool~) render_logo::$11 [495] if((byte) render_logo::screen_idx#10!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto render_logo::@7 +Simple Condition (bool~) render_logo::$16 [506] unroll if((byte) render_logo::line#4!=rangelast(0,5)) goto render_logo::@9 +Simple Condition (bool~) render_logo::$19 [512] if((byte) render_logo::logo_idx#11!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto render_logo::@12 +Simple Condition (bool~) render_logo::$24 [523] unroll if((byte) render_logo::line#6!=rangelast(0,5)) goto render_logo::@14 +Simple Condition (bool~) render_logo::$25 [529] if((byte) render_logo::screen_idx#15!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto render_logo::@16 +Simple Condition (bool~) render_logo::$28 [538] unroll if((byte) render_logo::line#8!=rangelast(0,5)) goto render_logo::@18 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) PROCPORT_DDR#0 = ((byte*))0 Constant (const byte) PROCPORT_DDR_MEMORY_MASK#0 = 7 @@ -2352,19 +2236,9 @@ Successful SSA optimization Pass2CullEmptyBlocks Alias (dword) div32u16u::return#0 = (dword~) div32u16u::$4 Alias (dword) mul16s::m#4 = (dword) mul16s::m#5 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#32 Self Phi Eliminated (byte) render_logo::logo_start#1 -Self Phi Eliminated (byte*) SCREEN#11 -Self Phi Eliminated (byte*) SCREEN#12 -Self Phi Eliminated (byte*) SCREEN#13 -Self Phi Eliminated (byte*) SCREEN#14 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#32 (const byte*) SCREEN#0 Redundant Phi (byte) render_logo::logo_start#1 (byte)(signed byte) render_logo::x_char#0 -Redundant Phi (byte*) SCREEN#11 (byte*) SCREEN#32 -Redundant Phi (byte*) SCREEN#12 (byte*) SCREEN#11 -Redundant Phi (byte*) SCREEN#13 (byte*) SCREEN#32 -Redundant Phi (byte*) SCREEN#14 (byte*) SCREEN#13 Successful SSA optimization Pass2RedundantPhiElimination Unrolling loop Loop head: render_logo::@5 tails: render_logo::@5 blocks: render_logo::@5 Successful SSA optimization Pass2LoopUnroll diff --git a/src/test/ref/examples/showlogo/showlogo.log b/src/test/ref/examples/showlogo/showlogo.log index 3bac98cc0..e7f672844 100644 --- a/src/test/ref/examples/showlogo/showlogo.log +++ b/src/test/ref/examples/showlogo/showlogo.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) SCREEN +Identified constant variable (byte*) LOGO Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx Inlined call (byte~) main::$0 ← call toD018 (byte*) SCREEN (byte*) LOGO @@ -96,17 +98,14 @@ CONTROL FLOW GRAPH SSA }} to:@6 main: scope:[main] from @6 - (byte*) LOGO#1 ← phi( @6/(byte*) LOGO#2 ) - (byte*) SCREEN#1 ← phi( @6/(byte*) SCREEN#5 ) *((byte*) BORDERCOL#0) ← (byte) WHITE#0 *((byte*) BGCOL2#0) ← (byte) DARK_GREY#0 *((byte*) BGCOL#0) ← *((byte*) BGCOL2#0) *((byte*) BGCOL3#0) ← (byte) BLACK#0 - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#1 - (byte*) main::toD0181_gfx#0 ← (byte*) LOGO#1 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 + (byte*) main::toD0181_gfx#0 ← (byte*) LOGO#0 to:main::toD0181 main::toD0181: scope:[main] from main - (byte*) SCREEN#9 ← phi( main/(byte*) SCREEN#1 ) (byte*) main::toD0181_gfx#1 ← phi( main/(byte*) main::toD0181_gfx#0 ) (byte*) main::toD0181_screen#1 ← phi( main/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 @@ -121,25 +120,22 @@ main::toD0181: scope:[main] from main (byte) main::toD0181_return#0 ← (byte) main::toD0181_$8#0 to:main::toD0181_@return main::toD0181_@return: scope:[main] from main::toD0181 - (byte*) SCREEN#6 ← phi( main::toD0181/(byte*) SCREEN#9 ) (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 ) (byte) main::toD0181_return#1 ← (byte) main::toD0181_return#2 to:main::@9 main::@9: scope:[main] from main::toD0181_@return - (byte*) SCREEN#2 ← phi( main::toD0181_@return/(byte*) SCREEN#6 ) (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) (byte~) main::$0 ← (byte) main::toD0181_return#3 *((byte*) D018#0) ← (byte~) main::$0 (byte~) main::$1 ← (byte) VIC_MCM#0 | (byte) VIC_CSEL#0 *((byte*) D016#0) ← (byte~) main::$1 (word/signed word/dword/signed dword~) main::$2 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $19 - (byte*) fill::start#0 ← (byte*) SCREEN#2 + (byte*) fill::start#0 ← (byte*) SCREEN#0 (word) fill::size#0 ← (word/signed word/dword/signed dword~) main::$2 (byte) fill::val#0 ← (byte) BLACK#0 call fill to:main::@10 main::@10: scope:[main] from main::@9 - (byte*) SCREEN#10 ← phi( main::@9/(byte*) SCREEN#2 ) (word/signed word/dword/signed dword~) main::$4 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $19 (byte/word/dword~) main::$5 ← (byte) WHITE#0 | (byte/signed byte/word/signed word/dword/signed dword) 8 (byte*) fill::start#1 ← (byte*) COLS#0 @@ -148,26 +144,22 @@ main::@10: scope:[main] from main::@9 call fill to:main::@11 main::@11: scope:[main] from main::@10 - (byte*) SCREEN#7 ← phi( main::@10/(byte*) SCREEN#10 ) (byte) main::ch#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main::@1 main::@11 - (byte*) SCREEN#3 ← phi( main::@1/(byte*) SCREEN#3 main::@11/(byte*) SCREEN#7 ) (byte) main::ch#2 ← phi( main::@1/(byte) main::ch#1 main::@11/(byte) main::ch#0 ) - *((byte*) SCREEN#3 + (byte) main::ch#2) ← (byte) main::ch#2 + *((byte*) SCREEN#0 + (byte) main::ch#2) ← (byte) main::ch#2 (byte) main::ch#1 ← (byte) main::ch#2 + rangenext(0,$ef) (bool~) main::$7 ← (byte) main::ch#1 != rangelast(0,$ef) if((bool~) main::$7) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 main::@3 - (byte*) SCREEN#8 ← phi( main::@1/(byte*) SCREEN#3 main::@3/(byte*) SCREEN#4 ) if(true) goto main::@3 to:main::@return main::@3: scope:[main] from main::@2 - (byte*) SCREEN#4 ← phi( main::@2/(byte*) SCREEN#8 ) - (byte*~) main::$8 ← (byte*) SCREEN#4 + (word/signed word/dword/signed dword) $3e7 - (byte*~) main::$9 ← (byte*) SCREEN#4 + (word/signed word/dword/signed dword) $3e7 - (byte*~) main::$10 ← (byte*) SCREEN#4 + (word/signed word/dword/signed dword) $3e7 + (byte*~) main::$8 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) $3e7 + (byte*~) main::$9 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) $3e7 + (byte*~) main::$10 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) $3e7 *((byte*~) main::$10) ← ++ *((byte*~) main::$10) kickasm() {{ inc $d020 }} to:main::@2 @@ -195,8 +187,6 @@ fill::@return: scope:[fill] from fill::@1 return to:@return @6: scope:[] from @4 - (byte*) LOGO#2 ← phi( @4/(byte*) LOGO#0 ) - (byte*) SCREEN#5 ← phi( @4/(byte*) SCREEN#0 ) call main to:@7 @7: scope:[] from @6 @@ -297,8 +287,6 @@ SYMBOL TABLE SSA (byte) LIGHT_GREY#0 (byte*) LOGO (byte*) LOGO#0 -(byte*) LOGO#1 -(byte*) LOGO#2 (byte) ORANGE (byte) ORANGE#0 (byte) PINK @@ -327,16 +315,6 @@ SYMBOL TABLE SSA (byte) RED#0 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (byte*) SPRITES_COLS (byte*) SPRITES_COLS#0 (byte*) SPRITES_ENABLE @@ -467,31 +445,21 @@ Culled Empty Block (label) @7 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#9 (byte*) SCREEN#6 (byte*) SCREEN#2 (byte*) SCREEN#10 (byte*) SCREEN#7 Alias (byte) main::toD0181_return#0 = (byte) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$0 Alias (word) fill::size#0 = (word/signed word/dword/signed dword~) main::$2 Alias (word) fill::size#1 = (word/signed word/dword/signed dword~) main::$4 Alias (byte) fill::val#1 = (byte/word/dword~) main::$5 -Alias (byte*) SCREEN#4 = (byte*) SCREEN#8 Alias (byte*) fill::end#0 = (byte*~) fill::$0 Alias (byte*) fill::addr#0 = (byte*) fill::start#2 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#5 -Alias (byte*) LOGO#0 = (byte*) LOGO#2 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#3 -Self Phi Eliminated (byte*) SCREEN#4 Self Phi Eliminated (byte) fill::val#2 Self Phi Eliminated (byte*) fill::end#1 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte*) LOGO#1 (byte*) LOGO#0 -Redundant Phi (byte*) SCREEN#3 (byte*) SCREEN#1 -Redundant Phi (byte*) SCREEN#4 (byte*) SCREEN#3 Redundant Phi (byte) fill::val#2 (byte) fill::val#3 Redundant Phi (byte*) fill::end#1 (byte*) fill::end#0 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$7 [127] if((byte) main::ch#1!=rangelast(0,$ef)) goto main::@1 -Simple Condition (bool~) fill::$1 [145] if((byte*) fill::addr#1!=(byte*) fill::end#0) goto fill::@1 +Simple Condition (bool~) main::$7 [124] if((byte) main::ch#1!=rangelast(0,$ef)) goto main::@1 +Simple Condition (bool~) fill::$1 [140] if((byte*) fill::addr#1!=(byte*) fill::end#0) goto fill::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) PROCPORT_DDR#0 = ((byte*))0 Constant (const byte) PROCPORT_DDR_MEMORY_MASK#0 = 7 diff --git a/src/test/ref/examples/sinplotter/sine-plotter.log b/src/test/ref/examples/sinplotter/sine-plotter.log index 494b1e717..d54ec0df1 100644 --- a/src/test/ref/examples/sinplotter/sine-plotter.log +++ b/src/test/ref/examples/sinplotter/sine-plotter.log @@ -1,3 +1,6 @@ +Identified constant variable (byte*) SCREEN +Identified constant variable (byte*) BITMAP +Identified constant variable (signed word*) sin2 Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx Inlined call call vicSelectGfxBank (byte*) SCREEN Inlined call (byte~) main::$4 ← call toD018 (byte*) SCREEN (byte*) BITMAP @@ -707,10 +710,7 @@ bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot }} to:@32 main: scope:[main] from @32 - (signed word*) sin2#21 ← phi( @32/(signed word*) sin2#22 ) (word) rem16u#45 ← phi( @32/(word) rem16u#25 ) - (byte*) BITMAP#10 ← phi( @32/(byte*) BITMAP#11 ) - (byte*) SCREEN#1 ← phi( @32/(byte*) SCREEN#4 ) asm { sei } *((byte*) PROCPORT_DDR#0) ← (byte) PROCPORT_DDR_MEMORY_MASK#0 *((byte*) PROCPORT#0) ← (byte) PROCPORT_RAM_IO#0 @@ -718,22 +718,16 @@ main: scope:[main] from @32 (byte~) main::$1 ← (byte~) main::$0 | (byte) VIC_RSEL#0 (byte/word/dword~) main::$2 ← (byte~) main::$1 | (byte/signed byte/word/signed word/dword/signed dword) 3 *((byte*) D011#0) ← (byte/word/dword~) main::$2 - (byte*) main::vicSelectGfxBank1_gfx#0 ← (byte*) SCREEN#1 + (byte*) main::vicSelectGfxBank1_gfx#0 ← (byte*) SCREEN#0 to:main::vicSelectGfxBank1 main::vicSelectGfxBank1: scope:[main] from main - (signed word*) sin2#20 ← phi( main/(signed word*) sin2#21 ) (word) rem16u#44 ← phi( main/(word) rem16u#45 ) - (byte*) BITMAP#9 ← phi( main/(byte*) BITMAP#10 ) - (byte*) SCREEN#10 ← phi( main/(byte*) SCREEN#1 ) (byte*) main::vicSelectGfxBank1_gfx#1 ← phi( main/(byte*) main::vicSelectGfxBank1_gfx#0 ) *((byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 (byte*) main::vicSelectGfxBank1_toDd001_gfx#0 ← (byte*) main::vicSelectGfxBank1_gfx#1 to:main::vicSelectGfxBank1_toDd001 main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1 - (signed word*) sin2#19 ← phi( main::vicSelectGfxBank1/(signed word*) sin2#20 ) (word) rem16u#43 ← phi( main::vicSelectGfxBank1/(word) rem16u#44 ) - (byte*) BITMAP#7 ← phi( main::vicSelectGfxBank1/(byte*) BITMAP#9 ) - (byte*) SCREEN#9 ← phi( main::vicSelectGfxBank1/(byte*) SCREEN#10 ) (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 ← phi( main::vicSelectGfxBank1/(byte*) main::vicSelectGfxBank1_toDd001_gfx#0 ) (word) main::vicSelectGfxBank1_toDd001_$0#0 ← ((word)) (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 (byte) main::vicSelectGfxBank1_toDd001_$1#0 ← > (word) main::vicSelectGfxBank1_toDd001_$0#0 @@ -742,36 +736,24 @@ main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1 (byte) main::vicSelectGfxBank1_toDd001_return#0 ← (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 to:main::vicSelectGfxBank1_toDd001_@return main::vicSelectGfxBank1_toDd001_@return: scope:[main] from main::vicSelectGfxBank1_toDd001 - (signed word*) sin2#18 ← phi( main::vicSelectGfxBank1_toDd001/(signed word*) sin2#19 ) (word) rem16u#42 ← phi( main::vicSelectGfxBank1_toDd001/(word) rem16u#43 ) - (byte*) BITMAP#5 ← phi( main::vicSelectGfxBank1_toDd001/(byte*) BITMAP#7 ) - (byte*) SCREEN#7 ← phi( main::vicSelectGfxBank1_toDd001/(byte*) SCREEN#9 ) (byte) main::vicSelectGfxBank1_toDd001_return#2 ← phi( main::vicSelectGfxBank1_toDd001/(byte) main::vicSelectGfxBank1_toDd001_return#0 ) (byte) main::vicSelectGfxBank1_toDd001_return#1 ← (byte) main::vicSelectGfxBank1_toDd001_return#2 to:main::vicSelectGfxBank1_@1 main::vicSelectGfxBank1_@1: scope:[main] from main::vicSelectGfxBank1_toDd001_@return - (signed word*) sin2#17 ← phi( main::vicSelectGfxBank1_toDd001_@return/(signed word*) sin2#18 ) (word) rem16u#41 ← phi( main::vicSelectGfxBank1_toDd001_@return/(word) rem16u#42 ) - (byte*) BITMAP#3 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte*) BITMAP#5 ) - (byte*) SCREEN#5 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte*) SCREEN#7 ) (byte) main::vicSelectGfxBank1_toDd001_return#3 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte) main::vicSelectGfxBank1_toDd001_return#1 ) (byte) main::vicSelectGfxBank1_$0#0 ← (byte) main::vicSelectGfxBank1_toDd001_return#3 *((byte*) CIA2_PORT_A#0) ← (byte) main::vicSelectGfxBank1_$0#0 to:main::@7 main::@7: scope:[main] from main::vicSelectGfxBank1_@1 - (signed word*) sin2#16 ← phi( main::vicSelectGfxBank1_@1/(signed word*) sin2#17 ) (word) rem16u#40 ← phi( main::vicSelectGfxBank1_@1/(word) rem16u#41 ) - (byte*) BITMAP#1 ← phi( main::vicSelectGfxBank1_@1/(byte*) BITMAP#3 ) - (byte*) SCREEN#2 ← phi( main::vicSelectGfxBank1_@1/(byte*) SCREEN#5 ) *((byte*) D016#0) ← (byte) VIC_CSEL#0 - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#2 - (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP#1 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 + (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP#0 to:main::toD0181 main::toD0181: scope:[main] from main::@7 - (signed word*) sin2#15 ← phi( main::@7/(signed word*) sin2#16 ) (word) rem16u#39 ← phi( main::@7/(word) rem16u#40 ) - (byte*) BITMAP#8 ← phi( main::@7/(byte*) BITMAP#1 ) - (byte*) SCREEN#8 ← phi( main::@7/(byte*) SCREEN#2 ) (byte*) main::toD0181_gfx#1 ← phi( main::@7/(byte*) main::toD0181_gfx#0 ) (byte*) main::toD0181_screen#1 ← phi( main::@7/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 @@ -786,40 +768,30 @@ main::toD0181: scope:[main] from main::@7 (byte) main::toD0181_return#0 ← (byte) main::toD0181_$8#0 to:main::toD0181_@return main::toD0181_@return: scope:[main] from main::toD0181 - (signed word*) sin2#14 ← phi( main::toD0181/(signed word*) sin2#15 ) (word) rem16u#37 ← phi( main::toD0181/(word) rem16u#39 ) - (byte*) BITMAP#6 ← phi( main::toD0181/(byte*) BITMAP#8 ) - (byte*) SCREEN#6 ← phi( main::toD0181/(byte*) SCREEN#8 ) (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 ) (byte) main::toD0181_return#1 ← (byte) main::toD0181_return#2 to:main::@8 main::@8: scope:[main] from main::toD0181_@return - (signed word*) sin2#13 ← phi( main::toD0181_@return/(signed word*) sin2#14 ) (word) rem16u#35 ← phi( main::toD0181_@return/(word) rem16u#37 ) - (byte*) BITMAP#4 ← phi( main::toD0181_@return/(byte*) BITMAP#6 ) - (byte*) SCREEN#3 ← phi( main::toD0181_@return/(byte*) SCREEN#6 ) (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) (byte~) main::$4 ← (byte) main::toD0181_return#3 *((byte*) D018#0) ← (byte~) main::$4 - (byte*) fill::start#0 ← (byte*) SCREEN#3 + (byte*) fill::start#0 ← (byte*) SCREEN#0 (word) fill::size#0 ← (word/signed word/dword/signed dword) $3e8 (byte) fill::val#0 ← (byte) WHITE#0 call fill to:main::@9 main::@9: scope:[main] from main::@8 - (signed word*) sin2#12 ← phi( main::@8/(signed word*) sin2#13 ) (word) rem16u#33 ← phi( main::@8/(word) rem16u#35 ) - (byte*) BITMAP#2 ← phi( main::@8/(byte*) BITMAP#4 ) - (byte*) bitmap_init::bitmap#0 ← (byte*) BITMAP#2 + (byte*) bitmap_init::bitmap#0 ← (byte*) BITMAP#0 call bitmap_init to:main::@10 main::@10: scope:[main] from main::@9 - (signed word*) sin2#11 ← phi( main::@9/(signed word*) sin2#12 ) (word) rem16u#27 ← phi( main::@9/(word) rem16u#33 ) call bitmap_clear to:main::@11 main::@11: scope:[main] from main::@10 - (signed word*) sin2#9 ← phi( main::@10/(signed word*) sin2#11 ) (word) rem16u#23 ← phi( main::@10/(word) rem16u#27 ) (signed word/signed dword~) main::$8 ← - (word/signed word/dword/signed dword) $140 (signed word*) sin16s_gen2::sintab#1 ← (signed word[$200]) sin#0 @@ -829,7 +801,6 @@ main::@11: scope:[main] from main::@10 call sin16s_gen2 to:main::@12 main::@12: scope:[main] from main::@11 - (signed word*) sin2#6 ← phi( main::@11/(signed word*) sin2#9 ) (word) rem16u#17 ← phi( main::@11/(word) rem16u#7 ) (word) rem16u#8 ← (word) rem16u#17 call render_sine @@ -851,12 +822,10 @@ main::@return: scope:[main] from main::@1 return to:@return render_sine: scope:[render_sine] from main::@12 - (signed word*) sin2#4 ← phi( main::@12/(signed word*) sin2#6 ) (word) render_sine::xpos#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 (word) render_sine::sin_idx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:render_sine::@1 render_sine::@1: scope:[render_sine] from render_sine render_sine::@2 - (signed word*) sin2#3 ← phi( render_sine/(signed word*) sin2#4 render_sine::@2/(signed word*) sin2#5 ) (word) render_sine::xpos#6 ← phi( render_sine/(word) render_sine::xpos#0 render_sine::@2/(word) render_sine::xpos#8 ) (word) render_sine::sin_idx#2 ← phi( render_sine/(word) render_sine::sin_idx#0 render_sine::@2/(word) render_sine::sin_idx#1 ) (word~) render_sine::$0 ← (word) render_sine::sin_idx#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 @@ -867,7 +836,6 @@ render_sine::@1: scope:[render_sine] from render_sine render_sine::@2 (byte) wrap_y::return#0 ← (byte) wrap_y::return#3 to:render_sine::@5 render_sine::@5: scope:[render_sine] from render_sine::@1 - (signed word*) sin2#2 ← phi( render_sine::@1/(signed word*) sin2#3 ) (word) render_sine::sin_idx#5 ← phi( render_sine::@1/(word) render_sine::sin_idx#2 ) (word) render_sine::xpos#3 ← phi( render_sine::@1/(word) render_sine::xpos#6 ) (byte) wrap_y::return#4 ← phi( render_sine::@1/(byte) wrap_y::return#0 ) @@ -879,10 +847,9 @@ render_sine::@5: scope:[render_sine] from render_sine::@1 to:render_sine::@6 render_sine::@6: scope:[render_sine] from render_sine::@5 (word) render_sine::xpos#7 ← phi( render_sine::@5/(word) render_sine::xpos#3 ) - (signed word*) sin2#1 ← phi( render_sine::@5/(signed word*) sin2#2 ) (word) render_sine::sin_idx#3 ← phi( render_sine::@5/(word) render_sine::sin_idx#5 ) (word~) render_sine::$4 ← (word) render_sine::sin_idx#3 << (byte/signed byte/word/signed word/dword/signed dword) 1 - (signed word*~) render_sine::$5 ← (signed word*) sin2#1 + (word~) render_sine::$4 + (signed word*~) render_sine::$5 ← (signed word*) sin2#0 + (word~) render_sine::$4 (signed word) render_sine::sin2_val#0 ← *((signed word*~) render_sine::$5) (signed word/signed dword~) render_sine::$6 ← (signed word) render_sine::sin2_val#0 + (byte/signed byte/word/signed word/dword/signed dword) $a (signed word) wrap_y::y#1 ← (signed word/signed dword~) render_sine::$6 @@ -890,7 +857,6 @@ render_sine::@6: scope:[render_sine] from render_sine::@5 (byte) wrap_y::return#1 ← (byte) wrap_y::return#3 to:render_sine::@7 render_sine::@7: scope:[render_sine] from render_sine::@6 - (signed word*) sin2#10 ← phi( render_sine::@6/(signed word*) sin2#1 ) (word) render_sine::sin_idx#8 ← phi( render_sine::@6/(word) render_sine::sin_idx#3 ) (word) render_sine::xpos#4 ← phi( render_sine::@6/(word) render_sine::xpos#7 ) (byte) wrap_y::return#5 ← phi( render_sine::@6/(byte) wrap_y::return#1 ) @@ -901,7 +867,6 @@ render_sine::@7: scope:[render_sine] from render_sine::@6 call bitmap_plot to:render_sine::@8 render_sine::@8: scope:[render_sine] from render_sine::@7 - (signed word*) sin2#8 ← phi( render_sine::@7/(signed word*) sin2#10 ) (word) render_sine::sin_idx#7 ← phi( render_sine::@7/(word) render_sine::sin_idx#8 ) (word) render_sine::xpos#5 ← phi( render_sine::@7/(word) render_sine::xpos#4 ) (word) render_sine::xpos#1 ← ++ (word) render_sine::xpos#5 @@ -910,7 +875,6 @@ render_sine::@8: scope:[render_sine] from render_sine::@7 if((bool~) render_sine::$10) goto render_sine::@2 to:render_sine::@3 render_sine::@2: scope:[render_sine] from render_sine::@3 render_sine::@8 - (signed word*) sin2#5 ← phi( render_sine::@3/(signed word*) sin2#7 render_sine::@8/(signed word*) sin2#8 ) (word) render_sine::xpos#8 ← phi( render_sine::@3/(word) render_sine::xpos#2 render_sine::@8/(word) render_sine::xpos#1 ) (word) render_sine::sin_idx#4 ← phi( render_sine::@3/(word) render_sine::sin_idx#6 render_sine::@8/(word) render_sine::sin_idx#7 ) (word) render_sine::sin_idx#1 ← ++ (word) render_sine::sin_idx#4 @@ -918,7 +882,6 @@ render_sine::@2: scope:[render_sine] from render_sine::@3 render_sine::@8 if((bool~) render_sine::$11) goto render_sine::@1 to:render_sine::@return render_sine::@3: scope:[render_sine] from render_sine::@8 - (signed word*) sin2#7 ← phi( render_sine::@8/(signed word*) sin2#8 ) (word) render_sine::sin_idx#6 ← phi( render_sine::@8/(word) render_sine::sin_idx#7 ) (word) render_sine::xpos#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:render_sine::@2 @@ -957,10 +920,7 @@ wrap_y::@return: scope:[wrap_y] from wrap_y::@6 return to:@return @32: scope:[] from @29 - (signed word*) sin2#22 ← phi( @29/(signed word*) sin2#0 ) - (byte*) BITMAP#11 ← phi( @29/(byte*) BITMAP#0 ) (word) rem16u#25 ← phi( @29/(word) rem16u#30 ) - (byte*) SCREEN#4 ← phi( @29/(byte*) SCREEN#0 ) call main to:@33 @33: scope:[] from @32 @@ -993,17 +953,6 @@ SYMBOL TABLE SSA (byte*) BGCOL4#0 (byte*) BITMAP (byte*) BITMAP#0 -(byte*) BITMAP#1 -(byte*) BITMAP#10 -(byte*) BITMAP#11 -(byte*) BITMAP#2 -(byte*) BITMAP#3 -(byte*) BITMAP#4 -(byte*) BITMAP#5 -(byte*) BITMAP#6 -(byte*) BITMAP#7 -(byte*) BITMAP#8 -(byte*) BITMAP#9 (byte) BLACK (byte) BLACK#0 (byte) BLUE @@ -1118,16 +1067,6 @@ SYMBOL TABLE SSA (byte) RED#0 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (word) SIN_SIZE (word) SIN_SIZE#0 (byte*) SPRITES_COLS @@ -1882,28 +1821,6 @@ SYMBOL TABLE SSA (dword) sin16s_gen2::x#4 (signed word*) sin2 (signed word*) sin2#0 -(signed word*) sin2#1 -(signed word*) sin2#10 -(signed word*) sin2#11 -(signed word*) sin2#12 -(signed word*) sin2#13 -(signed word*) sin2#14 -(signed word*) sin2#15 -(signed word*) sin2#16 -(signed word*) sin2#17 -(signed word*) sin2#18 -(signed word*) sin2#19 -(signed word*) sin2#2 -(signed word*) sin2#20 -(signed word*) sin2#21 -(signed word*) sin2#22 -(signed word*) sin2#3 -(signed word*) sin2#4 -(signed word*) sin2#5 -(signed word*) sin2#6 -(signed word*) sin2#7 -(signed word*) sin2#8 -(signed word*) sin2#9 (byte()) wrap_y((signed word) wrap_y::y) (bool~) wrap_y::$0 (bool~) wrap_y::$1 @@ -1944,7 +1861,7 @@ Inversing boolean not [264] (bool~) sin16s::$4 ← (dword) sin16s::x#4 < (dword) Inversing boolean not [324] (bool~) sin16s::$19 ← (byte) sin16s::isUpper#2 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [323] (bool~) sin16s::$18 ← (byte) sin16s::isUpper#2 != (byte/signed byte/word/signed word/dword/signed dword) 0 Inversing boolean not [372] (bool~) bitmap_init::$1 ← (byte) bitmap_init::bits#1 != (byte/signed byte/word/signed word/dword/signed dword) 0 from [371] (bool~) bitmap_init::$0 ← (byte) bitmap_init::bits#1 == (byte/signed byte/word/signed word/dword/signed dword) 0 Inversing boolean not [392] (bool~) bitmap_init::$9 ← (byte~) bitmap_init::$7 != (byte/signed byte/word/signed word/dword/signed dword) 7 from [391] (bool~) bitmap_init::$8 ← (byte~) bitmap_init::$7 == (byte/signed byte/word/signed word/dword/signed dword) 7 -Inversing boolean not [537] (bool~) render_sine::$10 ← (word) render_sine::xpos#1 != (word/signed word/dword/signed dword) $140 from [536] (bool~) render_sine::$9 ← (word) render_sine::xpos#1 == (word/signed word/dword/signed dword) $140 +Inversing boolean not [536] (bool~) render_sine::$10 ← (word) render_sine::xpos#1 != (word/signed word/dword/signed dword) $140 from [535] (bool~) render_sine::$9 ← (word) render_sine::xpos#1 == (word/signed word/dword/signed dword) $140 Successful SSA optimization Pass2UnaryNotSimplification Alias (word) divr16u::rem#0 = (word~) divr16u::$0 (word) divr16u::rem#7 Alias (word) divr16u::dividend#0 = (word~) divr16u::$6 (word) divr16u::dividend#8 @@ -2050,10 +1967,7 @@ Alias (byte) bitmap_clear::y#2 = (byte) bitmap_clear::y#3 Alias (byte*) bitmap_clear::bitmap#1 = (byte*) bitmap_clear::bitmap#4 Alias (byte*) bitmap_plot::plotter#0 = (byte*~) bitmap_plot::$0 Alias (byte*) main::vicSelectGfxBank1_gfx#0 = (byte*) main::vicSelectGfxBank1_gfx#1 (byte*) main::vicSelectGfxBank1_toDd001_gfx#0 (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#10 (byte*) SCREEN#9 (byte*) SCREEN#7 (byte*) SCREEN#5 (byte*) SCREEN#2 (byte*) SCREEN#8 (byte*) SCREEN#6 (byte*) SCREEN#3 -Alias (byte*) BITMAP#1 = (byte*) BITMAP#9 (byte*) BITMAP#10 (byte*) BITMAP#7 (byte*) BITMAP#5 (byte*) BITMAP#3 (byte*) BITMAP#8 (byte*) BITMAP#6 (byte*) BITMAP#4 (byte*) BITMAP#2 Alias (word) rem16u#23 = (word) rem16u#44 (word) rem16u#45 (word) rem16u#43 (word) rem16u#42 (word) rem16u#41 (word) rem16u#40 (word) rem16u#39 (word) rem16u#37 (word) rem16u#35 (word) rem16u#33 (word) rem16u#27 -Alias (signed word*) sin2#11 = (signed word*) sin2#20 (signed word*) sin2#21 (signed word*) sin2#19 (signed word*) sin2#18 (signed word*) sin2#17 (signed word*) sin2#16 (signed word*) sin2#15 (signed word*) sin2#14 (signed word*) sin2#13 (signed word*) sin2#12 (signed word*) sin2#9 (signed word*) sin2#6 Alias (byte) main::vicSelectGfxBank1_toDd001_return#0 = (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 (byte) main::vicSelectGfxBank1_toDd001_return#2 (byte) main::vicSelectGfxBank1_toDd001_return#1 (byte) main::vicSelectGfxBank1_toDd001_return#3 (byte) main::vicSelectGfxBank1_$0#0 Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 @@ -2064,7 +1978,6 @@ Alias (word) rem16u#18 = (word) rem16u#29 (word) rem16u#24 (word) rem16u#9 Alias (byte) wrap_y::return#0 = (byte) wrap_y::return#4 Alias (word) render_sine::xpos#3 = (word) render_sine::xpos#6 (word) render_sine::xpos#7 (word) render_sine::xpos#4 (word) render_sine::xpos#5 Alias (word) render_sine::sin_idx#2 = (word) render_sine::sin_idx#5 (word) render_sine::sin_idx#3 (word) render_sine::sin_idx#8 (word) render_sine::sin_idx#7 (word) render_sine::sin_idx#6 -Alias (signed word*) sin2#1 = (signed word*) sin2#2 (signed word*) sin2#3 (signed word*) sin2#10 (signed word*) sin2#8 (signed word*) sin2#7 Alias (byte) render_sine::ypos#0 = (byte~) render_sine::$2 Alias (signed word) wrap_y::y#1 = (signed word/signed dword~) render_sine::$6 Alias (byte) wrap_y::return#1 = (byte) wrap_y::return#5 @@ -2072,9 +1985,6 @@ Alias (byte) render_sine::ypos2#0 = (byte~) render_sine::$7 Alias (signed word) wrap_y::y#4 = (signed word) wrap_y::y#5 Alias (signed word) wrap_y::y#6 = (signed word) wrap_y::y#7 (signed word) wrap_y::y#8 Alias (byte) wrap_y::return#2 = (byte~) wrap_y::$2 (byte) wrap_y::return#6 (byte) wrap_y::return#3 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#4 -Alias (byte*) BITMAP#0 = (byte*) BITMAP#11 -Alias (signed word*) sin2#0 = (signed word*) sin2#22 Alias (word) rem16u#10 = (word) rem16u#19 Successful SSA optimization Pass2AliasElimination Alias (word) divr16u::dividend#3 = (word) divr16u::dividend#4 @@ -2091,7 +2001,6 @@ Alias (byte) bitmap_init::x#2 = (byte) bitmap_init::x#3 Alias (byte*) bitmap_init::bitmap#1 = (byte*) bitmap_init::bitmap#3 Alias (byte) bitmap_init::y#2 = (byte) bitmap_init::y#3 Alias (word) render_sine::sin_idx#2 = (word) render_sine::sin_idx#4 -Alias (signed word*) sin2#1 = (signed word*) sin2#5 Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (word) divr16u::divisor#2 Self Phi Eliminated (signed word) sin16s_gen2::ampl#1 @@ -2104,7 +2013,6 @@ Self Phi Eliminated (byte*) fill::end#1 Self Phi Eliminated (byte*) bitmap_init::bitmap#1 Self Phi Eliminated (byte) bitmap_clear::y#2 Self Phi Eliminated (word) rem16u#18 -Self Phi Eliminated (signed word*) sin2#1 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (word) divr16u::divisor#2 (word) divr16u::divisor#6 Redundant Phi (dword) div32u16u::dividend#1 (dword) div32u16u::dividend#0 @@ -2134,14 +2042,9 @@ Redundant Phi (byte*) fill::end#1 (byte*) fill::end#0 Redundant Phi (byte*) bitmap_init::bitmap#5 (byte*) bitmap_init::bitmap#0 Redundant Phi (byte*) bitmap_init::bitmap#1 (byte*) bitmap_init::bitmap#5 Redundant Phi (byte) bitmap_clear::y#2 (byte) bitmap_clear::y#4 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte*) BITMAP#1 (byte*) BITMAP#0 Redundant Phi (word) rem16u#23 (word) rem16u#0 -Redundant Phi (signed word*) sin2#11 (signed word*) sin2#0 Redundant Phi (word) rem16u#17 (word) rem16u#16 Redundant Phi (word) rem16u#18 (word) rem16u#17 -Redundant Phi (signed word*) sin2#4 (signed word*) sin2#11 -Redundant Phi (signed word*) sin2#1 (signed word*) sin2#4 Redundant Phi (word) rem16u#10 (word) rem16u#18 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) divr16u::$4 [91] if((byte~) divr16u::$2==(byte/signed byte/word/signed word/dword/signed dword) 0) goto divr16u::@2 @@ -2162,10 +2065,10 @@ Simple Condition (bool~) bitmap_init::$9 [393] if((byte~) bitmap_init::$7!=(byte Simple Condition (bool~) bitmap_init::$12 [397] if((byte) bitmap_init::y#1!=rangelast(0,$ff)) goto bitmap_init::@3 Simple Condition (bool~) bitmap_clear::$1 [413] if((byte) bitmap_clear::x#1!=rangelast(0,$c7)) goto bitmap_clear::@2 Simple Condition (bool~) bitmap_clear::$2 [417] if((byte) bitmap_clear::y#1!=rangelast(0,$27)) goto bitmap_clear::@1 -Simple Condition (bool~) render_sine::$10 [538] if((word) render_sine::xpos#1!=(word/signed word/dword/signed dword) $140) goto render_sine::@2 -Simple Condition (bool~) render_sine::$11 [542] if((word) render_sine::sin_idx#1<(word) SIN_SIZE#0) goto render_sine::@1 -Simple Condition (bool~) wrap_y::$0 [549] if((signed word) wrap_y::y#4>=(byte/word/signed word/dword/signed dword) $c8) goto wrap_y::@2 -Simple Condition (bool~) wrap_y::$1 [554] if((signed word) wrap_y::y#6<(byte/signed byte/word/signed word/dword/signed dword) 0) goto wrap_y::@5 +Simple Condition (bool~) render_sine::$10 [537] if((word) render_sine::xpos#1!=(word/signed word/dword/signed dword) $140) goto render_sine::@2 +Simple Condition (bool~) render_sine::$11 [541] if((word) render_sine::sin_idx#1<(word) SIN_SIZE#0) goto render_sine::@1 +Simple Condition (bool~) wrap_y::$0 [548] if((signed word) wrap_y::y#4>=(byte/word/signed word/dword/signed dword) $c8) goto wrap_y::@2 +Simple Condition (bool~) wrap_y::$1 [553] if((signed word) wrap_y::y#6<(byte/signed byte/word/signed word/dword/signed dword) 0) goto wrap_y::@5 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) PROCPORT_DDR#0 = ((byte*))0 Constant (const byte) PROCPORT_DDR_MEMORY_MASK#0 = 7 diff --git a/src/test/ref/examples/sinsprites/sinus-sprites.log b/src/test/ref/examples/sinsprites/sinus-sprites.log index f30b7392f..dfde92d83 100644 --- a/src/test/ref/examples/sinsprites/sinus-sprites.log +++ b/src/test/ref/examples/sinsprites/sinus-sprites.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) gen_sintab::f_2pi Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx CONTROL FLOW GRAPH SSA @@ -741,7 +742,6 @@ gen_sintab::@3: scope:[gen_sintab] from gen_sintab (byte) progress_idx#64 ← phi( gen_sintab/(byte) progress_idx#65 ) (byte*) gen_sintab::sintab#23 ← phi( gen_sintab/(byte*) gen_sintab::sintab#24 ) (byte) gen_sintab::length#23 ← phi( gen_sintab/(byte) gen_sintab::length#24 ) - (byte*) gen_sintab::f_2pi#22 ← phi( gen_sintab/(byte*) gen_sintab::f_2pi#0 ) (byte) gen_sintab::min#3 ← phi( gen_sintab/(byte) gen_sintab::min#4 ) call setARGtoFAC to:gen_sintab::@4 @@ -750,7 +750,6 @@ gen_sintab::@4: scope:[gen_sintab] from gen_sintab::@3 (byte) progress_idx#63 ← phi( gen_sintab::@3/(byte) progress_idx#64 ) (byte*) gen_sintab::sintab#22 ← phi( gen_sintab::@3/(byte*) gen_sintab::sintab#23 ) (byte) gen_sintab::length#22 ← phi( gen_sintab::@3/(byte) gen_sintab::length#23 ) - (byte*) gen_sintab::f_2pi#21 ← phi( gen_sintab::@3/(byte*) gen_sintab::f_2pi#22 ) (byte) gen_sintab::min#2 ← phi( gen_sintab::@3/(byte) gen_sintab::min#3 ) (word~) gen_sintab::$3 ← ((word)) (byte) gen_sintab::min#2 (word) setFAC::w#1 ← (word~) gen_sintab::$3 @@ -761,7 +760,6 @@ gen_sintab::@5: scope:[gen_sintab] from gen_sintab::@4 (byte) progress_idx#62 ← phi( gen_sintab::@4/(byte) progress_idx#63 ) (byte*) gen_sintab::sintab#21 ← phi( gen_sintab::@4/(byte*) gen_sintab::sintab#22 ) (byte) gen_sintab::length#21 ← phi( gen_sintab::@4/(byte) gen_sintab::length#22 ) - (byte*) gen_sintab::f_2pi#19 ← phi( gen_sintab::@4/(byte*) gen_sintab::f_2pi#21 ) (byte*) setMEMtoFAC::mem#0 ← (byte[]) gen_sintab::f_min#0 call setMEMtoFAC to:gen_sintab::@6 @@ -770,7 +768,6 @@ gen_sintab::@6: scope:[gen_sintab] from gen_sintab::@5 (byte) progress_idx#61 ← phi( gen_sintab::@5/(byte) progress_idx#62 ) (byte*) gen_sintab::sintab#20 ← phi( gen_sintab::@5/(byte*) gen_sintab::sintab#21 ) (byte) gen_sintab::length#20 ← phi( gen_sintab::@5/(byte) gen_sintab::length#21 ) - (byte*) gen_sintab::f_2pi#17 ← phi( gen_sintab::@5/(byte*) gen_sintab::f_2pi#19 ) call subFACfromARG to:gen_sintab::@7 gen_sintab::@7: scope:[gen_sintab] from gen_sintab::@6 @@ -778,7 +775,6 @@ gen_sintab::@7: scope:[gen_sintab] from gen_sintab::@6 (byte) progress_idx#60 ← phi( gen_sintab::@6/(byte) progress_idx#61 ) (byte*) gen_sintab::sintab#19 ← phi( gen_sintab::@6/(byte*) gen_sintab::sintab#20 ) (byte) gen_sintab::length#19 ← phi( gen_sintab::@6/(byte) gen_sintab::length#20 ) - (byte*) gen_sintab::f_2pi#15 ← phi( gen_sintab::@6/(byte*) gen_sintab::f_2pi#17 ) (byte*) setMEMtoFAC::mem#1 ← (byte[]) gen_sintab::f_amp#0 call setMEMtoFAC to:gen_sintab::@8 @@ -787,7 +783,6 @@ gen_sintab::@8: scope:[gen_sintab] from gen_sintab::@7 (byte) progress_idx#59 ← phi( gen_sintab::@7/(byte) progress_idx#60 ) (byte*) gen_sintab::sintab#18 ← phi( gen_sintab::@7/(byte*) gen_sintab::sintab#19 ) (byte) gen_sintab::length#18 ← phi( gen_sintab::@7/(byte) gen_sintab::length#19 ) - (byte*) gen_sintab::f_2pi#13 ← phi( gen_sintab::@7/(byte*) gen_sintab::f_2pi#15 ) (word) setFAC::w#2 ← (byte/signed byte/word/signed word/dword/signed dword) 2 call setFAC to:gen_sintab::@9 @@ -796,7 +791,6 @@ gen_sintab::@9: scope:[gen_sintab] from gen_sintab::@8 (byte) progress_idx#58 ← phi( gen_sintab::@8/(byte) progress_idx#59 ) (byte*) gen_sintab::sintab#17 ← phi( gen_sintab::@8/(byte*) gen_sintab::sintab#18 ) (byte) gen_sintab::length#17 ← phi( gen_sintab::@8/(byte) gen_sintab::length#18 ) - (byte*) gen_sintab::f_2pi#11 ← phi( gen_sintab::@8/(byte*) gen_sintab::f_2pi#13 ) (byte*) divMEMbyFAC::mem#0 ← (byte[]) gen_sintab::f_amp#0 call divMEMbyFAC to:gen_sintab::@10 @@ -805,7 +799,6 @@ gen_sintab::@10: scope:[gen_sintab] from gen_sintab::@9 (byte) progress_idx#57 ← phi( gen_sintab::@9/(byte) progress_idx#58 ) (byte*) gen_sintab::sintab#16 ← phi( gen_sintab::@9/(byte*) gen_sintab::sintab#17 ) (byte) gen_sintab::length#16 ← phi( gen_sintab::@9/(byte) gen_sintab::length#17 ) - (byte*) gen_sintab::f_2pi#9 ← phi( gen_sintab::@9/(byte*) gen_sintab::f_2pi#11 ) (byte*) setMEMtoFAC::mem#2 ← (byte[]) gen_sintab::f_amp#0 call setMEMtoFAC to:gen_sintab::@11 @@ -814,7 +807,6 @@ gen_sintab::@11: scope:[gen_sintab] from gen_sintab::@10 (byte) progress_idx#56 ← phi( gen_sintab::@10/(byte) progress_idx#57 ) (byte*) gen_sintab::sintab#15 ← phi( gen_sintab::@10/(byte*) gen_sintab::sintab#16 ) (byte) gen_sintab::length#14 ← phi( gen_sintab::@10/(byte) gen_sintab::length#16 ) - (byte*) gen_sintab::f_2pi#7 ← phi( gen_sintab::@10/(byte*) gen_sintab::f_2pi#9 ) (byte*) addMEMtoFAC::mem#0 ← (byte[]) gen_sintab::f_min#0 call addMEMtoFAC to:gen_sintab::@12 @@ -823,7 +815,6 @@ gen_sintab::@12: scope:[gen_sintab] from gen_sintab::@11 (byte) progress_idx#55 ← phi( gen_sintab::@11/(byte) progress_idx#56 ) (byte*) gen_sintab::sintab#14 ← phi( gen_sintab::@11/(byte*) gen_sintab::sintab#15 ) (byte) gen_sintab::length#12 ← phi( gen_sintab::@11/(byte) gen_sintab::length#14 ) - (byte*) gen_sintab::f_2pi#5 ← phi( gen_sintab::@11/(byte*) gen_sintab::f_2pi#7 ) (byte*) setMEMtoFAC::mem#3 ← (byte[]) gen_sintab::f_min#0 call setMEMtoFAC to:gen_sintab::@13 @@ -832,7 +823,6 @@ gen_sintab::@13: scope:[gen_sintab] from gen_sintab::@12 (byte) progress_idx#54 ← phi( gen_sintab::@12/(byte) progress_idx#55 ) (byte*) gen_sintab::sintab#12 ← phi( gen_sintab::@12/(byte*) gen_sintab::sintab#14 ) (byte) gen_sintab::length#10 ← phi( gen_sintab::@12/(byte) gen_sintab::length#12 ) - (byte*) gen_sintab::f_2pi#3 ← phi( gen_sintab::@12/(byte*) gen_sintab::f_2pi#5 ) (byte) gen_sintab::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:gen_sintab::@1 gen_sintab::@1: scope:[gen_sintab] from gen_sintab::@13 gen_sintab::@23 @@ -840,7 +830,6 @@ gen_sintab::@1: scope:[gen_sintab] from gen_sintab::@13 gen_sintab::@23 (byte) progress_idx#53 ← phi( gen_sintab::@13/(byte) progress_idx#54 gen_sintab::@23/(byte) progress_idx#13 ) (byte*) gen_sintab::sintab#11 ← phi( gen_sintab::@13/(byte*) gen_sintab::sintab#12 gen_sintab::@23/(byte*) gen_sintab::sintab#13 ) (byte) gen_sintab::length#8 ← phi( gen_sintab::@13/(byte) gen_sintab::length#10 gen_sintab::@23/(byte) gen_sintab::length#3 ) - (byte*) gen_sintab::f_2pi#2 ← phi( gen_sintab::@13/(byte*) gen_sintab::f_2pi#3 gen_sintab::@23/(byte*) gen_sintab::f_2pi#4 ) (byte) gen_sintab::i#2 ← phi( gen_sintab::@13/(byte) gen_sintab::i#0 gen_sintab::@23/(byte) gen_sintab::i#1 ) (word~) gen_sintab::$13 ← ((word)) (byte) gen_sintab::i#2 (word) setFAC::w#3 ← (word~) gen_sintab::$13 @@ -852,12 +841,10 @@ gen_sintab::@14: scope:[gen_sintab] from gen_sintab::@1 (byte) gen_sintab::i#12 ← phi( gen_sintab::@1/(byte) gen_sintab::i#2 ) (byte*) gen_sintab::sintab#10 ← phi( gen_sintab::@1/(byte*) gen_sintab::sintab#11 ) (byte) gen_sintab::length#6 ← phi( gen_sintab::@1/(byte) gen_sintab::length#8 ) - (byte*) gen_sintab::f_2pi#1 ← phi( gen_sintab::@1/(byte*) gen_sintab::f_2pi#2 ) - (byte*) mulFACbyMEM::mem#0 ← (byte*) gen_sintab::f_2pi#1 + (byte*) mulFACbyMEM::mem#0 ← (byte*) gen_sintab::f_2pi#0 call mulFACbyMEM to:gen_sintab::@15 gen_sintab::@15: scope:[gen_sintab] from gen_sintab::@14 - (byte*) gen_sintab::f_2pi#20 ← phi( gen_sintab::@14/(byte*) gen_sintab::f_2pi#1 ) (byte*) progress_cursor#51 ← phi( gen_sintab::@14/(byte*) progress_cursor#52 ) (byte) progress_idx#51 ← phi( gen_sintab::@14/(byte) progress_idx#52 ) (byte) gen_sintab::i#11 ← phi( gen_sintab::@14/(byte) gen_sintab::i#12 ) @@ -867,7 +854,6 @@ gen_sintab::@15: scope:[gen_sintab] from gen_sintab::@14 call setMEMtoFAC to:gen_sintab::@16 gen_sintab::@16: scope:[gen_sintab] from gen_sintab::@15 - (byte*) gen_sintab::f_2pi#18 ← phi( gen_sintab::@15/(byte*) gen_sintab::f_2pi#20 ) (byte*) progress_cursor#50 ← phi( gen_sintab::@15/(byte*) progress_cursor#51 ) (byte) progress_idx#50 ← phi( gen_sintab::@15/(byte) progress_idx#51 ) (byte) gen_sintab::i#10 ← phi( gen_sintab::@15/(byte) gen_sintab::i#11 ) @@ -878,7 +864,6 @@ gen_sintab::@16: scope:[gen_sintab] from gen_sintab::@15 call setFAC to:gen_sintab::@17 gen_sintab::@17: scope:[gen_sintab] from gen_sintab::@16 - (byte*) gen_sintab::f_2pi#16 ← phi( gen_sintab::@16/(byte*) gen_sintab::f_2pi#18 ) (byte) gen_sintab::length#15 ← phi( gen_sintab::@16/(byte) gen_sintab::length#2 ) (byte*) progress_cursor#49 ← phi( gen_sintab::@16/(byte*) progress_cursor#50 ) (byte) progress_idx#49 ← phi( gen_sintab::@16/(byte) progress_idx#50 ) @@ -888,7 +873,6 @@ gen_sintab::@17: scope:[gen_sintab] from gen_sintab::@16 call divMEMbyFAC to:gen_sintab::@18 gen_sintab::@18: scope:[gen_sintab] from gen_sintab::@17 - (byte*) gen_sintab::f_2pi#14 ← phi( gen_sintab::@17/(byte*) gen_sintab::f_2pi#16 ) (byte) gen_sintab::length#13 ← phi( gen_sintab::@17/(byte) gen_sintab::length#15 ) (byte*) progress_cursor#47 ← phi( gen_sintab::@17/(byte*) progress_cursor#49 ) (byte) progress_idx#47 ← phi( gen_sintab::@17/(byte) progress_idx#49 ) @@ -897,7 +881,6 @@ gen_sintab::@18: scope:[gen_sintab] from gen_sintab::@17 call sinFAC to:gen_sintab::@19 gen_sintab::@19: scope:[gen_sintab] from gen_sintab::@18 - (byte*) gen_sintab::f_2pi#12 ← phi( gen_sintab::@18/(byte*) gen_sintab::f_2pi#14 ) (byte) gen_sintab::length#11 ← phi( gen_sintab::@18/(byte) gen_sintab::length#13 ) (byte*) progress_cursor#45 ← phi( gen_sintab::@18/(byte*) progress_cursor#47 ) (byte) progress_idx#45 ← phi( gen_sintab::@18/(byte) progress_idx#47 ) @@ -907,7 +890,6 @@ gen_sintab::@19: scope:[gen_sintab] from gen_sintab::@18 call mulFACbyMEM to:gen_sintab::@20 gen_sintab::@20: scope:[gen_sintab] from gen_sintab::@19 - (byte*) gen_sintab::f_2pi#10 ← phi( gen_sintab::@19/(byte*) gen_sintab::f_2pi#12 ) (byte) gen_sintab::length#9 ← phi( gen_sintab::@19/(byte) gen_sintab::length#11 ) (byte*) progress_cursor#42 ← phi( gen_sintab::@19/(byte*) progress_cursor#45 ) (byte) progress_idx#42 ← phi( gen_sintab::@19/(byte) progress_idx#45 ) @@ -917,7 +899,6 @@ gen_sintab::@20: scope:[gen_sintab] from gen_sintab::@19 call addMEMtoFAC to:gen_sintab::@21 gen_sintab::@21: scope:[gen_sintab] from gen_sintab::@20 - (byte*) gen_sintab::f_2pi#8 ← phi( gen_sintab::@20/(byte*) gen_sintab::f_2pi#10 ) (byte) gen_sintab::length#7 ← phi( gen_sintab::@20/(byte) gen_sintab::length#9 ) (byte*) progress_cursor#38 ← phi( gen_sintab::@20/(byte*) progress_cursor#42 ) (byte) progress_idx#38 ← phi( gen_sintab::@20/(byte) progress_idx#42 ) @@ -927,7 +908,6 @@ gen_sintab::@21: scope:[gen_sintab] from gen_sintab::@20 (word) getFAC::return#2 ← (word) getFAC::return#1 to:gen_sintab::@22 gen_sintab::@22: scope:[gen_sintab] from gen_sintab::@21 - (byte*) gen_sintab::f_2pi#6 ← phi( gen_sintab::@21/(byte*) gen_sintab::f_2pi#8 ) (byte) gen_sintab::length#5 ← phi( gen_sintab::@21/(byte) gen_sintab::length#7 ) (byte*) progress_cursor#34 ← phi( gen_sintab::@21/(byte*) progress_cursor#38 ) (byte) progress_idx#34 ← phi( gen_sintab::@21/(byte) progress_idx#38 ) @@ -941,7 +921,6 @@ gen_sintab::@22: scope:[gen_sintab] from gen_sintab::@21 to:gen_sintab::@23 gen_sintab::@23: scope:[gen_sintab] from gen_sintab::@22 (byte*) gen_sintab::sintab#13 ← phi( gen_sintab::@22/(byte*) gen_sintab::sintab#2 ) - (byte*) gen_sintab::f_2pi#4 ← phi( gen_sintab::@22/(byte*) gen_sintab::f_2pi#6 ) (byte) gen_sintab::length#3 ← phi( gen_sintab::@22/(byte) gen_sintab::length#5 ) (byte) gen_sintab::i#4 ← phi( gen_sintab::@22/(byte) gen_sintab::i#3 ) (byte*) progress_cursor#26 ← phi( gen_sintab::@22/(byte*) progress_cursor#11 ) @@ -1404,28 +1383,6 @@ SYMBOL TABLE SSA (label) gen_sintab::@return (byte*) gen_sintab::f_2pi (byte*) gen_sintab::f_2pi#0 -(byte*) gen_sintab::f_2pi#1 -(byte*) gen_sintab::f_2pi#10 -(byte*) gen_sintab::f_2pi#11 -(byte*) gen_sintab::f_2pi#12 -(byte*) gen_sintab::f_2pi#13 -(byte*) gen_sintab::f_2pi#14 -(byte*) gen_sintab::f_2pi#15 -(byte*) gen_sintab::f_2pi#16 -(byte*) gen_sintab::f_2pi#17 -(byte*) gen_sintab::f_2pi#18 -(byte*) gen_sintab::f_2pi#19 -(byte*) gen_sintab::f_2pi#2 -(byte*) gen_sintab::f_2pi#20 -(byte*) gen_sintab::f_2pi#21 -(byte*) gen_sintab::f_2pi#22 -(byte*) gen_sintab::f_2pi#3 -(byte*) gen_sintab::f_2pi#4 -(byte*) gen_sintab::f_2pi#5 -(byte*) gen_sintab::f_2pi#6 -(byte*) gen_sintab::f_2pi#7 -(byte*) gen_sintab::f_2pi#8 -(byte*) gen_sintab::f_2pi#9 (byte[]) gen_sintab::f_amp (byte[]) gen_sintab::f_amp#0 (byte[]) gen_sintab::f_i @@ -1969,14 +1926,12 @@ Alias (byte) gen_chargen_sprite::bits#1 = (byte~) gen_chargen_sprite::$11 Alias (byte*) gen_chargen_sprite::sprite#2 = (byte*~) gen_chargen_sprite::$13 Alias (word) setFAC::w#0 = (word~) gen_sintab::$0 Alias (byte) gen_sintab::min#2 = (byte) gen_sintab::min#3 (byte) gen_sintab::min#4 -Alias (byte*) gen_sintab::f_2pi#0 = (byte*) gen_sintab::f_2pi#22 (byte*) gen_sintab::f_2pi#21 (byte*) gen_sintab::f_2pi#19 (byte*) gen_sintab::f_2pi#17 (byte*) gen_sintab::f_2pi#15 (byte*) gen_sintab::f_2pi#13 (byte*) gen_sintab::f_2pi#11 (byte*) gen_sintab::f_2pi#9 (byte*) gen_sintab::f_2pi#7 (byte*) gen_sintab::f_2pi#5 (byte*) gen_sintab::f_2pi#3 Alias (byte) gen_sintab::length#10 = (byte) gen_sintab::length#23 (byte) gen_sintab::length#24 (byte) gen_sintab::length#22 (byte) gen_sintab::length#21 (byte) gen_sintab::length#20 (byte) gen_sintab::length#19 (byte) gen_sintab::length#18 (byte) gen_sintab::length#17 (byte) gen_sintab::length#16 (byte) gen_sintab::length#14 (byte) gen_sintab::length#12 Alias (byte*) gen_sintab::sintab#12 = (byte*) gen_sintab::sintab#23 (byte*) gen_sintab::sintab#24 (byte*) gen_sintab::sintab#22 (byte*) gen_sintab::sintab#21 (byte*) gen_sintab::sintab#20 (byte*) gen_sintab::sintab#19 (byte*) gen_sintab::sintab#18 (byte*) gen_sintab::sintab#17 (byte*) gen_sintab::sintab#16 (byte*) gen_sintab::sintab#15 (byte*) gen_sintab::sintab#14 Alias (byte) progress_idx#54 = (byte) progress_idx#64 (byte) progress_idx#65 (byte) progress_idx#63 (byte) progress_idx#62 (byte) progress_idx#61 (byte) progress_idx#60 (byte) progress_idx#59 (byte) progress_idx#58 (byte) progress_idx#57 (byte) progress_idx#56 (byte) progress_idx#55 Alias (byte*) progress_cursor#54 = (byte*) progress_cursor#64 (byte*) progress_cursor#65 (byte*) progress_cursor#63 (byte*) progress_cursor#62 (byte*) progress_cursor#61 (byte*) progress_cursor#60 (byte*) progress_cursor#59 (byte*) progress_cursor#58 (byte*) progress_cursor#57 (byte*) progress_cursor#56 (byte*) progress_cursor#55 Alias (word) setFAC::w#1 = (word~) gen_sintab::$3 Alias (word) setFAC::w#3 = (word~) gen_sintab::$13 -Alias (byte*) gen_sintab::f_2pi#1 = (byte*) gen_sintab::f_2pi#2 (byte*) gen_sintab::f_2pi#20 (byte*) gen_sintab::f_2pi#18 (byte*) gen_sintab::f_2pi#16 (byte*) gen_sintab::f_2pi#14 (byte*) gen_sintab::f_2pi#12 (byte*) gen_sintab::f_2pi#10 (byte*) gen_sintab::f_2pi#8 (byte*) gen_sintab::f_2pi#6 (byte*) gen_sintab::f_2pi#4 Alias (byte) gen_sintab::length#11 = (byte) gen_sintab::length#6 (byte) gen_sintab::length#8 (byte) gen_sintab::length#4 (byte) gen_sintab::length#2 (byte) gen_sintab::length#15 (byte) gen_sintab::length#13 (byte) gen_sintab::length#9 (byte) gen_sintab::length#7 (byte) gen_sintab::length#5 (byte) gen_sintab::length#3 Alias (byte*) gen_sintab::sintab#10 = (byte*) gen_sintab::sintab#11 (byte*) gen_sintab::sintab#9 (byte*) gen_sintab::sintab#8 (byte*) gen_sintab::sintab#7 (byte*) gen_sintab::sintab#6 (byte*) gen_sintab::sintab#5 (byte*) gen_sintab::sintab#4 (byte*) gen_sintab::sintab#3 (byte*) gen_sintab::sintab#2 (byte*) gen_sintab::sintab#13 Alias (byte) gen_sintab::i#10 = (byte) gen_sintab::i#12 (byte) gen_sintab::i#2 (byte) gen_sintab::i#11 (byte) gen_sintab::i#9 (byte) gen_sintab::i#8 (byte) gen_sintab::i#7 (byte) gen_sintab::i#6 (byte) gen_sintab::i#5 (byte) gen_sintab::i#3 (byte) gen_sintab::i#4 @@ -2031,7 +1986,6 @@ Self Phi Eliminated (byte) gen_chargen_sprite::bits#3 Self Phi Eliminated (byte) gen_chargen_sprite::x#2 Self Phi Eliminated (byte) gen_chargen_sprite::y#3 Self Phi Eliminated (byte*) gen_chargen_sprite::chargen#2 -Self Phi Eliminated (byte*) gen_sintab::f_2pi#1 Self Phi Eliminated (byte) gen_sintab::length#11 Self Phi Eliminated (byte*) gen_sintab::sintab#10 Successful SSA optimization Pass2SelfPhiElimination @@ -2071,7 +2025,6 @@ Redundant Phi (byte) gen_chargen_sprite::bits#3 (byte) gen_chargen_sprite::bits# Redundant Phi (byte) gen_chargen_sprite::x#2 (byte) gen_chargen_sprite::x#6 Redundant Phi (byte) gen_chargen_sprite::y#3 (byte) gen_chargen_sprite::y#10 Redundant Phi (byte*) gen_chargen_sprite::chargen#2 (byte*) gen_chargen_sprite::chargen#7 -Redundant Phi (byte*) gen_sintab::f_2pi#1 (byte*) gen_sintab::f_2pi#0 Redundant Phi (byte) gen_sintab::length#11 (byte) gen_sintab::length#10 Redundant Phi (byte*) gen_sintab::sintab#10 (byte*) gen_sintab::sintab#12 Redundant Phi (byte) progress_idx#13 (byte) progress_idx#12 diff --git a/src/test/ref/fillscreen.log b/src/test/ref/fillscreen.log index 2ee601be2..dbf9cf5a7 100644 --- a/src/test/ref/fillscreen.log +++ b/src/test/ref/fillscreen.log @@ -1,11 +1,11 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@2 main: scope:[main] from @2 - (byte*) SCREEN#1 ← phi( @2/(byte*) SCREEN#3 ) - (byte) main::c#0 ← *((byte*) SCREEN#1) + (byte) main::c#0 ← *((byte*) SCREEN#0) (byte) fillscreen::c#0 ← (byte) main::c#0 call fillscreen to:main::@1 @@ -16,20 +16,18 @@ main::@return: scope:[main] from main::@1 to:@return fillscreen: scope:[fillscreen] from main (byte) fillscreen::c#2 ← phi( main/(byte) fillscreen::c#0 ) - (byte*) SCREEN#4 ← phi( main/(byte*) SCREEN#1 ) (byte) fillscreen::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:fillscreen::@1 fillscreen::@1: scope:[fillscreen] from fillscreen fillscreen::@1 (byte) fillscreen::j#2 ← phi( fillscreen/(byte) fillscreen::j#0 fillscreen::@1/(byte) fillscreen::j#1 ) (byte) fillscreen::c#1 ← phi( fillscreen/(byte) fillscreen::c#2 fillscreen::@1/(byte) fillscreen::c#1 ) - (byte*) SCREEN#2 ← phi( fillscreen/(byte*) SCREEN#4 fillscreen::@1/(byte*) SCREEN#2 ) - (byte*~) fillscreen::$0 ← (byte*) SCREEN#2 + (word/signed word/dword/signed dword) $100 + (byte*~) fillscreen::$0 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) $100 (byte*) fillscreen::SCREEN2#0 ← (byte*~) fillscreen::$0 - (byte*~) fillscreen::$1 ← (byte*) SCREEN#2 + (word/signed word/dword/signed dword) $200 + (byte*~) fillscreen::$1 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) $200 (byte*) fillscreen::SCREEN3#0 ← (byte*~) fillscreen::$1 - (byte*~) fillscreen::$2 ← (byte*) SCREEN#2 + (word/signed word/dword/signed dword) $3e8 + (byte*~) fillscreen::$2 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) $3e8 (byte*) fillscreen::SCREEN4#0 ← (byte*~) fillscreen::$2 - *((byte*) SCREEN#2 + (byte) fillscreen::j#2) ← (byte) fillscreen::c#1 + *((byte*) SCREEN#0 + (byte) fillscreen::j#2) ← (byte) fillscreen::c#1 *((byte*) fillscreen::SCREEN2#0 + (byte) fillscreen::j#2) ← (byte) fillscreen::c#1 *((byte*) fillscreen::SCREEN3#0 + (byte) fillscreen::j#2) ← (byte) fillscreen::c#1 *((byte*) fillscreen::SCREEN4#0 + (byte) fillscreen::j#2) ← (byte) fillscreen::c#1 @@ -41,7 +39,6 @@ fillscreen::@return: scope:[fillscreen] from fillscreen::@1 return to:@return @2: scope:[] from @begin - (byte*) SCREEN#3 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@3 @3: scope:[] from @2 @@ -55,10 +52,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 (void()) fillscreen((byte) fillscreen::c) (byte*~) fillscreen::$0 (byte*~) fillscreen::$1 @@ -92,18 +85,13 @@ Successful SSA optimization Pass2CullEmptyBlocks Alias (byte*) fillscreen::SCREEN2#0 = (byte*~) fillscreen::$0 Alias (byte*) fillscreen::SCREEN3#0 = (byte*~) fillscreen::$1 Alias (byte*) fillscreen::SCREEN4#0 = (byte*~) fillscreen::$2 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#2 Self Phi Eliminated (byte) fillscreen::c#1 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#4 (byte*) SCREEN#1 Redundant Phi (byte) fillscreen::c#2 (byte) fillscreen::c#0 -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#4 Redundant Phi (byte) fillscreen::c#1 (byte) fillscreen::c#2 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) fillscreen::$3 [21] if((byte) fillscreen::j#1!=rangelast(0,$ff)) goto fillscreen::@1 +Simple Condition (bool~) fillscreen::$3 [20] if((byte) fillscreen::j#1!=rangelast(0,$ff)) goto fillscreen::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) fillscreen::j#0 = 0 diff --git a/src/test/ref/flipper-rex2.log b/src/test/ref/flipper-rex2.log index ba730870e..f39536838 100644 --- a/src/test/ref/flipper-rex2.log +++ b/src/test/ref/flipper-rex2.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) RASTER +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -9,59 +11,39 @@ CONTROL FLOW GRAPH SSA (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@4 main: scope:[main] from @4 - (byte*) SCREEN#11 ← phi( @4/(byte*) SCREEN#12 ) - (byte*) RASTER#8 ← phi( @4/(byte*) RASTER#10 ) call prepare to:main::@9 main::@9: scope:[main] from main - (byte*) SCREEN#10 ← phi( main/(byte*) SCREEN#11 ) - (byte*) RASTER#6 ← phi( main/(byte*) RASTER#8 ) to:main::@1 main::@1: scope:[main] from main::@11 main::@9 - (byte*) SCREEN#7 ← phi( main::@11/(byte*) SCREEN#9 main::@9/(byte*) SCREEN#10 ) - (byte*) RASTER#3 ← phi( main::@11/(byte*) RASTER#5 main::@9/(byte*) RASTER#6 ) (byte) main::c#0 ← (byte/signed byte/word/signed word/dword/signed dword) $19 to:main::@3 main::@2: scope:[main] from main::@6 - (byte*) SCREEN#8 ← phi( main::@6/(byte*) SCREEN#4 ) (byte) main::c#5 ← phi( main::@6/(byte) main::c#1 ) - (byte*) RASTER#4 ← phi( main::@6/(byte*) RASTER#7 ) to:main::@3 main::@3: scope:[main] from main::@1 main::@2 main::@3 - (byte*) SCREEN#6 ← phi( main::@1/(byte*) SCREEN#7 main::@2/(byte*) SCREEN#8 main::@3/(byte*) SCREEN#6 ) (byte) main::c#4 ← phi( main::@1/(byte) main::c#0 main::@2/(byte) main::c#5 main::@3/(byte) main::c#4 ) - (byte*) RASTER#1 ← phi( main::@1/(byte*) RASTER#3 main::@2/(byte*) RASTER#4 main::@3/(byte*) RASTER#1 ) - (bool~) main::$1 ← *((byte*) RASTER#1) != (byte/word/signed word/dword/signed dword) $fe + (bool~) main::$1 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $fe if((bool~) main::$1) goto main::@3 to:main::@4 main::@4: scope:[main] from main::@3 main::@4 - (byte*) SCREEN#5 ← phi( main::@3/(byte*) SCREEN#6 main::@4/(byte*) SCREEN#5 ) (byte) main::c#3 ← phi( main::@3/(byte) main::c#4 main::@4/(byte) main::c#3 ) - (byte*) RASTER#2 ← phi( main::@3/(byte*) RASTER#1 main::@4/(byte*) RASTER#2 ) - (bool~) main::$2 ← *((byte*) RASTER#2) != (byte/word/signed word/dword/signed dword) $ff + (bool~) main::$2 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $ff if((bool~) main::$2) goto main::@4 to:main::@6 main::@6: scope:[main] from main::@4 - (byte*) SCREEN#4 ← phi( main::@4/(byte*) SCREEN#5 ) - (byte*) RASTER#7 ← phi( main::@4/(byte*) RASTER#2 ) (byte) main::c#2 ← phi( main::@4/(byte) main::c#3 ) (byte) main::c#1 ← (byte) main::c#2 + rangenext($19,1) (bool~) main::$3 ← (byte) main::c#1 != rangelast($19,1) if((bool~) main::$3) goto main::@2 to:main::@7 main::@7: scope:[main] from main::@6 - (byte*) RASTER#11 ← phi( main::@6/(byte*) RASTER#7 ) - (byte*) SCREEN#3 ← phi( main::@6/(byte*) SCREEN#4 ) call flip to:main::@10 main::@10: scope:[main] from main::@7 - (byte*) RASTER#9 ← phi( main::@7/(byte*) RASTER#11 ) - (byte*) SCREEN#2 ← phi( main::@7/(byte*) SCREEN#3 ) call plot to:main::@11 main::@11: scope:[main] from main::@10 - (byte*) SCREEN#9 ← phi( main::@10/(byte*) SCREEN#2 ) - (byte*) RASTER#5 ← phi( main::@10/(byte*) RASTER#9 ) if(true) goto main::@1 to:main::@return main::@return: scope:[main] from main::@11 @@ -127,9 +109,8 @@ flip::@return: scope:[flip] from flip::@3 return to:@return plot: scope:[plot] from main::@10 - (byte*) SCREEN#1 ← phi( main::@10/(byte*) SCREEN#2 ) (byte/word/signed word/dword/signed dword~) plot::$0 ← (byte/signed byte/word/signed word/dword/signed dword) 5 * (byte/signed byte/word/signed word/dword/signed dword) $28 - (byte*~) plot::$1 ← (byte*) SCREEN#1 + (byte/word/signed word/dword/signed dword~) plot::$0 + (byte*~) plot::$1 ← (byte*) SCREEN#0 + (byte/word/signed word/dword/signed dword~) plot::$0 (byte*~) plot::$2 ← (byte*~) plot::$1 + (byte/signed byte/word/signed word/dword/signed dword) $c (byte*) plot::line#0 ← (byte*~) plot::$2 (byte) plot::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -166,8 +147,6 @@ plot::@return: scope:[plot] from plot::@3 return to:@return @4: scope:[] from @begin - (byte*) SCREEN#12 ← phi( @begin/(byte*) SCREEN#0 ) - (byte*) RASTER#10 ← phi( @begin/(byte*) RASTER#0 ) call main to:@5 @5: scope:[] from @4 @@ -183,31 +162,8 @@ SYMBOL TABLE SSA (label) @end (byte*) RASTER (byte*) RASTER#0 -(byte*) RASTER#1 -(byte*) RASTER#10 -(byte*) RASTER#11 -(byte*) RASTER#2 -(byte*) RASTER#3 -(byte*) RASTER#4 -(byte*) RASTER#5 -(byte*) RASTER#6 -(byte*) RASTER#7 -(byte*) RASTER#8 -(byte*) RASTER#9 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#11 -(byte*) SCREEN#12 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (byte[$0]) buffer1 (byte[$0]) buffer1#0 (byte[$1]) buffer2 @@ -313,13 +269,10 @@ SYMBOL TABLE SSA (byte) prepare::i#1 (byte) prepare::i#2 +Culled Empty Block (label) main::@9 Culled Empty Block (label) @5 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) RASTER#6 = (byte*) RASTER#8 -Alias (byte*) SCREEN#10 = (byte*) SCREEN#11 -Alias (byte*) RASTER#11 = (byte*) RASTER#4 (byte*) RASTER#7 (byte*) RASTER#2 (byte*) RASTER#9 (byte*) RASTER#5 Alias (byte) main::c#1 = (byte) main::c#5 -Alias (byte*) SCREEN#2 = (byte*) SCREEN#8 (byte*) SCREEN#4 (byte*) SCREEN#5 (byte*) SCREEN#3 (byte*) SCREEN#9 Alias (byte) main::c#2 = (byte) main::c#3 Alias (byte) flip::dstIdx#1 = (byte/signed word/word/dword/signed dword~) flip::$0 (byte) flip::dstIdx#4 Alias (byte) flip::r#2 = (byte) flip::r#3 @@ -329,38 +282,27 @@ Alias (byte*) plot::line#2 = (byte*) plot::line#3 Alias (byte) plot::y#2 = (byte) plot::y#3 Alias (byte) plot::i#1 = (byte) plot::i#4 Alias (byte*) plot::line#1 = (byte*~) plot::$4 -Alias (byte*) RASTER#0 = (byte*) RASTER#10 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#12 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) RASTER#1 Self Phi Eliminated (byte) main::c#4 -Self Phi Eliminated (byte*) SCREEN#6 -Self Phi Eliminated (byte*) RASTER#11 Self Phi Eliminated (byte) main::c#2 -Self Phi Eliminated (byte*) SCREEN#2 Self Phi Eliminated (byte) flip::r#2 Self Phi Eliminated (byte*) plot::line#2 Self Phi Eliminated (byte) plot::y#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) RASTER#6 (byte*) RASTER#0 -Redundant Phi (byte*) SCREEN#10 (byte*) SCREEN#0 -Redundant Phi (byte*) RASTER#11 (byte*) RASTER#1 Redundant Phi (byte) main::c#2 (byte) main::c#4 -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#6 Redundant Phi (byte) flip::r#2 (byte) flip::r#4 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2 Redundant Phi (byte*) plot::line#2 (byte*) plot::line#4 Redundant Phi (byte) plot::y#2 (byte) plot::y#4 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [14] if(*((byte*) RASTER#1)!=(byte/word/signed word/dword/signed dword) $fe) goto main::@3 -Simple Condition (bool~) main::$2 [17] if(*((byte*) RASTER#1)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@4 -Simple Condition (bool~) main::$3 [21] if((byte) main::c#1!=rangelast($19,1)) goto main::@2 -Simple Condition (bool~) prepare::$0 [34] if((byte) prepare::i#1!=rangelast(0,$ff)) goto prepare::@1 -Simple Condition (bool~) flip::$1 [48] if((byte) flip::c#1!=rangelast($10,1)) goto flip::@2 -Simple Condition (bool~) flip::$2 [53] if((byte) flip::r#1!=rangelast($10,1)) goto flip::@1 -Simple Condition (bool~) flip::$3 [59] if((byte) flip::i#1!=rangelast(0,$ff)) goto flip::@3 -Simple Condition (bool~) plot::$3 [75] if((byte) plot::x#1<(byte/signed byte/word/signed word/dword/signed dword) $10) goto plot::@2 -Simple Condition (bool~) plot::$5 [81] if((byte) plot::y#1!=rangelast($10,1)) goto plot::@1 +Simple Condition (bool~) main::$1 [11] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $fe) goto main::@3 +Simple Condition (bool~) main::$2 [14] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@4 +Simple Condition (bool~) main::$3 [18] if((byte) main::c#1!=rangelast($19,1)) goto main::@2 +Simple Condition (bool~) prepare::$0 [28] if((byte) prepare::i#1!=rangelast(0,$ff)) goto prepare::@1 +Simple Condition (bool~) flip::$1 [42] if((byte) flip::c#1!=rangelast($10,1)) goto flip::@2 +Simple Condition (bool~) flip::$2 [47] if((byte) flip::r#1!=rangelast($10,1)) goto flip::@1 +Simple Condition (bool~) flip::$3 [53] if((byte) flip::i#1!=rangelast(0,$ff)) goto flip::@3 +Simple Condition (bool~) plot::$3 [68] if((byte) plot::x#1<(byte/signed byte/word/signed word/dword/signed dword) $10) goto plot::@2 +Simple Condition (bool~) plot::$5 [74] if((byte) plot::y#1!=rangelast($10,1)) goto plot::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const word/signed word/dword/signed dword) $0 = $10*$10 Constant (const word/signed word/dword/signed dword) $1 = $10*$10 @@ -380,10 +322,11 @@ Constant (const byte) plot::x#0 = 0 Successful SSA optimization Pass2ConstantIdentification Constant (const byte[$0]) buffer1#0 = { fill( $0, 0) } Constant (const byte[$1]) buffer2#0 = { fill( $1, 0) } +Constant (const byte*) plot::$1 = SCREEN#0+plot::$0 Successful SSA optimization Pass2ConstantIdentification -Consolidated constant in assignment plot::line#0 -Successful SSA optimization Pass2ConstantAdditionElimination -if() condition always true - replacing block destination [9] if(true) goto main::@1 +Constant (const byte*) plot::line#0 = plot::$1+$c +Successful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [8] if(true) goto main::@1 Successful SSA optimization Pass2ConstantIfs Removing unused block main::@return Successful SSA optimization Pass2EliminateUnusedBlocks @@ -399,29 +342,11 @@ Resolved ranged next value flip::i#1 ← ++ flip::i#2 to ++ Resolved ranged comparison value if(flip::i#1!=rangelast(0,$ff)) goto flip::@3 to (byte/signed byte/word/signed word/dword/signed dword) 0 Resolved ranged next value plot::y#1 ← -- plot::y#4 to -- Resolved ranged comparison value if(plot::y#1!=rangelast($10,1)) goto plot::@1 to (byte/signed byte/word/signed word/dword/signed dword) 0 -Culled Empty Block (label) main::@9 +Culled Empty Block (label) main::@1 Culled Empty Block (label) main::@2 Culled Empty Block (label) main::@11 Culled Empty Block (label) flip::@5 Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte*) RASTER#1 -Self Phi Eliminated (byte*) SCREEN#6 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) RASTER#1 (byte*) RASTER#3 -Redundant Phi (byte*) SCREEN#6 (byte*) SCREEN#7 -Successful SSA optimization Pass2RedundantPhiElimination -Self Phi Eliminated (byte*) RASTER#3 -Self Phi Eliminated (byte*) SCREEN#7 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) RASTER#3 (const byte*) RASTER#0 -Redundant Phi (byte*) SCREEN#7 (const byte*) SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination -Constant (const byte*) plot::$1 = SCREEN#0 -Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) plot::line#0 = plot::$1+plot::$0+$c -Successful SSA optimization Pass2ConstantIdentification -Culled Empty Block (label) main::@1 -Successful SSA optimization Pass2CullEmptyBlocks Inlining constant with var siblings (const byte) main::c#0 Inlining constant with var siblings (const byte) prepare::i#0 Inlining constant with var siblings (const byte) flip::srcIdx#0 @@ -435,7 +360,7 @@ Inlining constant with var siblings (const byte) plot::x#0 Inlining constant with var siblings (const byte*) plot::line#0 Constant inlined plot::line#0 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) $28+(byte/signed byte/word/signed word/dword/signed dword) $c Constant inlined plot::$0 = (byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) $28 -Constant inlined plot::$1 = (const byte*) SCREEN#0 +Constant inlined plot::$1 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 5*(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined plot::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined plot::y#0 = (byte/signed byte/word/signed word/dword/signed dword) $10 Constant inlined $0 = (byte/signed byte/word/signed word/dword/signed dword) $10*(byte/signed byte/word/signed word/dword/signed dword) $10 diff --git a/src/test/ref/forincrementassign.log b/src/test/ref/forincrementassign.log index 1400cf819..cbdebc27f 100644 --- a/src/test/ref/forincrementassign.log +++ b/src/test/ref/forincrementassign.log @@ -1,16 +1,15 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@1 main: scope:[main] from @1 - (byte*) SCREEN#2 ← phi( @1/(byte*) SCREEN#3 ) (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*) SCREEN#1 ← phi( main/(byte*) SCREEN#2 main::@1/(byte*) SCREEN#1 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) - *((byte*) SCREEN#1 + (byte) main::i#2) ← (byte) main::i#2 + *((byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 (byte/signed word/word/dword/signed dword~) main::$0 ← (byte) main::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 (byte) main::i#1 ← (byte/signed word/word/dword/signed dword~) main::$0 (bool~) main::$1 ← (byte) main::i#1 < (byte/signed byte/word/signed word/dword/signed dword) $28 @@ -20,7 +19,6 @@ main::@return: scope:[main] from main::@1 return to:@return @1: scope:[] from @begin - (byte*) SCREEN#3 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -34,9 +32,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 (void()) main() (byte/signed word/word/dword/signed dword~) main::$0 (bool~) main::$1 @@ -50,14 +45,8 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::i#1 = (byte/signed word/word/dword/signed dword~) main::$0 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [8] if((byte) main::i#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@1 +Simple Condition (bool~) main::$1 [7] if((byte) main::i#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) main::i#0 = 0 diff --git a/src/test/ref/forrangedwords.log b/src/test/ref/forrangedwords.log index 18706f4bc..0e95bc8b7 100644 --- a/src/test/ref/forrangedwords.log +++ b/src/test/ref/forrangedwords.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -7,28 +8,25 @@ main: scope:[main] from @1 (word) main::w#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 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 ) (word) main::w#2 ← phi( main/(word) main::w#0 main::@1/(word) main::w#1 ) (byte~) main::$0 ← < (word) main::w#2 - *((byte*) main::SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 + *((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 (byte~) main::$1 ← > (word) main::w#2 - *((byte*) main::SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 + *((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 (word) main::w#1 ← (word) main::w#2 + rangenext(0,$ffff) (bool~) main::$2 ← (word) main::w#1 != rangelast(0,$ffff) if((bool~) main::$2) goto main::@1 to:main::@3 main::@3: scope:[main] from main::@1 - (byte*) main::SCREEN#3 ← phi( main::@1/(byte*) main::SCREEN#1 ) (signed word/signed dword~) main::$3 ← - (word/signed word/dword/signed dword) $7fff (signed word) main::sw#0 ← (signed word/signed dword~) main::$3 to:main::@2 main::@2: scope:[main] from main::@2 main::@3 - (byte*) main::SCREEN#2 ← phi( main::@2/(byte*) main::SCREEN#2 main::@3/(byte*) main::SCREEN#3 ) (signed word) main::sw#2 ← phi( main::@2/(signed word) main::sw#1 main::@3/(signed word) main::sw#0 ) (byte~) main::$4 ← < (signed word) main::sw#2 - *((byte*) main::SCREEN#2 + (byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte~) main::$4 + *((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte~) main::$4 (byte~) main::$5 ← > (signed word) main::sw#2 - *((byte*) main::SCREEN#2 + (byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte~) main::$5 + *((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 4) ← (byte~) main::$5 (signed word) main::sw#1 ← (signed word) main::sw#2 + rangenext(main::$3,$7ffe) (bool~) main::$6 ← (signed word) main::sw#1 != rangelast(main::$3,$7ffe) if((bool~) main::$6) goto main::@2 @@ -62,9 +60,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::SCREEN (byte*) main::SCREEN#0 -(byte*) main::SCREEN#1 -(byte*) main::SCREEN#2 -(byte*) main::SCREEN#3 (signed word) main::sw (signed word) main::sw#0 (signed word) main::sw#1 @@ -76,17 +71,10 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) main::SCREEN#1 = (byte*) main::SCREEN#3 Alias (signed word) main::sw#0 = (signed word/signed dword~) main::$3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::SCREEN#1 -Self Phi Eliminated (byte*) main::SCREEN#2 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#0 -Redundant Phi (byte*) main::SCREEN#2 (byte*) main::SCREEN#1 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$2 [9] if((word) main::w#1!=rangelast(0,$ffff)) goto main::@1 -Simple Condition (bool~) main::$6 [20] if((signed word) main::sw#1!=rangelast(main::sw#0,$7ffe)) goto main::@2 +Simple Condition (bool~) main::$6 [19] if((signed word) main::sw#1!=rangelast(main::sw#0,$7ffe)) goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) main::SCREEN#0 = ((byte*))$400 Constant (const word) main::w#0 = 0 diff --git a/src/test/ref/forrangemin.log b/src/test/ref/forrangemin.log index c18ebb7d1..d96b76a3c 100644 --- a/src/test/ref/forrangemin.log +++ b/src/test/ref/forrangemin.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) SCREEN1 +Identified constant variable (byte*) SCREEN2 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -5,28 +7,22 @@ CONTROL FLOW GRAPH SSA (byte*) SCREEN2#0 ← ((byte*)) (word/signed word/dword/signed dword) $500 to:@1 main: scope:[main] from @1 - (byte*) SCREEN2#4 ← phi( @1/(byte*) SCREEN2#5 ) - (byte*) SCREEN1#2 ← phi( @1/(byte*) SCREEN1#3 ) (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*) SCREEN2#3 ← phi( main/(byte*) SCREEN2#4 main::@1/(byte*) SCREEN2#3 ) - (byte*) SCREEN1#1 ← phi( main/(byte*) SCREEN1#2 main::@1/(byte*) SCREEN1#1 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) - *((byte*) SCREEN1#1 + (byte) main::i#2) ← (byte) main::i#2 + *((byte*) SCREEN1#0 + (byte) main::i#2) ← (byte) main::i#2 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$ff) (bool~) main::$0 ← (byte) main::i#1 != rangelast(0,$ff) if((bool~) main::$0) goto main::@1 to:main::@3 main::@3: scope:[main] from main::@1 - (byte*) SCREEN2#2 ← phi( main::@1/(byte*) SCREEN2#3 ) (byte) main::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::j#1 ← (byte/signed byte/word/signed word/dword/signed dword) $64 to:main::@2 main::@2: scope:[main] from main::@2 main::@3 - (byte*) SCREEN2#1 ← phi( main::@2/(byte*) SCREEN2#1 main::@3/(byte*) SCREEN2#2 ) (byte) main::j#3 ← phi( main::@2/(byte) main::j#2 main::@3/(byte) main::j#1 ) - *((byte*) SCREEN2#1 + (byte) main::j#3) ← (byte) main::j#3 + *((byte*) SCREEN2#0 + (byte) main::j#3) ← (byte) main::j#3 (byte) main::j#2 ← (byte) main::j#3 + rangenext($64,0) (bool~) main::$1 ← (byte) main::j#2 != rangelast($64,0) if((bool~) main::$1) goto main::@2 @@ -35,8 +31,6 @@ main::@return: scope:[main] from main::@2 return to:@return @1: scope:[] from @begin - (byte*) SCREEN2#5 ← phi( @begin/(byte*) SCREEN2#0 ) - (byte*) SCREEN1#3 ← phi( @begin/(byte*) SCREEN1#0 ) call main to:@2 @2: scope:[] from @1 @@ -50,16 +44,8 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN1 (byte*) SCREEN1#0 -(byte*) SCREEN1#1 -(byte*) SCREEN1#2 -(byte*) SCREEN1#3 (byte*) SCREEN2 (byte*) SCREEN2#0 -(byte*) SCREEN2#1 -(byte*) SCREEN2#2 -(byte*) SCREEN2#3 -(byte*) SCREEN2#4 -(byte*) SCREEN2#5 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -79,22 +65,8 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) SCREEN2#2 = (byte*) SCREEN2#3 -Alias (byte*) SCREEN1#0 = (byte*) SCREEN1#3 -Alias (byte*) SCREEN2#0 = (byte*) SCREEN2#5 -Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN1#1 -Self Phi Eliminated (byte*) SCREEN2#2 -Self Phi Eliminated (byte*) SCREEN2#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN1#2 (byte*) SCREEN1#0 -Redundant Phi (byte*) SCREEN2#4 (byte*) SCREEN2#0 -Redundant Phi (byte*) SCREEN1#1 (byte*) SCREEN1#2 -Redundant Phi (byte*) SCREEN2#2 (byte*) SCREEN2#4 -Redundant Phi (byte*) SCREEN2#1 (byte*) SCREEN2#2 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$0 [8] if((byte) main::i#1!=rangelast(0,$ff)) goto main::@1 -Simple Condition (bool~) main::$1 [16] if((byte) main::j#2!=rangelast($64,0)) goto main::@2 +Simple Condition (bool~) main::$0 [7] if((byte) main::i#1!=rangelast(0,$ff)) goto main::@1 +Simple Condition (bool~) main::$1 [14] if((byte) main::j#2!=rangelast($64,0)) goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN1#0 = ((byte*))$400 Constant (const byte*) SCREEN2#0 = ((byte*))$500 diff --git a/src/test/ref/fragment-synth.log b/src/test/ref/fragment-synth.log index 8e5d1bc6d..e16e432b3 100644 --- a/src/test/ref/fragment-synth.log +++ b/src/test/ref/fragment-synth.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -15,11 +16,10 @@ main: scope:[main] from @2 to:main::@1 main::@1: scope:[main] from main (byte*) main::z#2 ← phi( main/(byte*) main::z#0 ) - (byte*) main::screen#1 ← phi( main/(byte*) main::screen#0 ) (byte) fct::return#4 ← phi( main/(byte) fct::return#0 ) (byte~) main::$0 ← (byte) fct::return#4 (byte) main::a1#0 ← (byte~) main::$0 - *((byte*) main::screen#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::a1#0 + *((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::a1#0 (byte*) main::z#1 ← ++ (byte*) main::z#2 (byte) main::x#1 ← (byte/signed byte/word/signed word/dword/signed dword) $55 (byte) fct::x#1 ← (byte) main::x#1 @@ -28,11 +28,10 @@ main::@1: scope:[main] from main (byte) fct::return#1 ← (byte) fct::return#3 to:main::@2 main::@2: scope:[main] from main::@1 - (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#1 ) (byte) fct::return#5 ← phi( main::@1/(byte) fct::return#1 ) (byte~) main::$1 ← (byte) fct::return#5 (byte) main::a2#0 ← (byte~) main::$1 - *((byte*) main::screen#2 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::a2#0 + *((byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::a2#0 to:main::@return main::@return: scope:[main] from main::@2 return @@ -94,8 +93,6 @@ SYMBOL TABLE SSA (byte) main::a2#0 (byte*) main::screen (byte*) main::screen#0 -(byte*) main::screen#1 -(byte*) main::screen#2 (byte) main::x (byte) main::x#0 (byte) main::x#1 @@ -107,7 +104,6 @@ SYMBOL TABLE SSA Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) fct::return#0 = (byte) fct::return#4 -Alias (byte*) main::screen#0 = (byte*) main::screen#1 (byte*) main::screen#2 Alias (byte*) main::z#0 = (byte*) main::z#2 Alias (byte) main::a1#0 = (byte~) main::$0 Alias (byte) fct::return#1 = (byte) fct::return#5 diff --git a/src/test/ref/halfscii.log b/src/test/ref/halfscii.log index 9586177a7..ee0d136c9 100644 --- a/src/test/ref/halfscii.log +++ b/src/test/ref/halfscii.log @@ -1,3 +1,9 @@ +Identified constant variable (byte*) SCREEN +Identified constant variable (byte*) CHARSET +Identified constant variable (byte*) CHARGEN +Identified constant variable (byte*) PROCPORT +Identified constant variable (byte*) D018 +Identified constant variable (byte*) CHARSET4 CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -10,21 +16,12 @@ CONTROL FLOW GRAPH SSA (byte[]) bits_count#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 0, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) 4 } to:@1 main: scope:[main] from @1 - (byte*) D018#13 ← phi( @1/(byte*) D018#14 ) - (byte*) SCREEN#12 ← phi( @1/(byte*) SCREEN#13 ) - (byte*) CHARSET4#1 ← phi( @1/(byte*) CHARSET4#2 ) - (byte*) CHARGEN#1 ← phi( @1/(byte*) CHARGEN#3 ) - (byte*) PROCPORT#1 ← phi( @1/(byte*) PROCPORT#3 ) asm { sei } - *((byte*) PROCPORT#1) ← (byte/signed byte/word/signed word/dword/signed dword) $32 - (byte*) main::chargen#0 ← (byte*) CHARGEN#1 - (byte*) main::charset4#0 ← (byte*) CHARSET4#1 + *((byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $32 + (byte*) main::chargen#0 ← (byte*) CHARGEN#0 + (byte*) main::charset4#0 ← (byte*) CHARSET4#0 to:main::@1 main::@1: scope:[main] from main main::@5 - (byte*) D018#11 ← phi( main/(byte*) D018#13 main::@5/(byte*) D018#4 ) - (byte*) SCREEN#10 ← phi( main/(byte*) SCREEN#12 main::@5/(byte*) SCREEN#3 ) - (byte*) PROCPORT#11 ← phi( main/(byte*) PROCPORT#1 main::@5/(byte*) PROCPORT#4 ) - (byte*) CHARGEN#10 ← phi( main/(byte*) CHARGEN#1 main::@5/(byte*) CHARGEN#2 ) (byte*) main::charset4#9 ← phi( main/(byte*) main::charset4#0 main::@5/(byte*) main::charset4#1 ) (byte*) main::chargen#2 ← phi( main/(byte*) main::chargen#0 main::@5/(byte*) main::chargen#1 ) (byte) main::bits_gen#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -42,10 +39,6 @@ main::@1: scope:[main] from main main::@5 if((bool~) main::$8) goto main::@2 to:main::@7 main::@2: scope:[main] from main::@1 main::@7 - (byte*) D018#9 ← phi( main::@1/(byte*) D018#11 main::@7/(byte*) D018#12 ) - (byte*) SCREEN#8 ← phi( main::@1/(byte*) SCREEN#10 main::@7/(byte*) SCREEN#11 ) - (byte*) PROCPORT#9 ← phi( main::@1/(byte*) PROCPORT#11 main::@7/(byte*) PROCPORT#12 ) - (byte*) CHARGEN#8 ← phi( main::@1/(byte*) CHARGEN#10 main::@7/(byte*) CHARGEN#11 ) (byte*) main::charset4#7 ← phi( main::@1/(byte*) main::charset4#9 main::@7/(byte*) main::charset4#10 ) (byte*) main::chargen1#1 ← phi( main::@1/(byte*) main::chargen1#0 main::@7/(byte*) main::chargen1#4 ) (byte*) main::chargen#3 ← phi( main::@1/(byte*) main::chargen#2 main::@7/(byte*) main::chargen#7 ) @@ -63,10 +56,6 @@ main::@2: scope:[main] from main::@1 main::@7 if((bool~) main::$17) goto main::@3 to:main::@8 main::@7: scope:[main] from main::@1 - (byte*) D018#12 ← phi( main::@1/(byte*) D018#11 ) - (byte*) SCREEN#11 ← phi( main::@1/(byte*) SCREEN#10 ) - (byte*) PROCPORT#12 ← phi( main::@1/(byte*) PROCPORT#11 ) - (byte*) CHARGEN#11 ← phi( main::@1/(byte*) CHARGEN#10 ) (byte*) main::charset4#10 ← phi( main::@1/(byte*) main::charset4#9 ) (byte*) main::chargen1#4 ← phi( main::@1/(byte*) main::chargen1#0 ) (byte*) main::chargen#7 ← phi( main::@1/(byte*) main::chargen#2 ) @@ -75,10 +64,6 @@ main::@7: scope:[main] from main::@1 (byte) main::bits_gen#2 ← (byte/signed word/word/dword/signed dword~) main::$9 to:main::@2 main::@3: scope:[main] from main::@2 main::@8 - (byte*) D018#7 ← phi( main::@2/(byte*) D018#9 main::@8/(byte*) D018#10 ) - (byte*) SCREEN#6 ← phi( main::@2/(byte*) SCREEN#8 main::@8/(byte*) SCREEN#9 ) - (byte*) PROCPORT#7 ← phi( main::@2/(byte*) PROCPORT#9 main::@8/(byte*) PROCPORT#10 ) - (byte*) CHARGEN#6 ← phi( main::@2/(byte*) CHARGEN#8 main::@8/(byte*) CHARGEN#9 ) (byte*) main::charset4#5 ← phi( main::@2/(byte*) main::charset4#7 main::@8/(byte*) main::charset4#8 ) (byte*) main::chargen1#2 ← phi( main::@2/(byte*) main::chargen1#1 main::@8/(byte*) main::chargen1#5 ) (byte*) main::chargen#4 ← phi( main::@2/(byte*) main::chargen#3 main::@8/(byte*) main::chargen#8 ) @@ -96,10 +81,6 @@ main::@3: scope:[main] from main::@2 main::@8 if((bool~) main::$26) goto main::@4 to:main::@9 main::@8: scope:[main] from main::@2 - (byte*) D018#10 ← phi( main::@2/(byte*) D018#9 ) - (byte*) SCREEN#9 ← phi( main::@2/(byte*) SCREEN#8 ) - (byte*) PROCPORT#10 ← phi( main::@2/(byte*) PROCPORT#9 ) - (byte*) CHARGEN#9 ← phi( main::@2/(byte*) CHARGEN#8 ) (byte*) main::charset4#8 ← phi( main::@2/(byte*) main::charset4#7 ) (byte*) main::chargen1#5 ← phi( main::@2/(byte*) main::chargen1#1 ) (byte*) main::chargen#8 ← phi( main::@2/(byte*) main::chargen#3 ) @@ -108,10 +89,6 @@ main::@8: scope:[main] from main::@2 (byte) main::bits_gen#4 ← (byte/signed word/word/dword/signed dword~) main::$18 to:main::@3 main::@4: scope:[main] from main::@3 main::@9 - (byte*) D018#6 ← phi( main::@3/(byte*) D018#7 main::@9/(byte*) D018#8 ) - (byte*) SCREEN#5 ← phi( main::@3/(byte*) SCREEN#6 main::@9/(byte*) SCREEN#7 ) - (byte*) PROCPORT#6 ← phi( main::@3/(byte*) PROCPORT#7 main::@9/(byte*) PROCPORT#8 ) - (byte*) CHARGEN#5 ← phi( main::@3/(byte*) CHARGEN#6 main::@9/(byte*) CHARGEN#7 ) (byte*) main::charset4#4 ← phi( main::@3/(byte*) main::charset4#5 main::@9/(byte*) main::charset4#6 ) (byte*) main::chargen1#3 ← phi( main::@3/(byte*) main::chargen1#2 main::@9/(byte*) main::chargen1#6 ) (byte*) main::chargen#5 ← phi( main::@3/(byte*) main::chargen#4 main::@9/(byte*) main::chargen#9 ) @@ -128,10 +105,6 @@ main::@4: scope:[main] from main::@3 main::@9 if((bool~) main::$34) goto main::@5 to:main::@10 main::@9: scope:[main] from main::@3 - (byte*) D018#8 ← phi( main::@3/(byte*) D018#7 ) - (byte*) SCREEN#7 ← phi( main::@3/(byte*) SCREEN#6 ) - (byte*) PROCPORT#8 ← phi( main::@3/(byte*) PROCPORT#7 ) - (byte*) CHARGEN#7 ← phi( main::@3/(byte*) CHARGEN#6 ) (byte*) main::charset4#6 ← phi( main::@3/(byte*) main::charset4#5 ) (byte*) main::chargen1#6 ← phi( main::@3/(byte*) main::chargen1#2 ) (byte*) main::chargen#9 ← phi( main::@3/(byte*) main::chargen#4 ) @@ -140,10 +113,6 @@ main::@9: scope:[main] from main::@3 (byte) main::bits_gen#6 ← (byte/signed word/word/dword/signed dword~) main::$27 to:main::@4 main::@5: scope:[main] from main::@10 main::@4 - (byte*) D018#4 ← phi( main::@10/(byte*) D018#5 main::@4/(byte*) D018#6 ) - (byte*) SCREEN#3 ← phi( main::@10/(byte*) SCREEN#4 main::@4/(byte*) SCREEN#5 ) - (byte*) PROCPORT#4 ← phi( main::@10/(byte*) PROCPORT#5 main::@4/(byte*) PROCPORT#6 ) - (byte*) CHARGEN#2 ← phi( main::@10/(byte*) CHARGEN#4 main::@4/(byte*) CHARGEN#5 ) (byte*) main::chargen#6 ← phi( main::@10/(byte*) main::chargen#10 main::@4/(byte*) main::chargen#5 ) (byte*) main::charset4#2 ← phi( main::@10/(byte*) main::charset4#3 main::@4/(byte*) main::charset4#4 ) (byte) main::bits_gen#15 ← phi( main::@10/(byte) main::bits_gen#8 main::@4/(byte) main::bits_gen#5 ) @@ -153,15 +122,11 @@ main::@5: scope:[main] from main::@10 main::@4 (byte*) main::charset4#1 ← ++ (byte*) main::charset4#2 (byte*~) main::$37 ← (byte*) main::chargen#6 + (byte/signed byte/word/signed word/dword/signed dword) 2 (byte*) main::chargen#1 ← (byte*~) main::$37 - (byte*~) main::$38 ← (byte*) CHARGEN#2 + (word/signed word/dword/signed dword) $800 + (byte*~) main::$38 ← (byte*) CHARGEN#0 + (word/signed word/dword/signed dword) $800 (bool~) main::$39 ← (byte*) main::chargen#1 < (byte*~) main::$38 if((bool~) main::$39) goto main::@1 to:main::@11 main::@10: scope:[main] from main::@4 - (byte*) D018#5 ← phi( main::@4/(byte*) D018#6 ) - (byte*) SCREEN#4 ← phi( main::@4/(byte*) SCREEN#5 ) - (byte*) PROCPORT#5 ← phi( main::@4/(byte*) PROCPORT#6 ) - (byte*) CHARGEN#4 ← phi( main::@4/(byte*) CHARGEN#5 ) (byte*) main::chargen#10 ← phi( main::@4/(byte*) main::chargen#5 ) (byte*) main::charset4#3 ← phi( main::@4/(byte*) main::charset4#4 ) (byte) main::bits_gen#16 ← phi( main::@4/(byte) main::bits_gen#5 ) @@ -169,35 +134,24 @@ main::@10: scope:[main] from main::@4 (byte) main::bits_gen#8 ← (byte/signed word/word/dword/signed dword~) main::$35 to:main::@5 main::@11: scope:[main] from main::@5 - (byte*) D018#3 ← phi( main::@5/(byte*) D018#4 ) - (byte*) SCREEN#2 ← phi( main::@5/(byte*) SCREEN#3 ) - (byte*) PROCPORT#2 ← phi( main::@5/(byte*) PROCPORT#4 ) - *((byte*) PROCPORT#2) ← (byte/signed byte/word/signed word/dword/signed dword) $37 + *((byte*) PROCPORT#0) ← (byte/signed byte/word/signed word/dword/signed dword) $37 asm { cli } (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@6 main::@6: scope:[main] from main::@11 main::@6 - (byte*) D018#2 ← phi( main::@11/(byte*) D018#3 main::@6/(byte*) D018#2 ) - (byte*) SCREEN#1 ← phi( main::@11/(byte*) SCREEN#2 main::@6/(byte*) SCREEN#1 ) (byte) main::i#2 ← phi( main::@11/(byte) main::i#0 main::@6/(byte) main::i#1 ) - *((byte*) SCREEN#1 + (byte) main::i#2) ← (byte) main::i#2 + *((byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$ff) (bool~) main::$40 ← (byte) main::i#1 != rangelast(0,$ff) if((bool~) main::$40) goto main::@6 to:main::@12 main::@12: scope:[main] from main::@6 - (byte*) D018#1 ← phi( main::@6/(byte*) D018#2 ) - *((byte*) D018#1) ← (byte/signed byte/word/signed word/dword/signed dword) $19 + *((byte*) D018#0) ← (byte/signed byte/word/signed word/dword/signed dword) $19 to:main::@return main::@return: scope:[main] from main::@12 return to:@return @1: scope:[] from @begin - (byte*) D018#14 ← phi( @begin/(byte*) D018#0 ) - (byte*) SCREEN#13 ← phi( @begin/(byte*) SCREEN#0 ) - (byte*) CHARSET4#2 ← phi( @begin/(byte*) CHARSET4#0 ) - (byte*) CHARGEN#3 ← phi( @begin/(byte*) CHARGEN#0 ) - (byte*) PROCPORT#3 ← phi( @begin/(byte*) PROCPORT#0 ) call main to:@2 @2: scope:[] from @1 @@ -211,68 +165,16 @@ SYMBOL TABLE SSA (label) @end (byte*) CHARGEN (byte*) CHARGEN#0 -(byte*) CHARGEN#1 -(byte*) CHARGEN#10 -(byte*) CHARGEN#11 -(byte*) CHARGEN#2 -(byte*) CHARGEN#3 -(byte*) CHARGEN#4 -(byte*) CHARGEN#5 -(byte*) CHARGEN#6 -(byte*) CHARGEN#7 -(byte*) CHARGEN#8 -(byte*) CHARGEN#9 (byte*) CHARSET (byte*) CHARSET#0 (byte*) CHARSET4 (byte*) CHARSET4#0 -(byte*) CHARSET4#1 -(byte*) CHARSET4#2 (byte*) D018 (byte*) D018#0 -(byte*) D018#1 -(byte*) D018#10 -(byte*) D018#11 -(byte*) D018#12 -(byte*) D018#13 -(byte*) D018#14 -(byte*) D018#2 -(byte*) D018#3 -(byte*) D018#4 -(byte*) D018#5 -(byte*) D018#6 -(byte*) D018#7 -(byte*) D018#8 -(byte*) D018#9 (byte*) PROCPORT (byte*) PROCPORT#0 -(byte*) PROCPORT#1 -(byte*) PROCPORT#10 -(byte*) PROCPORT#11 -(byte*) PROCPORT#12 -(byte*) PROCPORT#2 -(byte*) PROCPORT#3 -(byte*) PROCPORT#4 -(byte*) PROCPORT#5 -(byte*) PROCPORT#6 -(byte*) PROCPORT#7 -(byte*) PROCPORT#8 -(byte*) PROCPORT#9 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#11 -(byte*) SCREEN#12 -(byte*) SCREEN#13 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (byte[]) bits_count (byte[]) bits_count#0 (void()) main() @@ -392,91 +294,43 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [24] (bool~) main::$8 ← (byte) main::bits#0 < (byte/signed byte/word/signed word/dword/signed dword) 2 from [23] (bool~) main::$7 ← (byte) main::bits#0 >= (byte/signed byte/word/signed word/dword/signed dword) 2 -Inversing boolean not [36] (bool~) main::$17 ← (byte) main::bits#1 < (byte/signed byte/word/signed word/dword/signed dword) 2 from [35] (bool~) main::$16 ← (byte) main::bits#1 >= (byte/signed byte/word/signed word/dword/signed dword) 2 -Inversing boolean not [51] (bool~) main::$26 ← (byte) main::bits#2 < (byte/signed byte/word/signed word/dword/signed dword) 2 from [50] (bool~) main::$25 ← (byte) main::bits#2 >= (byte/signed byte/word/signed word/dword/signed dword) 2 -Inversing boolean not [65] (bool~) main::$34 ← (byte) main::bits#3 < (byte/signed byte/word/signed word/dword/signed dword) 2 from [64] (bool~) main::$33 ← (byte) main::bits#3 >= (byte/signed byte/word/signed word/dword/signed dword) 2 +Inversing boolean not [23] (bool~) main::$8 ← (byte) main::bits#0 < (byte/signed byte/word/signed word/dword/signed dword) 2 from [22] (bool~) main::$7 ← (byte) main::bits#0 >= (byte/signed byte/word/signed word/dword/signed dword) 2 +Inversing boolean not [35] (bool~) main::$17 ← (byte) main::bits#1 < (byte/signed byte/word/signed word/dword/signed dword) 2 from [34] (bool~) main::$16 ← (byte) main::bits#1 >= (byte/signed byte/word/signed word/dword/signed dword) 2 +Inversing boolean not [50] (bool~) main::$26 ← (byte) main::bits#2 < (byte/signed byte/word/signed word/dword/signed dword) 2 from [49] (bool~) main::$25 ← (byte) main::bits#2 >= (byte/signed byte/word/signed word/dword/signed dword) 2 +Inversing boolean not [64] (bool~) main::$34 ← (byte) main::bits#3 < (byte/signed byte/word/signed word/dword/signed dword) 2 from [63] (bool~) main::$33 ← (byte) main::bits#3 >= (byte/signed byte/word/signed word/dword/signed dword) 2 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte*) main::chargen1#0 = (byte*~) main::$0 (byte*) main::chargen1#4 Alias (byte) main::bits_gen#1 = (byte~) main::$10 (byte) main::bits_gen#12 Alias (byte) main::bits_gen#0 = (byte) main::bits_gen#10 Alias (byte*) main::chargen#2 = (byte*) main::chargen#7 Alias (byte*) main::charset4#10 = (byte*) main::charset4#9 -Alias (byte*) CHARGEN#10 = (byte*) CHARGEN#11 -Alias (byte*) PROCPORT#11 = (byte*) PROCPORT#12 -Alias (byte*) SCREEN#10 = (byte*) SCREEN#11 -Alias (byte*) D018#11 = (byte*) D018#12 Alias (byte) main::bits_gen#2 = (byte/signed word/word/dword/signed dword~) main::$9 Alias (byte) main::bits_gen#14 = (byte) main::bits_gen#3 (byte~) main::$19 Alias (byte*) main::chargen#3 = (byte*) main::chargen#8 Alias (byte*) main::chargen1#1 = (byte*) main::chargen1#5 Alias (byte*) main::charset4#7 = (byte*) main::charset4#8 -Alias (byte*) CHARGEN#8 = (byte*) CHARGEN#9 -Alias (byte*) PROCPORT#10 = (byte*) PROCPORT#9 -Alias (byte*) SCREEN#8 = (byte*) SCREEN#9 -Alias (byte*) D018#10 = (byte*) D018#9 Alias (byte) main::bits_gen#4 = (byte/signed word/word/dword/signed dword~) main::$18 Alias (byte) main::bits_gen#16 = (byte) main::bits_gen#5 (byte~) main::$28 Alias (byte*) main::chargen#4 = (byte*) main::chargen#9 Alias (byte*) main::chargen1#2 = (byte*) main::chargen1#6 Alias (byte*) main::charset4#5 = (byte*) main::charset4#6 -Alias (byte*) CHARGEN#6 = (byte*) CHARGEN#7 -Alias (byte*) PROCPORT#7 = (byte*) PROCPORT#8 -Alias (byte*) SCREEN#6 = (byte*) SCREEN#7 -Alias (byte*) D018#7 = (byte*) D018#8 Alias (byte) main::bits_gen#6 = (byte/signed word/word/dword/signed dword~) main::$27 Alias (byte) main::bits_gen#7 = (byte~) main::$36 Alias (byte*) main::chargen#1 = (byte*~) main::$37 Alias (byte*) main::charset4#3 = (byte*) main::charset4#4 Alias (byte*) main::chargen#10 = (byte*) main::chargen#5 -Alias (byte*) CHARGEN#4 = (byte*) CHARGEN#5 -Alias (byte*) PROCPORT#5 = (byte*) PROCPORT#6 -Alias (byte*) SCREEN#4 = (byte*) SCREEN#5 -Alias (byte*) D018#5 = (byte*) D018#6 Alias (byte) main::bits_gen#8 = (byte/signed word/word/dword/signed dword~) main::$35 -Alias (byte*) PROCPORT#2 = (byte*) PROCPORT#4 -Alias (byte*) SCREEN#2 = (byte*) SCREEN#3 -Alias (byte*) D018#3 = (byte*) D018#4 -Alias (byte*) D018#1 = (byte*) D018#2 -Alias (byte*) PROCPORT#0 = (byte*) PROCPORT#3 -Alias (byte*) CHARGEN#0 = (byte*) CHARGEN#3 -Alias (byte*) CHARSET4#0 = (byte*) CHARSET4#2 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#13 -Alias (byte*) D018#0 = (byte*) D018#14 Successful SSA optimization Pass2AliasElimination Alias (byte*) main::chargen#10 = (byte*) main::chargen#3 (byte*) main::chargen#2 (byte*) main::chargen#4 (byte*) main::chargen#6 Alias (byte*) main::chargen1#0 = (byte*) main::chargen1#1 (byte*) main::chargen1#2 (byte*) main::chargen1#3 Alias (byte*) main::charset4#10 = (byte*) main::charset4#7 (byte*) main::charset4#5 (byte*) main::charset4#3 (byte*) main::charset4#2 -Alias (byte*) CHARGEN#10 = (byte*) CHARGEN#8 (byte*) CHARGEN#6 (byte*) CHARGEN#4 (byte*) CHARGEN#2 -Alias (byte*) PROCPORT#10 = (byte*) PROCPORT#11 (byte*) PROCPORT#7 (byte*) PROCPORT#5 (byte*) PROCPORT#2 -Alias (byte*) SCREEN#10 = (byte*) SCREEN#8 (byte*) SCREEN#6 (byte*) SCREEN#4 (byte*) SCREEN#2 -Alias (byte*) D018#10 = (byte*) D018#11 (byte*) D018#7 (byte*) D018#5 (byte*) D018#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) CHARGEN#10 -Self Phi Eliminated (byte*) PROCPORT#10 -Self Phi Eliminated (byte*) SCREEN#10 -Self Phi Eliminated (byte*) D018#10 -Self Phi Eliminated (byte*) SCREEN#1 -Self Phi Eliminated (byte*) D018#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) PROCPORT#1 (byte*) PROCPORT#0 -Redundant Phi (byte*) CHARGEN#1 (byte*) CHARGEN#0 -Redundant Phi (byte*) CHARSET4#1 (byte*) CHARSET4#0 -Redundant Phi (byte*) SCREEN#12 (byte*) SCREEN#0 -Redundant Phi (byte*) D018#13 (byte*) D018#0 -Redundant Phi (byte*) CHARGEN#10 (byte*) CHARGEN#1 -Redundant Phi (byte*) PROCPORT#10 (byte*) PROCPORT#1 -Redundant Phi (byte*) SCREEN#10 (byte*) SCREEN#12 -Redundant Phi (byte*) D018#10 (byte*) D018#13 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#10 -Redundant Phi (byte*) D018#1 (byte*) D018#10 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$8 [25] if((byte) main::bits#0<(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@2 -Simple Condition (bool~) main::$17 [37] if((byte) main::bits#1<(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@3 -Simple Condition (bool~) main::$26 [52] if((byte) main::bits#2<(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@4 -Simple Condition (bool~) main::$34 [66] if((byte) main::bits#3<(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@5 -Simple Condition (bool~) main::$39 [79] if((byte*) main::chargen#1<(byte*~) main::$38) goto main::@1 -Simple Condition (bool~) main::$40 [91] if((byte) main::i#1!=rangelast(0,$ff)) goto main::@6 +Simple Condition (bool~) main::$8 [24] if((byte) main::bits#0<(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@2 +Simple Condition (bool~) main::$17 [36] if((byte) main::bits#1<(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@3 +Simple Condition (bool~) main::$26 [51] if((byte) main::bits#2<(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@4 +Simple Condition (bool~) main::$34 [65] if((byte) main::bits#3<(byte/signed byte/word/signed word/dword/signed dword) 2) goto main::@5 +Simple Condition (bool~) main::$39 [78] if((byte*) main::chargen#1<(byte*~) main::$38) goto main::@1 +Simple Condition (bool~) main::$40 [89] if((byte) main::i#1!=rangelast(0,$ff)) goto main::@6 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte*) CHARSET#0 = ((byte*))$2000 diff --git a/src/test/ref/helloworld2-inline.asm b/src/test/ref/helloworld2-inline.asm index b1d19659e..ce5b4cc64 100644 --- a/src/test/ref/helloworld2-inline.asm +++ b/src/test/ref/helloworld2-inline.asm @@ -7,25 +7,25 @@ main: { ldx #0 ldy #0 print21_b1: - lda print21_msg,y + lda hello,y sta screen,x inx inx iny - lda print21_msg,y + lda hello,y cmp #'@' bne print21_b1 ldx #0 ldy #0 print22_b1: - lda print21_msg,y + lda hello,y sta print22_at,x inx inx iny - lda print21_msg,y + lda hello,y cmp #'@' bne print22_b1 rts - print21_msg: .text "hello world!@" + hello: .text "hello world!@" } diff --git a/src/test/ref/helloworld2-inline.cfg b/src/test/ref/helloworld2-inline.cfg index 38404e32b..d643f8199 100644 --- a/src/test/ref/helloworld2-inline.cfg +++ b/src/test/ref/helloworld2-inline.cfg @@ -16,10 +16,10 @@ main::print21: scope:[main] from main main::print21_@1: scope:[main] from main::print21 main::print21_@1 [6] (byte) main::print21_j#2 ← phi( main::print21/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print21_@1/(byte) main::print21_j#1 ) [6] (byte) main::print21_i#2 ← phi( main::print21/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print21_@1/(byte) main::print21_i#1 ) - [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print21_i#2) + [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) [8] (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [9] (byte) main::print21_i#1 ← ++ (byte) main::print21_i#2 - [10] if(*((const byte*) main::print21_msg#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 + [10] if(*((const byte*) main::hello#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 to:main::print22 main::print22: scope:[main] from main::print21_@1 [11] phi() @@ -27,10 +27,10 @@ main::print22: scope:[main] from main::print21_@1 main::print22_@1: scope:[main] from main::print22 main::print22_@1 [12] (byte) main::print22_j#2 ← phi( main::print22/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print22_@1/(byte) main::print22_j#1 ) [12] (byte) main::print22_i#2 ← phi( main::print22/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print22_@1/(byte) main::print22_i#1 ) - [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print22_i#2) + [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) [14] (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [15] (byte) main::print22_i#1 ← ++ (byte) main::print22_i#2 - [16] if(*((const byte*) main::print21_msg#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 + [16] if(*((const byte*) main::hello#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 to:main::@return main::@return: scope:[main] from main::print22_@1 [17] return diff --git a/src/test/ref/helloworld2-inline.log b/src/test/ref/helloworld2-inline.log index 42836f25f..96d542a69 100644 --- a/src/test/ref/helloworld2-inline.log +++ b/src/test/ref/helloworld2-inline.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) screen +Identified constant variable (byte*) main::hello Inlined call call print2 (byte*) screen (byte*) main::hello Inlined call call print2 (byte*~) main::$1 (byte*) main::hello @@ -6,22 +8,17 @@ CONTROL FLOW GRAPH SSA (byte*) screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@2 main: scope:[main] from @2 - (byte*) screen#1 ← phi( @2/(byte*) screen#3 ) (byte*) main::hello#0 ← (const string) main::$3 - (byte*) main::print21_at#0 ← (byte*) screen#1 + (byte*) main::print21_at#0 ← (byte*) screen#0 (byte*) main::print21_msg#0 ← (byte*) main::hello#0 to:main::print21 main::print21: scope:[main] from main - (byte*) main::hello#3 ← phi( main/(byte*) main::hello#0 ) - (byte*) screen#5 ← phi( main/(byte*) screen#1 ) (byte*) main::print21_at#2 ← phi( main/(byte*) main::print21_at#0 ) (byte*) main::print21_msg#2 ← phi( main/(byte*) main::print21_msg#0 ) (byte) main::print21_j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::print21_i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::print21_@1 main::print21_@1: scope:[main] from main::print21 main::print21_@1 - (byte*) main::hello#2 ← phi( main::print21/(byte*) main::hello#3 main::print21_@1/(byte*) main::hello#2 ) - (byte*) screen#4 ← phi( main::print21/(byte*) screen#5 main::print21_@1/(byte*) screen#4 ) (byte) main::print21_j#2 ← phi( main::print21/(byte) main::print21_j#0 main::print21_@1/(byte) main::print21_j#1 ) (byte*) main::print21_at#1 ← phi( main::print21/(byte*) main::print21_at#2 main::print21_@1/(byte*) main::print21_at#1 ) (byte) main::print21_i#2 ← phi( main::print21/(byte) main::print21_i#0 main::print21_@1/(byte) main::print21_i#1 ) @@ -33,11 +30,9 @@ main::print21_@1: scope:[main] from main::print21 main::print21_@1 if((bool) main::print21_$0#0) goto main::print21_@1 to:main::@1 main::@1: scope:[main] from main::print21_@1 - (byte*) main::hello#1 ← phi( main::print21_@1/(byte*) main::hello#2 ) - (byte*) screen#2 ← phi( main::print21_@1/(byte*) screen#4 ) - (byte*~) main::$1 ← (byte*) screen#2 + (byte/signed byte/word/signed word/dword/signed dword) $50 + (byte*~) main::$1 ← (byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) $50 (byte*) main::print22_at#0 ← (byte*~) main::$1 - (byte*) main::print22_msg#0 ← (byte*) main::hello#1 + (byte*) main::print22_msg#0 ← (byte*) main::hello#0 to:main::print22 main::print22: scope:[main] from main::@1 (byte*) main::print22_at#2 ← phi( main::@1/(byte*) main::print22_at#0 ) @@ -60,7 +55,6 @@ main::@return: scope:[main] from main::print22_@1 return to:@return @2: scope:[] from @begin - (byte*) screen#3 ← phi( @begin/(byte*) screen#0 ) call main to:@3 @3: scope:[] from @2 @@ -79,9 +73,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::hello (byte*) main::hello#0 -(byte*) main::hello#1 -(byte*) main::hello#2 -(byte*) main::hello#3 (label) main::print21 (bool~) main::print21_$0 (bool) main::print21_$0#0 @@ -124,42 +115,28 @@ SYMBOL TABLE SSA (byte*) main::print22_msg#2 (byte*) screen (byte*) screen#0 -(byte*) screen#1 -(byte*) screen#2 -(byte*) screen#3 -(byte*) screen#4 -(byte*) screen#5 Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) main::print21_msg#0 = (byte*) main::hello#0 (byte*) main::print21_msg#2 (byte*) main::hello#3 +Alias (byte*) main::hello#0 = (byte*) main::print21_msg#0 (byte*) main::print21_msg#2 (byte*) main::print22_msg#0 (byte*) main::print22_msg#2 Alias (byte*) main::print21_at#0 = (byte*) main::print21_at#2 -Alias (byte*) screen#1 = (byte*) screen#5 -Alias (byte*) screen#2 = (byte*) screen#4 -Alias (byte*) main::hello#1 = (byte*) main::hello#2 (byte*) main::print22_msg#0 (byte*) main::print22_msg#2 Alias (byte*) main::print22_at#0 = (byte*~) main::$1 (byte*) main::print22_at#2 -Alias (byte*) screen#0 = (byte*) screen#3 Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (byte*) main::print21_msg#1 Self Phi Eliminated (byte*) main::print21_at#1 -Self Phi Eliminated (byte*) screen#2 -Self Phi Eliminated (byte*) main::hello#1 Self Phi Eliminated (byte*) main::print22_msg#1 Self Phi Eliminated (byte*) main::print22_at#1 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) screen#1 (byte*) screen#0 -Redundant Phi (byte*) main::print21_msg#1 (byte*) main::print21_msg#0 +Redundant Phi (byte*) main::print21_msg#1 (byte*) main::hello#0 Redundant Phi (byte*) main::print21_at#1 (byte*) main::print21_at#0 -Redundant Phi (byte*) screen#2 (byte*) screen#1 -Redundant Phi (byte*) main::hello#1 (byte*) main::print21_msg#0 -Redundant Phi (byte*) main::print22_msg#1 (byte*) main::hello#1 +Redundant Phi (byte*) main::print22_msg#1 (byte*) main::hello#0 Redundant Phi (byte*) main::print22_at#1 (byte*) main::print22_at#0 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool) main::print21_$0#0 [13] if(*((byte*) main::print21_msg#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 -Simple Condition (bool) main::print22_$0#0 [26] if(*((byte*) main::print21_msg#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 +Simple Condition (bool) main::print21_$0#0 [12] if(*((byte*) main::hello#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 +Simple Condition (bool) main::print22_$0#0 [24] if(*((byte*) main::hello#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) screen#0 = ((byte*))$400 -Constant (const byte*) main::print21_msg#0 = main::$3 +Constant (const byte*) main::hello#0 = main::$3 Constant (const byte) main::print21_j#0 = 0 Constant (const byte) main::print21_i#0 = 0 Constant (const byte) main::print22_j#0 = 0 @@ -175,7 +152,7 @@ Inlining constant with var siblings (const byte) main::print21_i#0 Inlining constant with var siblings (const byte) main::print22_j#0 Inlining constant with var siblings (const byte) main::print22_i#0 Constant inlined main::print22_i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined main::$3 = (const byte*) main::print21_msg#0 +Constant inlined main::$3 = (const byte*) main::hello#0 Constant inlined main::print21_at#0 = (const byte*) screen#0 Constant inlined main::print21_i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined main::print22_j#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -226,10 +203,10 @@ main::print21: scope:[main] from main main::print21_@1: scope:[main] from main::print21 main::print21_@1 [6] (byte) main::print21_j#2 ← phi( main::print21/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print21_@1/(byte) main::print21_j#1 ) [6] (byte) main::print21_i#2 ← phi( main::print21/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print21_@1/(byte) main::print21_i#1 ) - [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print21_i#2) + [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) [8] (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [9] (byte) main::print21_i#1 ← ++ (byte) main::print21_i#2 - [10] if(*((const byte*) main::print21_msg#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 + [10] if(*((const byte*) main::hello#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 to:main::print22 main::print22: scope:[main] from main::print21_@1 [11] phi() @@ -237,10 +214,10 @@ main::print22: scope:[main] from main::print21_@1 main::print22_@1: scope:[main] from main::print22 main::print22_@1 [12] (byte) main::print22_j#2 ← phi( main::print22/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print22_@1/(byte) main::print22_j#1 ) [12] (byte) main::print22_i#2 ← phi( main::print22/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print22_@1/(byte) main::print22_i#1 ) - [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print22_i#2) + [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) [14] (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [15] (byte) main::print22_i#1 ← ++ (byte) main::print22_i#2 - [16] if(*((const byte*) main::print21_msg#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 + [16] if(*((const byte*) main::hello#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 to:main::@return main::@return: scope:[main] from main::print22_@1 [17] return @@ -337,9 +314,9 @@ main: { jmp print21_b1 //SEG19 main::print21_@1 print21_b1: - //SEG20 [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 + //SEG20 [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 ldy print21_i - lda print21_msg,y + lda hello,y ldy print21_j sta screen,y //SEG21 [8] (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuz1=vbuz1_plus_2 @@ -349,9 +326,9 @@ main: { sta print21_j //SEG22 [9] (byte) main::print21_i#1 ← ++ (byte) main::print21_i#2 -- vbuz1=_inc_vbuz1 inc print21_i - //SEG23 [10] if(*((const byte*) main::print21_msg#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 -- pbuc1_derefidx_vbuz1_neq_vbuc2_then_la1 + //SEG23 [10] if(*((const byte*) main::hello#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 -- pbuc1_derefidx_vbuz1_neq_vbuc2_then_la1 ldy print21_i - lda print21_msg,y + lda hello,y cmp #'@' bne print21_b1_from_print21_b1 //SEG24 [11] phi from main::print21_@1 to main::print22 [phi:main::print21_@1->main::print22] @@ -375,9 +352,9 @@ main: { jmp print22_b1 //SEG32 main::print22_@1 print22_b1: - //SEG33 [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 + //SEG33 [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 ldy print22_i - lda print21_msg,y + lda hello,y ldy print22_j sta print22_at,y //SEG34 [14] (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuz1=vbuz1_plus_2 @@ -387,9 +364,9 @@ main: { sta print22_j //SEG35 [15] (byte) main::print22_i#1 ← ++ (byte) main::print22_i#2 -- vbuz1=_inc_vbuz1 inc print22_i - //SEG36 [16] if(*((const byte*) main::print21_msg#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 -- pbuc1_derefidx_vbuz1_neq_vbuc2_then_la1 + //SEG36 [16] if(*((const byte*) main::hello#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 -- pbuc1_derefidx_vbuz1_neq_vbuc2_then_la1 ldy print22_i - lda print21_msg,y + lda hello,y cmp #'@' bne print22_b1_from_print22_b1 jmp breturn @@ -397,22 +374,22 @@ main: { breturn: //SEG38 [17] return rts - print21_msg: .text "hello world!@" + hello: .text "hello world!@" } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print21_i#2) [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a +Statement [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::print21_i#2 main::print21_i#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::print21_j#2 main::print21_j#1 ] -Statement [10] if(*((const byte*) main::print21_msg#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 [ main::print21_i#1 main::print21_j#1 ] ( main:2 [ main::print21_i#1 main::print21_j#1 ] ) always clobbers reg byte a -Statement [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print22_i#2) [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a +Statement [10] if(*((const byte*) main::hello#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 [ main::print21_i#1 main::print21_j#1 ] ( main:2 [ main::print21_i#1 main::print21_j#1 ] ) always clobbers reg byte a +Statement [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::print22_i#2 main::print22_i#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ main::print22_j#2 main::print22_j#1 ] -Statement [16] if(*((const byte*) main::print21_msg#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 [ main::print22_i#1 main::print22_j#1 ] ( main:2 [ main::print22_i#1 main::print22_j#1 ] ) always clobbers reg byte a -Statement [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print21_i#2) [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a -Statement [10] if(*((const byte*) main::print21_msg#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 [ main::print21_i#1 main::print21_j#1 ] ( main:2 [ main::print21_i#1 main::print21_j#1 ] ) always clobbers reg byte a -Statement [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print22_i#2) [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a -Statement [16] if(*((const byte*) main::print21_msg#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 [ main::print22_i#1 main::print22_j#1 ] ( main:2 [ main::print22_i#1 main::print22_j#1 ] ) always clobbers reg byte a +Statement [16] if(*((const byte*) main::hello#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 [ main::print22_i#1 main::print22_j#1 ] ( main:2 [ main::print22_i#1 main::print22_j#1 ] ) always clobbers reg byte a +Statement [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) [ main::print21_i#2 main::print21_j#2 ] ( main:2 [ main::print21_i#2 main::print21_j#2 ] ) always clobbers reg byte a +Statement [10] if(*((const byte*) main::hello#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 [ main::print21_i#1 main::print21_j#1 ] ( main:2 [ main::print21_i#1 main::print21_j#1 ] ) always clobbers reg byte a +Statement [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) [ main::print22_i#2 main::print22_j#2 ] ( main:2 [ main::print22_i#2 main::print22_j#2 ] ) always clobbers reg byte a +Statement [16] if(*((const byte*) main::hello#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 [ main::print22_i#1 main::print22_j#1 ] ( main:2 [ main::print22_i#1 main::print22_j#1 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::print21_i#2 main::print21_i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ main::print21_j#2 main::print21_j#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:4 [ main::print22_i#2 main::print22_i#1 ] : zp ZP_BYTE:4 , reg byte x , reg byte y , @@ -471,16 +448,16 @@ main: { jmp print21_b1 //SEG19 main::print21_@1 print21_b1: - //SEG20 [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy - lda print21_msg,y + //SEG20 [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + lda hello,y sta screen,x //SEG21 [8] (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuxx=vbuxx_plus_2 inx inx //SEG22 [9] (byte) main::print21_i#1 ← ++ (byte) main::print21_i#2 -- vbuyy=_inc_vbuyy iny - //SEG23 [10] if(*((const byte*) main::print21_msg#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 - lda print21_msg,y + //SEG23 [10] if(*((const byte*) main::hello#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 + lda hello,y cmp #'@' bne print21_b1_from_print21_b1 //SEG24 [11] phi from main::print21_@1 to main::print22 [phi:main::print21_@1->main::print22] @@ -502,16 +479,16 @@ main: { jmp print22_b1 //SEG32 main::print22_@1 print22_b1: - //SEG33 [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy - lda print21_msg,y + //SEG33 [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + lda hello,y sta print22_at,x //SEG34 [14] (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuxx=vbuxx_plus_2 inx inx //SEG35 [15] (byte) main::print22_i#1 ← ++ (byte) main::print22_i#2 -- vbuyy=_inc_vbuyy iny - //SEG36 [16] if(*((const byte*) main::print21_msg#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 - lda print21_msg,y + //SEG36 [16] if(*((const byte*) main::hello#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 + lda hello,y cmp #'@' bne print22_b1_from_print22_b1 jmp breturn @@ -519,7 +496,7 @@ main: { breturn: //SEG38 [17] return rts - print21_msg: .text "hello world!@" + hello: .text "hello world!@" } ASSEMBLER OPTIMIZATIONS @@ -565,6 +542,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@return (byte*) main::hello +(const byte*) main::hello#0 hello = (string) "hello world!@" (label) main::print21 (bool~) main::print21_$0 (label) main::print21_@1 @@ -576,7 +554,6 @@ FINAL SYMBOL TABLE (byte) main::print21_j#1 reg byte x 7.333333333333333 (byte) main::print21_j#2 reg byte x 16.5 (byte*) main::print21_msg -(const byte*) main::print21_msg#0 print21_msg = (string) "hello world!@" (label) main::print22 (bool~) main::print22_$0 (label) main::print22_@1 @@ -630,16 +607,16 @@ main: { //SEG18 [6] phi (byte) main::print21_i#2 = (byte) main::print21_i#1 [phi:main::print21_@1->main::print21_@1#1] -- register_copy //SEG19 main::print21_@1 print21_b1: - //SEG20 [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy - lda print21_msg,y + //SEG20 [7] *((const byte*) screen#0 + (byte) main::print21_j#2) ← *((const byte*) main::hello#0 + (byte) main::print21_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + lda hello,y sta screen,x //SEG21 [8] (byte) main::print21_j#1 ← (byte) main::print21_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuxx=vbuxx_plus_2 inx inx //SEG22 [9] (byte) main::print21_i#1 ← ++ (byte) main::print21_i#2 -- vbuyy=_inc_vbuyy iny - //SEG23 [10] if(*((const byte*) main::print21_msg#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 - lda print21_msg,y + //SEG23 [10] if(*((const byte*) main::hello#0 + (byte) main::print21_i#1)!=(byte) '@') goto main::print21_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 + lda hello,y cmp #'@' bne print21_b1 //SEG24 [11] phi from main::print21_@1 to main::print22 [phi:main::print21_@1->main::print22] @@ -654,21 +631,21 @@ main: { //SEG31 [12] phi (byte) main::print22_i#2 = (byte) main::print22_i#1 [phi:main::print22_@1->main::print22_@1#1] -- register_copy //SEG32 main::print22_@1 print22_b1: - //SEG33 [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::print21_msg#0 + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy - lda print21_msg,y + //SEG33 [13] *((const byte*) main::print22_at#0 + (byte) main::print22_j#2) ← *((const byte*) main::hello#0 + (byte) main::print22_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + lda hello,y sta print22_at,x //SEG34 [14] (byte) main::print22_j#1 ← (byte) main::print22_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuxx=vbuxx_plus_2 inx inx //SEG35 [15] (byte) main::print22_i#1 ← ++ (byte) main::print22_i#2 -- vbuyy=_inc_vbuyy iny - //SEG36 [16] if(*((const byte*) main::print21_msg#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 - lda print21_msg,y + //SEG36 [16] if(*((const byte*) main::hello#0 + (byte) main::print22_i#1)!=(byte) '@') goto main::print22_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 + lda hello,y cmp #'@' bne print22_b1 //SEG37 main::@return //SEG38 [17] return rts - print21_msg: .text "hello world!@" + hello: .text "hello world!@" } diff --git a/src/test/ref/helloworld2-inline.sym b/src/test/ref/helloworld2-inline.sym index dae26b932..f586a85a2 100644 --- a/src/test/ref/helloworld2-inline.sym +++ b/src/test/ref/helloworld2-inline.sym @@ -4,6 +4,7 @@ (void()) main() (label) main::@return (byte*) main::hello +(const byte*) main::hello#0 hello = (string) "hello world!@" (label) main::print21 (bool~) main::print21_$0 (label) main::print21_@1 @@ -15,7 +16,6 @@ (byte) main::print21_j#1 reg byte x 7.333333333333333 (byte) main::print21_j#2 reg byte x 16.5 (byte*) main::print21_msg -(const byte*) main::print21_msg#0 print21_msg = (string) "hello world!@" (label) main::print22 (bool~) main::print22_$0 (label) main::print22_@1 diff --git a/src/test/ref/helloworld2.log b/src/test/ref/helloworld2.log index 2c6b26c28..269f88993 100644 --- a/src/test/ref/helloworld2.log +++ b/src/test/ref/helloworld2.log @@ -1,21 +1,20 @@ +Identified constant variable (byte*) screen +Identified constant variable (byte*) main::hello CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@2 main: scope:[main] from @2 - (byte*) screen#1 ← phi( @2/(byte*) screen#3 ) (byte*) main::hello#0 ← (const string) main::$3 - (byte*) print2::at#0 ← (byte*) screen#1 + (byte*) print2::at#0 ← (byte*) screen#0 (byte*) print2::msg#0 ← (byte*) main::hello#0 call print2 to:main::@1 main::@1: scope:[main] from main - (byte*) main::hello#1 ← phi( main/(byte*) main::hello#0 ) - (byte*) screen#2 ← phi( main/(byte*) screen#1 ) - (byte*~) main::$1 ← (byte*) screen#2 + (byte/signed byte/word/signed word/dword/signed dword) $50 + (byte*~) main::$1 ← (byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) $50 (byte*) print2::at#1 ← (byte*~) main::$1 - (byte*) print2::msg#1 ← (byte*) main::hello#1 + (byte*) print2::msg#1 ← (byte*) main::hello#0 call print2 to:main::@2 main::@2: scope:[main] from main::@1 @@ -44,7 +43,6 @@ print2::@return: scope:[print2] from print2::@1 return to:@return @2: scope:[] from @begin - (byte*) screen#3 ← phi( @begin/(byte*) screen#0 ) call main to:@3 @3: scope:[] from @2 @@ -64,7 +62,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::hello (byte*) main::hello#0 -(byte*) main::hello#1 (void()) print2((byte*) print2::at , (byte*) print2::msg) (bool~) print2::$0 (label) print2::@1 @@ -89,26 +86,19 @@ SYMBOL TABLE SSA (byte*) print2::msg#3 (byte*) screen (byte*) screen#0 -(byte*) screen#1 -(byte*) screen#2 -(byte*) screen#3 Culled Empty Block (label) main::@2 Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) screen#1 = (byte*) screen#2 -Alias (byte*) main::hello#0 = (byte*) main::hello#1 Alias (byte*) print2::at#1 = (byte*~) main::$1 -Alias (byte*) screen#0 = (byte*) screen#3 Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (byte*) print2::msg#2 Self Phi Eliminated (byte*) print2::at#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) screen#1 (byte*) screen#0 Redundant Phi (byte*) print2::msg#2 (byte*) print2::msg#3 Redundant Phi (byte*) print2::at#2 (byte*) print2::at#3 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) print2::$0 [20] if(*((byte*) print2::msg#3 + (byte) print2::i#1)!=(byte) '@') goto print2::@1 +Simple Condition (bool~) print2::$0 [18] if(*((byte*) print2::msg#3 + (byte) print2::i#1)!=(byte) '@') goto print2::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) screen#0 = ((byte*))$400 Constant (const byte*) main::hello#0 = main::$3 diff --git a/src/test/ref/ifmin.log b/src/test/ref/ifmin.log index d77f1d21f..cf3696e6f 100644 --- a/src/test/ref/ifmin.log +++ b/src/test/ref/ifmin.log @@ -1,36 +1,32 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@1 main: scope:[main] from @1 - (byte*) SCREEN#3 ← phi( @1/(byte*) SCREEN#5 ) (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@2 - (byte*) SCREEN#2 ← phi( main/(byte*) SCREEN#3 main::@2/(byte*) SCREEN#4 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#1 ) (bool~) main::$0 ← (byte) main::i#2 < (byte/signed byte/word/signed word/dword/signed dword) $32 (bool~) main::$1 ← ! (bool~) main::$0 if((bool~) main::$1) goto main::@2 to:main::@3 main::@2: scope:[main] from main::@1 main::@3 - (byte*) SCREEN#4 ← phi( main::@1/(byte*) SCREEN#2 main::@3/(byte*) SCREEN#1 ) (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 main::@3/(byte) main::i#4 ) (byte) main::i#1 ← ++ (byte) main::i#3 (bool~) main::$2 ← (byte) main::i#1 < (byte/signed byte/word/signed word/dword/signed dword) $64 if((bool~) main::$2) goto main::@1 to:main::@return main::@3: scope:[main] from main::@1 - (byte*) SCREEN#1 ← phi( main::@1/(byte*) SCREEN#2 ) (byte) main::i#4 ← phi( main::@1/(byte) main::i#2 ) - *((byte*) SCREEN#1) ← (byte) main::i#4 + *((byte*) SCREEN#0) ← (byte) main::i#4 to:main::@2 main::@return: scope:[main] from main::@2 return to:@return @1: scope:[] from @begin - (byte*) SCREEN#5 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -44,11 +40,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -66,22 +57,14 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [5] (bool~) main::$1 ← (byte) main::i#2 >= (byte/signed byte/word/signed word/dword/signed dword) $32 from [4] (bool~) main::$0 ← (byte) main::i#2 < (byte/signed byte/word/signed word/dword/signed dword) $32 +Inversing boolean not [4] (bool~) main::$1 ← (byte) main::i#2 >= (byte/signed byte/word/signed word/dword/signed dword) $32 from [3] (bool~) main::$0 ← (byte) main::i#2 < (byte/signed byte/word/signed word/dword/signed dword) $32 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) main::i#2 = (byte) main::i#4 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#2 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#5 Successful SSA optimization Pass2AliasElimination Alias (byte) main::i#2 = (byte) main::i#3 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#4 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#3 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#3 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [6] if((byte) main::i#2>=(byte/signed byte/word/signed word/dword/signed dword) $32) goto main::@2 -Simple Condition (bool~) main::$2 [10] if((byte) main::i#1<(byte/signed byte/word/signed word/dword/signed dword) $64) goto main::@1 +Simple Condition (bool~) main::$1 [5] if((byte) main::i#2>=(byte/signed byte/word/signed word/dword/signed dword) $32) goto main::@2 +Simple Condition (bool~) main::$2 [9] if((byte) main::i#1<(byte/signed byte/word/signed word/dword/signed dword) $64) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) main::i#0 = 0 diff --git a/src/test/ref/importing.log b/src/test/ref/importing.log index 377bd08f1..27321fbd1 100644 --- a/src/test/ref/importing.log +++ b/src/test/ref/importing.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/incd020.log b/src/test/ref/incd020.log index 5b7ab33a6..583472d87 100644 --- a/src/test/ref/incd020.log +++ b/src/test/ref/incd020.log @@ -1,22 +1,20 @@ +Identified constant variable (byte*) BGCOL CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) BGCOL#0 ← ((byte*)) (word/dword/signed dword) $d020 to:@1 main: scope:[main] from @1 - (byte*) BGCOL#2 ← phi( @1/(byte*) BGCOL#3 ) to:main::@1 main::@1: scope:[main] from main main::@1 - (byte*) BGCOL#1 ← phi( main/(byte*) BGCOL#2 main::@1/(byte*) BGCOL#1 ) - *((byte*) BGCOL#1) ← ++ *((byte*) BGCOL#1) - *((byte*) BGCOL#1) ← -- *((byte*) BGCOL#1) + *((byte*) BGCOL#0) ← ++ *((byte*) BGCOL#0) + *((byte*) BGCOL#0) ← -- *((byte*) BGCOL#0) if(true) goto main::@1 to:main::@return main::@return: scope:[main] from main::@1 return to:@return @1: scope:[] from @begin - (byte*) BGCOL#3 ← phi( @begin/(byte*) BGCOL#0 ) call main to:@2 @2: scope:[] from @1 @@ -30,22 +28,12 @@ SYMBOL TABLE SSA (label) @end (byte*) BGCOL (byte*) BGCOL#0 -(byte*) BGCOL#1 -(byte*) BGCOL#2 -(byte*) BGCOL#3 (void()) main() (label) main::@1 (label) main::@return Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) BGCOL#0 = (byte*) BGCOL#3 -Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) BGCOL#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) BGCOL#2 (byte*) BGCOL#0 -Redundant Phi (byte*) BGCOL#1 (byte*) BGCOL#2 -Successful SSA optimization Pass2RedundantPhiElimination Constant (const byte*) BGCOL#0 = ((byte*))$d020 Successful SSA optimization Pass2ConstantIdentification if() condition always true - replacing block destination [2] if(true) goto main::@1 diff --git a/src/test/ref/infloop-error.log b/src/test/ref/infloop-error.log index 3313a6a9d..7691eba47 100644 --- a/src/test/ref/infloop-error.log +++ b/src/test/ref/infloop-error.log @@ -1,23 +1,21 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@1 main: scope:[main] from @1 - (byte*) SCREEN#7 ← phi( @1/(byte*) SCREEN#8 ) (byte) main::min#0 ← (byte/word/signed word/dword/signed dword) $ff (byte) main::max#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::pos#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@5 - (byte*) SCREEN#6 ← phi( main/(byte*) SCREEN#7 main::@5/(byte*) SCREEN#1 ) (byte) main::max#6 ← phi( main/(byte) main::max#0 main::@5/(byte) main::max#3 ) (byte) main::min#4 ← phi( main/(byte) main::min#0 main::@5/(byte) main::min#3 ) (byte) main::pos#7 ← phi( main/(byte) main::pos#0 main::@5/(byte) main::pos#5 ) if(true) goto main::@2 to:main::@return main::@2: scope:[main] from main::@1 - (byte*) SCREEN#4 ← phi( main::@1/(byte*) SCREEN#6 ) (byte) main::max#4 ← phi( main::@1/(byte) main::max#6 ) (byte) main::min#2 ← phi( main::@1/(byte) main::min#4 ) (byte) main::pos#2 ← phi( main::@1/(byte) main::pos#7 ) @@ -27,7 +25,6 @@ main::@2: scope:[main] from main::@1 if((bool~) main::$1) goto main::@4 to:main::@8 main::@4: scope:[main] from main::@2 main::@8 - (byte*) SCREEN#2 ← phi( main::@2/(byte*) SCREEN#4 main::@8/(byte*) SCREEN#5 ) (byte) main::min#5 ← phi( main::@2/(byte) main::min#2 main::@8/(byte) main::min#1 ) (byte) main::max#2 ← phi( main::@2/(byte) main::max#4 main::@8/(byte) main::max#5 ) (byte) main::pos#3 ← phi( main::@2/(byte) main::pos#1 main::@8/(byte) main::pos#4 ) @@ -36,7 +33,6 @@ main::@4: scope:[main] from main::@2 main::@8 if((bool~) main::$3) goto main::@5 to:main::@9 main::@8: scope:[main] from main::@2 - (byte*) SCREEN#5 ← phi( main::@2/(byte*) SCREEN#4 ) (byte) main::max#5 ← phi( main::@2/(byte) main::max#4 ) (byte) main::pos#4 ← phi( main::@2/(byte) main::pos#1 ) (byte) main::min#1 ← (byte) main::pos#4 @@ -44,14 +40,12 @@ main::@8: scope:[main] from main::@2 main::@5: scope:[main] from main::@4 main::@9 (byte) main::pos#5 ← phi( main::@4/(byte) main::pos#3 main::@9/(byte) main::pos#6 ) (byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::max#1 ) - (byte*) SCREEN#1 ← phi( main::@4/(byte*) SCREEN#2 main::@9/(byte*) SCREEN#3 ) (byte) main::min#3 ← phi( main::@4/(byte) main::min#5 main::@9/(byte) main::min#6 ) - *((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3 - *((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3 - *((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#5 + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3 + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3 + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#5 to:main::@1 main::@9: scope:[main] from main::@4 - (byte*) SCREEN#3 ← phi( main::@4/(byte*) SCREEN#2 ) (byte) main::min#6 ← phi( main::@4/(byte) main::min#5 ) (byte) main::pos#6 ← phi( main::@4/(byte) main::pos#3 ) (byte) main::max#1 ← (byte) main::pos#6 @@ -60,7 +54,6 @@ main::@return: scope:[main] from main::@1 return to:@return @1: scope:[] from @begin - (byte*) SCREEN#8 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -74,14 +67,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -122,35 +107,27 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [10] (bool~) main::$1 ← (byte) main::pos#1 >= (byte) main::min#2 from [9] (bool~) main::$0 ← (byte) main::pos#1 < (byte) main::min#2 -Inversing boolean not [14] (bool~) main::$3 ← (byte) main::pos#3 <= (byte) main::max#2 from [13] (bool~) main::$2 ← (byte) main::pos#3 > (byte) main::max#2 +Inversing boolean not [9] (bool~) main::$1 ← (byte) main::pos#1 >= (byte) main::min#2 from [8] (bool~) main::$0 ← (byte) main::pos#1 < (byte) main::min#2 +Inversing boolean not [13] (bool~) main::$3 ← (byte) main::pos#3 <= (byte) main::max#2 from [12] (bool~) main::$2 ← (byte) main::pos#3 > (byte) main::max#2 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) main::pos#2 = (byte) main::pos#7 Alias (byte) main::min#2 = (byte) main::min#4 Alias (byte) main::max#4 = (byte) main::max#6 (byte) main::max#5 -Alias (byte*) SCREEN#4 = (byte*) SCREEN#6 (byte*) SCREEN#5 Alias (byte) main::pos#1 = (byte) main::pos#4 (byte) main::min#1 Alias (byte) main::pos#3 = (byte) main::pos#6 (byte) main::max#1 Alias (byte) main::min#5 = (byte) main::min#6 -Alias (byte*) SCREEN#2 = (byte*) SCREEN#3 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#8 Successful SSA optimization Pass2AliasElimination Alias candidate removed (phi-usage) (byte) main::pos#1 Alias (byte) main::pos#3 = (byte) main::pos#5 Alias (byte) main::max#2 = (byte) main::max#4 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#2 (byte*) SCREEN#4 Alias (byte) main::min#3 = (byte) main::min#5 Successful SSA optimization Pass2AliasElimination Alias candidate removed (phi-usage) (byte) main::pos#1 Alias candidate removed (solo) (byte) main::pos#3 = -Self Phi Eliminated (byte*) SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#7 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#7 Redundant Phi (byte) main::pos#3 (byte) main::pos#1 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [11] if((byte) main::pos#1>=(byte) main::min#2) goto main::@4 -Simple Condition (bool~) main::$3 [15] if((byte) main::pos#1<=(byte) main::max#2) goto main::@5 +Simple Condition (bool~) main::$1 [10] if((byte) main::pos#1>=(byte) main::min#2) goto main::@4 +Simple Condition (bool~) main::$3 [14] if((byte) main::pos#1<=(byte) main::max#2) goto main::@5 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) main::min#0 = $ff diff --git a/src/test/ref/inline-asm-clobber-none.log b/src/test/ref/inline-asm-clobber-none.log index ad637f9a4..bf85b187c 100644 --- a/src/test/ref/inline-asm-clobber-none.log +++ b/src/test/ref/inline-asm-clobber-none.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/inline-asm-clobber.log b/src/test/ref/inline-asm-clobber.log index f1fde80cd..94a3d2e32 100644 --- a/src/test/ref/inline-asm-clobber.log +++ b/src/test/ref/inline-asm-clobber.log @@ -1,54 +1,47 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@1 main: scope:[main] from @1 - (byte*) SCREEN#5 ← phi( @1/(byte*) SCREEN#9 ) (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@5 (byte) main::i#4 ← phi( main/(byte) main::i#0 main::@5/(byte) main::i#1 ) - (byte*) SCREEN#3 ← phi( main/(byte*) SCREEN#5 main::@5/(byte*) SCREEN#6 ) (byte) main::j#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::i#2 ← phi( main::@1/(byte) main::i#4 main::@2/(byte) main::i#2 ) - (byte*) SCREEN#1 ← phi( main::@1/(byte*) SCREEN#3 main::@2/(byte*) SCREEN#1 ) (byte) main::j#2 ← phi( main::@1/(byte) main::j#0 main::@2/(byte) main::j#1 ) - *((byte*) SCREEN#1 + (byte) main::i#2) ← (byte) main::j#2 + *((byte*) SCREEN#0 + (byte) main::i#2) ← (byte) main::j#2 (byte) main::j#1 ← (byte) main::j#2 + rangenext(0,$64) (bool~) main::$0 ← (byte) main::j#1 != rangelast(0,$64) if((bool~) main::$0) goto main::@2 to:main::@5 main::@5: scope:[main] from main::@2 - (byte*) SCREEN#6 ← phi( main::@2/(byte*) SCREEN#1 ) (byte) main::i#3 ← phi( main::@2/(byte) main::i#2 ) (byte) main::i#1 ← (byte) main::i#3 + rangenext(0,$64) (bool~) main::$1 ← (byte) main::i#1 != rangelast(0,$64) if((bool~) main::$1) goto main::@1 to:main::@6 main::@6: scope:[main] from main::@5 - (byte*) SCREEN#7 ← phi( main::@5/(byte*) SCREEN#6 ) (byte) main::k#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@3 main::@3: scope:[main] from main::@6 main::@7 (byte) main::k#4 ← phi( main::@6/(byte) main::k#0 main::@7/(byte) main::k#1 ) - (byte*) SCREEN#4 ← phi( main::@6/(byte*) SCREEN#7 main::@7/(byte*) SCREEN#8 ) (byte) main::l#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::k#2 ← phi( main::@3/(byte) main::k#4 main::@4/(byte) main::k#2 ) - (byte*) SCREEN#2 ← phi( main::@3/(byte*) SCREEN#4 main::@4/(byte*) SCREEN#2 ) (byte) main::l#2 ← phi( main::@3/(byte) main::l#0 main::@4/(byte) main::l#1 ) asm { eor#$55 tax } - *((byte*) SCREEN#2 + (byte) main::k#2) ← (byte) main::l#2 + *((byte*) SCREEN#0 + (byte) main::k#2) ← (byte) main::l#2 (byte) main::l#1 ← (byte) main::l#2 + rangenext(0,$64) (bool~) main::$2 ← (byte) main::l#1 != rangelast(0,$64) if((bool~) main::$2) goto main::@4 to:main::@7 main::@7: scope:[main] from main::@4 - (byte*) SCREEN#8 ← phi( main::@4/(byte*) SCREEN#2 ) (byte) main::k#3 ← phi( main::@4/(byte) main::k#2 ) (byte) main::k#1 ← (byte) main::k#3 + rangenext(0,$64) (bool~) main::$3 ← (byte) main::k#1 != rangelast(0,$64) @@ -58,7 +51,6 @@ main::@return: scope:[main] from main::@7 return to:@return @1: scope:[] from @begin - (byte*) SCREEN#9 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -72,15 +64,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -118,26 +101,18 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::i#2 = (byte) main::i#3 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#6 (byte*) SCREEN#7 Alias (byte) main::k#2 = (byte) main::k#3 -Alias (byte*) SCREEN#2 = (byte*) SCREEN#8 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#9 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#1 Self Phi Eliminated (byte) main::i#2 -Self Phi Eliminated (byte*) SCREEN#2 Self Phi Eliminated (byte) main::k#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#5 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#3 Redundant Phi (byte) main::i#2 (byte) main::i#4 -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#4 Redundant Phi (byte) main::k#2 (byte) main::k#4 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$0 [9] if((byte) main::j#1!=rangelast(0,$64)) goto main::@2 -Simple Condition (bool~) main::$1 [13] if((byte) main::i#1!=rangelast(0,$64)) goto main::@1 -Simple Condition (bool~) main::$2 [23] if((byte) main::l#1!=rangelast(0,$64)) goto main::@4 -Simple Condition (bool~) main::$3 [27] if((byte) main::k#1!=rangelast(0,$64)) goto main::@3 +Simple Condition (bool~) main::$0 [8] if((byte) main::j#1!=rangelast(0,$64)) goto main::@2 +Simple Condition (bool~) main::$1 [12] if((byte) main::i#1!=rangelast(0,$64)) goto main::@1 +Simple Condition (bool~) main::$2 [21] if((byte) main::l#1!=rangelast(0,$64)) goto main::@4 +Simple Condition (bool~) main::$3 [25] if((byte) main::k#1!=rangelast(0,$64)) goto main::@3 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) main::i#0 = 0 @@ -155,12 +130,6 @@ Resolved ranged next value main::k#1 ← ++ main::k#4 to ++ Resolved ranged comparison value if(main::k#1!=rangelast(0,$64)) goto main::@3 to (byte/signed byte/word/signed word/dword/signed dword) $65 Culled Empty Block (label) main::@6 Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte*) SCREEN#3 -Self Phi Eliminated (byte*) SCREEN#4 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#3 (const byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#4 (byte*) SCREEN#3 -Successful SSA optimization Pass2RedundantPhiElimination Inlining constant with var siblings (const byte) main::i#0 Inlining constant with var siblings (const byte) main::j#0 Inlining constant with var siblings (const byte) main::k#0 diff --git a/src/test/ref/inline-asm-jsr-clobber.log b/src/test/ref/inline-asm-jsr-clobber.log index 744531785..aac77ce46 100644 --- a/src/test/ref/inline-asm-jsr-clobber.log +++ b/src/test/ref/inline-asm-jsr-clobber.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/inline-function-if.log b/src/test/ref/inline-function-if.log index 67e1e0e55..3cfbaa3c4 100644 --- a/src/test/ref/inline-function-if.log +++ b/src/test/ref/inline-function-if.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) screen Inlined call (byte~) main::$0 ← call toUpper (byte) 'c' true Inlined call (byte~) main::$1 ← call toUpper (byte) 'm' false @@ -6,12 +7,10 @@ CONTROL FLOW GRAPH SSA (byte*) screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@2 main: scope:[main] from @2 - (byte*) screen#11 ← phi( @2/(byte*) screen#12 ) (byte) main::toUpper1_ch#0 ← (byte) 'c' (bool) main::toUpper1_bo#0 ← true to:main::toUpper1 main::toUpper1: scope:[main] from main - (byte*) screen#7 ← phi( main/(byte*) screen#11 ) (bool) main::toUpper1_bo#1 ← phi( main/(bool) main::toUpper1_bo#0 ) (byte) main::toUpper1_ch#1 ← phi( main/(byte) main::toUpper1_ch#0 ) (byte) main::toUpper1_res#0 ← (byte) main::toUpper1_ch#1 @@ -19,30 +18,25 @@ main::toUpper1: scope:[main] from main if((bool) main::toUpper1_$0#0) goto main::toUpper1_@1 to:main::toUpper1_@2 main::toUpper1_@1: scope:[main] from main::toUpper1 main::toUpper1_@2 - (byte*) screen#5 ← phi( main::toUpper1/(byte*) screen#7 main::toUpper1_@2/(byte*) screen#8 ) (byte) main::toUpper1_res#2 ← phi( main::toUpper1/(byte) main::toUpper1_res#0 main::toUpper1_@2/(byte) main::toUpper1_res#1 ) (byte) main::toUpper1_return#0 ← (byte) main::toUpper1_res#2 to:main::toUpper1_@return main::toUpper1_@2: scope:[main] from main::toUpper1 - (byte*) screen#8 ← phi( main::toUpper1/(byte*) screen#7 ) (byte) main::toUpper1_res#3 ← phi( main::toUpper1/(byte) main::toUpper1_res#0 ) (byte) main::toUpper1_res#1 ← (byte) main::toUpper1_res#3 + (byte/signed byte/word/signed word/dword/signed dword) $40 to:main::toUpper1_@1 main::toUpper1_@return: scope:[main] from main::toUpper1_@1 - (byte*) screen#3 ← phi( main::toUpper1_@1/(byte*) screen#5 ) (byte) main::toUpper1_return#2 ← phi( main::toUpper1_@1/(byte) main::toUpper1_return#0 ) (byte) main::toUpper1_return#1 ← (byte) main::toUpper1_return#2 to:main::@1 main::@1: scope:[main] from main::toUpper1_@return - (byte*) screen#1 ← phi( main::toUpper1_@return/(byte*) screen#3 ) (byte) main::toUpper1_return#3 ← phi( main::toUpper1_@return/(byte) main::toUpper1_return#1 ) (byte~) main::$0 ← (byte) main::toUpper1_return#3 - *((byte*) screen#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 + *((byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 (byte) main::toUpper2_ch#0 ← (byte) 'm' (bool) main::toUpper2_bo#0 ← false to:main::toUpper2 main::toUpper2: scope:[main] from main::@1 - (byte*) screen#9 ← phi( main::@1/(byte*) screen#1 ) (bool) main::toUpper2_bo#1 ← phi( main::@1/(bool) main::toUpper2_bo#0 ) (byte) main::toUpper2_ch#1 ← phi( main::@1/(byte) main::toUpper2_ch#0 ) (byte) main::toUpper2_res#0 ← (byte) main::toUpper2_ch#1 @@ -50,31 +44,26 @@ main::toUpper2: scope:[main] from main::@1 if((bool) main::toUpper2_$0#0) goto main::toUpper2_@1 to:main::toUpper2_@2 main::toUpper2_@1: scope:[main] from main::toUpper2 main::toUpper2_@2 - (byte*) screen#6 ← phi( main::toUpper2/(byte*) screen#9 main::toUpper2_@2/(byte*) screen#10 ) (byte) main::toUpper2_res#2 ← phi( main::toUpper2/(byte) main::toUpper2_res#0 main::toUpper2_@2/(byte) main::toUpper2_res#1 ) (byte) main::toUpper2_return#0 ← (byte) main::toUpper2_res#2 to:main::toUpper2_@return main::toUpper2_@2: scope:[main] from main::toUpper2 - (byte*) screen#10 ← phi( main::toUpper2/(byte*) screen#9 ) (byte) main::toUpper2_res#3 ← phi( main::toUpper2/(byte) main::toUpper2_res#0 ) (byte) main::toUpper2_res#1 ← (byte) main::toUpper2_res#3 + (byte/signed byte/word/signed word/dword/signed dword) $40 to:main::toUpper2_@1 main::toUpper2_@return: scope:[main] from main::toUpper2_@1 - (byte*) screen#4 ← phi( main::toUpper2_@1/(byte*) screen#6 ) (byte) main::toUpper2_return#2 ← phi( main::toUpper2_@1/(byte) main::toUpper2_return#0 ) (byte) main::toUpper2_return#1 ← (byte) main::toUpper2_return#2 to:main::@2 main::@2: scope:[main] from main::toUpper2_@return - (byte*) screen#2 ← phi( main::toUpper2_@return/(byte*) screen#4 ) (byte) main::toUpper2_return#3 ← phi( main::toUpper2_@return/(byte) main::toUpper2_return#1 ) (byte~) main::$1 ← (byte) main::toUpper2_return#3 - *((byte*) screen#2 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 + *((byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 to:main::@return main::@return: scope:[main] from main::@2 return to:@return @2: scope:[] from @begin - (byte*) screen#12 ← phi( @begin/(byte*) screen#0 ) call main to:@3 @3: scope:[] from @2 @@ -138,39 +127,19 @@ SYMBOL TABLE SSA (byte) main::toUpper2_return#3 (byte*) screen (byte*) screen#0 -(byte*) screen#1 -(byte*) screen#10 -(byte*) screen#11 -(byte*) screen#12 -(byte*) screen#2 -(byte*) screen#3 -(byte*) screen#4 -(byte*) screen#5 -(byte*) screen#6 -(byte*) screen#7 -(byte*) screen#8 -(byte*) screen#9 Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::toUpper1_ch#0 = (byte) main::toUpper1_ch#1 (byte) main::toUpper1_res#0 (byte) main::toUpper1_res#3 Alias (bool) main::toUpper1_bo#0 = (bool) main::toUpper1_bo#1 -Alias (byte*) screen#11 = (byte*) screen#7 (byte*) screen#8 Alias (byte) main::toUpper1_return#0 = (byte) main::toUpper1_res#2 (byte) main::toUpper1_return#2 (byte) main::toUpper1_return#1 (byte) main::toUpper1_return#3 (byte~) main::$0 -Alias (byte*) screen#1 = (byte*) screen#3 (byte*) screen#5 (byte*) screen#9 (byte*) screen#10 Alias (byte) main::toUpper2_ch#0 = (byte) main::toUpper2_ch#1 (byte) main::toUpper2_res#0 (byte) main::toUpper2_res#3 Alias (bool) main::toUpper2_bo#0 = (bool) main::toUpper2_bo#1 Alias (byte) main::toUpper2_return#0 = (byte) main::toUpper2_res#2 (byte) main::toUpper2_return#2 (byte) main::toUpper2_return#1 (byte) main::toUpper2_return#3 (byte~) main::$1 -Alias (byte*) screen#2 = (byte*) screen#4 (byte*) screen#6 -Alias (byte*) screen#0 = (byte*) screen#12 Successful SSA optimization Pass2AliasElimination -Alias (byte*) screen#1 = (byte*) screen#11 (byte*) screen#2 -Successful SSA optimization Pass2AliasElimination -Redundant Phi (byte*) screen#1 (byte*) screen#0 -Successful SSA optimization Pass2RedundantPhiElimination -Rewriting ! if()-condition to reversed if() [6] (bool) main::toUpper1_$0#0 ← ! (bool) main::toUpper1_bo#0 +Rewriting ! if()-condition to reversed if() [5] (bool) main::toUpper1_$0#0 ← ! (bool) main::toUpper1_bo#0 Successful SSA optimization Pass2ConditionalAndOrRewriting -Rewriting ! if()-condition to reversed if() [21] (bool) main::toUpper2_$0#0 ← ! (bool) main::toUpper2_bo#0 +Rewriting ! if()-condition to reversed if() [20] (bool) main::toUpper2_$0#0 ← ! (bool) main::toUpper2_bo#0 Successful SSA optimization Pass2ConditionalAndOrRewriting Constant (const byte*) screen#0 = ((byte*))$400 Constant (const byte) main::toUpper1_ch#0 = 'c' diff --git a/src/test/ref/inline-function-min.log b/src/test/ref/inline-function-min.log index 6fabbb132..1f64a81c3 100644 --- a/src/test/ref/inline-function-min.log +++ b/src/test/ref/inline-function-min.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) screen Inlined call (byte~) main::$0 ← call sum (byte/signed byte/word/signed word/dword/signed dword) 2 (byte/signed byte/word/signed word/dword/signed dword) 1 Inlined call (byte~) main::$1 ← call sum (byte/signed byte/word/signed word/dword/signed dword) $a (byte/signed byte/word/signed word/dword/signed dword) 3 Inlined call (byte~) main::$2 ← call sum (byte/signed byte/word/signed word/dword/signed dword) 4 (byte/signed byte/word/signed word/dword/signed dword) 8 @@ -7,73 +8,62 @@ CONTROL FLOW GRAPH SSA (byte*) screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@2 main: scope:[main] from @2 - (byte*) screen#10 ← phi( @2/(byte*) screen#11 ) (byte) main::sum1_a#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2 (byte) main::sum1_b#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1 to:main::sum1 main::sum1: scope:[main] from main - (byte*) screen#7 ← phi( main/(byte*) screen#10 ) (byte) main::sum1_b#1 ← phi( main/(byte) main::sum1_b#0 ) (byte) main::sum1_a#1 ← phi( main/(byte) main::sum1_a#0 ) (byte) main::sum1_$0#0 ← (byte) main::sum1_a#1 + (byte) main::sum1_b#1 (byte) main::sum1_return#0 ← (byte) main::sum1_$0#0 to:main::sum1_@return main::sum1_@return: scope:[main] from main::sum1 - (byte*) screen#4 ← phi( main::sum1/(byte*) screen#7 ) (byte) main::sum1_return#2 ← phi( main::sum1/(byte) main::sum1_return#0 ) (byte) main::sum1_return#1 ← (byte) main::sum1_return#2 to:main::@1 main::@1: scope:[main] from main::sum1_@return - (byte*) screen#1 ← phi( main::sum1_@return/(byte*) screen#4 ) (byte) main::sum1_return#3 ← phi( main::sum1_@return/(byte) main::sum1_return#1 ) (byte~) main::$0 ← (byte) main::sum1_return#3 - *((byte*) screen#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 + *((byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte~) main::$0 (byte) main::sum2_a#0 ← (byte/signed byte/word/signed word/dword/signed dword) $a (byte) main::sum2_b#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3 to:main::sum2 main::sum2: scope:[main] from main::@1 - (byte*) screen#8 ← phi( main::@1/(byte*) screen#1 ) (byte) main::sum2_b#1 ← phi( main::@1/(byte) main::sum2_b#0 ) (byte) main::sum2_a#1 ← phi( main::@1/(byte) main::sum2_a#0 ) (byte) main::sum2_$0#0 ← (byte) main::sum2_a#1 + (byte) main::sum2_b#1 (byte) main::sum2_return#0 ← (byte) main::sum2_$0#0 to:main::sum2_@return main::sum2_@return: scope:[main] from main::sum2 - (byte*) screen#5 ← phi( main::sum2/(byte*) screen#8 ) (byte) main::sum2_return#2 ← phi( main::sum2/(byte) main::sum2_return#0 ) (byte) main::sum2_return#1 ← (byte) main::sum2_return#2 to:main::@2 main::@2: scope:[main] from main::sum2_@return - (byte*) screen#2 ← phi( main::sum2_@return/(byte*) screen#5 ) (byte) main::sum2_return#3 ← phi( main::sum2_@return/(byte) main::sum2_return#1 ) (byte~) main::$1 ← (byte) main::sum2_return#3 - *((byte*) screen#2 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 + *((byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte~) main::$1 (byte) main::sum3_a#0 ← (byte/signed byte/word/signed word/dword/signed dword) 4 (byte) main::sum3_b#0 ← (byte/signed byte/word/signed word/dword/signed dword) 8 to:main::sum3 main::sum3: scope:[main] from main::@2 - (byte*) screen#9 ← phi( main::@2/(byte*) screen#2 ) (byte) main::sum3_b#1 ← phi( main::@2/(byte) main::sum3_b#0 ) (byte) main::sum3_a#1 ← phi( main::@2/(byte) main::sum3_a#0 ) (byte) main::sum3_$0#0 ← (byte) main::sum3_a#1 + (byte) main::sum3_b#1 (byte) main::sum3_return#0 ← (byte) main::sum3_$0#0 to:main::sum3_@return main::sum3_@return: scope:[main] from main::sum3 - (byte*) screen#6 ← phi( main::sum3/(byte*) screen#9 ) (byte) main::sum3_return#2 ← phi( main::sum3/(byte) main::sum3_return#0 ) (byte) main::sum3_return#1 ← (byte) main::sum3_return#2 to:main::@3 main::@3: scope:[main] from main::sum3_@return - (byte*) screen#3 ← phi( main::sum3_@return/(byte*) screen#6 ) (byte) main::sum3_return#3 ← phi( main::sum3_@return/(byte) main::sum3_return#1 ) (byte~) main::$2 ← (byte) main::sum3_return#3 - *((byte*) screen#3 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte~) main::$2 + *((byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte~) main::$2 to:main::@return main::@return: scope:[main] from main::@3 return to:@return @2: scope:[] from @begin - (byte*) screen#11 ← phi( @begin/(byte*) screen#0 ) call main to:@3 @3: scope:[] from @2 @@ -140,23 +130,11 @@ SYMBOL TABLE SSA (byte) main::sum3_return#3 (byte*) screen (byte*) screen#0 -(byte*) screen#1 -(byte*) screen#10 -(byte*) screen#11 -(byte*) screen#2 -(byte*) screen#3 -(byte*) screen#4 -(byte*) screen#5 -(byte*) screen#6 -(byte*) screen#7 -(byte*) screen#8 -(byte*) screen#9 Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::sum1_a#0 = (byte) main::sum1_a#1 Alias (byte) main::sum1_b#0 = (byte) main::sum1_b#1 -Alias (byte*) screen#1 = (byte*) screen#7 (byte*) screen#10 (byte*) screen#4 (byte*) screen#8 (byte*) screen#5 (byte*) screen#2 (byte*) screen#9 (byte*) screen#6 (byte*) screen#3 Alias (byte) main::sum1_return#0 = (byte) main::sum1_$0#0 (byte) main::sum1_return#2 (byte) main::sum1_return#1 (byte) main::sum1_return#3 (byte~) main::$0 Alias (byte) main::sum2_a#0 = (byte) main::sum2_a#1 Alias (byte) main::sum2_b#0 = (byte) main::sum2_b#1 @@ -164,10 +142,7 @@ Alias (byte) main::sum2_return#0 = (byte) main::sum2_$0#0 (byte) main::sum2_retu Alias (byte) main::sum3_a#0 = (byte) main::sum3_a#1 Alias (byte) main::sum3_b#0 = (byte) main::sum3_b#1 Alias (byte) main::sum3_return#0 = (byte) main::sum3_$0#0 (byte) main::sum3_return#2 (byte) main::sum3_return#1 (byte) main::sum3_return#3 (byte~) main::$2 -Alias (byte*) screen#0 = (byte*) screen#11 Successful SSA optimization Pass2AliasElimination -Redundant Phi (byte*) screen#1 (byte*) screen#0 -Successful SSA optimization Pass2RedundantPhiElimination Constant (const byte*) screen#0 = ((byte*))$400 Constant (const byte) main::sum1_a#0 = 2 Constant (const byte) main::sum1_b#0 = 1 diff --git a/src/test/ref/inline-function-print.asm b/src/test/ref/inline-function-print.asm index bd3d2717d..b84a8b51c 100644 --- a/src/test/ref/inline-function-print.asm +++ b/src/test/ref/inline-function-print.asm @@ -8,25 +8,25 @@ main: { ldx #0 ldy #0 print1_b1: - lda print1_msg,y + lda hello,y sta screen,x inx inx iny - lda print1_msg,y + lda hello,y cmp #'@' bne print1_b1 ldx #0 ldy #0 print2_b1: - lda print1_msg,y + lda hello,y sta print2_at,x inx inx iny - lda print1_msg,y + lda hello,y cmp #'@' bne print2_b1 rts - print1_msg: .text "hello world!@" + hello: .text "hello world!@" } diff --git a/src/test/ref/inline-function-print.cfg b/src/test/ref/inline-function-print.cfg index fdcfa58cc..2cee9e636 100644 --- a/src/test/ref/inline-function-print.cfg +++ b/src/test/ref/inline-function-print.cfg @@ -16,10 +16,10 @@ main::print1: scope:[main] from main main::print1_@1: scope:[main] from main::print1 main::print1_@1 [6] (byte) main::print1_j#2 ← phi( main::print1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print1_@1/(byte) main::print1_j#1 ) [6] (byte) main::print1_i#2 ← phi( main::print1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print1_@1/(byte) main::print1_i#1 ) - [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print1_i#2) + [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) [8] (byte) main::print1_j#1 ← (byte) main::print1_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [9] (byte) main::print1_i#1 ← ++ (byte) main::print1_i#2 - [10] if(*((const byte*) main::print1_msg#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 + [10] if(*((const byte*) main::hello#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 to:main::print2 main::print2: scope:[main] from main::print1_@1 [11] phi() @@ -27,10 +27,10 @@ main::print2: scope:[main] from main::print1_@1 main::print2_@1: scope:[main] from main::print2 main::print2_@1 [12] (byte) main::print2_j#2 ← phi( main::print2/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print2_@1/(byte) main::print2_j#1 ) [12] (byte) main::print2_i#2 ← phi( main::print2/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print2_@1/(byte) main::print2_i#1 ) - [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print2_i#2) + [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) [14] (byte) main::print2_j#1 ← (byte) main::print2_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [15] (byte) main::print2_i#1 ← ++ (byte) main::print2_i#2 - [16] if(*((const byte*) main::print1_msg#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 + [16] if(*((const byte*) main::hello#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 to:main::@return main::@return: scope:[main] from main::print2_@1 [17] return diff --git a/src/test/ref/inline-function-print.log b/src/test/ref/inline-function-print.log index 6339beb42..3987dd327 100644 --- a/src/test/ref/inline-function-print.log +++ b/src/test/ref/inline-function-print.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) screen +Identified constant variable (byte*) main::hello Inlined call call print (byte*) screen (byte*) main::hello Inlined call call print (byte*~) main::$2 (byte*) main::hello @@ -6,22 +8,17 @@ CONTROL FLOW GRAPH SSA (byte*) screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@2 main: scope:[main] from @2 - (byte*) screen#1 ← phi( @2/(byte*) screen#3 ) (byte*) main::hello#0 ← (const string) main::$4 - (byte*) main::print1_at#0 ← (byte*) screen#1 + (byte*) main::print1_at#0 ← (byte*) screen#0 (byte*) main::print1_msg#0 ← (byte*) main::hello#0 to:main::print1 main::print1: scope:[main] from main - (byte*) main::hello#3 ← phi( main/(byte*) main::hello#0 ) - (byte*) screen#5 ← phi( main/(byte*) screen#1 ) (byte*) main::print1_at#2 ← phi( main/(byte*) main::print1_at#0 ) (byte*) main::print1_msg#2 ← phi( main/(byte*) main::print1_msg#0 ) (byte) main::print1_j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::print1_i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::print1_@1 main::print1_@1: scope:[main] from main::print1 main::print1_@1 - (byte*) main::hello#2 ← phi( main::print1/(byte*) main::hello#3 main::print1_@1/(byte*) main::hello#2 ) - (byte*) screen#4 ← phi( main::print1/(byte*) screen#5 main::print1_@1/(byte*) screen#4 ) (byte) main::print1_j#2 ← phi( main::print1/(byte) main::print1_j#0 main::print1_@1/(byte) main::print1_j#1 ) (byte*) main::print1_at#1 ← phi( main::print1/(byte*) main::print1_at#2 main::print1_@1/(byte*) main::print1_at#1 ) (byte) main::print1_i#2 ← phi( main::print1/(byte) main::print1_i#0 main::print1_@1/(byte) main::print1_i#1 ) @@ -33,12 +30,10 @@ main::print1_@1: scope:[main] from main::print1 main::print1_@1 if((bool) main::print1_$0#0) goto main::print1_@1 to:main::@1 main::@1: scope:[main] from main::print1_@1 - (byte*) main::hello#1 ← phi( main::print1_@1/(byte*) main::hello#2 ) - (byte*) screen#2 ← phi( main::print1_@1/(byte*) screen#4 ) (byte/signed byte/word/signed word/dword/signed dword~) main::$1 ← (byte/signed byte/word/signed word/dword/signed dword) 2 * (byte/signed byte/word/signed word/dword/signed dword) $28 - (byte*~) main::$2 ← (byte*) screen#2 + (byte/signed byte/word/signed word/dword/signed dword~) main::$1 + (byte*~) main::$2 ← (byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword~) main::$1 (byte*) main::print2_at#0 ← (byte*~) main::$2 - (byte*) main::print2_msg#0 ← (byte*) main::hello#1 + (byte*) main::print2_msg#0 ← (byte*) main::hello#0 to:main::print2 main::print2: scope:[main] from main::@1 (byte*) main::print2_at#2 ← phi( main::@1/(byte*) main::print2_at#0 ) @@ -61,7 +56,6 @@ main::@return: scope:[main] from main::print2_@1 return to:@return @2: scope:[] from @begin - (byte*) screen#3 ← phi( @begin/(byte*) screen#0 ) call main to:@3 @3: scope:[] from @2 @@ -81,9 +75,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::hello (byte*) main::hello#0 -(byte*) main::hello#1 -(byte*) main::hello#2 -(byte*) main::hello#3 (label) main::print1 (bool~) main::print1_$0 (bool) main::print1_$0#0 @@ -126,42 +117,28 @@ SYMBOL TABLE SSA (byte*) main::print2_msg#2 (byte*) screen (byte*) screen#0 -(byte*) screen#1 -(byte*) screen#2 -(byte*) screen#3 -(byte*) screen#4 -(byte*) screen#5 Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) main::print1_msg#0 = (byte*) main::hello#0 (byte*) main::print1_msg#2 (byte*) main::hello#3 +Alias (byte*) main::hello#0 = (byte*) main::print1_msg#0 (byte*) main::print1_msg#2 (byte*) main::print2_msg#0 (byte*) main::print2_msg#2 Alias (byte*) main::print1_at#0 = (byte*) main::print1_at#2 -Alias (byte*) screen#1 = (byte*) screen#5 -Alias (byte*) screen#2 = (byte*) screen#4 -Alias (byte*) main::hello#1 = (byte*) main::hello#2 (byte*) main::print2_msg#0 (byte*) main::print2_msg#2 Alias (byte*) main::print2_at#0 = (byte*~) main::$2 (byte*) main::print2_at#2 -Alias (byte*) screen#0 = (byte*) screen#3 Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (byte*) main::print1_msg#1 Self Phi Eliminated (byte*) main::print1_at#1 -Self Phi Eliminated (byte*) screen#2 -Self Phi Eliminated (byte*) main::hello#1 Self Phi Eliminated (byte*) main::print2_msg#1 Self Phi Eliminated (byte*) main::print2_at#1 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) screen#1 (byte*) screen#0 -Redundant Phi (byte*) main::print1_msg#1 (byte*) main::print1_msg#0 +Redundant Phi (byte*) main::print1_msg#1 (byte*) main::hello#0 Redundant Phi (byte*) main::print1_at#1 (byte*) main::print1_at#0 -Redundant Phi (byte*) screen#2 (byte*) screen#1 -Redundant Phi (byte*) main::hello#1 (byte*) main::print1_msg#0 -Redundant Phi (byte*) main::print2_msg#1 (byte*) main::hello#1 +Redundant Phi (byte*) main::print2_msg#1 (byte*) main::hello#0 Redundant Phi (byte*) main::print2_at#1 (byte*) main::print2_at#0 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool) main::print1_$0#0 [13] if(*((byte*) main::print1_msg#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 -Simple Condition (bool) main::print2_$0#0 [27] if(*((byte*) main::print1_msg#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 +Simple Condition (bool) main::print1_$0#0 [12] if(*((byte*) main::hello#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 +Simple Condition (bool) main::print2_$0#0 [25] if(*((byte*) main::hello#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) screen#0 = ((byte*))$400 -Constant (const byte*) main::print1_msg#0 = main::$4 +Constant (const byte*) main::hello#0 = main::$4 Constant (const byte) main::print1_j#0 = 0 Constant (const byte) main::print1_i#0 = 0 Constant (const byte/signed byte/word/signed word/dword/signed dword) main::$1 = 2*$28 @@ -181,7 +158,7 @@ Constant inlined main::print2_j#0 = (byte/signed byte/word/signed word/dword/sig Constant inlined main::print1_at#0 = (const byte*) screen#0 Constant inlined main::print2_i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined main::$1 = (byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) $28 -Constant inlined main::$4 = (const byte*) main::print1_msg#0 +Constant inlined main::$4 = (const byte*) main::hello#0 Constant inlined main::print1_i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined main::print1_j#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Successful SSA optimization Pass2ConstantInlining @@ -230,10 +207,10 @@ main::print1: scope:[main] from main main::print1_@1: scope:[main] from main::print1 main::print1_@1 [6] (byte) main::print1_j#2 ← phi( main::print1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print1_@1/(byte) main::print1_j#1 ) [6] (byte) main::print1_i#2 ← phi( main::print1/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print1_@1/(byte) main::print1_i#1 ) - [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print1_i#2) + [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) [8] (byte) main::print1_j#1 ← (byte) main::print1_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [9] (byte) main::print1_i#1 ← ++ (byte) main::print1_i#2 - [10] if(*((const byte*) main::print1_msg#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 + [10] if(*((const byte*) main::hello#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 to:main::print2 main::print2: scope:[main] from main::print1_@1 [11] phi() @@ -241,10 +218,10 @@ main::print2: scope:[main] from main::print1_@1 main::print2_@1: scope:[main] from main::print2 main::print2_@1 [12] (byte) main::print2_j#2 ← phi( main::print2/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print2_@1/(byte) main::print2_j#1 ) [12] (byte) main::print2_i#2 ← phi( main::print2/(byte/signed byte/word/signed word/dword/signed dword) 0 main::print2_@1/(byte) main::print2_i#1 ) - [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print2_i#2) + [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) [14] (byte) main::print2_j#1 ← (byte) main::print2_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 [15] (byte) main::print2_i#1 ← ++ (byte) main::print2_i#2 - [16] if(*((const byte*) main::print1_msg#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 + [16] if(*((const byte*) main::hello#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 to:main::@return main::@return: scope:[main] from main::print2_@1 [17] return @@ -342,9 +319,9 @@ main: { jmp print1_b1 //SEG19 main::print1_@1 print1_b1: - //SEG20 [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print1_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 + //SEG20 [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 ldy print1_i - lda print1_msg,y + lda hello,y ldy print1_j sta screen,y //SEG21 [8] (byte) main::print1_j#1 ← (byte) main::print1_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuz1=vbuz1_plus_2 @@ -354,9 +331,9 @@ main: { sta print1_j //SEG22 [9] (byte) main::print1_i#1 ← ++ (byte) main::print1_i#2 -- vbuz1=_inc_vbuz1 inc print1_i - //SEG23 [10] if(*((const byte*) main::print1_msg#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 -- pbuc1_derefidx_vbuz1_neq_vbuc2_then_la1 + //SEG23 [10] if(*((const byte*) main::hello#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 -- pbuc1_derefidx_vbuz1_neq_vbuc2_then_la1 ldy print1_i - lda print1_msg,y + lda hello,y cmp #'@' bne print1_b1_from_print1_b1 //SEG24 [11] phi from main::print1_@1 to main::print2 [phi:main::print1_@1->main::print2] @@ -380,9 +357,9 @@ main: { jmp print2_b1 //SEG32 main::print2_@1 print2_b1: - //SEG33 [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print2_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 + //SEG33 [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 ldy print2_i - lda print1_msg,y + lda hello,y ldy print2_j sta print2_at,y //SEG34 [14] (byte) main::print2_j#1 ← (byte) main::print2_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuz1=vbuz1_plus_2 @@ -392,9 +369,9 @@ main: { sta print2_j //SEG35 [15] (byte) main::print2_i#1 ← ++ (byte) main::print2_i#2 -- vbuz1=_inc_vbuz1 inc print2_i - //SEG36 [16] if(*((const byte*) main::print1_msg#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 -- pbuc1_derefidx_vbuz1_neq_vbuc2_then_la1 + //SEG36 [16] if(*((const byte*) main::hello#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 -- pbuc1_derefidx_vbuz1_neq_vbuc2_then_la1 ldy print2_i - lda print1_msg,y + lda hello,y cmp #'@' bne print2_b1_from_print2_b1 jmp breturn @@ -402,22 +379,22 @@ main: { breturn: //SEG38 [17] return rts - print1_msg: .text "hello world!@" + hello: .text "hello world!@" } REGISTER UPLIFT POTENTIAL REGISTERS -Statement [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print1_i#2) [ main::print1_i#2 main::print1_j#2 ] ( main:2 [ main::print1_i#2 main::print1_j#2 ] ) always clobbers reg byte a +Statement [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) [ main::print1_i#2 main::print1_j#2 ] ( main:2 [ main::print1_i#2 main::print1_j#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:2 [ main::print1_i#2 main::print1_i#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ main::print1_j#2 main::print1_j#1 ] -Statement [10] if(*((const byte*) main::print1_msg#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 [ main::print1_i#1 main::print1_j#1 ] ( main:2 [ main::print1_i#1 main::print1_j#1 ] ) always clobbers reg byte a -Statement [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print2_i#2) [ main::print2_i#2 main::print2_j#2 ] ( main:2 [ main::print2_i#2 main::print2_j#2 ] ) always clobbers reg byte a +Statement [10] if(*((const byte*) main::hello#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 [ main::print1_i#1 main::print1_j#1 ] ( main:2 [ main::print1_i#1 main::print1_j#1 ] ) always clobbers reg byte a +Statement [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) [ main::print2_i#2 main::print2_j#2 ] ( main:2 [ main::print2_i#2 main::print2_j#2 ] ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ main::print2_i#2 main::print2_i#1 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ main::print2_j#2 main::print2_j#1 ] -Statement [16] if(*((const byte*) main::print1_msg#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 [ main::print2_i#1 main::print2_j#1 ] ( main:2 [ main::print2_i#1 main::print2_j#1 ] ) always clobbers reg byte a -Statement [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print1_i#2) [ main::print1_i#2 main::print1_j#2 ] ( main:2 [ main::print1_i#2 main::print1_j#2 ] ) always clobbers reg byte a -Statement [10] if(*((const byte*) main::print1_msg#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 [ main::print1_i#1 main::print1_j#1 ] ( main:2 [ main::print1_i#1 main::print1_j#1 ] ) always clobbers reg byte a -Statement [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print2_i#2) [ main::print2_i#2 main::print2_j#2 ] ( main:2 [ main::print2_i#2 main::print2_j#2 ] ) always clobbers reg byte a -Statement [16] if(*((const byte*) main::print1_msg#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 [ main::print2_i#1 main::print2_j#1 ] ( main:2 [ main::print2_i#1 main::print2_j#1 ] ) always clobbers reg byte a +Statement [16] if(*((const byte*) main::hello#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 [ main::print2_i#1 main::print2_j#1 ] ( main:2 [ main::print2_i#1 main::print2_j#1 ] ) always clobbers reg byte a +Statement [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) [ main::print1_i#2 main::print1_j#2 ] ( main:2 [ main::print1_i#2 main::print1_j#2 ] ) always clobbers reg byte a +Statement [10] if(*((const byte*) main::hello#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 [ main::print1_i#1 main::print1_j#1 ] ( main:2 [ main::print1_i#1 main::print1_j#1 ] ) always clobbers reg byte a +Statement [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) [ main::print2_i#2 main::print2_j#2 ] ( main:2 [ main::print2_i#2 main::print2_j#2 ] ) always clobbers reg byte a +Statement [16] if(*((const byte*) main::hello#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 [ main::print2_i#1 main::print2_j#1 ] ( main:2 [ main::print2_i#1 main::print2_j#1 ] ) always clobbers reg byte a Potential registers zp ZP_BYTE:2 [ main::print1_i#2 main::print1_i#1 ] : zp ZP_BYTE:2 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:3 [ main::print1_j#2 main::print1_j#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:4 [ main::print2_i#2 main::print2_i#1 ] : zp ZP_BYTE:4 , reg byte x , reg byte y , @@ -477,16 +454,16 @@ main: { jmp print1_b1 //SEG19 main::print1_@1 print1_b1: - //SEG20 [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print1_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy - lda print1_msg,y + //SEG20 [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + lda hello,y sta screen,x //SEG21 [8] (byte) main::print1_j#1 ← (byte) main::print1_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuxx=vbuxx_plus_2 inx inx //SEG22 [9] (byte) main::print1_i#1 ← ++ (byte) main::print1_i#2 -- vbuyy=_inc_vbuyy iny - //SEG23 [10] if(*((const byte*) main::print1_msg#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 - lda print1_msg,y + //SEG23 [10] if(*((const byte*) main::hello#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 + lda hello,y cmp #'@' bne print1_b1_from_print1_b1 //SEG24 [11] phi from main::print1_@1 to main::print2 [phi:main::print1_@1->main::print2] @@ -508,16 +485,16 @@ main: { jmp print2_b1 //SEG32 main::print2_@1 print2_b1: - //SEG33 [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print2_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy - lda print1_msg,y + //SEG33 [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + lda hello,y sta print2_at,x //SEG34 [14] (byte) main::print2_j#1 ← (byte) main::print2_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuxx=vbuxx_plus_2 inx inx //SEG35 [15] (byte) main::print2_i#1 ← ++ (byte) main::print2_i#2 -- vbuyy=_inc_vbuyy iny - //SEG36 [16] if(*((const byte*) main::print1_msg#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 - lda print1_msg,y + //SEG36 [16] if(*((const byte*) main::hello#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 + lda hello,y cmp #'@' bne print2_b1_from_print2_b1 jmp breturn @@ -525,7 +502,7 @@ main: { breturn: //SEG38 [17] return rts - print1_msg: .text "hello world!@" + hello: .text "hello world!@" } ASSEMBLER OPTIMIZATIONS @@ -571,6 +548,7 @@ FINAL SYMBOL TABLE (void()) main() (label) main::@return (byte*) main::hello +(const byte*) main::hello#0 hello = (string) "hello world!@" (label) main::print1 (bool~) main::print1_$0 (label) main::print1_@1 @@ -582,7 +560,6 @@ FINAL SYMBOL TABLE (byte) main::print1_j#1 reg byte x 7.333333333333333 (byte) main::print1_j#2 reg byte x 16.5 (byte*) main::print1_msg -(const byte*) main::print1_msg#0 print1_msg = (string) "hello world!@" (label) main::print2 (bool~) main::print2_$0 (label) main::print2_@1 @@ -637,16 +614,16 @@ main: { //SEG18 [6] phi (byte) main::print1_i#2 = (byte) main::print1_i#1 [phi:main::print1_@1->main::print1_@1#1] -- register_copy //SEG19 main::print1_@1 print1_b1: - //SEG20 [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print1_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy - lda print1_msg,y + //SEG20 [7] *((const byte*) screen#0 + (byte) main::print1_j#2) ← *((const byte*) main::hello#0 + (byte) main::print1_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + lda hello,y sta screen,x //SEG21 [8] (byte) main::print1_j#1 ← (byte) main::print1_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuxx=vbuxx_plus_2 inx inx //SEG22 [9] (byte) main::print1_i#1 ← ++ (byte) main::print1_i#2 -- vbuyy=_inc_vbuyy iny - //SEG23 [10] if(*((const byte*) main::print1_msg#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 - lda print1_msg,y + //SEG23 [10] if(*((const byte*) main::hello#0 + (byte) main::print1_i#1)!=(byte) '@') goto main::print1_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 + lda hello,y cmp #'@' bne print1_b1 //SEG24 [11] phi from main::print1_@1 to main::print2 [phi:main::print1_@1->main::print2] @@ -661,21 +638,21 @@ main: { //SEG31 [12] phi (byte) main::print2_i#2 = (byte) main::print2_i#1 [phi:main::print2_@1->main::print2_@1#1] -- register_copy //SEG32 main::print2_@1 print2_b1: - //SEG33 [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::print1_msg#0 + (byte) main::print2_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy - lda print1_msg,y + //SEG33 [13] *((const byte*) main::print2_at#0 + (byte) main::print2_j#2) ← *((const byte*) main::hello#0 + (byte) main::print2_i#2) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuyy + lda hello,y sta print2_at,x //SEG34 [14] (byte) main::print2_j#1 ← (byte) main::print2_j#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuxx=vbuxx_plus_2 inx inx //SEG35 [15] (byte) main::print2_i#1 ← ++ (byte) main::print2_i#2 -- vbuyy=_inc_vbuyy iny - //SEG36 [16] if(*((const byte*) main::print1_msg#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 - lda print1_msg,y + //SEG36 [16] if(*((const byte*) main::hello#0 + (byte) main::print2_i#1)!=(byte) '@') goto main::print2_@1 -- pbuc1_derefidx_vbuyy_neq_vbuc2_then_la1 + lda hello,y cmp #'@' bne print2_b1 //SEG37 main::@return //SEG38 [17] return rts - print1_msg: .text "hello world!@" + hello: .text "hello world!@" } diff --git a/src/test/ref/inline-function-print.sym b/src/test/ref/inline-function-print.sym index 5621c0d7f..98fa2fca4 100644 --- a/src/test/ref/inline-function-print.sym +++ b/src/test/ref/inline-function-print.sym @@ -4,6 +4,7 @@ (void()) main() (label) main::@return (byte*) main::hello +(const byte*) main::hello#0 hello = (string) "hello world!@" (label) main::print1 (bool~) main::print1_$0 (label) main::print1_@1 @@ -15,7 +16,6 @@ (byte) main::print1_j#1 reg byte x 7.333333333333333 (byte) main::print1_j#2 reg byte x 16.5 (byte*) main::print1_msg -(const byte*) main::print1_msg#0 print1_msg = (string) "hello world!@" (label) main::print2 (bool~) main::print2_$0 (label) main::print2_@1 diff --git a/src/test/ref/inline-function.log b/src/test/ref/inline-function.log index b66bfcf9d..a6861066d 100644 --- a/src/test/ref/inline-function.log +++ b/src/test/ref/inline-function.log @@ -1,3 +1,9 @@ +Identified constant variable (byte*) RASTER +Identified constant variable (byte*) D018 +Identified constant variable (byte*) BGCOL +Identified constant variable (byte*) screen +Identified constant variable (byte*) charset1 +Identified constant variable (byte*) charset2 Inlined call (byte~) main::$1 ← call toD018 (byte*) screen (byte*) charset1 Inlined call (byte~) main::$3 ← call toD018 (byte*) screen (byte*) charset2 @@ -11,66 +17,24 @@ CONTROL FLOW GRAPH SSA (byte*) charset2#0 ← ((byte*)) (word/signed word/dword/signed dword) $1800 to:@2 main: scope:[main] from @2 - (byte*) charset2#12 ← phi( @2/(byte*) charset2#14 ) - (byte*) BGCOL#15 ← phi( @2/(byte*) BGCOL#16 ) - (byte*) D018#15 ← phi( @2/(byte*) D018#16 ) - (byte*) charset1#6 ← phi( @2/(byte*) charset1#8 ) - (byte*) screen#11 ← phi( @2/(byte*) screen#14 ) - (byte*) RASTER#9 ← phi( @2/(byte*) RASTER#12 ) asm { sei } to:main::@1 main::@1: scope:[main] from main main::@20 - (byte*) charset2#11 ← phi( main/(byte*) charset2#12 main::@20/(byte*) charset2#13 ) - (byte*) BGCOL#14 ← phi( main/(byte*) BGCOL#15 main::@20/(byte*) BGCOL#2 ) - (byte*) D018#14 ← phi( main/(byte*) D018#15 main::@20/(byte*) D018#2 ) - (byte*) charset1#5 ← phi( main/(byte*) charset1#6 main::@20/(byte*) charset1#7 ) - (byte*) screen#9 ← phi( main/(byte*) screen#11 main::@20/(byte*) screen#12 ) - (byte*) RASTER#7 ← phi( main/(byte*) RASTER#9 main::@20/(byte*) RASTER#10 ) if(true) goto main::@2 to:main::@return main::@2: scope:[main] from main::@1 - (byte*) charset2#9 ← phi( main::@1/(byte*) charset2#11 ) - (byte*) BGCOL#11 ← phi( main::@1/(byte*) BGCOL#14 ) - (byte*) D018#11 ← phi( main::@1/(byte*) D018#14 ) - (byte*) charset1#3 ← phi( main::@1/(byte*) charset1#5 ) - (byte*) screen#5 ← phi( main::@1/(byte*) screen#9 ) - (byte*) RASTER#3 ← phi( main::@1/(byte*) RASTER#7 ) to:main::@4 main::@4: scope:[main] from main::@2 main::@5 - (byte*) charset2#8 ← phi( main::@2/(byte*) charset2#9 main::@5/(byte*) charset2#10 ) - (byte*) BGCOL#9 ← phi( main::@2/(byte*) BGCOL#11 main::@5/(byte*) BGCOL#12 ) - (byte*) D018#9 ← phi( main::@2/(byte*) D018#11 main::@5/(byte*) D018#12 ) - (byte*) charset1#2 ← phi( main::@2/(byte*) charset1#3 main::@5/(byte*) charset1#4 ) - (byte*) screen#3 ← phi( main::@2/(byte*) screen#5 main::@5/(byte*) screen#6 ) - (byte*) RASTER#1 ← phi( main::@2/(byte*) RASTER#3 main::@5/(byte*) RASTER#4 ) - (bool~) main::$0 ← *((byte*) RASTER#1) != (byte/word/signed word/dword/signed dword) $ff + (bool~) main::$0 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $ff if((bool~) main::$0) goto main::@5 to:main::@6 main::@5: scope:[main] from main::@4 - (byte*) charset2#10 ← phi( main::@4/(byte*) charset2#8 ) - (byte*) BGCOL#12 ← phi( main::@4/(byte*) BGCOL#9 ) - (byte*) D018#12 ← phi( main::@4/(byte*) D018#9 ) - (byte*) charset1#4 ← phi( main::@4/(byte*) charset1#2 ) - (byte*) screen#6 ← phi( main::@4/(byte*) screen#3 ) - (byte*) RASTER#4 ← phi( main::@4/(byte*) RASTER#1 ) to:main::@4 main::@6: scope:[main] from main::@4 - (byte*) charset2#7 ← phi( main::@4/(byte*) charset2#8 ) - (byte*) RASTER#13 ← phi( main::@4/(byte*) RASTER#1 ) - (byte*) BGCOL#7 ← phi( main::@4/(byte*) BGCOL#9 ) - (byte*) D018#7 ← phi( main::@4/(byte*) D018#9 ) - (byte*) charset1#1 ← phi( main::@4/(byte*) charset1#2 ) - (byte*) screen#1 ← phi( main::@4/(byte*) screen#3 ) - (byte*) main::toD0181_screen#0 ← (byte*) screen#1 - (byte*) main::toD0181_charset#0 ← (byte*) charset1#1 + (byte*) main::toD0181_screen#0 ← (byte*) screen#0 + (byte*) main::toD0181_charset#0 ← (byte*) charset1#0 to:main::toD0181 main::toD0181: scope:[main] from main::@6 - (byte*) charset1#16 ← phi( main::@6/(byte*) charset1#1 ) - (byte*) charset2#6 ← phi( main::@6/(byte*) charset2#7 ) - (byte*) screen#13 ← phi( main::@6/(byte*) screen#1 ) - (byte*) RASTER#11 ← phi( main::@6/(byte*) RASTER#13 ) - (byte*) BGCOL#5 ← phi( main::@6/(byte*) BGCOL#7 ) - (byte*) D018#5 ← phi( main::@6/(byte*) D018#7 ) (byte*) main::toD0181_charset#1 ← phi( main::@6/(byte*) main::toD0181_charset#0 ) (byte*) main::toD0181_screen#1 ← phi( main::@6/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 @@ -82,62 +46,26 @@ main::toD0181: scope:[main] from main::@6 (byte) main::toD0181_return#0 ← (byte) main::toD0181_$5#0 to:main::toD0181_@return main::toD0181_@return: scope:[main] from main::toD0181 - (byte*) charset1#15 ← phi( main::toD0181/(byte*) charset1#16 ) - (byte*) charset2#5 ← phi( main::toD0181/(byte*) charset2#6 ) - (byte*) screen#10 ← phi( main::toD0181/(byte*) screen#13 ) - (byte*) RASTER#8 ← phi( main::toD0181/(byte*) RASTER#11 ) - (byte*) BGCOL#3 ← phi( main::toD0181/(byte*) BGCOL#5 ) - (byte*) D018#3 ← phi( main::toD0181/(byte*) D018#5 ) (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 ) (byte) main::toD0181_return#1 ← (byte) main::toD0181_return#2 to:main::@19 main::@19: scope:[main] from main::toD0181_@return - (byte*) charset1#13 ← phi( main::toD0181_@return/(byte*) charset1#15 ) - (byte*) charset2#3 ← phi( main::toD0181_@return/(byte*) charset2#5 ) - (byte*) screen#7 ← phi( main::toD0181_@return/(byte*) screen#10 ) - (byte*) RASTER#5 ← phi( main::toD0181_@return/(byte*) RASTER#8 ) - (byte*) BGCOL#1 ← phi( main::toD0181_@return/(byte*) BGCOL#3 ) - (byte*) D018#1 ← phi( main::toD0181_@return/(byte*) D018#3 ) (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) (byte~) main::$1 ← (byte) main::toD0181_return#3 - *((byte*) D018#1) ← (byte~) main::$1 - *((byte*) BGCOL#1) ← (byte/signed byte/word/signed word/dword/signed dword) 6 + *((byte*) D018#0) ← (byte~) main::$1 + *((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 6 to:main::@7 main::@7: scope:[main] from main::@19 main::@8 - (byte*) charset1#12 ← phi( main::@19/(byte*) charset1#13 main::@8/(byte*) charset1#14 ) - (byte*) BGCOL#10 ← phi( main::@19/(byte*) BGCOL#1 main::@8/(byte*) BGCOL#13 ) - (byte*) D018#10 ← phi( main::@19/(byte*) D018#1 main::@8/(byte*) D018#13 ) - (byte*) charset2#2 ← phi( main::@19/(byte*) charset2#3 main::@8/(byte*) charset2#4 ) - (byte*) screen#4 ← phi( main::@19/(byte*) screen#7 main::@8/(byte*) screen#8 ) - (byte*) RASTER#2 ← phi( main::@19/(byte*) RASTER#5 main::@8/(byte*) RASTER#6 ) - (bool~) main::$2 ← *((byte*) RASTER#2) != (byte/signed byte/word/signed word/dword/signed dword) $62 + (bool~) main::$2 ← *((byte*) RASTER#0) != (byte/signed byte/word/signed word/dword/signed dword) $62 if((bool~) main::$2) goto main::@8 to:main::@9 main::@8: scope:[main] from main::@7 - (byte*) charset1#14 ← phi( main::@7/(byte*) charset1#12 ) - (byte*) BGCOL#13 ← phi( main::@7/(byte*) BGCOL#10 ) - (byte*) D018#13 ← phi( main::@7/(byte*) D018#10 ) - (byte*) charset2#4 ← phi( main::@7/(byte*) charset2#2 ) - (byte*) screen#8 ← phi( main::@7/(byte*) screen#4 ) - (byte*) RASTER#6 ← phi( main::@7/(byte*) RASTER#2 ) to:main::@7 main::@9: scope:[main] from main::@7 - (byte*) charset1#11 ← phi( main::@7/(byte*) charset1#12 ) - (byte*) RASTER#16 ← phi( main::@7/(byte*) RASTER#2 ) - (byte*) BGCOL#8 ← phi( main::@7/(byte*) BGCOL#10 ) - (byte*) D018#8 ← phi( main::@7/(byte*) D018#10 ) - (byte*) charset2#1 ← phi( main::@7/(byte*) charset2#2 ) - (byte*) screen#2 ← phi( main::@7/(byte*) screen#4 ) - (byte*) main::toD0182_screen#0 ← (byte*) screen#2 - (byte*) main::toD0182_charset#0 ← (byte*) charset2#1 + (byte*) main::toD0182_screen#0 ← (byte*) screen#0 + (byte*) main::toD0182_charset#0 ← (byte*) charset2#0 to:main::toD0182 main::toD0182: scope:[main] from main::@9 - (byte*) charset2#16 ← phi( main::@9/(byte*) charset2#1 ) - (byte*) charset1#10 ← phi( main::@9/(byte*) charset1#11 ) - (byte*) screen#16 ← phi( main::@9/(byte*) screen#2 ) - (byte*) RASTER#15 ← phi( main::@9/(byte*) RASTER#16 ) - (byte*) BGCOL#6 ← phi( main::@9/(byte*) BGCOL#8 ) - (byte*) D018#6 ← phi( main::@9/(byte*) D018#8 ) (byte*) main::toD0182_charset#1 ← phi( main::@9/(byte*) main::toD0182_charset#0 ) (byte*) main::toD0182_screen#1 ← phi( main::@9/(byte*) main::toD0182_screen#0 ) (word) main::toD0182_$0#0 ← ((word)) (byte*) main::toD0182_screen#1 @@ -149,37 +77,19 @@ main::toD0182: scope:[main] from main::@9 (byte) main::toD0182_return#0 ← (byte) main::toD0182_$5#0 to:main::toD0182_@return main::toD0182_@return: scope:[main] from main::toD0182 - (byte*) charset2#15 ← phi( main::toD0182/(byte*) charset2#16 ) - (byte*) charset1#9 ← phi( main::toD0182/(byte*) charset1#10 ) - (byte*) screen#15 ← phi( main::toD0182/(byte*) screen#16 ) - (byte*) RASTER#14 ← phi( main::toD0182/(byte*) RASTER#15 ) - (byte*) BGCOL#4 ← phi( main::toD0182/(byte*) BGCOL#6 ) - (byte*) D018#4 ← phi( main::toD0182/(byte*) D018#6 ) (byte) main::toD0182_return#2 ← phi( main::toD0182/(byte) main::toD0182_return#0 ) (byte) main::toD0182_return#1 ← (byte) main::toD0182_return#2 to:main::@20 main::@20: scope:[main] from main::toD0182_@return - (byte*) charset2#13 ← phi( main::toD0182_@return/(byte*) charset2#15 ) - (byte*) charset1#7 ← phi( main::toD0182_@return/(byte*) charset1#9 ) - (byte*) screen#12 ← phi( main::toD0182_@return/(byte*) screen#15 ) - (byte*) RASTER#10 ← phi( main::toD0182_@return/(byte*) RASTER#14 ) - (byte*) BGCOL#2 ← phi( main::toD0182_@return/(byte*) BGCOL#4 ) - (byte*) D018#2 ← phi( main::toD0182_@return/(byte*) D018#4 ) (byte) main::toD0182_return#3 ← phi( main::toD0182_@return/(byte) main::toD0182_return#1 ) (byte~) main::$3 ← (byte) main::toD0182_return#3 - *((byte*) D018#2) ← (byte~) main::$3 - *((byte*) BGCOL#2) ← (byte/signed byte/word/signed word/dword/signed dword) $b + *((byte*) D018#0) ← (byte~) main::$3 + *((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) $b to:main::@1 main::@return: scope:[main] from main::@1 return to:@return @2: scope:[] from @begin - (byte*) charset2#14 ← phi( @begin/(byte*) charset2#0 ) - (byte*) BGCOL#16 ← phi( @begin/(byte*) BGCOL#0 ) - (byte*) D018#16 ← phi( @begin/(byte*) D018#0 ) - (byte*) charset1#8 ← phi( @begin/(byte*) charset1#0 ) - (byte*) screen#14 ← phi( @begin/(byte*) screen#0 ) - (byte*) RASTER#12 ← phi( @begin/(byte*) RASTER#0 ) call main to:@3 @3: scope:[] from @2 @@ -193,94 +103,14 @@ SYMBOL TABLE SSA (label) @end (byte*) BGCOL (byte*) BGCOL#0 -(byte*) BGCOL#1 -(byte*) BGCOL#10 -(byte*) BGCOL#11 -(byte*) BGCOL#12 -(byte*) BGCOL#13 -(byte*) BGCOL#14 -(byte*) BGCOL#15 -(byte*) BGCOL#16 -(byte*) BGCOL#2 -(byte*) BGCOL#3 -(byte*) BGCOL#4 -(byte*) BGCOL#5 -(byte*) BGCOL#6 -(byte*) BGCOL#7 -(byte*) BGCOL#8 -(byte*) BGCOL#9 (byte*) D018 (byte*) D018#0 -(byte*) D018#1 -(byte*) D018#10 -(byte*) D018#11 -(byte*) D018#12 -(byte*) D018#13 -(byte*) D018#14 -(byte*) D018#15 -(byte*) D018#16 -(byte*) D018#2 -(byte*) D018#3 -(byte*) D018#4 -(byte*) D018#5 -(byte*) D018#6 -(byte*) D018#7 -(byte*) D018#8 -(byte*) D018#9 (byte*) RASTER (byte*) RASTER#0 -(byte*) RASTER#1 -(byte*) RASTER#10 -(byte*) RASTER#11 -(byte*) RASTER#12 -(byte*) RASTER#13 -(byte*) RASTER#14 -(byte*) RASTER#15 -(byte*) RASTER#16 -(byte*) RASTER#2 -(byte*) RASTER#3 -(byte*) RASTER#4 -(byte*) RASTER#5 -(byte*) RASTER#6 -(byte*) RASTER#7 -(byte*) RASTER#8 -(byte*) RASTER#9 (byte*) charset1 (byte*) charset1#0 -(byte*) charset1#1 -(byte*) charset1#10 -(byte*) charset1#11 -(byte*) charset1#12 -(byte*) charset1#13 -(byte*) charset1#14 -(byte*) charset1#15 -(byte*) charset1#16 -(byte*) charset1#2 -(byte*) charset1#3 -(byte*) charset1#4 -(byte*) charset1#5 -(byte*) charset1#6 -(byte*) charset1#7 -(byte*) charset1#8 -(byte*) charset1#9 (byte*) charset2 (byte*) charset2#0 -(byte*) charset2#1 -(byte*) charset2#10 -(byte*) charset2#11 -(byte*) charset2#12 -(byte*) charset2#13 -(byte*) charset2#14 -(byte*) charset2#15 -(byte*) charset2#16 -(byte*) charset2#2 -(byte*) charset2#3 -(byte*) charset2#4 -(byte*) charset2#5 -(byte*) charset2#6 -(byte*) charset2#7 -(byte*) charset2#8 -(byte*) charset2#9 (void()) main() (bool~) main::$0 (byte~) main::$1 @@ -349,90 +179,21 @@ SYMBOL TABLE SSA (byte*) main::toD0182_screen#1 (byte*) screen (byte*) screen#0 -(byte*) screen#1 -(byte*) screen#10 -(byte*) screen#11 -(byte*) screen#12 -(byte*) screen#13 -(byte*) screen#14 -(byte*) screen#15 -(byte*) screen#16 -(byte*) screen#2 -(byte*) screen#3 -(byte*) screen#4 -(byte*) screen#5 -(byte*) screen#6 -(byte*) screen#7 -(byte*) screen#8 -(byte*) screen#9 +Culled Empty Block (label) main::@2 +Culled Empty Block (label) main::@5 +Culled Empty Block (label) main::@8 Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) RASTER#3 = (byte*) RASTER#7 -Alias (byte*) screen#5 = (byte*) screen#9 -Alias (byte*) charset1#3 = (byte*) charset1#5 -Alias (byte*) D018#11 = (byte*) D018#14 -Alias (byte*) BGCOL#11 = (byte*) BGCOL#14 -Alias (byte*) charset2#11 = (byte*) charset2#9 -Alias (byte*) RASTER#1 = (byte*) RASTER#4 (byte*) RASTER#13 (byte*) RASTER#11 (byte*) RASTER#8 (byte*) RASTER#5 -Alias (byte*) screen#1 = (byte*) screen#6 (byte*) screen#3 (byte*) screen#13 (byte*) screen#10 (byte*) screen#7 -Alias (byte*) charset1#1 = (byte*) charset1#4 (byte*) charset1#2 (byte*) charset1#16 (byte*) charset1#15 (byte*) charset1#13 -Alias (byte*) D018#1 = (byte*) D018#12 (byte*) D018#9 (byte*) D018#7 (byte*) D018#5 (byte*) D018#3 -Alias (byte*) BGCOL#1 = (byte*) BGCOL#12 (byte*) BGCOL#9 (byte*) BGCOL#7 (byte*) BGCOL#5 (byte*) BGCOL#3 -Alias (byte*) charset2#10 = (byte*) charset2#8 (byte*) charset2#7 (byte*) charset2#6 (byte*) charset2#5 (byte*) charset2#3 Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_charset#0 = (byte*) main::toD0181_charset#1 Alias (byte) main::toD0181_return#0 = (byte) main::toD0181_$5#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$1 -Alias (byte*) RASTER#10 = (byte*) RASTER#6 (byte*) RASTER#2 (byte*) RASTER#16 (byte*) RASTER#15 (byte*) RASTER#14 -Alias (byte*) screen#12 = (byte*) screen#8 (byte*) screen#4 (byte*) screen#2 (byte*) screen#16 (byte*) screen#15 -Alias (byte*) charset2#1 = (byte*) charset2#4 (byte*) charset2#2 (byte*) charset2#16 (byte*) charset2#15 (byte*) charset2#13 -Alias (byte*) D018#10 = (byte*) D018#13 (byte*) D018#8 (byte*) D018#6 (byte*) D018#4 (byte*) D018#2 -Alias (byte*) BGCOL#10 = (byte*) BGCOL#13 (byte*) BGCOL#8 (byte*) BGCOL#6 (byte*) BGCOL#4 (byte*) BGCOL#2 -Alias (byte*) charset1#10 = (byte*) charset1#14 (byte*) charset1#12 (byte*) charset1#11 (byte*) charset1#9 (byte*) charset1#7 Alias (byte*) main::toD0182_screen#0 = (byte*) main::toD0182_screen#1 Alias (byte*) main::toD0182_charset#0 = (byte*) main::toD0182_charset#1 Alias (byte) main::toD0182_return#0 = (byte) main::toD0182_$5#0 (byte) main::toD0182_return#2 (byte) main::toD0182_return#1 (byte) main::toD0182_return#3 (byte~) main::$3 -Alias (byte*) RASTER#0 = (byte*) RASTER#12 -Alias (byte*) screen#0 = (byte*) screen#14 -Alias (byte*) charset1#0 = (byte*) charset1#8 -Alias (byte*) D018#0 = (byte*) D018#16 -Alias (byte*) BGCOL#0 = (byte*) BGCOL#16 -Alias (byte*) charset2#0 = (byte*) charset2#14 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) RASTER#1 -Self Phi Eliminated (byte*) screen#1 -Self Phi Eliminated (byte*) charset1#1 -Self Phi Eliminated (byte*) D018#1 -Self Phi Eliminated (byte*) BGCOL#1 -Self Phi Eliminated (byte*) charset2#10 -Self Phi Eliminated (byte*) RASTER#10 -Self Phi Eliminated (byte*) screen#12 -Self Phi Eliminated (byte*) charset2#1 -Self Phi Eliminated (byte*) D018#10 -Self Phi Eliminated (byte*) BGCOL#10 -Self Phi Eliminated (byte*) charset1#10 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) RASTER#9 (byte*) RASTER#0 -Redundant Phi (byte*) screen#11 (byte*) screen#0 -Redundant Phi (byte*) charset1#6 (byte*) charset1#0 -Redundant Phi (byte*) D018#15 (byte*) D018#0 -Redundant Phi (byte*) BGCOL#15 (byte*) BGCOL#0 -Redundant Phi (byte*) charset2#12 (byte*) charset2#0 -Redundant Phi (byte*) RASTER#1 (byte*) RASTER#3 -Redundant Phi (byte*) screen#1 (byte*) screen#5 -Redundant Phi (byte*) charset1#1 (byte*) charset1#3 -Redundant Phi (byte*) D018#1 (byte*) D018#11 -Redundant Phi (byte*) BGCOL#1 (byte*) BGCOL#11 -Redundant Phi (byte*) charset2#10 (byte*) charset2#11 -Redundant Phi (byte*) RASTER#10 (byte*) RASTER#1 -Redundant Phi (byte*) screen#12 (byte*) screen#1 -Redundant Phi (byte*) charset2#1 (byte*) charset2#10 -Redundant Phi (byte*) D018#10 (byte*) D018#1 -Redundant Phi (byte*) BGCOL#10 (byte*) BGCOL#1 -Redundant Phi (byte*) charset1#10 (byte*) charset1#1 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$0 [13] if(*((byte*) RASTER#3)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@5 -Simple Condition (bool~) main::$2 [34] if(*((byte*) RASTER#3)!=(byte/signed byte/word/signed word/dword/signed dword) $62) goto main::@8 +Simple Condition (bool~) main::$0 [9] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@4 +Simple Condition (bool~) main::$2 [27] if(*((byte*) RASTER#0)!=(byte/signed byte/word/signed word/dword/signed dword) $62) goto main::@7 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) RASTER#0 = ((byte*))$d012 Constant (const byte*) D018#0 = ((byte*))$d018 @@ -441,44 +202,20 @@ Constant (const byte*) screen#0 = ((byte*))$400 Constant (const byte*) charset1#0 = ((byte*))$1000 Constant (const byte*) charset2#0 = ((byte*))$1800 Successful SSA optimization Pass2ConstantIdentification -if() condition always true - replacing block destination [2] if(true) goto main::@2 -Successful SSA optimization Pass2ConstantIfs -Eliminating Noop Cast (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#0 -Eliminating Noop Cast (word) main::toD0181_$2#0 ← ((word)) (byte*) main::toD0181_charset#0 -Eliminating Noop Cast (word) main::toD0182_$0#0 ← ((word)) (byte*) main::toD0182_screen#0 -Eliminating Noop Cast (word) main::toD0182_$2#0 ← ((word)) (byte*) main::toD0182_charset#0 -Successful SSA optimization Pass2NopCastElimination -Removing unused block main::@return -Successful SSA optimization Pass2EliminateUnusedBlocks -Culled Empty Block (label) main::@2 -Culled Empty Block (label) main::@5 -Culled Empty Block (label) main::toD0181_@return -Culled Empty Block (label) main::@8 -Culled Empty Block (label) main::toD0182_@return -Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte*) RASTER#3 -Self Phi Eliminated (byte*) screen#5 -Self Phi Eliminated (byte*) charset1#3 -Self Phi Eliminated (byte*) D018#11 -Self Phi Eliminated (byte*) BGCOL#11 -Self Phi Eliminated (byte*) charset2#11 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) RASTER#3 (const byte*) RASTER#0 -Redundant Phi (byte*) screen#5 (const byte*) screen#0 -Redundant Phi (byte*) charset1#3 (const byte*) charset1#0 -Redundant Phi (byte*) D018#11 (const byte*) D018#0 -Redundant Phi (byte*) BGCOL#11 (const byte*) BGCOL#0 -Redundant Phi (byte*) charset2#11 (const byte*) charset2#0 -Successful SSA optimization Pass2RedundantPhiElimination Constant (const byte*) main::toD0181_screen#0 = screen#0 Constant (const byte*) main::toD0181_charset#0 = charset1#0 Constant (const byte*) main::toD0182_screen#0 = screen#0 Constant (const byte*) main::toD0182_charset#0 = charset2#0 Successful SSA optimization Pass2ConstantIdentification -Constant (const word/signed dword/dword) main::toD0181_$1#0 = (word)main::toD0181_screen#0/$40 -Constant (const word/signed dword/dword) main::toD0181_$3#0 = (word)main::toD0181_charset#0/$400 -Constant (const word/signed dword/dword) main::toD0182_$1#0 = (word)main::toD0182_screen#0/$40 -Constant (const word/signed dword/dword) main::toD0182_$3#0 = (word)main::toD0182_charset#0/$400 +Constant (const word) main::toD0181_$0#0 = ((word))main::toD0181_screen#0 +Constant (const word) main::toD0181_$2#0 = ((word))main::toD0181_charset#0 +Constant (const word) main::toD0182_$0#0 = ((word))main::toD0182_screen#0 +Constant (const word) main::toD0182_$2#0 = ((word))main::toD0182_charset#0 +Successful SSA optimization Pass2ConstantIdentification +Constant (const word/signed dword/dword) main::toD0181_$1#0 = main::toD0181_$0#0/$40 +Constant (const word/signed dword/dword) main::toD0181_$3#0 = main::toD0181_$2#0/$400 +Constant (const word/signed dword/dword) main::toD0182_$1#0 = main::toD0182_$0#0/$40 +Constant (const word/signed dword/dword) main::toD0182_$3#0 = main::toD0182_$2#0/$400 Successful SSA optimization Pass2ConstantIdentification Constant (const word/dword) main::toD0181_$4#0 = main::toD0181_$1#0|main::toD0181_$3#0 Constant (const word/dword) main::toD0182_$4#0 = main::toD0182_$1#0|main::toD0182_$3#0 @@ -486,19 +223,29 @@ Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::toD0181_return#0 = ((byte))main::toD0181_$4#0 Constant (const byte) main::toD0182_return#0 = ((byte))main::toD0182_$4#0 Successful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [1] if(true) goto main::@4 +Successful SSA optimization Pass2ConstantIfs +Removing unused block main::@return +Successful SSA optimization Pass2EliminateUnusedBlocks Culled Empty Block (label) main::@1 Culled Empty Block (label) main::@6 +Culled Empty Block (label) main::toD0181_@return Culled Empty Block (label) main::@9 +Culled Empty Block (label) main::toD0182_@return Successful SSA optimization Pass2CullEmptyBlocks Constant inlined main::toD0181_screen#0 = (const byte*) screen#0 Constant inlined main::toD0182_charset#0 = (const byte*) charset2#0 -Constant inlined main::toD0181_$3#0 = (word)(const byte*) charset1#0/(word/signed word/dword/signed dword) $400 +Constant inlined main::toD0182_$4#0 = ((word))(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40|((word))(const byte*) charset2#0/(word/signed word/dword/signed dword) $400 +Constant inlined main::toD0182_$3#0 = ((word))(const byte*) charset2#0/(word/signed word/dword/signed dword) $400 +Constant inlined main::toD0181_$0#0 = ((word))(const byte*) screen#0 +Constant inlined main::toD0181_$1#0 = ((word))(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40 +Constant inlined main::toD0181_$2#0 = ((word))(const byte*) charset1#0 +Constant inlined main::toD0182_$0#0 = ((word))(const byte*) screen#0 +Constant inlined main::toD0181_$3#0 = ((word))(const byte*) charset1#0/(word/signed word/dword/signed dword) $400 Constant inlined main::toD0182_screen#0 = (const byte*) screen#0 -Constant inlined main::toD0181_$4#0 = (word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40|(word)(const byte*) charset1#0/(word/signed word/dword/signed dword) $400 -Constant inlined main::toD0182_$1#0 = (word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40 -Constant inlined main::toD0182_$4#0 = (word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40|(word)(const byte*) charset2#0/(word/signed word/dword/signed dword) $400 -Constant inlined main::toD0182_$3#0 = (word)(const byte*) charset2#0/(word/signed word/dword/signed dword) $400 -Constant inlined main::toD0181_$1#0 = (word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40 +Constant inlined main::toD0182_$2#0 = ((word))(const byte*) charset2#0 +Constant inlined main::toD0181_$4#0 = ((word))(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40|((word))(const byte*) charset1#0/(word/signed word/dword/signed dword) $400 +Constant inlined main::toD0182_$1#0 = ((word))(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40 Constant inlined main::toD0181_charset#0 = (const byte*) charset1#0 Successful SSA optimization Pass2ConstantInlining Adding NOP phi() at start of @begin @@ -813,7 +560,7 @@ FINAL SYMBOL TABLE (byte~) main::toD0181_$5 (byte*) main::toD0181_charset (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = ((byte))(word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40|(word)(const byte*) charset1#0/(word/signed word/dword/signed dword) $400 +(const byte) main::toD0181_return#0 toD0181_return = ((byte))((word))(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40|((word))(const byte*) charset1#0/(word/signed word/dword/signed dword) $400 (byte*) main::toD0181_screen (label) main::toD0182 (word~) main::toD0182_$0 @@ -824,7 +571,7 @@ FINAL SYMBOL TABLE (byte~) main::toD0182_$5 (byte*) main::toD0182_charset (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = ((byte))(word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40|(word)(const byte*) charset2#0/(word/signed word/dword/signed dword) $400 +(const byte) main::toD0182_return#0 toD0182_return = ((byte))((word))(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40|((word))(const byte*) charset2#0/(word/signed word/dword/signed dword) $400 (byte*) main::toD0182_screen (byte*) screen (const byte*) screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400 diff --git a/src/test/ref/inline-function.sym b/src/test/ref/inline-function.sym index e4a53d9ec..579e897bc 100644 --- a/src/test/ref/inline-function.sym +++ b/src/test/ref/inline-function.sym @@ -25,7 +25,7 @@ (byte~) main::toD0181_$5 (byte*) main::toD0181_charset (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = ((byte))(word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40|(word)(const byte*) charset1#0/(word/signed word/dword/signed dword) $400 +(const byte) main::toD0181_return#0 toD0181_return = ((byte))((word))(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40|((word))(const byte*) charset1#0/(word/signed word/dword/signed dword) $400 (byte*) main::toD0181_screen (label) main::toD0182 (word~) main::toD0182_$0 @@ -36,7 +36,7 @@ (byte~) main::toD0182_$5 (byte*) main::toD0182_charset (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = ((byte))(word)(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40|(word)(const byte*) charset2#0/(word/signed word/dword/signed dword) $400 +(const byte) main::toD0182_return#0 toD0182_return = ((byte))((word))(const byte*) screen#0/(byte/signed byte/word/signed word/dword/signed dword) $40|((word))(const byte*) charset2#0/(word/signed word/dword/signed dword) $400 (byte*) main::toD0182_screen (byte*) screen (const byte*) screen#0 screen = ((byte*))(word/signed word/dword/signed dword) $400 diff --git a/src/test/ref/inline-kasm-clobber.log b/src/test/ref/inline-kasm-clobber.log index 9a83ec767..dbdf67370 100644 --- a/src/test/ref/inline-kasm-clobber.log +++ b/src/test/ref/inline-kasm-clobber.log @@ -1,29 +1,26 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@1 main: scope:[main] from @1 - (byte*) SCREEN#5 ← phi( @1/(byte*) SCREEN#7 ) (byte) main::k#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@5 (byte) main::k#6 ← phi( main/(byte) main::k#0 main::@5/(byte) main::k#1 ) - (byte*) SCREEN#3 ← phi( main/(byte*) SCREEN#5 main::@5/(byte*) SCREEN#6 ) (byte) main::l#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@2 main::@2: scope:[main] from main::@1 main::@4 (byte) main::k#5 ← phi( main::@1/(byte) main::k#6 main::@4/(byte) main::k#3 ) (byte) main::l#4 ← phi( main::@1/(byte) main::l#0 main::@4/(byte) main::l#1 ) - (byte*) SCREEN#2 ← phi( main::@1/(byte*) SCREEN#3 main::@4/(byte*) SCREEN#4 ) (byte) main::m#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@3 main::@3: scope:[main] from main::@2 main::@3 (byte) main::k#4 ← phi( main::@2/(byte) main::k#5 main::@3/(byte) main::k#4 ) (byte) main::l#3 ← phi( main::@2/(byte) main::l#4 main::@3/(byte) main::l#3 ) (byte) main::m#2 ← phi( main::@2/(byte) main::m#0 main::@3/(byte) main::m#1 ) - (byte*) SCREEN#1 ← phi( main::@2/(byte*) SCREEN#2 main::@3/(byte*) SCREEN#1 ) - kickasm( uses SCREEN#1) {{ lda #0 + kickasm( uses SCREEN#0) {{ lda #0 ldx #0 sta SCREEN,x }} @@ -32,7 +29,6 @@ main::@3: scope:[main] from main::@2 main::@3 if((bool~) main::$0) goto main::@3 to:main::@4 main::@4: scope:[main] from main::@3 - (byte*) SCREEN#4 ← phi( main::@3/(byte*) SCREEN#1 ) (byte) main::k#3 ← phi( main::@3/(byte) main::k#4 ) (byte) main::l#2 ← phi( main::@3/(byte) main::l#3 ) (byte) main::l#1 ← (byte) main::l#2 + rangenext(0,$a) @@ -40,7 +36,6 @@ main::@4: scope:[main] from main::@3 if((bool~) main::$1) goto main::@2 to:main::@5 main::@5: scope:[main] from main::@4 - (byte*) SCREEN#6 ← phi( main::@4/(byte*) SCREEN#4 ) (byte) main::k#2 ← phi( main::@4/(byte) main::k#3 ) (byte) main::k#1 ← (byte) main::k#2 + rangenext(0,$a) (bool~) main::$2 ← (byte) main::k#1 != rangelast(0,$a) @@ -50,7 +45,6 @@ main::@return: scope:[main] from main::@5 return to:@return @1: scope:[] from @begin - (byte*) SCREEN#7 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -64,13 +58,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -104,21 +91,16 @@ Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::l#2 = (byte) main::l#3 Alias (byte) main::k#2 = (byte) main::k#3 (byte) main::k#4 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#4 (byte*) SCREEN#6 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#7 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#1 Self Phi Eliminated (byte) main::l#2 Self Phi Eliminated (byte) main::k#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#5 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2 Redundant Phi (byte) main::l#2 (byte) main::l#4 Redundant Phi (byte) main::k#2 (byte) main::k#5 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$0 [11] if((byte) main::m#1!=rangelast(0,$a)) goto main::@3 -Simple Condition (bool~) main::$1 [15] if((byte) main::l#1!=rangelast(0,$a)) goto main::@2 -Simple Condition (bool~) main::$2 [19] if((byte) main::k#1!=rangelast(0,$a)) goto main::@1 +Simple Condition (bool~) main::$0 [10] if((byte) main::m#1!=rangelast(0,$a)) goto main::@3 +Simple Condition (bool~) main::$1 [14] if((byte) main::l#1!=rangelast(0,$a)) goto main::@2 +Simple Condition (bool~) main::$2 [18] if((byte) main::k#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) main::k#0 = 0 @@ -131,16 +113,10 @@ Resolved ranged next value main::l#1 ← ++ main::l#4 to ++ Resolved ranged comparison value if(main::l#1!=rangelast(0,$a)) goto main::@2 to (byte/signed byte/word/signed word/dword/signed dword) $b Resolved ranged next value main::k#1 ← ++ main::k#5 to ++ Resolved ranged comparison value if(main::k#1!=rangelast(0,$a)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) $b -Self Phi Eliminated (byte*) SCREEN#2 Self Phi Eliminated (byte) main::k#5 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#3 Redundant Phi (byte) main::k#5 (byte) main::k#6 Successful SSA optimization Pass2RedundantPhiElimination -Self Phi Eliminated (byte*) SCREEN#3 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#3 (const byte*) SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Inlining constant with var siblings (const byte) main::k#0 Inlining constant with var siblings (const byte) main::l#0 Inlining constant with var siblings (const byte) main::m#0 diff --git a/src/test/ref/inlinearrayproblem.log b/src/test/ref/inlinearrayproblem.log index a9df40841..01fc76b15 100644 --- a/src/test/ref/inlinearrayproblem.log +++ b/src/test/ref/inlinearrayproblem.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -7,16 +8,14 @@ CONTROL FLOW GRAPH SSA to:@1 main: scope:[main] from @1 (byte*) SCREEN2#2 ← phi( @1/(byte*) SCREEN2#3 ) - (byte*) SCREEN#2 ← phi( @1/(byte*) SCREEN#3 ) (byte[]) main::txt#0 ← (const string) main::$1 (byte[]) main::data#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 3 } (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*) SCREEN2#1 ← phi( main/(byte*) SCREEN2#2 main::@1/(byte*) SCREEN2#1 ) - (byte*) SCREEN#1 ← phi( main/(byte*) SCREEN#2 main::@1/(byte*) SCREEN#1 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) - *((byte*) SCREEN#1 + (byte) main::i#2) ← *((byte[]) main::txt#0 + (byte) main::i#2) + *((byte*) SCREEN#0 + (byte) main::i#2) ← *((byte[]) main::txt#0 + (byte) main::i#2) *((byte*) SCREEN2#1 + (byte) main::i#2) ← *((byte[]) main::data#0 + (byte) main::i#2) (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,3) (bool~) main::$0 ← (byte) main::i#1 != rangelast(0,3) @@ -27,7 +26,6 @@ main::@return: scope:[main] from main::@1 to:@return @1: scope:[] from @begin (byte*) SCREEN2#3 ← phi( @begin/(byte*) SCREEN2#0 ) - (byte*) SCREEN#3 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -42,9 +40,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 (byte*) SCREEN2 (byte*) SCREEN2#0 (byte*) SCREEN2#1 @@ -66,15 +61,11 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) SCREEN#0 = (byte*) SCREEN#3 Alias (byte*) SCREEN2#0 = (byte*) SCREEN2#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#1 Self Phi Eliminated (byte*) SCREEN2#1 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#0 Redundant Phi (byte*) SCREEN2#2 (byte*) SCREEN2#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2 Redundant Phi (byte*) SCREEN2#1 (byte*) SCREEN2#2 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$0 [12] if((byte) main::i#1!=rangelast(0,3)) goto main::@1 diff --git a/src/test/ref/inmem-const-array.log b/src/test/ref/inmem-const-array.log index 9e63322db..47ef9eb0a 100644 --- a/src/test/ref/inmem-const-array.log +++ b/src/test/ref/inmem-const-array.log @@ -1,3 +1,8 @@ +Identified constant variable (byte) WHITE +Identified constant variable (byte) RED +Identified constant variable (byte) GREEN +Identified constant variable (byte*) main::screen +Identified constant variable (byte*) main::cols CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -6,39 +11,30 @@ CONTROL FLOW GRAPH SSA (byte) GREEN#0 ← (byte/signed byte/word/signed word/dword/signed dword) 5 to:@1 main: scope:[main] from @1 - (byte) GREEN#1 ← phi( @1/(byte) GREEN#2 ) - (byte) RED#1 ← phi( @1/(byte) RED#2 ) - (byte) WHITE#1 ← phi( @1/(byte) WHITE#2 ) - (byte[]) main::colseq#0 ← { (byte) WHITE#1, (byte) RED#1, (byte) GREEN#1 } + (byte[]) main::colseq#0 ← { (byte) WHITE#0, (byte) RED#0, (byte) GREEN#0 } (byte*) main::screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 (byte*) main::cols#0 ← ((byte*)) (word/dword/signed dword) $d800 (byte) main::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@2 - (byte*) main::cols#1 ← phi( main/(byte*) main::cols#0 main::@2/(byte*) main::cols#2 ) (byte) main::j#3 ← phi( main/(byte) main::j#0 main::@2/(byte) main::j#4 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#1 ) - (byte*) main::screen#1 ← phi( main/(byte*) main::screen#0 main::@2/(byte*) main::screen#2 ) - *((byte*) main::screen#1 + (byte) main::i#2) ← (byte) '*' - *((byte*) main::cols#1 + (byte) main::i#2) ← *((byte[]) main::colseq#0 + (byte) main::j#3) + *((byte*) main::screen#0 + (byte) main::i#2) ← (byte) '*' + *((byte*) main::cols#0 + (byte) main::i#2) ← *((byte[]) main::colseq#0 + (byte) main::j#3) (byte) main::j#1 ← ++ (byte) main::j#3 (bool~) main::$0 ← (byte) main::j#1 == (byte/signed byte/word/signed word/dword/signed dword) 3 (bool~) main::$1 ← ! (bool~) main::$0 if((bool~) main::$1) goto main::@2 to:main::@3 main::@2: scope:[main] from main::@1 main::@3 - (byte*) main::cols#2 ← phi( main::@1/(byte*) main::cols#1 main::@3/(byte*) main::cols#3 ) (byte) main::j#4 ← phi( main::@1/(byte) main::j#1 main::@3/(byte) main::j#2 ) - (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#1 main::@3/(byte*) main::screen#3 ) (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 main::@3/(byte) main::i#4 ) (byte) main::i#1 ← (byte) main::i#3 + rangenext(0,$27) (bool~) main::$2 ← (byte) main::i#1 != rangelast(0,$27) if((bool~) main::$2) goto main::@1 to:main::@return main::@3: scope:[main] from main::@1 - (byte*) main::cols#3 ← phi( main::@1/(byte*) main::cols#1 ) - (byte*) main::screen#3 ← phi( main::@1/(byte*) main::screen#1 ) (byte) main::i#4 ← phi( main::@1/(byte) main::i#2 ) (byte) main::j#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@2 @@ -46,9 +42,6 @@ main::@return: scope:[main] from main::@2 return to:@return @1: scope:[] from @begin - (byte) GREEN#2 ← phi( @begin/(byte) GREEN#0 ) - (byte) RED#2 ← phi( @begin/(byte) RED#0 ) - (byte) WHITE#2 ← phi( @begin/(byte) WHITE#0 ) call main to:@2 @2: scope:[] from @1 @@ -62,16 +55,10 @@ SYMBOL TABLE SSA (label) @end (byte) GREEN (byte) GREEN#0 -(byte) GREEN#1 -(byte) GREEN#2 (byte) RED (byte) RED#0 -(byte) RED#1 -(byte) RED#2 (byte) WHITE (byte) WHITE#0 -(byte) WHITE#1 -(byte) WHITE#2 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -82,9 +69,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::cols (byte*) main::cols#0 -(byte*) main::cols#1 -(byte*) main::cols#2 -(byte*) main::cols#3 (byte[]) main::colseq (byte[]) main::colseq#0 (byte) main::i @@ -101,36 +85,17 @@ SYMBOL TABLE SSA (byte) main::j#4 (byte*) main::screen (byte*) main::screen#0 -(byte*) main::screen#1 -(byte*) main::screen#2 -(byte*) main::screen#3 Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [14] (bool~) main::$1 ← (byte) main::j#1 != (byte/signed byte/word/signed word/dword/signed dword) 3 from [13] (bool~) main::$0 ← (byte) main::j#1 == (byte/signed byte/word/signed word/dword/signed dword) 3 +Inversing boolean not [13] (bool~) main::$1 ← (byte) main::j#1 != (byte/signed byte/word/signed word/dword/signed dword) 3 from [12] (bool~) main::$0 ← (byte) main::j#1 == (byte/signed byte/word/signed word/dword/signed dword) 3 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) main::i#2 = (byte) main::i#4 -Alias (byte*) main::screen#1 = (byte*) main::screen#3 -Alias (byte*) main::cols#1 = (byte*) main::cols#3 -Alias (byte) WHITE#0 = (byte) WHITE#2 -Alias (byte) RED#0 = (byte) RED#2 -Alias (byte) GREEN#0 = (byte) GREEN#2 Successful SSA optimization Pass2AliasElimination Alias (byte) main::i#2 = (byte) main::i#3 -Alias (byte*) main::screen#1 = (byte*) main::screen#2 -Alias (byte*) main::cols#1 = (byte*) main::cols#2 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::screen#1 -Self Phi Eliminated (byte*) main::cols#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte) WHITE#1 (byte) WHITE#0 -Redundant Phi (byte) RED#1 (byte) RED#0 -Redundant Phi (byte) GREEN#1 (byte) GREEN#0 -Redundant Phi (byte*) main::screen#1 (byte*) main::screen#0 -Redundant Phi (byte*) main::cols#1 (byte*) main::cols#0 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [15] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) 3) goto main::@2 -Simple Condition (bool~) main::$2 [19] if((byte) main::i#1!=rangelast(0,$27)) goto main::@1 +Simple Condition (bool~) main::$1 [14] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) 3) goto main::@2 +Simple Condition (bool~) main::$2 [18] if((byte) main::i#1!=rangelast(0,$27)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte) WHITE#0 = 1 Constant (const byte) RED#0 = 2 diff --git a/src/test/ref/inmemarray.log b/src/test/ref/inmemarray.log index 5fe4979a8..81f948398 100644 --- a/src/test/ref/inmemarray.log +++ b/src/test/ref/inmemarray.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -5,22 +6,19 @@ CONTROL FLOW GRAPH SSA (byte[]) TXT#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) $d, (byte/signed byte/word/signed word/dword/signed dword) 5, (byte/signed byte/word/signed word/dword/signed dword) $c, (byte/signed byte/word/signed word/dword/signed dword) $f, (byte/signed byte/word/signed word/dword/signed dword) $14, (byte/signed byte/word/signed word/dword/signed dword) $20 } to:@1 main: scope:[main] from @1 - (byte*) SCREEN#2 ← phi( @1/(byte*) SCREEN#4 ) (byte) main::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@2 (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#1 ) - (byte*) SCREEN#1 ← phi( main/(byte*) SCREEN#2 main::@2/(byte*) SCREEN#3 ) (byte) main::j#3 ← phi( main/(byte) main::j#0 main::@2/(byte) main::j#4 ) - *((byte*) SCREEN#1 + (byte) main::i#2) ← *((byte[]) TXT#0 + (byte) main::j#3) + *((byte*) SCREEN#0 + (byte) main::i#2) ← *((byte[]) TXT#0 + (byte) main::j#3) (byte) main::j#1 ← ++ (byte) main::j#3 (bool~) main::$0 ← (byte) main::j#1 == (byte/signed byte/word/signed word/dword/signed dword) 8 (bool~) main::$1 ← ! (bool~) main::$0 if((bool~) main::$1) goto main::@2 to:main::@3 main::@2: scope:[main] from main::@1 main::@3 - (byte*) SCREEN#3 ← phi( main::@1/(byte*) SCREEN#1 main::@3/(byte*) SCREEN#5 ) (byte) main::j#4 ← phi( main::@1/(byte) main::j#1 main::@3/(byte) main::j#2 ) (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 main::@3/(byte) main::i#4 ) (byte) main::i#1 ← (byte) main::i#3 + rangenext(0,$64) @@ -28,7 +26,6 @@ main::@2: scope:[main] from main::@1 main::@3 if((bool~) main::$2) goto main::@1 to:main::@return main::@3: scope:[main] from main::@1 - (byte*) SCREEN#5 ← phi( main::@1/(byte*) SCREEN#1 ) (byte) main::i#4 ← phi( main::@1/(byte) main::i#2 ) (byte) main::j#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@2 @@ -36,7 +33,6 @@ main::@return: scope:[main] from main::@2 return to:@return @1: scope:[] from @begin - (byte*) SCREEN#4 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -50,11 +46,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 (byte[]) TXT (byte[]) TXT#0 (void()) main() @@ -80,22 +71,14 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [9] (bool~) main::$1 ← (byte) main::j#1 != (byte/signed byte/word/signed word/dword/signed dword) 8 from [8] (bool~) main::$0 ← (byte) main::j#1 == (byte/signed byte/word/signed word/dword/signed dword) 8 +Inversing boolean not [8] (bool~) main::$1 ← (byte) main::j#1 != (byte/signed byte/word/signed word/dword/signed dword) 8 from [7] (bool~) main::$0 ← (byte) main::j#1 == (byte/signed byte/word/signed word/dword/signed dword) 8 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) main::i#2 = (byte) main::i#4 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#5 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#4 Successful SSA optimization Pass2AliasElimination Alias (byte) main::i#2 = (byte) main::i#3 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [10] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2 -Simple Condition (bool~) main::$2 [14] if((byte) main::i#1!=rangelast(0,$64)) goto main::@1 +Simple Condition (bool~) main::$1 [9] if((byte) main::j#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2 +Simple Condition (bool~) main::$2 [13] if((byte) main::i#1!=rangelast(0,$64)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte[]) TXT#0 = { 3, 1, $d, 5, $c, $f, $14, $20 } diff --git a/src/test/ref/inmemstring.log b/src/test/ref/inmemstring.log index 06733c346..92ddd1560 100644 --- a/src/test/ref/inmemstring.log +++ b/src/test/ref/inmemstring.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -5,12 +6,10 @@ CONTROL FLOW GRAPH SSA (byte[]) TEXT#0 ← (const string) $0 to:@1 main: scope:[main] from @1 - (byte*) SCREEN#1 ← phi( @1/(byte*) SCREEN#3 ) - (byte*) main::cursor#0 ← (byte*) SCREEN#1 + (byte*) main::cursor#0 ← (byte*) SCREEN#0 (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@2 - (byte*) SCREEN#4 ← phi( main/(byte*) SCREEN#1 main::@2/(byte*) SCREEN#2 ) (byte*) main::cursor#2 ← phi( main/(byte*) main::cursor#0 main::@2/(byte*) main::cursor#1 ) (byte) main::i#3 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#4 ) *((byte*) main::cursor#2) ← *((byte[]) TEXT#0 + (byte) main::i#3) @@ -21,15 +20,13 @@ main::@1: scope:[main] from main main::@2 to:main::@3 main::@2: scope:[main] from main::@1 main::@3 (byte) main::i#4 ← phi( main::@1/(byte) main::i#1 main::@3/(byte) main::i#2 ) - (byte*) SCREEN#2 ← phi( main::@1/(byte*) SCREEN#4 main::@3/(byte*) SCREEN#5 ) (byte*) main::cursor#3 ← phi( main::@1/(byte*) main::cursor#2 main::@3/(byte*) main::cursor#4 ) (byte*) main::cursor#1 ← ++ (byte*) main::cursor#3 - (byte*~) main::$2 ← (byte*) SCREEN#2 + (word/signed word/dword/signed dword) $3e8 + (byte*~) main::$2 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) $3e8 (bool~) main::$3 ← (byte*) main::cursor#1 < (byte*~) main::$2 if((bool~) main::$3) goto main::@1 to:main::@return main::@3: scope:[main] from main::@1 - (byte*) SCREEN#5 ← phi( main::@1/(byte*) SCREEN#4 ) (byte*) main::cursor#4 ← phi( main::@1/(byte*) main::cursor#2 ) (byte) main::i#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@2 @@ -37,7 +34,6 @@ main::@return: scope:[main] from main::@2 return to:@return @1: scope:[] from @begin - (byte*) SCREEN#3 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -52,11 +48,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 (byte[]) TEXT (byte[]) TEXT#0 (void()) main() @@ -83,22 +74,14 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [9] (bool~) main::$1 ← (byte) main::i#1 != (byte/signed byte/word/signed word/dword/signed dword) 8 from [8] (bool~) main::$0 ← (byte) main::i#1 == (byte/signed byte/word/signed word/dword/signed dword) 8 +Inversing boolean not [8] (bool~) main::$1 ← (byte) main::i#1 != (byte/signed byte/word/signed word/dword/signed dword) 8 from [7] (bool~) main::$0 ← (byte) main::i#1 == (byte/signed byte/word/signed word/dword/signed dword) 8 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte*) main::cursor#2 = (byte*) main::cursor#4 -Alias (byte*) SCREEN#4 = (byte*) SCREEN#5 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#3 Successful SSA optimization Pass2AliasElimination Alias (byte*) main::cursor#2 = (byte*) main::cursor#3 -Alias (byte*) SCREEN#2 = (byte*) SCREEN#4 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#2 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#1 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [10] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2 -Simple Condition (bool~) main::$3 [15] if((byte*) main::cursor#1<(byte*~) main::$2) goto main::@1 +Simple Condition (bool~) main::$1 [9] if((byte) main::i#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto main::@2 +Simple Condition (bool~) main::$3 [14] if((byte*) main::cursor#1<(byte*~) main::$2) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte[]) TEXT#0 = $0 diff --git a/src/test/ref/keyboard-glitch.log b/src/test/ref/keyboard-glitch.log index e9c69ea7e..313a843d3 100644 --- a/src/test/ref/keyboard-glitch.log +++ b/src/test/ref/keyboard-glitch.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) SCREEN Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx CONTROL FLOW GRAPH SSA @@ -198,19 +199,15 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p (byte[8]) keyboard_scan_values#0 ← { fill( 8, 0) } to:@12 main: scope:[main] from @14 - (byte*) SCREEN#12 ← phi( @14/(byte*) SCREEN#14 ) *((byte*) BORDERCOL#0) ← (byte) GREEN#0 to:main::@1 main::@1: scope:[main] from main main::@7 - (byte*) SCREEN#11 ← phi( main/(byte*) SCREEN#12 main::@7/(byte*) SCREEN#13 ) if(true) goto main::@2 to:main::@return main::@2: scope:[main] from main::@1 - (byte*) SCREEN#10 ← phi( main::@1/(byte*) SCREEN#11 ) call menu to:main::@7 main::@7: scope:[main] from main::@2 - (byte*) SCREEN#13 ← phi( main::@2/(byte*) SCREEN#10 ) to:main::@1 main::@return: scope:[main] from main::@1 return @@ -219,20 +216,16 @@ main::@return: scope:[main] from main::@1 (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@14 menu: scope:[menu] from main::@2 - (byte*) SCREEN#9 ← phi( main::@2/(byte*) SCREEN#10 ) to:menu::@1 menu::@1: scope:[menu] from menu menu::@6 - (byte*) SCREEN#8 ← phi( menu/(byte*) SCREEN#9 menu::@6/(byte*) SCREEN#1 ) if(true) goto menu::@2 to:menu::@return menu::@2: scope:[menu] from menu::@1 - (byte*) SCREEN#7 ← phi( menu::@1/(byte*) SCREEN#8 ) (byte) keyboard_key_pressed::key#0 ← (byte) KEY_C#0 call keyboard_key_pressed (byte) keyboard_key_pressed::return#2 ← (byte) keyboard_key_pressed::return#1 to:menu::@16 menu::@16: scope:[menu] from menu::@2 - (byte*) SCREEN#6 ← phi( menu::@2/(byte*) SCREEN#7 ) (byte) keyboard_key_pressed::return#7 ← phi( menu::@2/(byte) keyboard_key_pressed::return#2 ) (byte~) menu::$0 ← (byte) keyboard_key_pressed::return#7 (bool~) menu::$1 ← (byte~) menu::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -240,13 +233,11 @@ menu::@16: scope:[menu] from menu::@2 if((bool~) menu::$2) goto menu::@4 to:menu::@9 menu::@4: scope:[menu] from menu::@16 - (byte*) SCREEN#5 ← phi( menu::@16/(byte*) SCREEN#6 ) (byte) keyboard_key_pressed::key#1 ← (byte) KEY_I#0 call keyboard_key_pressed (byte) keyboard_key_pressed::return#3 ← (byte) keyboard_key_pressed::return#1 to:menu::@17 menu::@17: scope:[menu] from menu::@4 - (byte*) SCREEN#4 ← phi( menu::@4/(byte*) SCREEN#5 ) (byte) keyboard_key_pressed::return#8 ← phi( menu::@4/(byte) keyboard_key_pressed::return#3 ) (byte~) menu::$4 ← (byte) keyboard_key_pressed::return#8 (bool~) menu::$5 ← (byte~) menu::$4 != (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -262,13 +253,11 @@ menu::@return: scope:[menu] from menu::@1 menu::@11 menu::@13 menu::@18 return to:@return menu::@5: scope:[menu] from menu::@17 - (byte*) SCREEN#3 ← phi( menu::@17/(byte*) SCREEN#4 ) (byte) keyboard_key_pressed::key#2 ← (byte) KEY_E#0 call keyboard_key_pressed (byte) keyboard_key_pressed::return#4 ← (byte) keyboard_key_pressed::return#1 to:menu::@19 menu::@19: scope:[menu] from menu::@5 - (byte*) SCREEN#2 ← phi( menu::@5/(byte*) SCREEN#3 ) (byte) keyboard_key_pressed::return#9 ← phi( menu::@5/(byte) keyboard_key_pressed::return#4 ) (byte~) menu::$7 ← (byte) keyboard_key_pressed::return#9 (bool~) menu::$8 ← (byte~) menu::$7 != (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -280,8 +269,7 @@ menu::@11: scope:[menu] from menu::@17 asm { sei } to:menu::@return menu::@6: scope:[menu] from menu::@19 - (byte*) SCREEN#1 ← phi( menu::@19/(byte*) SCREEN#2 ) - *((byte*) SCREEN#1) ← ++ *((byte*) SCREEN#1) + *((byte*) SCREEN#0) ← ++ *((byte*) SCREEN#0) to:menu::@1 menu::@13: scope:[menu] from menu::@19 *((byte*) BORDERCOL#0) ← (byte) GREEN#0 @@ -311,7 +299,6 @@ pressed::@return: scope:[pressed] from pressed::@1 pressed::@10 return to:@return @14: scope:[] from @12 - (byte*) SCREEN#14 ← phi( @12/(byte*) SCREEN#0 ) call main to:@15 @15: scope:[] from @14 @@ -577,20 +564,6 @@ SYMBOL TABLE SSA (byte) RED#0 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#11 -(byte*) SCREEN#12 -(byte*) SCREEN#13 -(byte*) SCREEN#14 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (byte*) SPRITES_COLS (byte*) SPRITES_COLS#0 (byte*) SPRITES_ENABLE @@ -735,14 +708,15 @@ SYMBOL TABLE SSA (label) pressed::@4 (label) pressed::@return +Culled Empty Block (label) main::@7 Culled Empty Block (label) menu::@18 Culled Empty Block (label) pressed::@4 Culled Empty Block (label) @15 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [198] (bool~) menu::$2 ← (byte~) menu::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [197] (bool~) menu::$1 ← (byte~) menu::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [207] (bool~) menu::$6 ← (byte~) menu::$4 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [206] (bool~) menu::$5 ← (byte~) menu::$4 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [218] (bool~) menu::$9 ← (byte~) menu::$7 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [217] (bool~) menu::$8 ← (byte~) menu::$7 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [234] (bool~) pressed::$2 ← (byte~) pressed::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [233] (bool~) pressed::$1 ← (byte~) pressed::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [191] (bool~) menu::$2 ← (byte~) menu::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [190] (bool~) menu::$1 ← (byte~) menu::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [199] (bool~) menu::$6 ← (byte~) menu::$4 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [198] (bool~) menu::$5 ← (byte~) menu::$4 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [209] (bool~) menu::$9 ← (byte~) menu::$7 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [208] (bool~) menu::$8 ← (byte~) menu::$7 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [224] (bool~) pressed::$2 ← (byte~) pressed::$0 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [223] (bool~) pressed::$1 ← (byte~) pressed::$0 != (byte/signed byte/word/signed word/dword/signed dword) 0 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) keyboard_matrix_read::return#0 = (byte) keyboard_matrix_read::row_pressed_bits#0 (byte~) keyboard_matrix_read::$0 (byte) keyboard_matrix_read::return#3 (byte) keyboard_matrix_read::return#1 Alias (byte) keyboard_key_pressed::colidx#0 = (byte~) keyboard_key_pressed::$0 (byte) keyboard_key_pressed::colidx#1 @@ -750,27 +724,17 @@ Alias (byte) keyboard_key_pressed::rowidx#0 = (byte~) keyboard_key_pressed::$1 Alias (byte) keyboard_matrix_read::return#2 = (byte) keyboard_matrix_read::return#4 Alias (byte) keyboard_key_pressed::return#0 = (byte~) keyboard_key_pressed::$3 (byte) keyboard_key_pressed::return#6 (byte) keyboard_key_pressed::return#1 Alias (byte) KEY_MODIFIER_SHIFT#0 = (byte~) $0 -Alias (byte*) SCREEN#10 = (byte*) SCREEN#11 (byte*) SCREEN#13 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#7 (byte*) SCREEN#8 (byte*) SCREEN#6 (byte*) SCREEN#5 (byte*) SCREEN#4 (byte*) SCREEN#3 (byte*) SCREEN#2 Alias (byte) keyboard_key_pressed::return#2 = (byte) keyboard_key_pressed::return#7 Alias (byte) keyboard_key_pressed::return#3 = (byte) keyboard_key_pressed::return#8 Alias (byte) keyboard_key_pressed::return#4 = (byte) keyboard_key_pressed::return#9 Alias (byte) keyboard_key_pressed::return#10 = (byte) keyboard_key_pressed::return#5 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#14 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#10 -Self Phi Eliminated (byte*) SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (byte) keyboard_matrix_read::rowid#1 (byte) keyboard_matrix_read::rowid#0 -Redundant Phi (byte*) SCREEN#12 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#10 (byte*) SCREEN#12 -Redundant Phi (byte*) SCREEN#9 (byte*) SCREEN#10 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#9 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) menu::$2 [199] if((byte~) menu::$0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto menu::@4 -Simple Condition (bool~) menu::$6 [208] if((byte~) menu::$4==(byte/signed byte/word/signed word/dword/signed dword) 0) goto menu::@5 -Simple Condition (bool~) menu::$9 [219] if((byte~) menu::$7==(byte/signed byte/word/signed word/dword/signed dword) 0) goto menu::@6 -Simple Condition (bool~) pressed::$2 [235] if((byte~) pressed::$0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto pressed::@1 +Simple Condition (bool~) menu::$2 [192] if((byte~) menu::$0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto menu::@4 +Simple Condition (bool~) menu::$6 [200] if((byte~) menu::$4==(byte/signed byte/word/signed word/dword/signed dword) 0) goto menu::@5 +Simple Condition (bool~) menu::$9 [210] if((byte~) menu::$7==(byte/signed byte/word/signed word/dword/signed dword) 0) goto menu::@6 +Simple Condition (bool~) pressed::$2 [225] if((byte~) pressed::$0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto pressed::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) PROCPORT_DDR#0 = ((byte*))0 Constant (const byte) PROCPORT_DDR_MEMORY_MASK#0 = 7 @@ -945,7 +909,6 @@ Successful SSA optimization Pass2EliminateUnusedBlocks Culled Empty Block (label) @4 Culled Empty Block (label) @8 Culled Empty Block (label) main::@1 -Culled Empty Block (label) main::@7 Culled Empty Block (label) @12 Culled Empty Block (label) menu::@1 Culled Empty Block (label) pressed::@1 diff --git a/src/test/ref/line-anim.log b/src/test/ref/line-anim.log index 8fc4f7871..09fd0ffa1 100644 --- a/src/test/ref/line-anim.log +++ b/src/test/ref/line-anim.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) BITMAP +Identified constant variable (byte*) SCREEN Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx Inlined call call vicSelectGfxBank (byte*) SCREEN Inlined call (byte~) main::$4 ← call toD018 (byte*) SCREEN (byte*) BITMAP @@ -315,8 +317,6 @@ divr16s::@return: scope:[divr16s] from divr16s::@11 divr16s::@5 main: scope:[main] from @19 (signed word) rem16s#52 ← phi( @19/(signed word) rem16s#19 ) (word) rem16u#66 ← phi( @19/(word) rem16u#25 ) - (byte*) BITMAP#9 ← phi( @19/(byte*) BITMAP#10 ) - (byte*) SCREEN#1 ← phi( @19/(byte*) SCREEN#4 ) asm { sei } *((byte*) PROCPORT_DDR#0) ← (byte) PROCPORT_DDR_MEMORY_MASK#0 *((byte*) PROCPORT#0) ← (byte) PROCPORT_RAM_IO#0 @@ -324,13 +324,11 @@ main: scope:[main] from @19 (byte~) main::$1 ← (byte~) main::$0 | (byte) VIC_RSEL#0 (byte/word/dword~) main::$2 ← (byte~) main::$1 | (byte/signed byte/word/signed word/dword/signed dword) 3 *((byte*) D011#0) ← (byte/word/dword~) main::$2 - (byte*) main::vicSelectGfxBank1_gfx#0 ← (byte*) SCREEN#1 + (byte*) main::vicSelectGfxBank1_gfx#0 ← (byte*) SCREEN#0 to:main::vicSelectGfxBank1 main::vicSelectGfxBank1: scope:[main] from main (signed word) rem16s#51 ← phi( main/(signed word) rem16s#52 ) (word) rem16u#65 ← phi( main/(word) rem16u#66 ) - (byte*) BITMAP#8 ← phi( main/(byte*) BITMAP#9 ) - (byte*) SCREEN#12 ← phi( main/(byte*) SCREEN#1 ) (byte*) main::vicSelectGfxBank1_gfx#1 ← phi( main/(byte*) main::vicSelectGfxBank1_gfx#0 ) *((byte*) CIA2_PORT_A_DDR#0) ← (byte/signed byte/word/signed word/dword/signed dword) 3 (byte*) main::vicSelectGfxBank1_toDd001_gfx#0 ← (byte*) main::vicSelectGfxBank1_gfx#1 @@ -338,8 +336,6 @@ main::vicSelectGfxBank1: scope:[main] from main main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1 (signed word) rem16s#50 ← phi( main::vicSelectGfxBank1/(signed word) rem16s#51 ) (word) rem16u#64 ← phi( main::vicSelectGfxBank1/(word) rem16u#65 ) - (byte*) BITMAP#7 ← phi( main::vicSelectGfxBank1/(byte*) BITMAP#8 ) - (byte*) SCREEN#10 ← phi( main::vicSelectGfxBank1/(byte*) SCREEN#12 ) (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 ← phi( main::vicSelectGfxBank1/(byte*) main::vicSelectGfxBank1_toDd001_gfx#0 ) (word) main::vicSelectGfxBank1_toDd001_$0#0 ← ((word)) (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 (byte) main::vicSelectGfxBank1_toDd001_$1#0 ← > (word) main::vicSelectGfxBank1_toDd001_$0#0 @@ -350,16 +346,12 @@ main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1 main::vicSelectGfxBank1_toDd001_@return: scope:[main] from main::vicSelectGfxBank1_toDd001 (signed word) rem16s#48 ← phi( main::vicSelectGfxBank1_toDd001/(signed word) rem16s#50 ) (word) rem16u#62 ← phi( main::vicSelectGfxBank1_toDd001/(word) rem16u#64 ) - (byte*) BITMAP#5 ← phi( main::vicSelectGfxBank1_toDd001/(byte*) BITMAP#7 ) - (byte*) SCREEN#7 ← phi( main::vicSelectGfxBank1_toDd001/(byte*) SCREEN#10 ) (byte) main::vicSelectGfxBank1_toDd001_return#2 ← phi( main::vicSelectGfxBank1_toDd001/(byte) main::vicSelectGfxBank1_toDd001_return#0 ) (byte) main::vicSelectGfxBank1_toDd001_return#1 ← (byte) main::vicSelectGfxBank1_toDd001_return#2 to:main::vicSelectGfxBank1_@1 main::vicSelectGfxBank1_@1: scope:[main] from main::vicSelectGfxBank1_toDd001_@return (signed word) rem16s#46 ← phi( main::vicSelectGfxBank1_toDd001_@return/(signed word) rem16s#48 ) (word) rem16u#60 ← phi( main::vicSelectGfxBank1_toDd001_@return/(word) rem16u#62 ) - (byte*) BITMAP#3 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte*) BITMAP#5 ) - (byte*) SCREEN#5 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte*) SCREEN#7 ) (byte) main::vicSelectGfxBank1_toDd001_return#3 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte) main::vicSelectGfxBank1_toDd001_return#1 ) (byte) main::vicSelectGfxBank1_$0#0 ← (byte) main::vicSelectGfxBank1_toDd001_return#3 *((byte*) CIA2_PORT_A#0) ← (byte) main::vicSelectGfxBank1_$0#0 @@ -367,16 +359,12 @@ main::vicSelectGfxBank1_@1: scope:[main] from main::vicSelectGfxBank1_toDd001_@ main::@15: scope:[main] from main::vicSelectGfxBank1_@1 (signed word) rem16s#43 ← phi( main::vicSelectGfxBank1_@1/(signed word) rem16s#46 ) (word) rem16u#57 ← phi( main::vicSelectGfxBank1_@1/(word) rem16u#60 ) - (byte*) BITMAP#1 ← phi( main::vicSelectGfxBank1_@1/(byte*) BITMAP#3 ) - (byte*) SCREEN#2 ← phi( main::vicSelectGfxBank1_@1/(byte*) SCREEN#5 ) - (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#2 - (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP#1 + (byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0 + (byte*) main::toD0181_gfx#0 ← (byte*) BITMAP#0 to:main::toD0181 main::toD0181: scope:[main] from main::@15 (signed word) rem16s#41 ← phi( main::@15/(signed word) rem16s#43 ) (word) rem16u#55 ← phi( main::@15/(word) rem16u#57 ) - (byte*) SCREEN#13 ← phi( main::@15/(byte*) SCREEN#2 ) - (byte*) BITMAP#6 ← phi( main::@15/(byte*) BITMAP#1 ) (byte*) main::toD0181_gfx#1 ← phi( main::@15/(byte*) main::toD0181_gfx#0 ) (byte*) main::toD0181_screen#1 ← phi( main::@15/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 @@ -393,33 +381,27 @@ main::toD0181: scope:[main] from main::@15 main::toD0181_@return: scope:[main] from main::toD0181 (signed word) rem16s#39 ← phi( main::toD0181/(signed word) rem16s#41 ) (word) rem16u#53 ← phi( main::toD0181/(word) rem16u#55 ) - (byte*) SCREEN#11 ← phi( main::toD0181/(byte*) SCREEN#13 ) - (byte*) BITMAP#4 ← phi( main::toD0181/(byte*) BITMAP#6 ) (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 ) (byte) main::toD0181_return#1 ← (byte) main::toD0181_return#2 to:main::@16 main::@16: scope:[main] from main::toD0181_@return (signed word) rem16s#37 ← phi( main::toD0181_@return/(signed word) rem16s#39 ) (word) rem16u#51 ← phi( main::toD0181_@return/(word) rem16u#53 ) - (byte*) SCREEN#8 ← phi( main::toD0181_@return/(byte*) SCREEN#11 ) - (byte*) BITMAP#2 ← phi( main::toD0181_@return/(byte*) BITMAP#4 ) (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) (byte~) main::$4 ← (byte) main::toD0181_return#3 *((byte*) D018#0) ← (byte~) main::$4 - (byte*) bitmap_init::bitmap#0 ← (byte*) BITMAP#2 + (byte*) bitmap_init::bitmap#0 ← (byte*) BITMAP#0 call bitmap_init to:main::@17 main::@17: scope:[main] from main::@16 (signed word) rem16s#32 ← phi( main::@16/(signed word) rem16s#37 ) (word) rem16u#44 ← phi( main::@16/(word) rem16u#51 ) - (byte*) SCREEN#6 ← phi( main::@16/(byte*) SCREEN#8 ) call bitmap_clear to:main::@18 main::@18: scope:[main] from main::@17 (signed word) rem16s#27 ← phi( main::@17/(signed word) rem16s#32 ) (word) rem16u#36 ← phi( main::@17/(word) rem16u#44 ) - (byte*) SCREEN#3 ← phi( main::@17/(byte*) SCREEN#6 ) - (byte*) screen_fill::screen#0 ← (byte*) SCREEN#3 + (byte*) screen_fill::screen#0 ← (byte*) SCREEN#0 (byte) screen_fill::ch#0 ← (byte/signed byte/word/signed word/dword/signed dword) $10 call screen_fill to:main::@19 @@ -722,10 +704,8 @@ screen_fill::@return: scope:[screen_fill] from screen_fill::@3 return to:@return @16: scope:[] from @12 - (byte*) BITMAP#11 ← phi( @12/(byte*) BITMAP#0 ) (signed word) rem16s#26 ← phi( @12/(signed word) rem16s#31 ) (word) rem16u#34 ← phi( @12/(word) rem16u#40 ) - (byte*) SCREEN#9 ← phi( @12/(byte*) SCREEN#0 ) (byte[$100]) bitmap_plot_ylo#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_yhi#0 ← { fill( $100, 0) } (byte[$100]) bitmap_plot_bit#0 ← { fill( $100, 0) } @@ -838,10 +818,8 @@ bitmap_plot::@return: scope:[bitmap_plot] from bitmap_plot return to:@return @19: scope:[] from @16 - (byte*) BITMAP#10 ← phi( @16/(byte*) BITMAP#11 ) (signed word) rem16s#19 ← phi( @16/(signed word) rem16s#26 ) (word) rem16u#25 ← phi( @16/(word) rem16u#34 ) - (byte*) SCREEN#4 ← phi( @16/(byte*) SCREEN#9 ) call main to:@20 @20: scope:[] from @19 @@ -875,17 +853,6 @@ SYMBOL TABLE SSA (byte*) BGCOL4#0 (byte*) BITMAP (byte*) BITMAP#0 -(byte*) BITMAP#1 -(byte*) BITMAP#10 -(byte*) BITMAP#11 -(byte*) BITMAP#2 -(byte*) BITMAP#3 -(byte*) BITMAP#4 -(byte*) BITMAP#5 -(byte*) BITMAP#6 -(byte*) BITMAP#7 -(byte*) BITMAP#8 -(byte*) BITMAP#9 (byte) BLACK (byte) BLACK#0 (byte) BLUE @@ -990,19 +957,6 @@ SYMBOL TABLE SSA (byte) RED#0 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#11 -(byte*) SCREEN#12 -(byte*) SCREEN#13 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (byte) SIZE (byte) SIZE#0 (byte*) SPRITES_COLS @@ -1774,8 +1728,6 @@ Alias (word) rem16u#14 = (word) rem16u#4 Alias (signed word) rem16s#3 = (signed word) rem16s#9 Alias (signed word) rem16s#0 = (signed word) rem16s#31 (signed word) rem16s#26 (signed word) rem16s#19 Alias (byte*) main::vicSelectGfxBank1_gfx#0 = (byte*) main::vicSelectGfxBank1_gfx#1 (byte*) main::vicSelectGfxBank1_toDd001_gfx#0 (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#12 (byte*) SCREEN#10 (byte*) SCREEN#7 (byte*) SCREEN#5 (byte*) SCREEN#2 (byte*) SCREEN#13 (byte*) SCREEN#11 (byte*) SCREEN#8 (byte*) SCREEN#6 (byte*) SCREEN#3 -Alias (byte*) BITMAP#1 = (byte*) BITMAP#8 (byte*) BITMAP#9 (byte*) BITMAP#7 (byte*) BITMAP#5 (byte*) BITMAP#3 (byte*) BITMAP#6 (byte*) BITMAP#4 (byte*) BITMAP#2 Alias (word) rem16u#28 = (word) rem16u#65 (word) rem16u#66 (word) rem16u#64 (word) rem16u#62 (word) rem16u#60 (word) rem16u#57 (word) rem16u#55 (word) rem16u#53 (word) rem16u#51 (word) rem16u#44 (word) rem16u#36 Alias (signed word) rem16s#20 = (signed word) rem16s#51 (signed word) rem16s#52 (signed word) rem16s#50 (signed word) rem16s#48 (signed word) rem16s#46 (signed word) rem16s#43 (signed word) rem16s#41 (signed word) rem16s#39 (signed word) rem16s#37 (signed word) rem16s#32 (signed word) rem16s#27 Alias (byte) main::vicSelectGfxBank1_toDd001_return#0 = (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 (byte) main::vicSelectGfxBank1_toDd001_return#2 (byte) main::vicSelectGfxBank1_toDd001_return#1 (byte) main::vicSelectGfxBank1_toDd001_return#3 (byte) main::vicSelectGfxBank1_$0#0 @@ -1824,8 +1776,6 @@ Alias (signed word) rem16s#13 = (signed word) rem16s#18 (signed word) rem16s#7 Alias (byte) screen_fill::y#2 = (byte) screen_fill::y#3 Alias (byte) screen_fill::ch#1 = (byte) screen_fill::ch#4 Alias (byte*) screen_fill::screen#1 = (byte*) screen_fill::screen#5 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#9 (byte*) SCREEN#4 -Alias (byte*) BITMAP#0 = (byte*) BITMAP#11 (byte*) BITMAP#10 Alias (byte) bitmap_init::x#2 = (byte) bitmap_init::x#4 Alias (byte*) bitmap_init::bitmap#3 = (byte*) bitmap_init::bitmap#4 Alias (byte*) bitmap_init::bitmap#1 = (byte*) bitmap_init::bitmap#2 (byte*) bitmap_init::yoffs#0 @@ -1879,8 +1829,6 @@ Redundant Phi (signed word) divr16s::rem#1 (signed word) divr16s::rem#0 Redundant Phi (signed word) divr16s::divisor#1 (signed word) divr16s::divisor#0 Redundant Phi (word) rem16u#20 (word) rem16u#23 Redundant Phi (word) rem16u#11 (word) rem16u#1 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte*) BITMAP#1 (byte*) BITMAP#0 Redundant Phi (word) rem16u#28 (word) rem16u#0 Redundant Phi (signed word) rem16s#20 (signed word) rem16s#0 Redundant Phi (word) rem16u#15 (word) rem16u#18 diff --git a/src/test/ref/literals.log b/src/test/ref/literals.log index 07b10f0d9..d0dd09c94 100644 --- a/src/test/ref/literals.log +++ b/src/test/ref/literals.log @@ -1,3 +1,6 @@ +Identified constant variable (byte*) SCREEN +Identified constant variable (byte) char +Identified constant variable (byte) num CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -10,20 +13,16 @@ CONTROL FLOW GRAPH SSA (byte[]) nums#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 5 } to:@1 main: scope:[main] from @1 - (byte) num#1 ← phi( @1/(byte) num#2 ) - (byte*) SCREEN#1 ← phi( @1/(byte*) SCREEN#3 ) - (byte) char#1 ← phi( @1/(byte) char#2 ) - *((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) char#1 - *((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) num#1 + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) char#0 + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) num#0 (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*) SCREEN#2 ← phi( main/(byte*) SCREEN#1 main::@1/(byte*) SCREEN#2 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) (byte/signed word/word/dword/signed dword~) main::$0 ← (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte) main::i#2 - *((byte*) SCREEN#2 + (byte/signed word/word/dword/signed dword~) main::$0) ← *((byte[]) str#0 + (byte) main::i#2) + *((byte*) SCREEN#0 + (byte/signed word/word/dword/signed dword~) main::$0) ← *((byte[]) str#0 + (byte) main::i#2) (byte/signed word/word/dword/signed dword~) main::$1 ← (byte/signed byte/word/signed word/dword/signed dword) 9 + (byte) main::i#2 - *((byte*) SCREEN#2 + (byte/signed word/word/dword/signed dword~) main::$1) ← *((byte[]) nums#0 + (byte) main::i#2) + *((byte*) SCREEN#0 + (byte/signed word/word/dword/signed dword~) main::$1) ← *((byte[]) nums#0 + (byte) main::i#2) (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,3) (bool~) main::$2 ← (byte) main::i#1 != rangelast(0,3) if((bool~) main::$2) goto main::@1 @@ -32,9 +31,6 @@ main::@return: scope:[main] from main::@1 return to:@return @1: scope:[] from @begin - (byte) num#2 ← phi( @begin/(byte) num#0 ) - (byte*) SCREEN#3 ← phi( @begin/(byte*) SCREEN#0 ) - (byte) char#2 ← phi( @begin/(byte) char#0 ) call main to:@2 @2: scope:[] from @1 @@ -52,13 +48,8 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 (byte) char (byte) char#0 -(byte) char#1 -(byte) char#2 (void()) main() (byte/signed word/word/dword/signed dword~) main::$0 (byte/signed word/word/dword/signed dword~) main::$1 @@ -71,8 +62,6 @@ SYMBOL TABLE SSA (byte) main::i#2 (byte) num (byte) num#0 -(byte) num#1 -(byte) num#2 (byte[]) nums (byte[]) nums#0 (byte[]) str @@ -81,18 +70,8 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte[]) str#0 = (string~) $1 -Alias (byte) char#0 = (byte) char#2 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#3 -Alias (byte) num#0 = (byte) num#2 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#2 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte) char#1 (byte) char#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte) num#1 (byte) num#0 -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#1 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$2 [18] if((byte) main::i#1!=rangelast(0,3)) goto main::@1 +Simple Condition (bool~) main::$2 [17] if((byte) main::i#1!=rangelast(0,3)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) char#0 = 'a' diff --git a/src/test/ref/liverange.log b/src/test/ref/liverange.log index 61eba2093..d86edc04c 100644 --- a/src/test/ref/liverange.log +++ b/src/test/ref/liverange.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/local-string.log b/src/test/ref/local-string.log index 9231fcd3b..c288a6097 100644 --- a/src/test/ref/local-string.log +++ b/src/test/ref/local-string.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -8,15 +9,13 @@ 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::@2 - (byte*) main::screen#2 ← phi( main/(byte*) main::screen#0 main::@2/(byte*) main::screen#1 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#1 ) (bool~) main::$0 ← *((byte[]) main::msg#0 + (byte) main::i#2) != (byte) '@' if((bool~) main::$0) goto main::@2 to:main::@return main::@2: scope:[main] from main::@1 - (byte*) main::screen#1 ← phi( main::@1/(byte*) main::screen#2 ) (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 ) - *((byte*) main::screen#1 + (byte) main::i#3) ← *((byte[]) main::msg#0 + (byte) main::i#3) + *((byte*) main::screen#0 + (byte) main::i#3) ← *((byte[]) main::msg#0 + (byte) main::i#3) (byte) main::i#1 ← ++ (byte) main::i#3 to:main::@1 main::@return: scope:[main] from main::@1 @@ -49,18 +48,11 @@ SYMBOL TABLE SSA (byte[]) main::msg#0 (byte*) main::screen (byte*) main::screen#0 -(byte*) main::screen#1 -(byte*) main::screen#2 Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::i#2 = (byte) main::i#3 -Alias (byte*) main::screen#1 = (byte*) main::screen#2 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::screen#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::screen#1 (byte*) main::screen#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$0 [5] if(*((byte[]) main::msg#0 + (byte) main::i#2)!=(byte) '@') goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) main::screen#0 = ((byte*))$400 diff --git a/src/test/ref/longjump.log b/src/test/ref/longjump.log index 41ec25e0b..3139ad668 100644 --- a/src/test/ref/longjump.log +++ b/src/test/ref/longjump.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -7,10 +8,9 @@ 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::SCREEN#1 ← phi( main/(byte*) main::SCREEN#0 main::@1/(byte*) main::SCREEN#1 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 ) asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - *((byte*) main::SCREEN#1 + (byte) main::i#2) ← (byte) main::i#2 + *((byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte) main::i#2 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$a) (bool~) main::$0 ← (byte) main::i#1 != rangelast(0,$a) if((bool~) main::$0) goto main::@1 @@ -36,7 +36,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::SCREEN (byte*) main::SCREEN#0 -(byte*) main::SCREEN#1 (byte) main::i (byte) main::i#0 (byte) main::i#1 @@ -44,10 +43,6 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte*) main::SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$0 [7] if((byte) main::i#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) main::SCREEN#0 = ((byte*))$400 diff --git a/src/test/ref/longjump2.log b/src/test/ref/longjump2.log index 4b7abd8cc..a5c54994f 100644 --- a/src/test/ref/longjump2.log +++ b/src/test/ref/longjump2.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) long1::SCREEN +Identified constant variable (byte*) long2::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -18,10 +20,9 @@ long1: scope:[long1] from main (byte) long1::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:long1::@1 long1::@1: scope:[long1] from long1 long1::@1 - (byte*) long1::SCREEN#1 ← phi( long1/(byte*) long1::SCREEN#0 long1::@1/(byte*) long1::SCREEN#1 ) (byte) long1::i#2 ← phi( long1/(byte) long1::i#0 long1::@1/(byte) long1::i#1 ) asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - *((byte*) long1::SCREEN#1 + (byte) long1::i#2) ← (byte) long1::i#2 + *((byte*) long1::SCREEN#0 + (byte) long1::i#2) ← (byte) long1::i#2 (byte) long1::i#1 ← (byte) long1::i#2 + rangenext(0,$a) (bool~) long1::$0 ← (byte) long1::i#1 != rangelast(0,$a) if((bool~) long1::$0) goto long1::@1 @@ -34,10 +35,9 @@ long2: scope:[long2] from main::@1 (byte) long2::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:long2::@1 long2::@1: scope:[long2] from long2 long2::@1 - (byte*) long2::SCREEN#1 ← phi( long2/(byte*) long2::SCREEN#0 long2::@1/(byte*) long2::SCREEN#1 ) (byte) long2::i#2 ← phi( long2/(byte) long2::i#0 long2::@1/(byte) long2::i#1 ) asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop } - *((byte*) long2::SCREEN#1 + (byte) long2::i#2) ← (byte) long2::i#2 + *((byte*) long2::SCREEN#0 + (byte) long2::i#2) ← (byte) long2::i#2 (byte) long2::i#1 ← (byte) long2::i#2 + rangenext(0,$a) (bool~) long2::$0 ← (byte) long2::i#1 != rangelast(0,$a) if((bool~) long2::$0) goto long2::@1 @@ -63,7 +63,6 @@ SYMBOL TABLE SSA (label) long1::@return (byte*) long1::SCREEN (byte*) long1::SCREEN#0 -(byte*) long1::SCREEN#1 (byte) long1::i (byte) long1::i#0 (byte) long1::i#1 @@ -74,7 +73,6 @@ SYMBOL TABLE SSA (label) long2::@return (byte*) long2::SCREEN (byte*) long2::SCREEN#0 -(byte*) long2::SCREEN#1 (byte) long2::i (byte) long2::i#0 (byte) long2::i#1 @@ -87,12 +85,6 @@ SYMBOL TABLE SSA Culled Empty Block (label) main::@2 Culled Empty Block (label) @4 Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte*) long1::SCREEN#1 -Self Phi Eliminated (byte*) long2::SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) long1::SCREEN#1 (byte*) long1::SCREEN#0 -Redundant Phi (byte*) long2::SCREEN#1 (byte*) long2::SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) long1::$0 [10] if((byte) long1::i#1!=rangelast(0,$a)) goto long1::@1 Simple Condition (bool~) long2::$0 [19] if((byte) long2::i#1!=rangelast(0,$a)) goto long2::@1 Successful SSA optimization Pass2ConditionalJumpSimplification diff --git a/src/test/ref/loop-problem.log b/src/test/ref/loop-problem.log index 06c8ff44f..3bcc538a7 100644 --- a/src/test/ref/loop-problem.log +++ b/src/test/ref/loop-problem.log @@ -1,15 +1,14 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@3 main: scope:[main] from @3 - (byte*) SCREEN#1 ← phi( @3/(byte*) SCREEN#3 ) - *((byte*) SCREEN#1) ← (byte) '0' + *((byte*) SCREEN#0) ← (byte) '0' call d to:main::@1 main::@1: scope:[main] from main - (byte*) SCREEN#7 ← phi( main/(byte*) SCREEN#1 ) call b to:main::@2 main::@2: scope:[main] from main::@1 @@ -18,16 +17,13 @@ main::@return: scope:[main] from main::@2 return to:@return b: scope:[b] from main::@1 - (byte*) SCREEN#5 ← phi( main::@1/(byte*) SCREEN#7 ) (byte) b::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:b::@1 b::@1: scope:[b] from b b::@3 - (byte*) SCREEN#4 ← phi( b/(byte*) SCREEN#5 b::@3/(byte*) SCREEN#6 ) (byte) b::i#3 ← phi( b/(byte) b::i#0 b::@3/(byte) b::i#1 ) call d to:b::@3 b::@3: scope:[b] from b::@1 - (byte*) SCREEN#6 ← phi( b::@1/(byte*) SCREEN#4 ) (byte) b::i#2 ← phi( b::@1/(byte) b::i#3 ) (byte) b::i#1 ← (byte) b::i#2 + rangenext(0,3) (bool~) b::$1 ← (byte) b::i#1 != rangelast(0,3) @@ -37,14 +33,12 @@ b::@return: scope:[b] from b::@3 return to:@return d: scope:[d] from b::@1 main - (byte*) SCREEN#2 ← phi( b::@1/(byte*) SCREEN#4 main/(byte*) SCREEN#1 ) - *((byte*) SCREEN#2) ← ++ *((byte*) SCREEN#2) + *((byte*) SCREEN#0) ← ++ *((byte*) SCREEN#0) to:d::@return d::@return: scope:[d] from d return to:@return @3: scope:[] from @begin - (byte*) SCREEN#3 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@4 @4: scope:[] from @3 @@ -58,13 +52,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 (void()) b() (bool~) b::$1 (label) b::@1 @@ -85,20 +72,9 @@ SYMBOL TABLE SSA Culled Empty Block (label) main::@2 Culled Empty Block (label) @4 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) SCREEN#1 = (byte*) SCREEN#7 Alias (byte) b::i#2 = (byte) b::i#3 -Alias (byte*) SCREEN#4 = (byte*) SCREEN#6 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#4 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#5 (byte*) SCREEN#1 -Redundant Phi (byte*) SCREEN#4 (byte*) SCREEN#5 -Successful SSA optimization Pass2RedundantPhiElimination -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) b::$1 [14] if((byte) b::i#1!=rangelast(0,3)) goto b::@1 +Simple Condition (bool~) b::$1 [11] if((byte) b::i#1!=rangelast(0,3)) goto b::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) b::i#0 = 0 diff --git a/src/test/ref/loopnest.log b/src/test/ref/loopnest.log index 455e9478d..b0a29e629 100644 --- a/src/test/ref/loopnest.log +++ b/src/test/ref/loopnest.log @@ -1,19 +1,17 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@2 main: scope:[main] from @2 - (byte*) SCREEN#4 ← phi( @2/(byte*) SCREEN#6 ) (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) $64 to:main::@1 main::@1: scope:[main] from main main::@3 - (byte*) SCREEN#3 ← phi( main/(byte*) SCREEN#4 main::@3/(byte*) SCREEN#5 ) (byte) main::i#3 ← phi( main/(byte) main::i#0 main::@3/(byte) main::i#1 ) call nest to:main::@3 main::@3: scope:[main] from main::@1 - (byte*) SCREEN#5 ← phi( main::@1/(byte*) SCREEN#3 ) (byte) main::i#2 ← phi( main::@1/(byte) main::i#3 ) (byte) main::i#1 ← -- (byte) main::i#2 (bool~) main::$1 ← (byte) main::i#1 > (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -23,13 +21,11 @@ main::@return: scope:[main] from main::@3 return to:@return nest: scope:[nest] from main::@1 - (byte*) SCREEN#2 ← phi( main::@1/(byte*) SCREEN#3 ) (byte) nest::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) $64 to:nest::@1 nest::@1: scope:[nest] from nest nest::@1 - (byte*) SCREEN#1 ← phi( nest/(byte*) SCREEN#2 nest::@1/(byte*) SCREEN#1 ) (byte) nest::j#2 ← phi( nest/(byte) nest::j#0 nest::@1/(byte) nest::j#1 ) - *((byte*) SCREEN#1) ← (byte) nest::j#2 + *((byte*) SCREEN#0) ← (byte) nest::j#2 (byte) nest::j#1 ← -- (byte) nest::j#2 (bool~) nest::$0 ← (byte) nest::j#1 > (byte/signed byte/word/signed word/dword/signed dword) 0 if((bool~) nest::$0) goto nest::@1 @@ -38,7 +34,6 @@ nest::@return: scope:[nest] from nest::@1 return to:@return @2: scope:[] from @begin - (byte*) SCREEN#6 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@3 @3: scope:[] from @2 @@ -52,12 +47,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 (void()) main() (bool~) main::$1 (label) main::@1 @@ -80,19 +69,9 @@ SYMBOL TABLE SSA Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::i#2 = (byte) main::i#3 -Alias (byte*) SCREEN#3 = (byte*) SCREEN#5 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#6 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#3 -Self Phi Eliminated (byte*) SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#4 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#3 (byte*) SCREEN#4 -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#3 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [8] if((byte) main::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1 -Simple Condition (bool~) nest::$0 [16] if((byte) nest::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest::@1 +Simple Condition (bool~) main::$1 [7] if((byte) main::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1 +Simple Condition (bool~) nest::$0 [14] if((byte) nest::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) main::i#0 = $64 diff --git a/src/test/ref/loopnest2.log b/src/test/ref/loopnest2.log index 41825ef5a..2df8cb5ab 100644 --- a/src/test/ref/loopnest2.log +++ b/src/test/ref/loopnest2.log @@ -1,25 +1,22 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@3 main: scope:[main] from @3 - (byte*) SCREEN#13 ← phi( @3/(byte*) SCREEN#15 ) (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) $64 to:main::@1 main::@1: scope:[main] from main main::@3 - (byte*) SCREEN#11 ← phi( main/(byte*) SCREEN#13 main::@3/(byte*) SCREEN#14 ) (byte) main::i#5 ← phi( main/(byte) main::i#0 main::@3/(byte) main::i#1 ) (byte) main::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) $64 to:main::@2 main::@2: scope:[main] from main::@1 main::@5 - (byte*) SCREEN#10 ← phi( main::@1/(byte*) SCREEN#11 main::@5/(byte*) SCREEN#12 ) (byte) main::i#4 ← phi( main::@1/(byte) main::i#5 main::@5/(byte) main::i#3 ) (byte) main::j#3 ← phi( main::@1/(byte) main::j#0 main::@5/(byte) main::j#1 ) call nest1 to:main::@5 main::@5: scope:[main] from main::@2 - (byte*) SCREEN#12 ← phi( main::@2/(byte*) SCREEN#10 ) (byte) main::i#3 ← phi( main::@2/(byte) main::i#4 ) (byte) main::j#2 ← phi( main::@2/(byte) main::j#3 ) (byte) main::j#1 ← -- (byte) main::j#2 @@ -27,7 +24,6 @@ main::@5: scope:[main] from main::@2 if((bool~) main::$1) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@5 - (byte*) SCREEN#14 ← phi( main::@5/(byte*) SCREEN#12 ) (byte) main::i#2 ← phi( main::@5/(byte) main::i#3 ) (byte) main::i#1 ← -- (byte) main::i#2 (bool~) main::$2 ← (byte) main::i#1 > (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -37,22 +33,18 @@ main::@return: scope:[main] from main::@3 return to:@return nest1: scope:[nest1] from main::@2 - (byte*) SCREEN#8 ← phi( main::@2/(byte*) SCREEN#10 ) (byte) nest1::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) $64 to:nest1::@1 nest1::@1: scope:[nest1] from nest1 nest1::@3 - (byte*) SCREEN#6 ← phi( nest1/(byte*) SCREEN#8 nest1::@3/(byte*) SCREEN#9 ) (byte) nest1::i#5 ← phi( nest1/(byte) nest1::i#0 nest1::@3/(byte) nest1::i#1 ) (byte) nest1::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) $64 to:nest1::@2 nest1::@2: scope:[nest1] from nest1::@1 nest1::@5 - (byte*) SCREEN#5 ← phi( nest1::@1/(byte*) SCREEN#6 nest1::@5/(byte*) SCREEN#7 ) (byte) nest1::i#4 ← phi( nest1::@1/(byte) nest1::i#5 nest1::@5/(byte) nest1::i#3 ) (byte) nest1::j#3 ← phi( nest1::@1/(byte) nest1::j#0 nest1::@5/(byte) nest1::j#1 ) call nest2 to:nest1::@5 nest1::@5: scope:[nest1] from nest1::@2 - (byte*) SCREEN#7 ← phi( nest1::@2/(byte*) SCREEN#5 ) (byte) nest1::i#3 ← phi( nest1::@2/(byte) nest1::i#4 ) (byte) nest1::j#2 ← phi( nest1::@2/(byte) nest1::j#3 ) (byte) nest1::j#1 ← -- (byte) nest1::j#2 @@ -60,7 +52,6 @@ nest1::@5: scope:[nest1] from nest1::@2 if((bool~) nest1::$1) goto nest1::@2 to:nest1::@3 nest1::@3: scope:[nest1] from nest1::@5 - (byte*) SCREEN#9 ← phi( nest1::@5/(byte*) SCREEN#7 ) (byte) nest1::i#2 ← phi( nest1::@5/(byte) nest1::i#3 ) (byte) nest1::i#1 ← -- (byte) nest1::i#2 (bool~) nest1::$2 ← (byte) nest1::i#1 > (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -70,25 +61,21 @@ nest1::@return: scope:[nest1] from nest1::@3 return to:@return nest2: scope:[nest2] from nest1::@2 - (byte*) SCREEN#3 ← phi( nest1::@2/(byte*) SCREEN#5 ) (byte) nest2::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) $64 to:nest2::@1 nest2::@1: scope:[nest2] from nest2 nest2::@3 (byte) nest2::i#4 ← phi( nest2/(byte) nest2::i#0 nest2::@3/(byte) nest2::i#1 ) - (byte*) SCREEN#2 ← phi( nest2/(byte*) SCREEN#3 nest2::@3/(byte*) SCREEN#4 ) (byte) nest2::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) $64 to:nest2::@2 nest2::@2: scope:[nest2] from nest2::@1 nest2::@2 (byte) nest2::i#3 ← phi( nest2::@1/(byte) nest2::i#4 nest2::@2/(byte) nest2::i#3 ) - (byte*) SCREEN#1 ← phi( nest2::@1/(byte*) SCREEN#2 nest2::@2/(byte*) SCREEN#1 ) (byte) nest2::j#2 ← phi( nest2::@1/(byte) nest2::j#0 nest2::@2/(byte) nest2::j#1 ) - *((byte*) SCREEN#1) ← (byte) nest2::j#2 + *((byte*) SCREEN#0) ← (byte) nest2::j#2 (byte) nest2::j#1 ← -- (byte) nest2::j#2 (bool~) nest2::$0 ← (byte) nest2::j#1 > (byte/signed byte/word/signed word/dword/signed dword) 0 if((bool~) nest2::$0) goto nest2::@2 to:nest2::@3 nest2::@3: scope:[nest2] from nest2::@2 - (byte*) SCREEN#4 ← phi( nest2::@2/(byte*) SCREEN#1 ) (byte) nest2::i#2 ← phi( nest2::@2/(byte) nest2::i#3 ) (byte) nest2::i#1 ← -- (byte) nest2::i#2 (bool~) nest2::$1 ← (byte) nest2::i#1 > (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -98,7 +85,6 @@ nest2::@return: scope:[nest2] from nest2::@3 return to:@return @3: scope:[] from @begin - (byte*) SCREEN#15 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@4 @4: scope:[] from @3 @@ -112,21 +98,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#11 -(byte*) SCREEN#12 -(byte*) SCREEN#13 -(byte*) SCREEN#14 -(byte*) SCREEN#15 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (void()) main() (bool~) main::$1 (bool~) main::$2 @@ -189,37 +160,24 @@ Culled Empty Block (label) @4 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::j#2 = (byte) main::j#3 Alias (byte) main::i#2 = (byte) main::i#3 (byte) main::i#4 -Alias (byte*) SCREEN#10 = (byte*) SCREEN#12 (byte*) SCREEN#14 Alias (byte) nest1::j#2 = (byte) nest1::j#3 Alias (byte) nest1::i#2 = (byte) nest1::i#3 (byte) nest1::i#4 -Alias (byte*) SCREEN#5 = (byte*) SCREEN#7 (byte*) SCREEN#9 Alias (byte) nest2::i#2 = (byte) nest2::i#3 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#4 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#15 Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (byte) main::i#2 -Self Phi Eliminated (byte*) SCREEN#10 Self Phi Eliminated (byte) nest1::i#2 -Self Phi Eliminated (byte*) SCREEN#5 -Self Phi Eliminated (byte*) SCREEN#1 Self Phi Eliminated (byte) nest2::i#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#13 (byte*) SCREEN#0 Redundant Phi (byte) main::i#2 (byte) main::i#5 -Redundant Phi (byte*) SCREEN#10 (byte*) SCREEN#11 -Redundant Phi (byte*) SCREEN#8 (byte*) SCREEN#10 Redundant Phi (byte) nest1::i#2 (byte) nest1::i#5 -Redundant Phi (byte*) SCREEN#5 (byte*) SCREEN#6 -Redundant Phi (byte*) SCREEN#3 (byte*) SCREEN#5 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2 Redundant Phi (byte) nest2::i#2 (byte) nest2::i#4 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [10] if((byte) main::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2 -Simple Condition (bool~) main::$2 [14] if((byte) main::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1 -Simple Condition (bool~) nest1::$1 [25] if((byte) nest1::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@2 -Simple Condition (bool~) nest1::$2 [29] if((byte) nest1::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@1 -Simple Condition (bool~) nest2::$0 [39] if((byte) nest2::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@2 -Simple Condition (bool~) nest2::$1 [43] if((byte) nest2::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@1 +Simple Condition (bool~) main::$1 [9] if((byte) main::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@2 +Simple Condition (bool~) main::$2 [13] if((byte) main::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@1 +Simple Condition (bool~) nest1::$1 [23] if((byte) nest1::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@2 +Simple Condition (bool~) nest1::$2 [27] if((byte) nest1::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest1::@1 +Simple Condition (bool~) nest2::$0 [36] if((byte) nest2::j#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@2 +Simple Condition (bool~) nest2::$1 [40] if((byte) nest2::i#1>(byte/signed byte/word/signed word/dword/signed dword) 0) goto nest2::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) main::i#0 = $64 @@ -229,14 +187,6 @@ Constant (const byte) nest1::j#0 = $64 Constant (const byte) nest2::i#0 = $64 Constant (const byte) nest2::j#0 = $64 Successful SSA optimization Pass2ConstantIdentification -Self Phi Eliminated (byte*) SCREEN#11 -Self Phi Eliminated (byte*) SCREEN#6 -Self Phi Eliminated (byte*) SCREEN#2 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#11 (const byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#6 (byte*) SCREEN#11 -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#6 -Successful SSA optimization Pass2RedundantPhiElimination Inlining constant with var siblings (const byte) main::i#0 Inlining constant with var siblings (const byte) main::j#0 Inlining constant with var siblings (const byte) nest1::i#0 diff --git a/src/test/ref/min-fmul-16.log b/src/test/ref/min-fmul-16.log index 8d5a818e7..51a3173a0 100644 --- a/src/test/ref/min-fmul-16.log +++ b/src/test/ref/min-fmul-16.log @@ -1,3 +1,8 @@ +Identified constant variable (byte*) RASTER +Identified constant variable (byte*) BORDERCOL +Identified constant variable (byte*) SCREEN +Identified constant variable (word) main::a +Identified constant variable (word) main::b CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -118,18 +123,12 @@ print_set_screen::@return: scope:[print_set_screen] from print_set_screen (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@20 main: scope:[main] from @22 - (byte*) SCREEN#10 ← phi( @22/(byte*) SCREEN#11 ) - (byte*) BORDERCOL#9 ← phi( @22/(byte*) BORDERCOL#11 ) - (byte*) RASTER#7 ← phi( @22/(byte*) RASTER#9 ) (byte*) print_line_cursor#16 ← phi( @22/(byte*) print_line_cursor#12 ) (byte*) print_screen#16 ← phi( @22/(byte*) print_screen#12 ) (byte*) print_char_cursor#43 ← phi( @22/(byte*) print_char_cursor#39 ) call mulf_init to:main::@13 main::@13: scope:[main] from main - (byte*) SCREEN#8 ← phi( main/(byte*) SCREEN#10 ) - (byte*) BORDERCOL#7 ← phi( main/(byte*) BORDERCOL#9 ) - (byte*) RASTER#5 ← phi( main/(byte*) RASTER#7 ) (byte*) print_line_cursor#13 ← phi( main/(byte*) print_line_cursor#16 ) (byte*) print_screen#13 ← phi( main/(byte*) print_screen#16 ) (byte*) print_char_cursor#40 ← phi( main/(byte*) print_char_cursor#43 ) @@ -138,11 +137,6 @@ main::@13: scope:[main] from main asm { sei } to:main::@1 main::@1: scope:[main] from main::@13 main::@16 - (byte*) SCREEN#7 ← phi( main::@13/(byte*) SCREEN#8 main::@16/(byte*) SCREEN#9 ) - (word) main::b#5 ← phi( main::@13/(word) main::b#0 main::@16/(word) main::b#6 ) - (word) main::a#5 ← phi( main::@13/(word) main::a#0 main::@16/(word) main::a#6 ) - (byte*) BORDERCOL#6 ← phi( main::@13/(byte*) BORDERCOL#7 main::@16/(byte*) BORDERCOL#8 ) - (byte*) RASTER#4 ← phi( main::@13/(byte*) RASTER#5 main::@16/(byte*) RASTER#6 ) (byte*) print_line_cursor#11 ← phi( main::@13/(byte*) print_line_cursor#13 main::@16/(byte*) print_line_cursor#3 ) (byte*) print_screen#11 ← phi( main::@13/(byte*) print_screen#13 main::@16/(byte*) print_screen#3 ) (byte*) print_char_cursor#38 ← phi( main::@13/(byte*) print_char_cursor#40 main::@16/(byte*) print_char_cursor#15 ) @@ -151,85 +145,50 @@ main::@1: scope:[main] from main::@13 main::@16 main::@2: scope:[main] from main::@1 (byte*) print_line_cursor#21 ← phi( main::@1/(byte*) print_line_cursor#11 ) (byte*) print_screen#21 ← phi( main::@1/(byte*) print_screen#11 ) - (byte*) SCREEN#5 ← phi( main::@1/(byte*) SCREEN#7 ) (byte*) print_char_cursor#47 ← phi( main::@1/(byte*) print_char_cursor#38 ) - (word) main::b#3 ← phi( main::@1/(word) main::b#5 ) - (word) main::a#3 ← phi( main::@1/(word) main::a#5 ) - (byte*) BORDERCOL#4 ← phi( main::@1/(byte*) BORDERCOL#6 ) - (byte*) RASTER#2 ← phi( main::@1/(byte*) RASTER#4 ) to:main::@4 main::@4: scope:[main] from main::@2 main::@5 (byte*) print_line_cursor#20 ← phi( main::@2/(byte*) print_line_cursor#21 main::@5/(byte*) print_line_cursor#22 ) (byte*) print_screen#20 ← phi( main::@2/(byte*) print_screen#21 main::@5/(byte*) print_screen#22 ) - (byte*) SCREEN#4 ← phi( main::@2/(byte*) SCREEN#5 main::@5/(byte*) SCREEN#6 ) (byte*) print_char_cursor#44 ← phi( main::@2/(byte*) print_char_cursor#47 main::@5/(byte*) print_char_cursor#48 ) - (word) main::b#2 ← phi( main::@2/(word) main::b#3 main::@5/(word) main::b#4 ) - (word) main::a#2 ← phi( main::@2/(word) main::a#3 main::@5/(word) main::a#4 ) - (byte*) BORDERCOL#3 ← phi( main::@2/(byte*) BORDERCOL#4 main::@5/(byte*) BORDERCOL#5 ) - (byte*) RASTER#1 ← phi( main::@2/(byte*) RASTER#2 main::@5/(byte*) RASTER#3 ) - (bool~) main::$1 ← *((byte*) RASTER#1) != (byte/word/signed word/dword/signed dword) $ff + (bool~) main::$1 ← *((byte*) RASTER#0) != (byte/word/signed word/dword/signed dword) $ff if((bool~) main::$1) goto main::@5 to:main::@6 main::@5: scope:[main] from main::@4 (byte*) print_line_cursor#22 ← phi( main::@4/(byte*) print_line_cursor#20 ) (byte*) print_screen#22 ← phi( main::@4/(byte*) print_screen#20 ) - (byte*) SCREEN#6 ← phi( main::@4/(byte*) SCREEN#4 ) (byte*) print_char_cursor#48 ← phi( main::@4/(byte*) print_char_cursor#44 ) - (word) main::b#4 ← phi( main::@4/(word) main::b#2 ) - (word) main::a#4 ← phi( main::@4/(word) main::a#2 ) - (byte*) BORDERCOL#5 ← phi( main::@4/(byte*) BORDERCOL#3 ) - (byte*) RASTER#3 ← phi( main::@4/(byte*) RASTER#1 ) to:main::@4 main::@6: scope:[main] from main::@4 - (byte*) RASTER#11 ← phi( main::@4/(byte*) RASTER#1 ) (byte*) print_line_cursor#17 ← phi( main::@4/(byte*) print_line_cursor#20 ) (byte*) print_screen#17 ← phi( main::@4/(byte*) print_screen#20 ) - (byte*) SCREEN#3 ← phi( main::@4/(byte*) SCREEN#4 ) (byte*) print_char_cursor#41 ← phi( main::@4/(byte*) print_char_cursor#44 ) - (word) main::b#1 ← phi( main::@4/(word) main::b#2 ) - (word) main::a#1 ← phi( main::@4/(word) main::a#2 ) - (byte*) BORDERCOL#1 ← phi( main::@4/(byte*) BORDERCOL#3 ) - *((byte*) BORDERCOL#1) ← ++ *((byte*) BORDERCOL#1) - (word) mulf16u::a#0 ← (word) main::a#1 - (word) mulf16u::b#0 ← (word) main::b#1 + *((byte*) BORDERCOL#0) ← ++ *((byte*) BORDERCOL#0) + (word) mulf16u::a#0 ← (word) main::a#0 + (word) mulf16u::b#0 ← (word) main::b#0 call mulf16u (dword) mulf16u::return#0 ← (dword) mulf16u::return#2 to:main::@14 main::@14: scope:[main] from main::@6 - (word) main::b#8 ← phi( main::@6/(word) main::b#1 ) - (word) main::a#8 ← phi( main::@6/(word) main::a#1 ) - (byte*) RASTER#10 ← phi( main::@6/(byte*) RASTER#11 ) (byte*) print_line_cursor#14 ← phi( main::@6/(byte*) print_line_cursor#17 ) (byte*) print_screen#14 ← phi( main::@6/(byte*) print_screen#17 ) - (byte*) SCREEN#2 ← phi( main::@6/(byte*) SCREEN#3 ) (byte*) print_char_cursor#37 ← phi( main::@6/(byte*) print_char_cursor#41 ) - (byte*) BORDERCOL#2 ← phi( main::@6/(byte*) BORDERCOL#1 ) (dword) mulf16u::return#3 ← phi( main::@6/(dword) mulf16u::return#0 ) (dword~) main::$2 ← (dword) mulf16u::return#3 (dword) main::r#0 ← (dword~) main::$2 - *((byte*) BORDERCOL#2) ← -- *((byte*) BORDERCOL#2) + *((byte*) BORDERCOL#0) ← -- *((byte*) BORDERCOL#0) (dword) print_dword::dw#0 ← (dword) main::r#0 call print_dword to:main::@15 main::@15: scope:[main] from main::@14 - (word) main::b#7 ← phi( main::@14/(word) main::b#8 ) - (word) main::a#7 ← phi( main::@14/(word) main::a#8 ) - (byte*) BORDERCOL#10 ← phi( main::@14/(byte*) BORDERCOL#2 ) - (byte*) RASTER#8 ← phi( main::@14/(byte*) RASTER#10 ) (byte*) print_line_cursor#10 ← phi( main::@14/(byte*) print_line_cursor#14 ) (byte*) print_screen#10 ← phi( main::@14/(byte*) print_screen#14 ) - (byte*) SCREEN#1 ← phi( main::@14/(byte*) SCREEN#2 ) (byte*) print_char_cursor#30 ← phi( main::@14/(byte*) print_char_cursor#6 ) (byte*) print_char_cursor#14 ← (byte*) print_char_cursor#30 - (byte*) print_set_screen::screen#0 ← (byte*) SCREEN#1 + (byte*) print_set_screen::screen#0 ← (byte*) SCREEN#0 call print_set_screen to:main::@16 main::@16: scope:[main] from main::@15 - (byte*) SCREEN#9 ← phi( main::@15/(byte*) SCREEN#1 ) - (word) main::b#6 ← phi( main::@15/(word) main::b#7 ) - (word) main::a#6 ← phi( main::@15/(word) main::a#7 ) - (byte*) BORDERCOL#8 ← phi( main::@15/(byte*) BORDERCOL#10 ) - (byte*) RASTER#6 ← phi( main::@15/(byte*) RASTER#8 ) (byte*) print_char_cursor#31 ← phi( main::@15/(byte*) print_char_cursor#13 ) (byte*) print_line_cursor#7 ← phi( main::@15/(byte*) print_line_cursor#2 ) (byte*) print_screen#7 ← phi( main::@15/(byte*) print_screen#2 ) @@ -247,9 +206,6 @@ main::@return: scope:[main] from main::@1 return to:@return @20: scope:[] from @19 - (byte*) SCREEN#12 ← phi( @19/(byte*) SCREEN#0 ) - (byte*) BORDERCOL#12 ← phi( @19/(byte*) BORDERCOL#0 ) - (byte*) RASTER#12 ← phi( @19/(byte*) RASTER#0 ) (byte*) print_line_cursor#15 ← phi( @19/(byte*) print_line_cursor#18 ) (byte*) print_screen#15 ← phi( @19/(byte*) print_screen#18 ) (byte*) print_char_cursor#42 ← phi( @19/(byte*) print_char_cursor#45 ) @@ -372,9 +328,6 @@ mulf16u::@return: scope:[mulf16u] from mulf16u return to:@return @22: scope:[] from @20 - (byte*) SCREEN#11 ← phi( @20/(byte*) SCREEN#12 ) - (byte*) BORDERCOL#11 ← phi( @20/(byte*) BORDERCOL#12 ) - (byte*) RASTER#9 ← phi( @20/(byte*) RASTER#12 ) (byte*) print_line_cursor#12 ← phi( @20/(byte*) print_line_cursor#15 ) (byte*) print_screen#12 ← phi( @20/(byte*) print_screen#15 ) (byte*) print_char_cursor#39 ← phi( @20/(byte*) print_char_cursor#42 ) @@ -401,46 +354,10 @@ SYMBOL TABLE SSA (label) @end (byte*) BORDERCOL (byte*) BORDERCOL#0 -(byte*) BORDERCOL#1 -(byte*) BORDERCOL#10 -(byte*) BORDERCOL#11 -(byte*) BORDERCOL#12 -(byte*) BORDERCOL#2 -(byte*) BORDERCOL#3 -(byte*) BORDERCOL#4 -(byte*) BORDERCOL#5 -(byte*) BORDERCOL#6 -(byte*) BORDERCOL#7 -(byte*) BORDERCOL#8 -(byte*) BORDERCOL#9 (byte*) RASTER (byte*) RASTER#0 -(byte*) RASTER#1 -(byte*) RASTER#10 -(byte*) RASTER#11 -(byte*) RASTER#12 -(byte*) RASTER#2 -(byte*) RASTER#3 -(byte*) RASTER#4 -(byte*) RASTER#5 -(byte*) RASTER#6 -(byte*) RASTER#7 -(byte*) RASTER#8 -(byte*) RASTER#9 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#11 -(byte*) SCREEN#12 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (void()) main() (bool~) main::$1 (dword~) main::$2 @@ -456,24 +373,8 @@ SYMBOL TABLE SSA (label) main::@return (word) main::a (word) main::a#0 -(word) main::a#1 -(word) main::a#2 -(word) main::a#3 -(word) main::a#4 -(word) main::a#5 -(word) main::a#6 -(word) main::a#7 -(word) main::a#8 (word) main::b (word) main::b#0 -(word) main::b#1 -(word) main::b#2 -(word) main::b#3 -(word) main::b#4 -(word) main::b#5 -(word) main::b#6 -(word) main::b#7 -(word) main::b#8 (dword) main::r (dword) main::r#0 (dword()) mulf16u((word) mulf16u::a , (word) mulf16u::b) @@ -755,23 +656,10 @@ Alias (byte*) print_screen#1 = (byte*) print_line_cursor#1 (byte*) print_char_cu Alias (byte*) print_char_cursor#40 = (byte*) print_char_cursor#43 Alias (byte*) print_screen#13 = (byte*) print_screen#16 Alias (byte*) print_line_cursor#13 = (byte*) print_line_cursor#16 -Alias (byte*) RASTER#5 = (byte*) RASTER#7 -Alias (byte*) BORDERCOL#7 = (byte*) BORDERCOL#9 -Alias (byte*) SCREEN#10 = (byte*) SCREEN#8 -Alias (byte*) RASTER#2 = (byte*) RASTER#4 -Alias (byte*) BORDERCOL#4 = (byte*) BORDERCOL#6 -Alias (word) main::a#3 = (word) main::a#5 -Alias (word) main::b#3 = (word) main::b#5 Alias (byte*) print_char_cursor#16 = (byte*) print_char_cursor#47 (byte*) print_char_cursor#38 (byte*) print_char_cursor#32 -Alias (byte*) SCREEN#5 = (byte*) SCREEN#7 Alias (byte*) print_screen#11 = (byte*) print_screen#21 (byte*) print_screen#8 (byte*) print_screen#4 Alias (byte*) print_line_cursor#11 = (byte*) print_line_cursor#21 (byte*) print_line_cursor#8 (byte*) print_line_cursor#4 -Alias (byte*) RASTER#1 = (byte*) RASTER#3 (byte*) RASTER#11 (byte*) RASTER#10 (byte*) RASTER#8 (byte*) RASTER#6 -Alias (byte*) BORDERCOL#1 = (byte*) BORDERCOL#5 (byte*) BORDERCOL#3 (byte*) BORDERCOL#2 (byte*) BORDERCOL#10 (byte*) BORDERCOL#8 -Alias (word) main::a#1 = (word) main::a#4 (word) main::a#2 (word) main::a#8 (word) main::a#7 (word) main::a#6 -Alias (word) main::b#1 = (word) main::b#4 (word) main::b#2 (word) main::b#8 (word) main::b#7 (word) main::b#6 Alias (byte*) print_char_cursor#37 = (byte*) print_char_cursor#48 (byte*) print_char_cursor#44 (byte*) print_char_cursor#41 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#6 (byte*) SCREEN#4 (byte*) SCREEN#3 (byte*) SCREEN#2 (byte*) SCREEN#9 Alias (byte*) print_screen#10 = (byte*) print_screen#22 (byte*) print_screen#20 (byte*) print_screen#17 (byte*) print_screen#14 Alias (byte*) print_line_cursor#10 = (byte*) print_line_cursor#22 (byte*) print_line_cursor#20 (byte*) print_line_cursor#17 (byte*) print_line_cursor#14 Alias (dword) mulf16u::return#0 = (dword) mulf16u::return#3 @@ -780,9 +668,6 @@ Alias (byte*) print_char_cursor#14 = (byte*) print_char_cursor#30 Alias (byte*) print_screen#3 = (byte*) print_screen#7 Alias (byte*) print_line_cursor#3 = (byte*) print_line_cursor#7 Alias (byte*) print_char_cursor#15 = (byte*) print_char_cursor#31 -Alias (byte*) RASTER#0 = (byte*) RASTER#12 (byte*) RASTER#9 -Alias (byte*) BORDERCOL#0 = (byte*) BORDERCOL#12 (byte*) BORDERCOL#11 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#12 (byte*) SCREEN#11 Alias (byte*) mulf_init::sqr1_hi#0 = (byte*~) mulf_init::$0 Alias (byte*) mulf_init::sqr1_lo#0 = (byte*~) mulf_init::$1 Alias (word) mulf_init::sqr#1 = (word~) mulf_init::$7 @@ -807,12 +692,7 @@ Alias (byte*) mulf_init::sqr2_lo#2 = (byte*) mulf_init::sqr2_lo#3 Alias (byte) mulf_init::x_255#1 = (byte) mulf_init::x_255#3 Alias (byte*) mulf_init::sqr2_hi#1 = (byte*) mulf_init::sqr2_hi#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) RASTER#1 -Self Phi Eliminated (byte*) BORDERCOL#1 -Self Phi Eliminated (word) main::a#1 -Self Phi Eliminated (word) main::b#1 Self Phi Eliminated (byte*) print_char_cursor#37 -Self Phi Eliminated (byte*) SCREEN#1 Self Phi Eliminated (byte*) print_screen#10 Self Phi Eliminated (byte*) print_line_cursor#10 Successful SSA optimization Pass2SelfPhiElimination @@ -828,15 +708,7 @@ Redundant Phi (byte*) print_set_screen::screen#1 (byte*) print_set_screen::scree Redundant Phi (byte*) print_char_cursor#40 (byte*) print_char_cursor#0 Redundant Phi (byte*) print_screen#13 (byte*) print_char_cursor#0 Redundant Phi (byte*) print_line_cursor#13 (byte*) print_char_cursor#0 -Redundant Phi (byte*) RASTER#5 (byte*) RASTER#0 -Redundant Phi (byte*) BORDERCOL#7 (byte*) BORDERCOL#0 -Redundant Phi (byte*) SCREEN#10 (byte*) SCREEN#0 -Redundant Phi (byte*) RASTER#1 (byte*) RASTER#2 -Redundant Phi (byte*) BORDERCOL#1 (byte*) BORDERCOL#4 -Redundant Phi (word) main::a#1 (word) main::a#3 -Redundant Phi (word) main::b#1 (word) main::b#3 Redundant Phi (byte*) print_char_cursor#37 (byte*) print_char_cursor#16 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#5 Redundant Phi (byte*) print_screen#10 (byte*) print_screen#11 Redundant Phi (byte*) print_line_cursor#10 (byte*) print_line_cursor#11 Redundant Phi (byte*) print_char_cursor#14 (byte*) print_char_cursor#22 @@ -849,7 +721,7 @@ Redundant Phi (byte*) print_char_cursor#17 (byte*) print_char_cursor#16 Redundant Phi (byte*) print_screen#5 (byte*) print_screen#11 Redundant Phi (byte*) print_line_cursor#5 (byte*) print_line_cursor#11 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [77] if(*((byte*) RASTER#2)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@5 +Simple Condition (bool~) main::$1 [77] if(*((byte*) RASTER#0)!=(byte/word/signed word/dword/signed dword) $ff) goto main::@5 Simple Condition (bool~) mulf_init::$4 [121] if((byte~) mulf_init::$2!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mulf_init::@2 Simple Condition (bool~) mulf_init::$9 [133] if((byte*) mulf_init::sqr1_lo#1!=(byte*~) mulf_init::$8) goto mulf_init::@1 Simple Condition (bool~) mulf_init::$14 [151] if((byte) mulf_init::x_255#1!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto mulf_init::@4 @@ -876,6 +748,9 @@ Constant (const word*) mulf16u::memA#0 = ((word*))$f8 Constant (const word*) mulf16u::memB#0 = ((word*))$fa Constant (const dword*) mulf16u::memR#0 = ((dword*))$fc Successful SSA optimization Pass2ConstantIdentification +Constant (const word) mulf16u::a#0 = main::a#0 +Constant (const word) mulf16u::b#0 = main::b#0 +Constant (const byte*) print_set_screen::screen#0 = SCREEN#0 Constant (const byte*) mulf_init::sqr1_hi#0 = mulf_sqr1_hi#0+1 Constant (const byte*) mulf_init::sqr1_lo#0 = mulf_sqr1_lo#0+1 Constant (const byte*) mulf_init::$8 = mulf_sqr1_lo#0+$200 @@ -888,7 +763,9 @@ Constant (const byte*) mulf_init::$18 = mulf_sqr1_lo#0+$100 Constant (const byte*) mulf_init::$19 = mulf_sqr2_hi#0+$1ff Constant (const byte*) mulf_init::$20 = mulf_sqr1_hi#0+$100 Successful SSA optimization Pass2ConstantIdentification -if() condition always true - replacing block destination [28] if(true) goto main::@2 +Constant (const byte*) print_screen#1 = print_set_screen::screen#0 +Successful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [27] if(true) goto main::@2 Successful SSA optimization Pass2ConstantIfs Successful SSA optimization PassNEliminateUnusedVars Removing unused block main::@return @@ -905,24 +782,6 @@ Culled Empty Block (label) @20 Culled Empty Block (label) mulf_init::@6 Culled Empty Block (label) @23 Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte*) RASTER#2 -Self Phi Eliminated (byte*) BORDERCOL#4 -Self Phi Eliminated (word) main::a#3 -Self Phi Eliminated (word) main::b#3 -Self Phi Eliminated (byte*) SCREEN#5 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) RASTER#2 (const byte*) RASTER#0 -Redundant Phi (byte*) BORDERCOL#4 (const byte*) BORDERCOL#0 -Redundant Phi (word) main::a#3 (const word) main::a#0 -Redundant Phi (word) main::b#3 (const word) main::b#0 -Redundant Phi (byte*) SCREEN#5 (const byte*) SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination -Constant (const word) mulf16u::a#0 = main::a#0 -Constant (const word) mulf16u::b#0 = main::b#0 -Constant (const byte*) print_set_screen::screen#0 = SCREEN#0 -Successful SSA optimization Pass2ConstantIdentification -Constant (const byte*) print_screen#1 = print_set_screen::screen#0 -Successful SSA optimization Pass2ConstantIdentification Inlining constant with var siblings (const word) mulf_init::sqr#0 Inlining constant with var siblings (const byte) mulf_init::x_2#0 Inlining constant with var siblings (const byte) mulf_init::c#0 diff --git a/src/test/ref/norom-charset.log b/src/test/ref/norom-charset.log index dfe063362..b553802f1 100644 --- a/src/test/ref/norom-charset.log +++ b/src/test/ref/norom-charset.log @@ -1,3 +1,6 @@ +Identified constant variable (byte*) VIC_MEMORY +Identified constant variable (byte*) SCREEN +Identified constant variable (byte*) CHARSET CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -7,17 +10,11 @@ CONTROL FLOW GRAPH SSA (word[]) charset_spec_row#0 ← { (word/dword/signed dword) $f7da, (word/dword/signed dword) $f7de, (word/dword/signed dword) $f24e, (word/dword/signed dword) $d6de } to:@2 main: scope:[main] from @2 - (byte*) VIC_MEMORY#4 ← phi( @2/(byte*) VIC_MEMORY#5 ) - (byte*) SCREEN#4 ← phi( @2/(byte*) SCREEN#5 ) - (byte*) CHARSET#1 ← phi( @2/(byte*) CHARSET#3 ) - (byte*~) main::$0 ← (byte*) CHARSET#1 + (byte/signed byte/word/signed word/dword/signed dword) 8 + (byte*~) main::$0 ← (byte*) CHARSET#0 + (byte/signed byte/word/signed word/dword/signed dword) 8 (byte*) main::charset#0 ← (byte*~) main::$0 (byte) main::c#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@3 - (byte*) VIC_MEMORY#3 ← phi( main/(byte*) VIC_MEMORY#4 main::@3/(byte*) VIC_MEMORY#2 ) - (byte*) CHARSET#5 ← phi( main/(byte*) CHARSET#1 main::@3/(byte*) CHARSET#4 ) - (byte*) SCREEN#3 ← phi( main/(byte*) SCREEN#4 main::@3/(byte*) SCREEN#2 ) (byte) main::c#2 ← phi( main/(byte) main::c#0 main::@3/(byte) main::c#1 ) (byte*) main::charset#2 ← phi( main/(byte*) main::charset#0 main::@3/(byte*) main::charset#1 ) (byte*) gen_char3::dst#0 ← (byte*) main::charset#2 @@ -25,9 +22,6 @@ main::@1: scope:[main] from main main::@3 call gen_char3 to:main::@3 main::@3: scope:[main] from main::@1 - (byte*) VIC_MEMORY#2 ← phi( main::@1/(byte*) VIC_MEMORY#3 ) - (byte*) CHARSET#4 ← phi( main::@1/(byte*) CHARSET#5 ) - (byte*) SCREEN#2 ← phi( main::@1/(byte*) SCREEN#3 ) (byte) main::c#3 ← phi( main::@1/(byte) main::c#2 ) (byte*) main::charset#3 ← phi( main::@1/(byte*) main::charset#2 ) (byte*~) main::$2 ← (byte*) main::charset#3 + (byte/signed byte/word/signed word/dword/signed dword) 8 @@ -38,16 +32,13 @@ main::@3: scope:[main] from main::@1 if((bool~) main::$4) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@3 - (byte*) VIC_MEMORY#1 ← phi( main::@3/(byte*) VIC_MEMORY#2 ) - (byte*) CHARSET#2 ← phi( main::@3/(byte*) CHARSET#4 ) - (byte*) SCREEN#1 ← phi( main::@3/(byte*) SCREEN#2 ) - (word~) main::$5 ← ((word)) (byte*) SCREEN#1 + (word~) main::$5 ← ((word)) (byte*) SCREEN#0 (word/signed dword/dword~) main::$6 ← (word~) main::$5 / (byte/signed byte/word/signed word/dword/signed dword) $40 - (word~) main::$7 ← ((word)) (byte*) CHARSET#2 + (word~) main::$7 ← ((word)) (byte*) CHARSET#0 (word/signed dword/dword~) main::$8 ← (word~) main::$7 / (word/signed word/dword/signed dword) $400 (word/dword~) main::$9 ← (word/signed dword/dword~) main::$6 | (word/signed dword/dword~) main::$8 (byte~) main::$10 ← ((byte)) (word/dword~) main::$9 - *((byte*) VIC_MEMORY#1) ← (byte~) main::$10 + *((byte*) VIC_MEMORY#0) ← (byte~) main::$10 to:main::@return main::@return: scope:[main] from main::@2 return @@ -113,9 +104,6 @@ gen_char3::@return: scope:[gen_char3] from gen_char3::@5 return to:@return @2: scope:[] from @begin - (byte*) VIC_MEMORY#5 ← phi( @begin/(byte*) VIC_MEMORY#0 ) - (byte*) SCREEN#5 ← phi( @begin/(byte*) SCREEN#0 ) - (byte*) CHARSET#3 ← phi( @begin/(byte*) CHARSET#0 ) call main to:@3 @3: scope:[] from @2 @@ -129,25 +117,10 @@ SYMBOL TABLE SSA (label) @end (byte*) CHARSET (byte*) CHARSET#0 -(byte*) CHARSET#1 -(byte*) CHARSET#2 -(byte*) CHARSET#3 -(byte*) CHARSET#4 -(byte*) CHARSET#5 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 (byte*) VIC_MEMORY (byte*) VIC_MEMORY#0 -(byte*) VIC_MEMORY#1 -(byte*) VIC_MEMORY#2 -(byte*) VIC_MEMORY#3 -(byte*) VIC_MEMORY#4 -(byte*) VIC_MEMORY#5 (word[]) charset_spec_row (word[]) charset_spec_row#0 (void()) gen_char3((byte*) gen_char3::dst , (word) gen_char3::spec) @@ -233,14 +206,11 @@ SYMBOL TABLE SSA Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [37] (bool~) gen_char3::$3 ← (byte~) gen_char3::$1 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [36] (bool~) gen_char3::$2 ← (byte~) gen_char3::$1 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [35] (bool~) gen_char3::$3 ← (byte~) gen_char3::$1 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [34] (bool~) gen_char3::$2 ← (byte~) gen_char3::$1 != (byte/signed byte/word/signed word/dword/signed dword) 0 Successful SSA optimization Pass2UnaryNotSimplification Alias (byte*) main::charset#0 = (byte*~) main::$0 Alias (byte*) main::charset#2 = (byte*) main::charset#3 Alias (byte) main::c#2 = (byte) main::c#3 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#2 (byte*) SCREEN#3 -Alias (byte*) CHARSET#2 = (byte*) CHARSET#4 (byte*) CHARSET#5 -Alias (byte*) VIC_MEMORY#1 = (byte*) VIC_MEMORY#2 (byte*) VIC_MEMORY#3 Alias (byte*) main::charset#1 = (byte*~) main::$2 Alias (byte) main::c#1 = (byte/signed word/word/dword/signed dword~) main::$3 Alias (byte) gen_char3::b#1 = (byte~) gen_char3::$5 (byte) gen_char3::b#5 @@ -253,36 +223,24 @@ Alias (byte) gen_char3::r#4 = (byte) gen_char3::r#5 Alias (byte) gen_char3::b#2 = (byte/word/dword~) gen_char3::$4 Alias (byte*) gen_char3::dst#1 = (byte*) gen_char3::dst#2 Alias (byte) gen_char3::r#2 = (byte) gen_char3::r#3 -Alias (byte*) CHARSET#0 = (byte*) CHARSET#3 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#5 -Alias (byte*) VIC_MEMORY#0 = (byte*) VIC_MEMORY#5 Successful SSA optimization Pass2AliasElimination Alias (word) gen_char3::spec#2 = (word) gen_char3::spec#3 Alias (byte) gen_char3::c#2 = (byte) gen_char3::c#3 Alias (byte*) gen_char3::dst#1 = (byte*) gen_char3::dst#3 Alias (byte) gen_char3::r#2 = (byte) gen_char3::r#4 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#1 -Self Phi Eliminated (byte*) CHARSET#2 -Self Phi Eliminated (byte*) VIC_MEMORY#1 Self Phi Eliminated (byte*) gen_char3::dst#1 Self Phi Eliminated (byte) gen_char3::r#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) CHARSET#1 (byte*) CHARSET#0 -Redundant Phi (byte*) SCREEN#4 (byte*) SCREEN#0 -Redundant Phi (byte*) VIC_MEMORY#4 (byte*) VIC_MEMORY#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#4 -Redundant Phi (byte*) CHARSET#2 (byte*) CHARSET#1 -Redundant Phi (byte*) VIC_MEMORY#1 (byte*) VIC_MEMORY#4 Redundant Phi (word) gen_char3::spec#6 (word) gen_char3::spec#0 Redundant Phi (byte*) gen_char3::dst#6 (byte*) gen_char3::dst#0 Redundant Phi (byte*) gen_char3::dst#1 (byte*) gen_char3::dst#5 Redundant Phi (byte) gen_char3::r#2 (byte) gen_char3::r#6 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$4 [18] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 6) goto main::@1 -Simple Condition (bool~) gen_char3::$3 [38] if((byte~) gen_char3::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gen_char3::@3 -Simple Condition (bool~) gen_char3::$7 [46] if((byte) gen_char3::c#1!=rangelast(0,2)) goto gen_char3::@2 -Simple Condition (bool~) gen_char3::$8 [54] if((byte) gen_char3::r#1!=rangelast(0,4)) goto gen_char3::@1 +Simple Condition (bool~) main::$4 [17] if((byte) main::c#1!=(byte/signed byte/word/signed word/dword/signed dword) 6) goto main::@1 +Simple Condition (bool~) gen_char3::$3 [36] if((byte~) gen_char3::$1==(byte/signed byte/word/signed word/dword/signed dword) 0) goto gen_char3::@3 +Simple Condition (bool~) gen_char3::$7 [44] if((byte) gen_char3::c#1!=rangelast(0,2)) goto gen_char3::@2 +Simple Condition (bool~) gen_char3::$8 [52] if((byte) gen_char3::r#1!=rangelast(0,4)) goto gen_char3::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) VIC_MEMORY#0 = ((byte*))$d018 Constant (const byte*) SCREEN#0 = ((byte*))$400 diff --git a/src/test/ref/overlap-allocation-2.log b/src/test/ref/overlap-allocation-2.log index fde97b499..2b1ea83da 100644 --- a/src/test/ref/overlap-allocation-2.log +++ b/src/test/ref/overlap-allocation-2.log @@ -1,37 +1,32 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@3 main: scope:[main] from @3 - (byte*) SCREEN#6 ← phi( @3/(byte*) SCREEN#10 ) (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@5 - (byte*) SCREEN#4 ← phi( main/(byte*) SCREEN#6 main::@5/(byte*) SCREEN#7 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@5/(byte) main::i#1 ) (byte) line::l#0 ← (byte) main::i#2 call line to:main::@5 main::@5: scope:[main] from main::@1 - (byte*) SCREEN#7 ← phi( main::@1/(byte*) SCREEN#4 ) (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 ) (byte) main::i#1 ← (byte) main::i#3 + rangenext(0,8) (bool~) main::$1 ← (byte) main::i#1 != rangelast(0,8) if((bool~) main::$1) goto main::@1 to:main::@3 main::@3: scope:[main] from main::@5 - (byte*) SCREEN#8 ← phi( main::@5/(byte*) SCREEN#7 ) (byte) main::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) $a to:main::@2 main::@2: scope:[main] from main::@3 main::@6 - (byte*) SCREEN#5 ← phi( main::@3/(byte*) SCREEN#8 main::@6/(byte*) SCREEN#9 ) (byte) main::j#2 ← phi( main::@3/(byte) main::j#0 main::@6/(byte) main::j#1 ) (byte) line::l#1 ← (byte) main::j#2 call line to:main::@6 main::@6: scope:[main] from main::@2 - (byte*) SCREEN#9 ← phi( main::@2/(byte*) SCREEN#5 ) (byte) main::j#3 ← phi( main::@2/(byte) main::j#2 ) (byte) main::j#1 ← (byte) main::j#3 + rangenext($a,$12) (bool~) main::$3 ← (byte) main::j#1 != rangelast($a,$12) @@ -41,13 +36,11 @@ main::@return: scope:[main] from main::@6 return to:@return line: scope:[line] from main::@1 main::@2 - (byte*) SCREEN#2 ← phi( main::@1/(byte*) SCREEN#4 main::@2/(byte*) SCREEN#5 ) (byte) line::l#2 ← phi( main::@1/(byte) line::l#0 main::@2/(byte) line::l#1 ) (byte) plot::x#0 ← (byte) line::l#2 call plot to:line::@1 line::@1: scope:[line] from line - (byte*) SCREEN#3 ← phi( line/(byte*) SCREEN#2 ) (byte) line::l#3 ← phi( line/(byte) line::l#2 ) (byte/signed word/word/dword/signed dword~) line::$1 ← (byte) line::l#3 + (byte/signed byte/word/signed word/dword/signed dword) $14 (byte) plot::x#1 ← (byte/signed word/word/dword/signed dword~) line::$1 @@ -60,14 +53,12 @@ line::@return: scope:[line] from line::@2 to:@return plot: scope:[plot] from line line::@1 (byte) plot::x#2 ← phi( line/(byte) plot::x#0 line::@1/(byte) plot::x#1 ) - (byte*) SCREEN#1 ← phi( line/(byte*) SCREEN#2 line::@1/(byte*) SCREEN#3 ) - *((byte*) SCREEN#1 + (byte) plot::x#2) ← (byte) '*' + *((byte*) SCREEN#0 + (byte) plot::x#2) ← (byte) '*' to:plot::@return plot::@return: scope:[plot] from plot return to:@return @3: scope:[] from @begin - (byte*) SCREEN#10 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@4 @4: scope:[] from @3 @@ -81,16 +72,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (void()) line((byte) line::l) (byte/signed word/word/dword/signed dword~) line::$1 (label) line::@1 @@ -131,26 +112,12 @@ Culled Empty Block (label) line::@2 Culled Empty Block (label) @4 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::i#2 = (byte) main::i#3 -Alias (byte*) SCREEN#4 = (byte*) SCREEN#7 (byte*) SCREEN#8 Alias (byte) main::j#2 = (byte) main::j#3 -Alias (byte*) SCREEN#5 = (byte*) SCREEN#9 Alias (byte) line::l#2 = (byte) line::l#3 -Alias (byte*) SCREEN#2 = (byte*) SCREEN#3 Alias (byte) plot::x#1 = (byte/signed word/word/dword/signed dword~) line::$1 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#10 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#4 -Self Phi Eliminated (byte*) SCREEN#5 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#6 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#4 (byte*) SCREEN#6 -Redundant Phi (byte*) SCREEN#5 (byte*) SCREEN#4 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#2 -Successful SSA optimization Pass2RedundantPhiElimination -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [9] if((byte) main::i#1!=rangelast(0,8)) goto main::@1 -Simple Condition (bool~) main::$3 [18] if((byte) main::j#1!=rangelast($a,$12)) goto main::@2 +Simple Condition (bool~) main::$1 [8] if((byte) main::i#1!=rangelast(0,8)) goto main::@1 +Simple Condition (bool~) main::$3 [16] if((byte) main::j#1!=rangelast($a,$12)) goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) main::i#0 = 0 diff --git a/src/test/ref/overlap-allocation.log b/src/test/ref/overlap-allocation.log index 0ec4d8d77..678b6d662 100644 --- a/src/test/ref/overlap-allocation.log +++ b/src/test/ref/overlap-allocation.log @@ -1,54 +1,46 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@2 main: scope:[main] from @2 - (byte*) SCREEN#5 ← phi( @2/(byte*) SCREEN#11 ) (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@7 - (byte*) SCREEN#2 ← phi( main/(byte*) SCREEN#5 main::@7/(byte*) SCREEN#6 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@7/(byte) main::i#1 ) (byte) plot::x#0 ← (byte) main::i#2 call plot to:main::@7 main::@7: scope:[main] from main::@1 - (byte*) SCREEN#6 ← phi( main::@1/(byte*) SCREEN#2 ) (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 ) (byte) main::i#1 ← (byte) main::i#3 + rangenext(0,$a) (bool~) main::$1 ← (byte) main::i#1 != rangelast(0,$a) if((bool~) main::$1) goto main::@1 to:main::@4 main::@4: scope:[main] from main::@7 - (byte*) SCREEN#7 ← phi( main::@7/(byte*) SCREEN#6 ) (byte) main::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@2 main::@2: scope:[main] from main::@4 main::@8 - (byte*) SCREEN#3 ← phi( main::@4/(byte*) SCREEN#7 main::@8/(byte*) SCREEN#8 ) (byte) main::j#2 ← phi( main::@4/(byte) main::j#0 main::@8/(byte) main::j#1 ) (byte) plot::x#1 ← (byte) main::j#2 call plot to:main::@8 main::@8: scope:[main] from main::@2 - (byte*) SCREEN#8 ← phi( main::@2/(byte*) SCREEN#3 ) (byte) main::j#3 ← phi( main::@2/(byte) main::j#2 ) (byte) main::j#1 ← (byte) main::j#3 + rangenext(0,$a) (bool~) main::$3 ← (byte) main::j#1 != rangelast(0,$a) if((bool~) main::$3) goto main::@2 to:main::@5 main::@5: scope:[main] from main::@8 - (byte*) SCREEN#9 ← phi( main::@8/(byte*) SCREEN#8 ) (byte) main::k#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@3 main::@3: scope:[main] from main::@5 main::@9 - (byte*) SCREEN#4 ← phi( main::@5/(byte*) SCREEN#9 main::@9/(byte*) SCREEN#10 ) (byte) main::k#2 ← phi( main::@5/(byte) main::k#0 main::@9/(byte) main::k#1 ) (byte) plot::x#2 ← (byte) main::k#2 call plot to:main::@9 main::@9: scope:[main] from main::@3 - (byte*) SCREEN#10 ← phi( main::@3/(byte*) SCREEN#4 ) (byte) main::k#3 ← phi( main::@3/(byte) main::k#2 ) (byte) main::k#1 ← (byte) main::k#3 + rangenext(0,$a) (bool~) main::$5 ← (byte) main::k#1 != rangelast(0,$a) @@ -59,14 +51,12 @@ main::@return: scope:[main] from main::@9 to:@return plot: scope:[plot] from main::@1 main::@2 main::@3 (byte) plot::x#3 ← phi( main::@1/(byte) plot::x#0 main::@2/(byte) plot::x#1 main::@3/(byte) plot::x#2 ) - (byte*) SCREEN#1 ← phi( main::@1/(byte*) SCREEN#2 main::@2/(byte*) SCREEN#3 main::@3/(byte*) SCREEN#4 ) - *((byte*) SCREEN#1 + (byte) plot::x#3) ← (byte) '*' + *((byte*) SCREEN#0 + (byte) plot::x#3) ← (byte) '*' to:plot::@return plot::@return: scope:[plot] from plot return to:@return @2: scope:[] from @begin - (byte*) SCREEN#11 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@3 @3: scope:[] from @2 @@ -80,17 +70,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#10 -(byte*) SCREEN#11 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 -(byte*) SCREEN#6 -(byte*) SCREEN#7 -(byte*) SCREEN#8 -(byte*) SCREEN#9 (void()) main() (bool~) main::$1 (bool~) main::$3 @@ -130,27 +109,12 @@ SYMBOL TABLE SSA Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::i#2 = (byte) main::i#3 -Alias (byte*) SCREEN#2 = (byte*) SCREEN#6 (byte*) SCREEN#7 Alias (byte) main::j#2 = (byte) main::j#3 -Alias (byte*) SCREEN#3 = (byte*) SCREEN#8 (byte*) SCREEN#9 Alias (byte) main::k#2 = (byte) main::k#3 -Alias (byte*) SCREEN#10 = (byte*) SCREEN#4 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#11 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#2 -Self Phi Eliminated (byte*) SCREEN#3 -Self Phi Eliminated (byte*) SCREEN#10 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#5 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#5 -Redundant Phi (byte*) SCREEN#3 (byte*) SCREEN#2 -Redundant Phi (byte*) SCREEN#10 (byte*) SCREEN#3 -Successful SSA optimization Pass2RedundantPhiElimination -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [9] if((byte) main::i#1!=rangelast(0,$a)) goto main::@1 -Simple Condition (bool~) main::$3 [18] if((byte) main::j#1!=rangelast(0,$a)) goto main::@2 -Simple Condition (bool~) main::$5 [27] if((byte) main::k#1!=rangelast(0,$a)) goto main::@3 +Simple Condition (bool~) main::$1 [8] if((byte) main::i#1!=rangelast(0,$a)) goto main::@1 +Simple Condition (bool~) main::$3 [16] if((byte) main::j#1!=rangelast(0,$a)) goto main::@2 +Simple Condition (bool~) main::$5 [24] if((byte) main::k#1!=rangelast(0,$a)) goto main::@3 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) main::i#0 = 0 diff --git a/src/test/ref/print-problem.log b/src/test/ref/print-problem.log index c276ccbb4..83aab571b 100644 --- a/src/test/ref/print-problem.log +++ b/src/test/ref/print-problem.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -6,13 +7,11 @@ CONTROL FLOW GRAPH SSA (byte) char#0 ← (byte) line#0 to:@2 main: scope:[main] from @2 - (byte*) SCREEN#4 ← phi( @2/(byte*) SCREEN#5 ) (byte) char#16 ← phi( @2/(byte) char#17 ) (byte) line#15 ← phi( @2/(byte) line#16 ) call ln to:main::@1 main::@1: scope:[main] from main - (byte*) SCREEN#3 ← phi( main/(byte*) SCREEN#4 ) (byte) char#10 ← phi( main/(byte) char#8 ) (byte) line#8 ← phi( main/(byte) line#6 ) (byte) line#1 ← (byte) line#8 @@ -21,7 +20,6 @@ main::@1: scope:[main] from main call ln to:main::@2 main::@2: scope:[main] from main::@1 - (byte*) SCREEN#2 ← phi( main::@1/(byte*) SCREEN#3 ) (byte) char#11 ← phi( main::@1/(byte) char#8 ) (byte) line#9 ← phi( main::@1/(byte) line#6 ) (byte) line#2 ← (byte) line#9 @@ -30,12 +28,11 @@ main::@2: scope:[main] from main::@1 call ln to:main::@3 main::@3: scope:[main] from main::@2 - (byte*) SCREEN#1 ← phi( main::@2/(byte*) SCREEN#2 ) (byte) char#12 ← phi( main::@2/(byte) char#8 ) (byte) line#10 ← phi( main::@2/(byte) line#6 ) (byte) line#3 ← (byte) line#10 (byte) char#5 ← (byte) char#12 - *((byte*) SCREEN#1) ← (byte) char#5 + *((byte*) SCREEN#0) ← (byte) char#5 to:main::@return main::@return: scope:[main] from main::@3 (byte) char#13 ← phi( main::@3/(byte) char#5 ) @@ -58,7 +55,6 @@ ln::@return: scope:[ln] from ln return to:@return @2: scope:[] from @begin - (byte*) SCREEN#5 ← phi( @begin/(byte*) SCREEN#0 ) (byte) char#17 ← phi( @begin/(byte) char#0 ) (byte) line#16 ← phi( @begin/(byte) line#0 ) call main @@ -78,11 +74,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 (byte) char (byte) char#0 (byte) char#1 @@ -130,7 +121,6 @@ SYMBOL TABLE SSA (label) main::@return Alias (byte) line#0 = (byte) char#0 (byte) line#16 (byte) char#17 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#3 (byte*) SCREEN#4 (byte*) SCREEN#2 Alias (byte) line#1 = (byte) line#8 Alias (byte) char#1 = (byte) char#10 Alias (byte) line#2 = (byte) line#9 @@ -138,13 +128,11 @@ Alias (byte) char#11 = (byte) char#3 Alias (byte) line#10 = (byte) line#3 (byte) line#11 (byte) line#4 Alias (byte) char#12 = (byte) char#5 (byte) char#13 (byte) char#6 Alias (byte) line#13 = (byte) line#5 (byte/signed word/word/dword/signed dword~) ln::$0 (byte) char#7 (byte) char#14 (byte) line#6 (byte) char#8 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#5 Alias (byte) line#14 = (byte) line#7 Alias (byte) char#15 = (byte) char#9 Successful SSA optimization Pass2AliasElimination Redundant Phi (byte) line#15 (byte) line#0 Redundant Phi (byte) char#16 (byte) line#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 Redundant Phi (byte) line#1 (byte) line#13 Redundant Phi (byte) char#1 (byte) line#13 Redundant Phi (byte) line#2 (byte) line#13 diff --git a/src/test/ref/ptr-complex.log b/src/test/ref/ptr-complex.log index 4f270173c..0ec5bf862 100644 --- a/src/test/ref/ptr-complex.log +++ b/src/test/ref/ptr-complex.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) main::screen +Identified constant variable (byte*) main::BGCOL CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -10,31 +12,28 @@ main: scope:[main] from @1 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::screen#1 ← phi( main/(byte*) main::screen#0 main::@1/(byte*) main::screen#1 ) - (byte*~) main::$1 ← (byte*) main::screen#1 + (byte/signed byte/word/signed word/dword/signed dword) $28 + (byte*~) main::$1 ← (byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) $28 (byte*~) main::$2 ← (byte*~) main::$1 + (byte) main::i#2 - *((byte*) main::screen#1 + (byte) main::i#2) ← *((byte*~) main::$2) + *((byte*) main::screen#0 + (byte) main::i#2) ← *((byte*~) main::$2) (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$a) (bool~) main::$3 ← (byte) main::i#1 != rangelast(0,$a) if((bool~) main::$3) goto main::@1 to:main::@3 main::@3: scope:[main] from main::@1 - (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#1 ) - (byte*~) main::$4 ← (byte*) main::screen#2 + (byte/signed byte/word/signed word/dword/signed dword) $51 + (byte*~) main::$4 ← (byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) $51 (byte*) main::sc2#0 ← (byte*~) main::$4 - (byte*~) main::$5 ← (byte*) main::screen#2 + (byte/signed byte/word/signed word/dword/signed dword) $79 + (byte*~) main::$5 ← (byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) $79 *((byte*) main::sc2#0) ← *((byte*~) main::$5) - (byte*~) main::$6 ← (byte*) main::screen#2 + (byte/signed byte/word/signed word/dword/signed dword) $52 - (byte*~) main::$7 ← (byte*) main::screen#2 + (byte/signed byte/word/signed word/dword/signed dword) $7a + (byte*~) main::$6 ← (byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) $52 + (byte*~) main::$7 ← (byte*) main::screen#0 + (byte/signed byte/word/signed word/dword/signed dword) $7a *((byte*~) main::$6) ← *((byte*~) main::$7) (byte) main::j#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@2 main::@2: scope:[main] from main::@2 main::@3 (byte) main::j#2 ← phi( main::@2/(byte) main::j#1 main::@3/(byte) main::j#0 ) - (byte*) main::screen#3 ← phi( main::@2/(byte*) main::screen#3 main::@3/(byte*) main::screen#2 ) - (byte*~) main::$8 ← (byte*) main::screen#3 + (byte/word/signed word/dword/signed dword) $a0 + (byte*~) main::$8 ← (byte*) main::screen#0 + (byte/word/signed word/dword/signed dword) $a0 (byte*~) main::$9 ← (byte*~) main::$8 + (byte) main::j#2 - (byte*~) main::$10 ← (byte*) main::screen#3 + (byte/word/signed word/dword/signed dword) $c8 + (byte*~) main::$10 ← (byte*) main::screen#0 + (byte/word/signed word/dword/signed dword) $c8 (byte*~) main::$11 ← (byte*~) main::$10 + (byte) main::j#2 *((byte*~) main::$9) ← *((byte*~) main::$11) (byte) main::j#1 ← (byte) main::j#2 + rangenext(0,$a) @@ -115,23 +114,13 @@ SYMBOL TABLE SSA (byte*) main::sc2#0 (byte*) main::screen (byte*) main::screen#0 -(byte*) main::screen#1 -(byte*) main::screen#2 -(byte*) main::screen#3 Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) main::screen#1 = (byte*) main::screen#2 Alias (byte*) main::sc2#0 = (byte*~) main::$4 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::screen#1 -Self Phi Eliminated (byte*) main::screen#3 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::screen#1 (byte*) main::screen#0 -Redundant Phi (byte*) main::screen#3 (byte*) main::screen#1 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$3 [10] if((byte) main::i#1!=rangelast(0,$a)) goto main::@1 -Simple Condition (bool~) main::$12 [28] if((byte) main::j#1!=rangelast(0,$a)) goto main::@2 +Simple Condition (bool~) main::$12 [27] if((byte) main::j#1!=rangelast(0,$a)) goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) main::screen#0 = ((byte*))$400 Constant (const byte) main::i#0 = 0 diff --git a/src/test/ref/ptrtest.log b/src/test/ref/ptrtest.log index 4f9d71e96..ba75970b5 100644 --- a/src/test/ref/ptrtest.log +++ b/src/test/ref/ptrtest.log @@ -1,3 +1,4 @@ +Identified constant variable (byte) lvaluevar::b CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -64,7 +65,6 @@ lvaluevar: scope:[lvaluevar] from main::@3 to:lvaluevar::@1 lvaluevar::@1: scope:[lvaluevar] from lvaluevar lvaluevar::@2 (byte*) lvaluevar::screen#3 ← phi( lvaluevar/(byte*) lvaluevar::screen#0 lvaluevar::@2/(byte*) lvaluevar::screen#1 ) - (byte) lvaluevar::b#2 ← phi( lvaluevar/(byte) lvaluevar::b#0 lvaluevar::@2/(byte) lvaluevar::b#1 ) (byte) lvaluevar::i#2 ← phi( lvaluevar/(byte) lvaluevar::i#0 lvaluevar::@2/(byte) lvaluevar::i#1 ) (bool~) lvaluevar::$0 ← (byte) lvaluevar::i#2 < (byte/signed byte/word/signed word/dword/signed dword) $a if((bool~) lvaluevar::$0) goto lvaluevar::@2 @@ -72,8 +72,7 @@ lvaluevar::@1: scope:[lvaluevar] from lvaluevar lvaluevar::@2 lvaluevar::@2: scope:[lvaluevar] from lvaluevar::@1 (byte) lvaluevar::i#3 ← phi( lvaluevar::@1/(byte) lvaluevar::i#2 ) (byte*) lvaluevar::screen#2 ← phi( lvaluevar::@1/(byte*) lvaluevar::screen#3 ) - (byte) lvaluevar::b#1 ← phi( lvaluevar::@1/(byte) lvaluevar::b#2 ) - *((byte*) lvaluevar::screen#2) ← (byte) lvaluevar::b#1 + *((byte*) lvaluevar::screen#2) ← (byte) lvaluevar::b#0 (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#3 to:lvaluevar::@1 @@ -132,8 +131,6 @@ SYMBOL TABLE SSA (label) lvaluevar::@return (byte) lvaluevar::b (byte) lvaluevar::b#0 -(byte) lvaluevar::b#1 -(byte) lvaluevar::b#2 (byte) lvaluevar::i (byte) lvaluevar::i#0 (byte) lvaluevar::i#1 @@ -190,16 +187,11 @@ Culled Empty Block (label) @6 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) lvalue::i#2 = (byte) lvalue::i#3 Alias (byte) rvalue::i#2 = (byte) rvalue::i#3 -Alias (byte) lvaluevar::b#1 = (byte) lvaluevar::b#2 Alias (byte*) lvaluevar::screen#2 = (byte*) lvaluevar::screen#3 Alias (byte) lvaluevar::i#2 = (byte) lvaluevar::i#3 Alias (byte*) rvaluevar::screen#2 = (byte*) rvaluevar::screen#3 Alias (byte) rvaluevar::i#2 = (byte) rvaluevar::i#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte) lvaluevar::b#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte) lvaluevar::b#1 (byte) lvaluevar::b#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) lvalue::$0 [11] if((byte) lvalue::i#2<(byte/signed byte/word/signed word/dword/signed dword) $a) goto lvalue::@2 Simple Condition (bool~) rvalue::$0 [22] if((byte) rvalue::i#2<(byte/signed byte/word/signed word/dword/signed dword) $a) goto rvalue::@2 Simple Condition (bool~) lvaluevar::$0 [32] if((byte) lvaluevar::i#2<(byte/signed byte/word/signed word/dword/signed dword) $a) goto lvaluevar::@2 diff --git a/src/test/ref/roll-variable.log b/src/test/ref/roll-variable.log index 37f477a64..bff8bdf51 100644 --- a/src/test/ref/roll-variable.log +++ b/src/test/ref/roll-variable.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -7,10 +8,9 @@ main: scope:[main] from @1 (byte) main::b#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 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::b#2 ← phi( main/(byte) main::b#0 main::@1/(byte) main::b#1 ) (byte/signed byte/word/signed word/dword/signed dword~) main::$0 ← (byte/signed byte/word/signed word/dword/signed dword) $55 << (byte) main::b#2 - *((byte*) main::screen#1 + (byte) main::b#2) ← (byte/signed byte/word/signed word/dword/signed dword~) main::$0 + *((byte*) main::screen#0 + (byte) main::b#2) ← (byte/signed byte/word/signed word/dword/signed dword~) main::$0 (byte) main::b#1 ← (byte) main::b#2 + rangenext(0,7) (bool~) main::$1 ← (byte) main::b#1 != rangelast(0,7) if((bool~) main::$1) goto main::@1 @@ -41,14 +41,9 @@ SYMBOL TABLE SSA (byte) main::b#2 (byte*) main::screen (byte*) main::screen#0 -(byte*) main::screen#1 Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte*) main::screen#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::screen#1 (byte*) main::screen#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$1 [7] if((byte) main::b#1!=rangelast(0,7)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) main::screen#0 = ((byte*))$400 diff --git a/src/test/ref/runtime-unused-procedure.log b/src/test/ref/runtime-unused-procedure.log index 777e1ca14..fe2189b76 100644 --- a/src/test/ref/runtime-unused-procedure.log +++ b/src/test/ref/runtime-unused-procedure.log @@ -1,3 +1,5 @@ +Identified constant variable (byte) call +Identified constant variable (byte*) screen CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -5,17 +7,14 @@ CONTROL FLOW GRAPH SSA (byte*) screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@2 main: scope:[main] from @2 - (byte) call#1 ← phi( @2/(byte) call#2 ) - (byte*) screen#1 ← phi( @2/(byte*) screen#4 ) - *((byte*) screen#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'a' - (bool~) main::$0 ← (byte) call#1 != (byte/signed byte/word/signed word/dword/signed dword) 0 + *((byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) 'a' + (bool~) main::$0 ← (byte) call#0 != (byte/signed byte/word/signed word/dword/signed dword) 0 (bool~) main::$1 ← ! (bool~) main::$0 if((bool~) main::$1) goto main::@1 to:main::@2 main::@1: scope:[main] from main to:main::@return main::@2: scope:[main] from main - (byte*) screen#5 ← phi( main/(byte*) screen#1 ) call proc to:main::@3 main::@3: scope:[main] from main::@2 @@ -24,24 +23,20 @@ main::@return: scope:[main] from main::@1 main::@3 return to:@return proc: scope:[proc] from main::@2 - (byte*) screen#2 ← phi( main::@2/(byte*) screen#5 ) - *((byte*) screen#2 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'a' - (bool~) proc::$0 ← *((byte*) screen#2 + (byte/signed byte/word/signed word/dword/signed dword) 1) != (byte/signed byte/word/signed word/dword/signed dword) 0 + *((byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) 'a' + (bool~) proc::$0 ← *((byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) != (byte/signed byte/word/signed word/dword/signed dword) 0 (bool~) proc::$1 ← ! (bool~) proc::$0 if((bool~) proc::$1) goto proc::@1 to:proc::@2 proc::@1: scope:[proc] from proc to:proc::@return proc::@2: scope:[proc] from proc - (byte*) screen#3 ← phi( proc/(byte*) screen#2 ) - *((byte*) screen#3 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) 'a' + *((byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) 'a' to:proc::@return proc::@return: scope:[proc] from proc::@1 proc::@2 return to:@return @2: scope:[] from @begin - (byte) call#2 ← phi( @begin/(byte) call#0 ) - (byte*) screen#4 ← phi( @begin/(byte*) screen#0 ) call main to:@3 @3: scope:[] from @2 @@ -55,8 +50,6 @@ SYMBOL TABLE SSA (label) @end (byte) call (byte) call#0 -(byte) call#1 -(byte) call#2 (void()) main() (bool~) main::$0 (bool~) main::$1 @@ -72,31 +65,17 @@ SYMBOL TABLE SSA (label) proc::@return (byte*) screen (byte*) screen#0 -(byte*) screen#1 -(byte*) screen#2 -(byte*) screen#3 -(byte*) screen#4 -(byte*) screen#5 Culled Empty Block (label) main::@1 Culled Empty Block (label) main::@3 Culled Empty Block (label) proc::@1 Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [5] (bool~) main::$1 ← (byte) call#1 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [4] (bool~) main::$0 ← (byte) call#1 != (byte/signed byte/word/signed word/dword/signed dword) 0 -Inversing boolean not [13] (bool~) proc::$1 ← *((byte*) screen#2 + (byte/signed byte/word/signed word/dword/signed dword) 1) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [12] (bool~) proc::$0 ← *((byte*) screen#2 + (byte/signed byte/word/signed word/dword/signed dword) 1) != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [4] (bool~) main::$1 ← (byte) call#0 == (byte/signed byte/word/signed word/dword/signed dword) 0 from [3] (bool~) main::$0 ← (byte) call#0 != (byte/signed byte/word/signed word/dword/signed dword) 0 +Inversing boolean not [10] (bool~) proc::$1 ← *((byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) == (byte/signed byte/word/signed word/dword/signed dword) 0 from [9] (bool~) proc::$0 ← *((byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) != (byte/signed byte/word/signed word/dword/signed dword) 0 Successful SSA optimization Pass2UnaryNotSimplification -Alias (byte*) screen#1 = (byte*) screen#5 -Alias (byte*) screen#2 = (byte*) screen#3 -Alias (byte*) screen#0 = (byte*) screen#4 -Alias (byte) call#0 = (byte) call#2 -Successful SSA optimization Pass2AliasElimination -Redundant Phi (byte*) screen#1 (byte*) screen#0 -Redundant Phi (byte) call#1 (byte) call#0 -Redundant Phi (byte*) screen#2 (byte*) screen#1 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [6] if((byte) call#0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@return -Simple Condition (bool~) proc::$1 [14] if(*((byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 1)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto proc::@return +Simple Condition (bool~) main::$1 [5] if((byte) call#0==(byte/signed byte/word/signed word/dword/signed dword) 0) goto main::@return +Simple Condition (bool~) proc::$1 [11] if(*((byte*) screen#0 + (byte/signed byte/word/signed word/dword/signed dword) 1)==(byte/signed byte/word/signed word/dword/signed dword) 0) goto proc::@return Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte) call#0 = 0 Constant (const byte*) screen#0 = ((byte*))$400 diff --git a/src/test/ref/scroll-clobber.log b/src/test/ref/scroll-clobber.log index 96f2c8f36..6fc39f114 100644 --- a/src/test/ref/scroll-clobber.log +++ b/src/test/ref/scroll-clobber.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) SCREEN +Identified constant variable (byte*) SCROLL CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -6,12 +8,10 @@ CONTROL FLOW GRAPH SSA (byte[]) TEXT#0 ← (const string) $0 to:@1 main: scope:[main] from @1 - (byte*) SCREEN#4 ← phi( @1/(byte*) SCREEN#5 ) (byte*) main::nxt#0 ← (byte[]) TEXT#0 (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@2 - (byte*) SCREEN#2 ← phi( main/(byte*) SCREEN#4 main::@2/(byte*) SCREEN#1 ) (byte) main::i#3 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#1 ) (byte*) main::nxt#3 ← phi( main/(byte*) main::nxt#0 main::@2/(byte*) main::nxt#1 ) (byte) main::c#0 ← *((byte*) main::nxt#3) @@ -21,16 +21,14 @@ main::@1: scope:[main] from main main::@2 to:main::@3 main::@2: scope:[main] from main::@1 main::@3 (byte*) main::nxt#4 ← phi( main::@1/(byte*) main::nxt#3 main::@3/(byte*) main::nxt#2 ) - (byte*) SCREEN#1 ← phi( main::@1/(byte*) SCREEN#2 main::@3/(byte*) SCREEN#3 ) (byte) main::c#2 ← phi( main::@1/(byte) main::c#0 main::@3/(byte) main::c#1 ) (byte) main::i#2 ← phi( main::@1/(byte) main::i#3 main::@3/(byte) main::i#4 ) (byte) main::i#1 ← ++ (byte) main::i#2 - *((byte*) SCREEN#1 + (byte) main::i#1) ← (byte) main::c#2 + *((byte*) SCREEN#0 + (byte) main::i#1) ← (byte) main::c#2 (byte*) main::nxt#1 ← ++ (byte*) main::nxt#4 if(true) goto main::@1 to:main::@return main::@3: scope:[main] from main::@1 - (byte*) SCREEN#3 ← phi( main::@1/(byte*) SCREEN#2 ) (byte) main::i#4 ← phi( main::@1/(byte) main::i#3 ) (byte*) main::nxt#2 ← (byte[]) TEXT#0 (byte) main::c#1 ← *((byte*) main::nxt#2) @@ -39,7 +37,6 @@ main::@return: scope:[main] from main::@2 return to:@return @1: scope:[] from @begin - (byte*) SCREEN#5 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -54,11 +51,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 (byte*) SCROLL (byte*) SCROLL#0 (byte[]) TEXT @@ -89,21 +81,13 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [9] (bool~) main::$1 ← (byte) main::c#0 != (byte) '@' from [8] (bool~) main::$0 ← (byte) main::c#0 == (byte) '@' +Inversing boolean not [8] (bool~) main::$1 ← (byte) main::c#0 != (byte) '@' from [7] (bool~) main::$0 ← (byte) main::c#0 == (byte) '@' Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) main::i#3 = (byte) main::i#4 -Alias (byte*) SCREEN#2 = (byte*) SCREEN#3 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#5 Successful SSA optimization Pass2AliasElimination Alias (byte) main::i#2 = (byte) main::i#3 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#2 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#4 (byte*) SCREEN#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#4 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [10] if((byte) main::c#0!=(byte) '@') goto main::@2 +Simple Condition (bool~) main::$1 [9] if((byte) main::c#0!=(byte) '@') goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte*) SCROLL#0 = ((byte*))$d016 diff --git a/src/test/ref/scrollbig-clobber.log b/src/test/ref/scrollbig-clobber.log index 5fcd9f9a7..a1c8b445f 100644 --- a/src/test/ref/scrollbig-clobber.log +++ b/src/test/ref/scrollbig-clobber.log @@ -1,31 +1,28 @@ +Identified constant variable (byte*) TEXT +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) TEXT#0 ← (const string) $0 to:@1 main: scope:[main] from @2 - (byte*) TEXT#5 ← phi( @2/(byte*) TEXT#7 ) (byte*) nxt#15 ← phi( @2/(byte*) nxt#14 ) (byte*) main::SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@3 - (byte*) TEXT#4 ← phi( main/(byte*) TEXT#5 main::@3/(byte*) TEXT#6 ) (byte) main::i#3 ← phi( main/(byte) main::i#0 main::@3/(byte) main::i#1 ) - (byte*) main::SCREEN#2 ← phi( main/(byte*) main::SCREEN#0 main::@3/(byte*) main::SCREEN#1 ) (byte*) nxt#13 ← phi( main/(byte*) nxt#15 main::@3/(byte*) nxt#0 ) call next_char (byte) next_char::return#0 ← (byte) next_char::return#2 to:main::@3 main::@3: scope:[main] from main::@1 - (byte*) TEXT#6 ← phi( main::@1/(byte*) TEXT#4 ) (byte) main::i#2 ← phi( main::@1/(byte) main::i#3 ) - (byte*) main::SCREEN#1 ← phi( main::@1/(byte*) main::SCREEN#2 ) (byte*) nxt#7 ← phi( main::@1/(byte*) nxt#5 ) (byte) next_char::return#3 ← phi( main::@1/(byte) next_char::return#0 ) (byte~) main::$0 ← (byte) next_char::return#3 (byte*) nxt#0 ← (byte*) nxt#7 - *((byte*) main::SCREEN#1 + (byte) main::i#2) ← (byte~) main::$0 + *((byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$0 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$ff) (bool~) main::$1 ← (byte) main::i#1 != rangelast(0,$ff) if((bool~) main::$1) goto main::@1 @@ -36,11 +33,9 @@ main::@return: scope:[main] from main::@3 return to:@return @1: scope:[] from @begin - (byte*) TEXT#1 ← phi( @begin/(byte*) TEXT#0 ) - (byte*) nxt#2 ← (byte*) TEXT#1 + (byte*) nxt#2 ← (byte*) TEXT#0 to:@2 next_char: scope:[next_char] from main::@1 - (byte*) TEXT#3 ← phi( main::@1/(byte*) TEXT#4 ) (byte*) nxt#9 ← phi( main::@1/(byte*) nxt#13 ) (byte) next_char::c#0 ← *((byte*) nxt#9) (bool~) next_char::$0 ← (byte) next_char::c#0 == (byte) '@' @@ -54,8 +49,7 @@ next_char::@1: scope:[next_char] from next_char next_char::@2 (byte) next_char::return#1 ← (byte) next_char::c#2 to:next_char::@return next_char::@2: scope:[next_char] from next_char - (byte*) TEXT#2 ← phi( next_char/(byte*) TEXT#3 ) - (byte*) nxt#4 ← (byte*) TEXT#2 + (byte*) nxt#4 ← (byte*) TEXT#0 (byte) next_char::c#1 ← *((byte*) nxt#4) to:next_char::@1 next_char::@return: scope:[next_char] from next_char::@1 @@ -66,7 +60,6 @@ next_char::@return: scope:[next_char] from next_char::@1 return to:@return @2: scope:[] from @1 - (byte*) TEXT#7 ← phi( @1/(byte*) TEXT#1 ) (byte*) nxt#14 ← phi( @1/(byte*) nxt#2 ) call main to:@3 @@ -85,13 +78,6 @@ SYMBOL TABLE SSA (label) @end (byte*) TEXT (byte*) TEXT#0 -(byte*) TEXT#1 -(byte*) TEXT#2 -(byte*) TEXT#3 -(byte*) TEXT#4 -(byte*) TEXT#5 -(byte*) TEXT#6 -(byte*) TEXT#7 (void()) main() (byte~) main::$0 (bool~) main::$1 @@ -100,8 +86,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::SCREEN (byte*) main::SCREEN#0 -(byte*) main::SCREEN#1 -(byte*) main::SCREEN#2 (byte) main::i (byte) main::i#0 (byte) main::i#1 @@ -141,46 +125,40 @@ SYMBOL TABLE SSA (byte*) nxt#8 (byte*) nxt#9 -Inversing boolean not [22] (bool~) next_char::$1 ← (byte) next_char::c#0 != (byte) '@' from [21] (bool~) next_char::$0 ← (byte) next_char::c#0 == (byte) '@' +Inversing boolean not [21] (bool~) next_char::$1 ← (byte) next_char::c#0 != (byte) '@' from [20] (bool~) next_char::$0 ← (byte) next_char::c#0 == (byte) '@' Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) next_char::return#0 = (byte) next_char::return#3 -Alias (byte*) main::SCREEN#1 = (byte*) main::SCREEN#2 Alias (byte) main::i#2 = (byte) main::i#3 -Alias (byte*) TEXT#4 = (byte*) TEXT#6 Alias (byte*) nxt#0 = (byte*) nxt#7 (byte*) nxt#8 (byte*) nxt#1 -Alias (byte*) TEXT#0 = (byte*) TEXT#1 (byte*) nxt#2 (byte*) nxt#14 (byte*) TEXT#7 +Alias (byte*) TEXT#0 = (byte*) nxt#2 (byte*) nxt#14 Alias (byte) next_char::return#1 = (byte) next_char::c#2 (byte) next_char::return#4 (byte) next_char::return#2 -Alias (byte*) TEXT#2 = (byte*) TEXT#3 (byte*) nxt#4 Alias (byte*) nxt#11 = (byte*) nxt#3 (byte*) nxt#5 Alias (byte*) nxt#12 = (byte*) nxt#6 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::SCREEN#1 -Self Phi Eliminated (byte*) TEXT#4 -Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (byte*) nxt#15 (byte*) TEXT#0 -Redundant Phi (byte*) TEXT#5 (byte*) TEXT#0 -Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#0 -Redundant Phi (byte*) TEXT#4 (byte*) TEXT#5 Redundant Phi (byte*) nxt#0 (byte*) nxt#11 Redundant Phi (byte*) nxt#9 (byte*) nxt#13 -Redundant Phi (byte*) TEXT#2 (byte*) TEXT#4 Redundant Phi (byte*) nxt#12 (byte*) nxt#0 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$1 [13] if((byte) main::i#1!=rangelast(0,$ff)) goto main::@1 -Simple Condition (bool~) next_char::$1 [23] if((byte) next_char::c#0!=(byte) '@') goto next_char::@1 +Simple Condition (bool~) next_char::$1 [22] if((byte) next_char::c#0!=(byte) '@') goto next_char::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) TEXT#0 = $0 Constant (const byte*) main::SCREEN#0 = ((byte*))$400 Constant (const byte) main::i#0 = 0 Successful SSA optimization Pass2ConstantIdentification +Constant (const byte*) nxt#4 = TEXT#0 +Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value main::i#1 ← ++ main::i#2 to ++ Resolved ranged comparison value if(main::i#1!=rangelast(0,$ff)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) 0 Culled Empty Block (label) @1 Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks Inlining constant with var siblings (const byte) main::i#0 +Inlining constant with var siblings (const byte*) nxt#4 Constant inlined $0 = (const byte*) TEXT#0 Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 +Constant inlined nxt#4 = (const byte*) TEXT#0 Successful SSA optimization Pass2ConstantInlining Added new block during phi lifting main::@4(between main::@3 and main::@1) Added new block during phi lifting next_char::@4(between next_char and next_char::@1) diff --git a/src/test/ref/signed-bytes.log b/src/test/ref/signed-bytes.log index bc013eeef..4bef27732 100644 --- a/src/test/ref/signed-bytes.log +++ b/src/test/ref/signed-bytes.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -10,17 +11,15 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@2 (byte) main::j#3 ← phi( main/(byte) main::j#0 main::@2/(byte) main::j#1 ) - (byte*) main::screen#2 ← phi( main/(byte*) main::screen#0 main::@2/(byte*) main::screen#1 ) (signed byte) main::i#2 ← phi( main/(signed byte) main::i#0 main::@2/(signed byte) main::i#1 ) (bool~) main::$1 ← (signed byte) main::i#2 < (byte/signed byte/word/signed word/dword/signed dword) $7f if((bool~) main::$1) goto main::@2 to:main::@return main::@2: scope:[main] from main::@1 (byte) main::j#2 ← phi( main::@1/(byte) main::j#3 ) - (byte*) main::screen#1 ← phi( main::@1/(byte*) main::screen#2 ) (signed byte) main::i#3 ← phi( main::@1/(signed byte) main::i#2 ) (byte~) main::$2 ← ((byte)) (signed byte) main::i#3 - *((byte*) main::screen#1 + (byte) main::j#2) ← (byte~) main::$2 + *((byte*) main::screen#0 + (byte) main::j#2) ← (byte~) main::$2 (signed byte) main::i#1 ← ++ (signed byte) main::i#3 (byte) main::j#1 ← ++ (byte) main::j#2 to:main::@1 @@ -58,20 +57,13 @@ SYMBOL TABLE SSA (byte) main::j#3 (byte*) main::screen (byte*) main::screen#0 -(byte*) main::screen#1 -(byte*) main::screen#2 Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (signed byte) main::i#0 = (signed byte/signed word/signed dword~) main::$0 Alias (signed byte) main::i#2 = (signed byte) main::i#3 -Alias (byte*) main::screen#1 = (byte*) main::screen#2 Alias (byte) main::j#2 = (byte) main::j#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::screen#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::screen#1 (byte*) main::screen#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$1 [6] if((signed byte) main::i#2<(byte/signed byte/word/signed word/dword/signed dword) $7f) goto main::@2 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) main::screen#0 = ((byte*))$400 diff --git a/src/test/ref/sinusgen16.log b/src/test/ref/sinusgen16.log index 1b8c11cec..d99f7255a 100644 --- a/src/test/ref/sinusgen16.log +++ b/src/test/ref/sinusgen16.log @@ -1,3 +1,4 @@ +Identified constant variable (word) main::wavelength CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -555,7 +556,6 @@ main: scope:[main] from @40 call sin16s_gen to:main::@5 main::@5: scope:[main] from main - (word) main::wavelength#8 ← phi( main/(word) main::wavelength#0 ) (byte*) print_char_cursor#47 ← phi( main/(byte*) print_char_cursor#53 ) (byte*) print_line_cursor#10 ← phi( main/(byte*) print_line_cursor#13 ) (byte*) print_screen#4 ← phi( main/(byte*) print_screen#5 ) @@ -565,7 +565,6 @@ main::@5: scope:[main] from main to:main::@6 main::@6: scope:[main] from main::@5 (word) rem16u#35 ← phi( main::@5/(word) rem16u#8 ) - (word) main::wavelength#6 ← phi( main::@5/(word) main::wavelength#8 ) (byte*) print_char_cursor#36 ← phi( main::@5/(byte*) print_char_cursor#15 ) (byte*) print_line_cursor#7 ← phi( main::@5/(byte*) print_line_cursor#2 ) (byte*) print_line_cursor#3 ← (byte*) print_line_cursor#7 @@ -575,7 +574,6 @@ main::@6: scope:[main] from main::@5 main::@1: scope:[main] from main::@6 main::@8 (byte*) print_line_cursor#17 ← phi( main::@6/(byte*) print_line_cursor#3 main::@8/(byte*) print_line_cursor#11 ) (word) rem16u#32 ← phi( main::@6/(word) rem16u#35 main::@8/(word) rem16u#24 ) - (word) main::wavelength#4 ← phi( main::@6/(word) main::wavelength#6 main::@8/(word) main::wavelength#1 ) (byte*) print_char_cursor#54 ← phi( main::@6/(byte*) print_char_cursor#16 main::@8/(byte*) print_char_cursor#18 ) (signed word*) main::st1#2 ← phi( main::@6/(signed word*) main::st1#0 main::@8/(signed word*) main::st1#1 ) (signed word) main::sw#0 ← *((signed word*) main::st1#2) @@ -586,7 +584,6 @@ main::@1: scope:[main] from main::@6 main::@8 main::@2: scope:[main] from main::@1 main::@9 (byte*) print_line_cursor#16 ← phi( main::@1/(byte*) print_line_cursor#17 main::@9/(byte*) print_line_cursor#18 ) (word) rem16u#30 ← phi( main::@1/(word) rem16u#32 main::@9/(word) rem16u#33 ) - (word) main::wavelength#3 ← phi( main::@1/(word) main::wavelength#4 main::@9/(word) main::wavelength#5 ) (signed word*) main::st1#5 ← phi( main::@1/(signed word*) main::st1#2 main::@9/(signed word*) main::st1#6 ) (byte*) print_char_cursor#48 ← phi( main::@1/(byte*) print_char_cursor#54 main::@9/(byte*) print_char_cursor#19 ) (signed word) main::sw#1 ← phi( main::@1/(signed word) main::sw#0 main::@9/(signed word) main::sw#2 ) @@ -596,7 +593,6 @@ main::@2: scope:[main] from main::@1 main::@9 main::@7: scope:[main] from main::@2 (byte*) print_line_cursor#14 ← phi( main::@2/(byte*) print_line_cursor#16 ) (word) rem16u#27 ← phi( main::@2/(word) rem16u#30 ) - (word) main::wavelength#2 ← phi( main::@2/(word) main::wavelength#3 ) (signed word*) main::st1#4 ← phi( main::@2/(signed word*) main::st1#5 ) (byte*) print_char_cursor#37 ← phi( main::@2/(byte*) print_char_cursor#5 ) (byte*) print_char_cursor#17 ← (byte*) print_char_cursor#37 @@ -606,13 +602,12 @@ main::@7: scope:[main] from main::@2 main::@8: scope:[main] from main::@7 (byte*) print_line_cursor#11 ← phi( main::@7/(byte*) print_line_cursor#14 ) (word) rem16u#24 ← phi( main::@7/(word) rem16u#27 ) - (word) main::wavelength#1 ← phi( main::@7/(word) main::wavelength#2 ) (signed word*) main::st1#3 ← phi( main::@7/(signed word*) main::st1#4 ) (byte*) print_char_cursor#38 ← phi( main::@7/(byte*) print_char_cursor#2 ) (byte*) print_char_cursor#18 ← (byte*) print_char_cursor#38 (signed word*~) main::$7 ← (signed word*) main::st1#3 + (byte/signed byte/word/signed word/dword/signed dword) 2 (signed word*) main::st1#1 ← (signed word*~) main::$7 - (word/signed dword/dword~) main::$8 ← (word) main::wavelength#1 * (byte/signed byte/word/signed word/dword/signed dword) 2 + (word/signed dword/dword~) main::$8 ← (word) main::wavelength#0 * (byte/signed byte/word/signed word/dword/signed dword) 2 (signed word*~) main::$9 ← (signed word[$78]) main::sintab1#0 + (word/signed dword/dword~) main::$8 (bool~) main::$10 ← (signed word*) main::st1#1 < (signed word*~) main::$9 if((bool~) main::$10) goto main::@1 @@ -620,7 +615,6 @@ main::@8: scope:[main] from main::@7 main::@3: scope:[main] from main::@1 (byte*) print_line_cursor#19 ← phi( main::@1/(byte*) print_line_cursor#17 ) (word) rem16u#36 ← phi( main::@1/(word) rem16u#32 ) - (word) main::wavelength#7 ← phi( main::@1/(word) main::wavelength#4 ) (signed word*) main::st1#7 ← phi( main::@1/(signed word*) main::st1#2 ) (signed word) main::sw#3 ← phi( main::@1/(signed word) main::sw#0 ) (byte*) print_char_cursor#49 ← phi( main::@1/(byte*) print_char_cursor#54 ) @@ -630,7 +624,6 @@ main::@3: scope:[main] from main::@1 main::@9: scope:[main] from main::@3 (byte*) print_line_cursor#18 ← phi( main::@3/(byte*) print_line_cursor#19 ) (word) rem16u#33 ← phi( main::@3/(word) rem16u#36 ) - (word) main::wavelength#5 ← phi( main::@3/(word) main::wavelength#7 ) (signed word*) main::st1#6 ← phi( main::@3/(signed word*) main::st1#7 ) (signed word) main::sw#2 ← phi( main::@3/(signed word) main::sw#3 ) (byte*) print_char_cursor#39 ← phi( main::@3/(byte*) print_char_cursor#2 ) @@ -829,14 +822,6 @@ SYMBOL TABLE SSA (signed word) main::sw#3 (word) main::wavelength (word) main::wavelength#0 -(word) main::wavelength#1 -(word) main::wavelength#2 -(word) main::wavelength#3 -(word) main::wavelength#4 -(word) main::wavelength#5 -(word) main::wavelength#6 -(word) main::wavelength#7 -(word) main::wavelength#8 (dword()) mul16u((word) mul16u::a , (word) mul16u::b) (bool~) mul16u::$0 (byte/word~) mul16u::$1 @@ -1359,13 +1344,11 @@ Alias (byte*) print_line_cursor#1 = (byte*) print_screen#3 (byte*) print_screen# Alias (byte*) print_screen#4 = (byte*) print_screen#5 Alias (byte*) print_line_cursor#10 = (byte*) print_line_cursor#13 Alias (byte*) print_char_cursor#47 = (byte*) print_char_cursor#53 -Alias (word) main::wavelength#0 = (word) main::wavelength#8 (word) main::wavelength#6 Alias (word) rem16u#17 = (word) rem16u#8 (word) rem16u#35 Alias (byte*) print_line_cursor#3 = (byte*) print_line_cursor#7 Alias (byte*) print_char_cursor#16 = (byte*) print_char_cursor#36 Alias (signed word[$78]) main::sintab1#0 = (signed word*) main::st1#0 Alias (signed word*) main::st1#3 = (signed word*) main::st1#4 (signed word*) main::st1#5 -Alias (word) main::wavelength#1 = (word) main::wavelength#2 (word) main::wavelength#3 Alias (word) rem16u#18 = (word) rem16u#27 (word) rem16u#30 (word) rem16u#24 (word) rem16u#9 Alias (byte*) print_line_cursor#11 = (byte*) print_line_cursor#14 (byte*) print_line_cursor#16 (byte*) print_line_cursor#8 (byte*) print_line_cursor#4 Alias (byte*) print_char_cursor#17 = (byte*) print_char_cursor#37 @@ -1374,7 +1357,6 @@ Alias (signed word*) main::st1#1 = (signed word*~) main::$7 Alias (byte*) print_char_cursor#49 = (byte*) print_char_cursor#54 Alias (signed word) main::sw#0 = (signed word) main::sw#3 (signed word) main::sw#2 Alias (signed word*) main::st1#2 = (signed word*) main::st1#7 (signed word*) main::st1#6 -Alias (word) main::wavelength#4 = (word) main::wavelength#7 (word) main::wavelength#5 Alias (word) rem16u#32 = (word) rem16u#36 (word) rem16u#33 Alias (byte*) print_line_cursor#17 = (byte*) print_line_cursor#19 (byte*) print_line_cursor#18 Alias (byte*) print_char_cursor#19 = (byte*) print_char_cursor#39 @@ -1392,7 +1374,6 @@ Alias (dword) mul16u::mb#2 = (dword) mul16u::mb#3 Alias (byte) sin16s::isUpper#2 = (byte) sin16s::isUpper#8 Alias (signed word) main::sw#0 = (signed word) main::sw#1 Alias (signed word*) main::st1#2 = (signed word*) main::st1#3 -Alias (word) main::wavelength#1 = (word) main::wavelength#4 Alias (word) rem16u#18 = (word) rem16u#32 Alias (byte*) print_line_cursor#11 = (byte*) print_line_cursor#17 Successful SSA optimization Pass2AliasElimination @@ -1401,7 +1382,6 @@ Self Phi Eliminated (dword) sin16s_gen::step#1 Self Phi Eliminated (word) sin16s_gen::wavelength#2 Self Phi Eliminated (word) rem16u#16 Self Phi Eliminated (byte*) print_line_cursor#1 -Self Phi Eliminated (word) main::wavelength#1 Self Phi Eliminated (word) rem16u#18 Self Phi Eliminated (byte*) print_line_cursor#11 Successful SSA optimization Pass2SelfPhiElimination @@ -1440,7 +1420,6 @@ Redundant Phi (byte*) print_char_cursor#47 (byte*) print_line_cursor#0 Redundant Phi (word) rem16u#17 (word) rem16u#16 Redundant Phi (byte*) print_line_cursor#3 (byte*) print_line_cursor#1 Redundant Phi (byte*) print_char_cursor#16 (byte*) print_line_cursor#1 -Redundant Phi (word) main::wavelength#1 (word) main::wavelength#0 Redundant Phi (word) rem16u#18 (word) rem16u#17 Redundant Phi (byte*) print_line_cursor#11 (byte*) print_line_cursor#3 Redundant Phi (byte*) print_char_cursor#17 (byte*) print_char_cursor#24 diff --git a/src/test/ref/sinusgen16b.log b/src/test/ref/sinusgen16b.log index 7df951dca..317b4b66a 100644 --- a/src/test/ref/sinusgen16b.log +++ b/src/test/ref/sinusgen16b.log @@ -1,3 +1,4 @@ +Identified constant variable (word) main::wavelength CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -735,11 +736,10 @@ main::@5: scope:[main] from main (byte*) print_char_cursor#53 ← phi( main/(byte*) print_char_cursor#56 ) (byte*) print_line_cursor#13 ← phi( main/(byte*) print_line_cursor#16 ) (byte*) print_screen#5 ← phi( main/(byte*) print_screen#6 ) - (word) main::wavelength#1 ← phi( main/(word) main::wavelength#0 ) (word) rem16u#22 ← phi( main/(word) rem16u#7 ) (word) rem16u#10 ← (word) rem16u#22 (signed word*) sin16s_genb::sintab#1 ← (signed word[$78]) main::sintab2#0 - (word) sin16s_genb::wavelength#0 ← (word) main::wavelength#1 + (word) sin16s_genb::wavelength#0 ← (word) main::wavelength#0 call sin16s_genb to:main::@6 main::@6: scope:[main] from main::@5 @@ -1050,7 +1050,6 @@ SYMBOL TABLE SSA (signed word) main::sw#3 (word) main::wavelength (word) main::wavelength#0 -(word) main::wavelength#1 (dword()) mul16u((word) mul16u::a , (word) mul16u::b) (bool~) mul16u::$0 (byte/word~) mul16u::$1 @@ -1776,7 +1775,6 @@ Alias (byte*) print_char_cursor#30 = (byte*) print_char_cursor#9 Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#31 (byte*) print_char_cursor#32 (byte*) print_char_cursor#11 Alias (byte*) print_char_cursor#12 = (byte*) print_char_cursor#34 (byte*) print_char_cursor#13 Alias (byte*) print_line_cursor#1 = (byte*) print_screen#3 (byte*) print_screen#2 (byte*) print_char_cursor#14 (byte*) print_line_cursor#6 (byte*) print_char_cursor#35 (byte*) print_line_cursor#2 (byte*) print_char_cursor#15 -Alias (word) main::wavelength#0 = (word) main::wavelength#1 Alias (byte*) print_screen#4 = (byte*) print_screen#5 (byte*) print_screen#6 Alias (byte*) print_line_cursor#10 = (byte*) print_line_cursor#13 (byte*) print_line_cursor#16 Alias (byte*) print_char_cursor#47 = (byte*) print_char_cursor#53 (byte*) print_char_cursor#56 diff --git a/src/test/ref/sinusgen8.log b/src/test/ref/sinusgen8.log index 32d375516..ecbf676d4 100644 --- a/src/test/ref/sinusgen8.log +++ b/src/test/ref/sinusgen8.log @@ -1,3 +1,4 @@ +Identified constant variable (word) main::wavelength CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/sinusgen8b.log b/src/test/ref/sinusgen8b.log index 9e6ccbb78..56a6e9f04 100644 --- a/src/test/ref/sinusgen8b.log +++ b/src/test/ref/sinusgen8b.log @@ -1,3 +1,4 @@ +Identified constant variable (word) main::wavelength CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -824,12 +825,11 @@ main::@5: scope:[main] from main (byte*) print_char_cursor#49 ← phi( main/(byte*) print_char_cursor#52 ) (byte*) print_line_cursor#13 ← phi( main/(byte*) print_line_cursor#16 ) (byte*) print_screen#5 ← phi( main/(byte*) print_screen#6 ) - (word) main::wavelength#1 ← phi( main/(word) main::wavelength#0 ) (word) rem16u#26 ← phi( main/(word) rem16u#11 ) (word) rem16u#12 ← (word) rem16u#26 (signed word[$c0]) main::sintabw#0 ← { fill( $c0, 0) } (signed word*) sin16s_gen::sintab#1 ← (signed word[$c0]) main::sintabw#0 - (word) sin16s_gen::wavelength#0 ← (word) main::wavelength#1 + (word) sin16s_gen::wavelength#0 ← (word) main::wavelength#0 call sin16s_gen to:main::@6 main::@6: scope:[main] from main::@5 @@ -1135,7 +1135,6 @@ SYMBOL TABLE SSA (signed word) main::sw#0 (word) main::wavelength (word) main::wavelength#0 -(word) main::wavelength#1 (dword()) mul16u((word) mul16u::a , (word) mul16u::b) (bool~) mul16u::$0 (byte/word~) mul16u::$1 @@ -1934,7 +1933,6 @@ Alias (byte*) print_char_cursor#26 = (byte*) print_char_cursor#7 Alias (byte*) print_char_cursor#27 = (byte*) print_char_cursor#8 (byte*) print_char_cursor#28 (byte*) print_char_cursor#9 Alias (byte*) print_char_cursor#10 = (byte*) print_char_cursor#30 (byte*) print_char_cursor#11 Alias (byte*) print_line_cursor#1 = (byte*) print_screen#3 (byte*) print_screen#2 (byte*) print_char_cursor#12 (byte*) print_line_cursor#6 (byte*) print_char_cursor#31 (byte*) print_line_cursor#2 (byte*) print_char_cursor#13 -Alias (word) main::wavelength#0 = (word) main::wavelength#1 Alias (byte*) print_screen#4 = (byte*) print_screen#5 (byte*) print_screen#6 Alias (byte*) print_line_cursor#10 = (byte*) print_line_cursor#13 (byte*) print_line_cursor#16 Alias (byte*) print_char_cursor#43 = (byte*) print_char_cursor#49 (byte*) print_char_cursor#52 diff --git a/src/test/ref/sinusgenscale8.log b/src/test/ref/sinusgenscale8.log index e73ede005..eb9747c05 100644 --- a/src/test/ref/sinusgenscale8.log +++ b/src/test/ref/sinusgenscale8.log @@ -1,3 +1,4 @@ +Identified constant variable (word) main::tabsize CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -601,13 +602,12 @@ main: scope:[main] from @41 to:main::@1 main::@1: scope:[main] from main (word) rem16u#19 ← phi( main/(word) rem16u#23 ) - (word) main::tabsize#1 ← phi( main/(word) main::tabsize#0 ) (byte*) print_char_cursor#67 ← phi( main/(byte*) print_char_cursor#21 ) (byte*) print_line_cursor#16 ← phi( main/(byte*) print_line_cursor#4 ) (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#16 (byte*) print_char_cursor#22 ← (byte*) print_char_cursor#67 (byte*) sin8u_table::sintab#0 ← (byte[$14]) main::sintab#0 - (word) sin8u_table::tabsize#0 ← (word) main::tabsize#1 + (word) sin8u_table::tabsize#0 ← (word) main::tabsize#0 (byte) sin8u_table::min#0 ← (byte/signed byte/word/signed word/dword/signed dword) $a (byte) sin8u_table::max#0 ← (byte/word/signed word/dword/signed dword) $ff call sin8u_table @@ -1177,7 +1177,6 @@ SYMBOL TABLE SSA (byte[$14]) main::sintab#0 (word) main::tabsize (word) main::tabsize#0 -(word) main::tabsize#1 (signed word()) mul8su((signed byte) mul8su::a , (byte) mul8su::b) (byte~) mul8su::$0 (byte~) mul8su::$1 @@ -2096,7 +2095,6 @@ Alias (byte*) print_char_cursor#15 = (byte*) print_char_cursor#61 Alias (byte*) print_char_cursor#16 = (byte*) print_char_cursor#62 (byte*) print_char_cursor#63 (byte*) print_char_cursor#17 Alias (byte*) print_char_cursor#18 = (byte*) print_char_cursor#65 (byte*) print_char_cursor#19 Alias (byte*) print_line_cursor#15 = (byte*) print_screen#3 (byte*) print_screen#2 (byte*) print_line_cursor#3 (byte*) print_char_cursor#20 (byte*) print_char_cursor#66 (byte*) print_line_cursor#4 (byte*) print_char_cursor#21 -Alias (word) main::tabsize#0 = (word) main::tabsize#1 Alias (word) rem16u#19 = (word) rem16u#23 Alias (byte*) print_line_cursor#16 = (byte*) print_line_cursor#5 Alias (byte*) print_char_cursor#22 = (byte*) print_char_cursor#67 diff --git a/src/test/ref/summin.log b/src/test/ref/summin.log index ea36b240b..490ea938e 100644 --- a/src/test/ref/summin.log +++ b/src/test/ref/summin.log @@ -1,17 +1,16 @@ +Identified constant variable (byte*) screen CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) screen#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@2 main: scope:[main] from @2 - (byte*) screen#4 ← phi( @2/(byte*) screen#5 ) (byte) sum::a#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1 (byte) sum::b#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2 call sum (byte) sum::return#0 ← (byte) sum::return#4 to:main::@1 main::@1: scope:[main] from main - (byte*) screen#3 ← phi( main/(byte*) screen#4 ) (byte) sum::return#5 ← phi( main/(byte) sum::return#0 ) (byte~) main::$0 ← (byte) sum::return#5 (byte) main::s1#0 ← (byte~) main::$0 @@ -21,7 +20,6 @@ main::@1: scope:[main] from main (byte) sum::return#1 ← (byte) sum::return#4 to:main::@2 main::@2: scope:[main] from main::@1 - (byte*) screen#2 ← phi( main::@1/(byte*) screen#3 ) (byte) main::s1#2 ← phi( main::@1/(byte) main::s1#0 ) (byte) sum::return#6 ← phi( main::@1/(byte) sum::return#1 ) (byte~) main::$1 ← (byte) sum::return#6 @@ -32,7 +30,6 @@ main::@2: scope:[main] from main::@1 (byte) sum::return#2 ← (byte) sum::return#4 to:main::@3 main::@3: scope:[main] from main::@2 - (byte*) screen#1 ← phi( main::@2/(byte*) screen#2 ) (byte) main::s2#1 ← phi( main::@2/(byte) main::s2#0 ) (byte) main::s1#1 ← phi( main::@2/(byte) main::s1#2 ) (byte) sum::return#7 ← phi( main::@2/(byte) sum::return#2 ) @@ -41,7 +38,7 @@ main::@3: scope:[main] from main::@2 (byte~) main::$3 ← (byte) main::s1#1 + (byte) main::s2#1 (byte~) main::$4 ← (byte~) main::$3 + (byte) main::s3#0 (byte) main::s4#0 ← (byte~) main::$4 - *((byte*) screen#1) ← (byte) main::s4#0 + *((byte*) screen#0) ← (byte) main::s4#0 to:main::@return main::@return: scope:[main] from main::@3 return @@ -58,7 +55,6 @@ sum::@return: scope:[sum] from sum return to:@return @2: scope:[] from @begin - (byte*) screen#5 ← phi( @begin/(byte*) screen#0 ) call main to:@3 @3: scope:[] from @2 @@ -93,11 +89,6 @@ SYMBOL TABLE SSA (byte) main::s4#0 (byte*) screen (byte*) screen#0 -(byte*) screen#1 -(byte*) screen#2 -(byte*) screen#3 -(byte*) screen#4 -(byte*) screen#5 (byte()) sum((byte) sum::a , (byte) sum::b) (byte~) sum::$0 (label) sum::@return @@ -125,7 +116,6 @@ SYMBOL TABLE SSA Culled Empty Block (label) @3 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) sum::return#0 = (byte) sum::return#5 -Alias (byte*) screen#1 = (byte*) screen#3 (byte*) screen#4 (byte*) screen#2 Alias (byte) main::s1#0 = (byte~) main::$0 (byte) main::s1#2 (byte) main::s1#1 Alias (byte) sum::return#1 = (byte) sum::return#6 Alias (byte) main::s2#0 = (byte~) main::$1 (byte) main::s2#1 @@ -133,10 +123,7 @@ Alias (byte) sum::return#2 = (byte) sum::return#7 Alias (byte) main::s3#0 = (byte~) main::$2 Alias (byte) main::s4#0 = (byte~) main::$4 Alias (byte) sum::return#3 = (byte~) sum::$0 (byte) sum::return#8 (byte) sum::return#4 -Alias (byte*) screen#0 = (byte*) screen#5 Successful SSA optimization Pass2AliasElimination -Redundant Phi (byte*) screen#1 (byte*) screen#0 -Successful SSA optimization Pass2RedundantPhiElimination Constant (const byte*) screen#0 = ((byte*))$400 Constant (const byte) sum::a#0 = 1 Constant (const byte) sum::b#0 = 2 diff --git a/src/test/ref/test-address-of-param.log b/src/test/ref/test-address-of-param.log index 798383902..958576825 100644 --- a/src/test/ref/test-address-of-param.log +++ b/src/test/ref/test-address-of-param.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -13,7 +14,6 @@ main: scope:[main] from @2 call setByte to:main::@1 main::@1: scope:[main] from main - (byte*) main::SCREEN#3 ← phi( main/(byte*) main::SCREEN#0 ) (byte) main::b1#3 ← phi( main/(byte) main::b1#0 ) (byte) main::b3#3 ← phi( main/(byte) main::b3#0 ) (byte) main::b2#1 ← phi( main/(byte) main::b2#0 ) @@ -24,7 +24,6 @@ main::@1: scope:[main] from main to:main::@2 main::@2: scope:[main] from main::@1 (byte) main::b2#3 ← phi( main::@1/(byte) main::b2#1 ) - (byte*) main::SCREEN#2 ← phi( main::@1/(byte*) main::SCREEN#3 ) (byte) main::b1#2 ← phi( main::@1/(byte) main::b1#3 ) (byte) main::b3#1 ← phi( main::@1/(byte) main::b3#3 ) (byte*~) main::$4 ← & (byte) main::b3#1 @@ -35,11 +34,10 @@ main::@2: scope:[main] from main::@1 main::@3: scope:[main] from main::@2 (byte) main::b3#2 ← phi( main::@2/(byte) main::b3#1 ) (byte) main::b2#2 ← phi( main::@2/(byte) main::b2#3 ) - (byte*) main::SCREEN#1 ← phi( main::@2/(byte*) main::SCREEN#2 ) (byte) main::b1#1 ← phi( main::@2/(byte) main::b1#2 ) - *((byte*) main::SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::b1#1 - *((byte*) main::SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::b2#2 - *((byte*) main::SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::b3#2 + *((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::b1#1 + *((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::b2#2 + *((byte*) main::SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::b3#2 to:main::@return main::@return: scope:[main] from main::@3 return @@ -74,9 +72,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::SCREEN (byte*) main::SCREEN#0 -(byte*) main::SCREEN#1 -(byte*) main::SCREEN#2 -(byte*) main::SCREEN#3 (byte) main::b1 (byte) main::b1#0 (byte) main::b1#1 @@ -111,7 +106,6 @@ Alias (byte*) setByte::ptr#0 = (byte*~) main::$0 Alias (byte) main::b2#0 = (byte) main::b2#1 (byte) main::b2#3 (byte) main::b2#2 Alias (byte) main::b3#0 = (byte) main::b3#3 (byte) main::b3#1 (byte) main::b3#2 Alias (byte) main::b1#0 = (byte) main::b1#3 (byte) main::b1#2 (byte) main::b1#1 -Alias (byte*) main::SCREEN#0 = (byte*) main::SCREEN#3 (byte*) main::SCREEN#2 (byte*) main::SCREEN#1 Alias (byte*) setByte::ptr#1 = (byte*~) main::$2 Alias (byte*) setByte::ptr#2 = (byte*~) main::$4 Successful SSA optimization Pass2AliasElimination diff --git a/src/test/ref/test-address-of.log b/src/test/ref/test-address-of.log index cdfcdb0c6..72127eb86 100644 --- a/src/test/ref/test-address-of.log +++ b/src/test/ref/test-address-of.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -7,13 +8,12 @@ main: scope:[main] from @1 (byte) main::b#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 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::b#2 ← phi( main/(byte) main::b#0 main::@1/(byte) main::b#1 ) (byte*~) main::$0 ← & (byte) main::b#2 (byte*) main::bp#0 ← (byte*~) main::$0 (byte/signed word/word/dword/signed dword~) main::$1 ← *((byte*) main::bp#0) + (byte/signed byte/word/signed word/dword/signed dword) 1 (byte) main::c#0 ← (byte/signed word/word/dword/signed dword~) main::$1 - *((byte*) main::SCREEN#1 + (byte) main::b#2) ← (byte) main::c#0 + *((byte*) main::SCREEN#0 + (byte) main::b#2) ← (byte) main::c#0 (byte) main::b#1 ← (byte) main::b#2 + rangenext(0,$a) (bool~) main::$2 ← (byte) main::b#1 != rangelast(0,$a) if((bool~) main::$2) goto main::@1 @@ -41,7 +41,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::SCREEN (byte*) main::SCREEN#0 -(byte*) main::SCREEN#1 (byte) main::b (byte) main::b#0 (byte) main::b#1 @@ -56,10 +55,6 @@ Successful SSA optimization Pass2CullEmptyBlocks Alias (byte*) main::bp#0 = (byte*~) main::$0 Alias (byte) main::c#0 = (byte/signed word/word/dword/signed dword~) main::$1 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$2 [10] if((byte) main::b#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) main::SCREEN#0 = ((byte*))$400 diff --git a/src/test/ref/test-comments-block.log b/src/test/ref/test-comments-block.log index 44af5acb5..05f34f72d 100644 --- a/src/test/ref/test-comments-block.log +++ b/src/test/ref/test-comments-block.log @@ -1,3 +1,4 @@ +Identified constant variable (byte) a CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -5,21 +6,18 @@ CONTROL FLOW GRAPH SSA (byte) a#0 ← (byte) 'a' to:@2 main: scope:[main] from @2 - (byte) a#2 ← phi( @2/(byte) a#4 ) (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::b#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@3 (byte) main::i#3 ← phi( main/(byte) main::i#0 main::@3/(byte) main::i#1 ) (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@3/(byte) main::b#1 ) - (byte) a#1 ← phi( main/(byte) a#2 main::@3/(byte) a#3 ) - (byte) sum::a#0 ← (byte) a#1 + (byte) sum::a#0 ← (byte) a#0 (byte) sum::b#0 ← (byte) main::b#2 call sum (byte) sum::return#0 ← (byte) sum::return#2 to:main::@3 main::@3: scope:[main] from main::@1 - (byte) a#3 ← phi( main::@1/(byte) a#1 ) (byte) main::b#3 ← phi( main::@1/(byte) main::b#2 ) (byte) main::i#2 ← phi( main::@1/(byte) main::i#3 ) (byte) sum::return#3 ← phi( main::@1/(byte) sum::return#0 ) @@ -46,7 +44,6 @@ sum::@return: scope:[sum] from sum return to:@return @2: scope:[] from @begin - (byte) a#4 ← phi( @begin/(byte) a#0 ) call main to:@3 @3: scope:[] from @2 @@ -62,10 +59,6 @@ SYMBOL TABLE SSA (byte*) SCREEN#0 (byte) a (byte) a#0 -(byte) a#1 -(byte) a#2 -(byte) a#3 -(byte) a#4 (void()) main() (byte~) main::$0 (bool~) main::$1 @@ -105,18 +98,12 @@ Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) sum::return#0 = (byte) sum::return#3 Alias (byte) main::i#2 = (byte) main::i#3 Alias (byte) main::b#2 = (byte) main::b#3 -Alias (byte) a#1 = (byte) a#3 Alias (byte) sum::return#1 = (byte) sum::r#0 (byte~) sum::$0 (byte) sum::return#4 (byte) sum::return#2 -Alias (byte) a#0 = (byte) a#4 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte) a#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte) a#2 (byte) a#0 -Redundant Phi (byte) a#1 (byte) a#2 Redundant Phi (byte) sum::a#1 (byte) sum::a#0 Redundant Phi (byte) sum::b#1 (byte) sum::b#0 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [16] if((byte) main::b#1!=rangelast(0,$a)) goto main::@1 +Simple Condition (bool~) main::$1 [15] if((byte) main::b#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) a#0 = 'a' diff --git a/src/test/ref/test-comments-single.log b/src/test/ref/test-comments-single.log index 5dcb14a15..b3fa166be 100644 --- a/src/test/ref/test-comments-single.log +++ b/src/test/ref/test-comments-single.log @@ -1,3 +1,4 @@ +Identified constant variable (byte) a CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -5,21 +6,18 @@ CONTROL FLOW GRAPH SSA (byte) a#0 ← (byte) 'a' to:@2 main: scope:[main] from @2 - (byte) a#2 ← phi( @2/(byte) a#4 ) (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 (byte) main::b#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@3 (byte) main::i#3 ← phi( main/(byte) main::i#0 main::@3/(byte) main::i#1 ) (byte) main::b#2 ← phi( main/(byte) main::b#0 main::@3/(byte) main::b#1 ) - (byte) a#1 ← phi( main/(byte) a#2 main::@3/(byte) a#3 ) - (byte) sum::a#0 ← (byte) a#1 + (byte) sum::a#0 ← (byte) a#0 (byte) sum::b#0 ← (byte) main::b#2 call sum (byte) sum::return#0 ← (byte) sum::return#2 to:main::@3 main::@3: scope:[main] from main::@1 - (byte) a#3 ← phi( main::@1/(byte) a#1 ) (byte) main::b#3 ← phi( main::@1/(byte) main::b#2 ) (byte) main::i#2 ← phi( main::@1/(byte) main::i#3 ) (byte) sum::return#3 ← phi( main::@1/(byte) sum::return#0 ) @@ -46,7 +44,6 @@ sum::@return: scope:[sum] from sum return to:@return @2: scope:[] from @begin - (byte) a#4 ← phi( @begin/(byte) a#0 ) call main to:@3 @3: scope:[] from @2 @@ -62,10 +59,6 @@ SYMBOL TABLE SSA (byte*) SCREEN#0 (byte) a (byte) a#0 -(byte) a#1 -(byte) a#2 -(byte) a#3 -(byte) a#4 (void()) main() (byte~) main::$0 (bool~) main::$1 @@ -105,18 +98,12 @@ Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) sum::return#0 = (byte) sum::return#3 Alias (byte) main::i#2 = (byte) main::i#3 Alias (byte) main::b#2 = (byte) main::b#3 -Alias (byte) a#1 = (byte) a#3 Alias (byte) sum::return#1 = (byte) sum::r#0 (byte~) sum::$0 (byte) sum::return#4 (byte) sum::return#2 -Alias (byte) a#0 = (byte) a#4 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte) a#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte) a#2 (byte) a#0 -Redundant Phi (byte) a#1 (byte) a#2 Redundant Phi (byte) sum::a#1 (byte) sum::a#0 Redundant Phi (byte) sum::b#1 (byte) sum::b#0 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$1 [16] if((byte) main::b#1!=rangelast(0,$a)) goto main::@1 +Simple Condition (bool~) main::$1 [15] if((byte) main::b#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte) a#0 = 'a' diff --git a/src/test/ref/test-division.log b/src/test/ref/test-division.log index 4557170bc..e097a8e39 100644 --- a/src/test/ref/test-division.log +++ b/src/test/ref/test-division.log @@ -1,3 +1,4 @@ +Identified constant variable (byte) test_8u::rem CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/test-kasm-pc.log b/src/test/ref/test-kasm-pc.log index b7f9d180b..339cb0c40 100644 --- a/src/test/ref/test-kasm-pc.log +++ b/src/test/ref/test-kasm-pc.log @@ -1,32 +1,28 @@ +Identified constant variable (byte*) TABLE +Identified constant variable (byte*) main::BORDERCOL CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) TABLE#0 ← ((byte*)) (word/signed word/dword/signed dword) $2000 to:@1 main: scope:[main] from @1 - (byte*) TABLE#4 ← phi( @1/(byte*) TABLE#2 ) (byte*) main::BORDERCOL#0 ← ((byte*)) (word/dword/signed dword) $d020 (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@2 - (byte*) main::BORDERCOL#2 ← phi( main/(byte*) main::BORDERCOL#0 main::@2/(byte*) main::BORDERCOL#1 ) (byte) main::i#3 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#1 ) - (byte*) TABLE#3 ← phi( main/(byte*) TABLE#4 main::@2/(byte*) TABLE#1 ) if(true) goto main::@2 to:main::@return main::@2: scope:[main] from main::@1 - (byte*) main::BORDERCOL#1 ← phi( main::@1/(byte*) main::BORDERCOL#2 ) (byte) main::i#2 ← phi( main::@1/(byte) main::i#3 ) - (byte*) TABLE#1 ← phi( main::@1/(byte*) TABLE#3 ) - *((byte*) main::BORDERCOL#1) ← *((byte*) TABLE#1 + (byte) main::i#2) + *((byte*) main::BORDERCOL#0) ← *((byte*) TABLE#0 + (byte) main::i#2) (byte) main::i#1 ← ++ (byte) main::i#2 to:main::@1 main::@return: scope:[main] from main::@1 return to:@return @1: scope:[] from @begin - (byte*) TABLE#2 ← phi( @begin/(byte*) TABLE#0 ) - kickasm(location (byte*) TABLE#2) {{ .byte 1, 2, 3 + kickasm(location (byte*) TABLE#0) {{ .byte 1, 2, 3 }} call main to:@2 @@ -41,18 +37,12 @@ SYMBOL TABLE SSA (label) @end (byte*) TABLE (byte*) TABLE#0 -(byte*) TABLE#1 -(byte*) TABLE#2 -(byte*) TABLE#3 -(byte*) TABLE#4 (void()) main() (label) main::@1 (label) main::@2 (label) main::@return (byte*) main::BORDERCOL (byte*) main::BORDERCOL#0 -(byte*) main::BORDERCOL#1 -(byte*) main::BORDERCOL#2 (byte) main::i (byte) main::i#0 (byte) main::i#1 @@ -61,18 +51,8 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) TABLE#1 = (byte*) TABLE#3 Alias (byte) main::i#2 = (byte) main::i#3 -Alias (byte*) main::BORDERCOL#1 = (byte*) main::BORDERCOL#2 -Alias (byte*) TABLE#0 = (byte*) TABLE#2 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) TABLE#1 -Self Phi Eliminated (byte*) main::BORDERCOL#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) TABLE#4 (byte*) TABLE#0 -Redundant Phi (byte*) TABLE#1 (byte*) TABLE#4 -Redundant Phi (byte*) main::BORDERCOL#1 (byte*) main::BORDERCOL#0 -Successful SSA optimization Pass2RedundantPhiElimination Constant (const byte*) TABLE#0 = ((byte*))$2000 Constant (const byte*) main::BORDERCOL#0 = ((byte*))$d020 Constant (const byte) main::i#0 = 0 diff --git a/src/test/ref/test-lohiconst.log b/src/test/ref/test-lohiconst.log index f1edc00c1..11578a0ec 100644 --- a/src/test/ref/test-lohiconst.log +++ b/src/test/ref/test-lohiconst.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/test-multiply-16bit.log b/src/test/ref/test-multiply-16bit.log index 8a05aea56..3a3a3a91a 100644 --- a/src/test/ref/test-multiply-16bit.log +++ b/src/test/ref/test-multiply-16bit.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) BGCOL Inlined call call mulf8s_prepare (signed byte) mulf8s::a CONTROL FLOW GRAPH SSA @@ -530,12 +531,10 @@ main: scope:[main] from @40 (byte*) print_char_cursor#137 ← phi( @40/(byte*) print_char_cursor#147 ) (byte*) print_line_cursor#44 ← phi( @40/(byte*) print_line_cursor#54 ) (byte*) print_screen#4 ← phi( @40/(byte*) print_screen#5 ) - (byte*) BGCOL#1 ← phi( @40/(byte*) BGCOL#4 ) - *((byte*) BGCOL#1) ← (byte/signed byte/word/signed word/dword/signed dword) 5 + *((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5 call print_cls to:main::@1 main::@1: scope:[main] from main - (byte*) BGCOL#33 ← phi( main/(byte*) BGCOL#1 ) (byte*) print_char_cursor#87 ← phi( main/(byte*) print_char_cursor#23 ) (byte*) print_line_cursor#26 ← phi( main/(byte*) print_line_cursor#4 ) (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#26 @@ -543,13 +542,11 @@ main::@1: scope:[main] from main call mulf_init to:main::@2 main::@2: scope:[main] from main::@1 - (byte*) BGCOL#31 ← phi( main::@1/(byte*) BGCOL#33 ) (byte*) print_line_cursor#45 ← phi( main::@1/(byte*) print_line_cursor#5 ) (byte*) print_char_cursor#138 ← phi( main::@1/(byte*) print_char_cursor#24 ) call mul16u_compare to:main::@3 main::@3: scope:[main] from main::@2 - (byte*) BGCOL#32 ← phi( main::@2/(byte*) BGCOL#31 ) (byte*) print_line_cursor#27 ← phi( main::@2/(byte*) print_line_cursor#10 ) (byte*) print_char_cursor#88 ← phi( main::@2/(byte*) print_char_cursor#30 ) (byte*) print_char_cursor#25 ← (byte*) print_char_cursor#88 @@ -666,7 +663,6 @@ muls16s::@return: scope:[muls16s] from muls16s::@4 to:@return mul16u_compare: scope:[mul16u_compare] from main::@2 (byte*) print_line_cursor#98 ← phi( main::@2/(byte*) print_line_cursor#45 ) - (byte*) BGCOL#27 ← phi( main::@2/(byte*) BGCOL#31 ) (byte*) print_char_cursor#151 ← phi( main::@2/(byte*) print_char_cursor#138 ) (word) mul16u_compare::a#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 (word) mul16u_compare::b#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -675,7 +671,6 @@ mul16u_compare: scope:[mul16u_compare] from main::@2 mul16u_compare::@1: scope:[mul16u_compare] from mul16u_compare mul16u_compare::@10 (byte*) print_line_cursor#94 ← phi( mul16u_compare/(byte*) print_line_cursor#98 mul16u_compare::@10/(byte*) print_line_cursor#56 ) (byte) mul16u_compare::i#13 ← phi( mul16u_compare/(byte) mul16u_compare::i#0 mul16u_compare::@10/(byte) mul16u_compare::i#1 ) - (byte*) BGCOL#25 ← phi( mul16u_compare/(byte*) BGCOL#27 mul16u_compare::@10/(byte*) BGCOL#28 ) (word) mul16u_compare::b#9 ← phi( mul16u_compare/(word) mul16u_compare::b#0 mul16u_compare::@10/(word) mul16u_compare::b#12 ) (word) mul16u_compare::a#9 ← phi( mul16u_compare/(word) mul16u_compare::a#0 mul16u_compare::@10/(word) mul16u_compare::a#12 ) (byte*) print_char_cursor#139 ← phi( mul16u_compare/(byte*) print_char_cursor#151 mul16u_compare::@10/(byte*) print_char_cursor#152 ) @@ -685,7 +680,6 @@ mul16u_compare::@1: scope:[mul16u_compare] from mul16u_compare mul16u_compare:: mul16u_compare::@12: scope:[mul16u_compare] from mul16u_compare::@1 (byte*) print_line_cursor#90 ← phi( mul16u_compare::@1/(byte*) print_line_cursor#94 ) (byte) mul16u_compare::i#12 ← phi( mul16u_compare::@1/(byte) mul16u_compare::i#13 ) - (byte*) BGCOL#21 ← phi( mul16u_compare::@1/(byte*) BGCOL#25 ) (word) mul16u_compare::b#6 ← phi( mul16u_compare::@1/(word) mul16u_compare::b#9 ) (word) mul16u_compare::a#6 ← phi( mul16u_compare::@1/(word) mul16u_compare::a#9 ) (byte*) print_char_cursor#91 ← phi( mul16u_compare::@1/(byte*) print_char_cursor#2 ) @@ -696,7 +690,6 @@ mul16u_compare::@2: scope:[mul16u_compare] from mul16u_compare::@12 mul16u_comp (byte*) print_line_cursor#86 ← phi( mul16u_compare::@12/(byte*) print_line_cursor#90 mul16u_compare::@5/(byte*) print_line_cursor#65 ) (byte*) print_char_cursor#174 ← phi( mul16u_compare::@12/(byte*) print_char_cursor#28 mul16u_compare::@5/(byte*) print_char_cursor#161 ) (byte) mul16u_compare::i#11 ← phi( mul16u_compare::@12/(byte) mul16u_compare::i#12 mul16u_compare::@5/(byte) mul16u_compare::i#3 ) - (byte*) BGCOL#19 ← phi( mul16u_compare::@12/(byte*) BGCOL#21 mul16u_compare::@5/(byte*) BGCOL#22 ) (byte) mul16u_compare::j#10 ← phi( mul16u_compare::@12/(byte) mul16u_compare::j#0 mul16u_compare::@5/(byte) mul16u_compare::j#1 ) (word) mul16u_compare::b#2 ← phi( mul16u_compare::@12/(word) mul16u_compare::b#6 mul16u_compare::@5/(word) mul16u_compare::b#7 ) (word) mul16u_compare::a#2 ← phi( mul16u_compare::@12/(word) mul16u_compare::a#6 mul16u_compare::@5/(word) mul16u_compare::a#7 ) @@ -713,7 +706,6 @@ mul16u_compare::@13: scope:[mul16u_compare] from mul16u_compare::@2 (byte*) print_line_cursor#82 ← phi( mul16u_compare::@2/(byte*) print_line_cursor#86 ) (byte*) print_char_cursor#172 ← phi( mul16u_compare::@2/(byte*) print_char_cursor#174 ) (byte) mul16u_compare::i#10 ← phi( mul16u_compare::@2/(byte) mul16u_compare::i#11 ) - (byte*) BGCOL#17 ← phi( mul16u_compare::@2/(byte*) BGCOL#19 ) (byte) mul16u_compare::j#9 ← phi( mul16u_compare::@2/(byte) mul16u_compare::j#10 ) (word) mul16u_compare::b#3 ← phi( mul16u_compare::@2/(word) mul16u_compare::b#1 ) (word) mul16u_compare::a#3 ← phi( mul16u_compare::@2/(word) mul16u_compare::a#1 ) @@ -729,7 +721,6 @@ mul16u_compare::@14: scope:[mul16u_compare] from mul16u_compare::@13 (byte*) print_line_cursor#78 ← phi( mul16u_compare::@13/(byte*) print_line_cursor#82 ) (byte*) print_char_cursor#170 ← phi( mul16u_compare::@13/(byte*) print_char_cursor#172 ) (byte) mul16u_compare::i#9 ← phi( mul16u_compare::@13/(byte) mul16u_compare::i#10 ) - (byte*) BGCOL#15 ← phi( mul16u_compare::@13/(byte*) BGCOL#17 ) (byte) mul16u_compare::j#8 ← phi( mul16u_compare::@13/(byte) mul16u_compare::j#9 ) (dword) mul16u_compare::ms#4 ← phi( mul16u_compare::@13/(dword) mul16u_compare::ms#0 ) (word) mul16u_compare::b#4 ← phi( mul16u_compare::@13/(word) mul16u_compare::b#3 ) @@ -748,7 +739,6 @@ mul16u_compare::@15: scope:[mul16u_compare] from mul16u_compare::@14 (byte) mul16u_compare::i#7 ← phi( mul16u_compare::@14/(byte) mul16u_compare::i#9 ) (word) mul16u_compare::b#13 ← phi( mul16u_compare::@14/(word) mul16u_compare::b#4 ) (word) mul16u_compare::a#13 ← phi( mul16u_compare::@14/(word) mul16u_compare::a#4 ) - (byte*) BGCOL#11 ← phi( mul16u_compare::@14/(byte*) BGCOL#15 ) (byte) mul16u_compare::j#6 ← phi( mul16u_compare::@14/(byte) mul16u_compare::j#8 ) (dword) mul16u_compare::mn#3 ← phi( mul16u_compare::@14/(dword) mul16u_compare::mn#0 ) (dword) mul16u_compare::ms#1 ← phi( mul16u_compare::@14/(dword) mul16u_compare::ms#4 ) @@ -767,7 +757,6 @@ mul16u_compare::@3: scope:[mul16u_compare] from mul16u_compare::@15 mul16u_comp (dword) mul16u_compare::mf#3 ← phi( mul16u_compare::@15/(dword) mul16u_compare::mf#0 mul16u_compare::@6/(dword) mul16u_compare::mf#5 ) (word) mul16u_compare::b#10 ← phi( mul16u_compare::@15/(word) mul16u_compare::b#13 mul16u_compare::@6/(word) mul16u_compare::b#14 ) (word) mul16u_compare::a#10 ← phi( mul16u_compare::@15/(word) mul16u_compare::a#13 mul16u_compare::@6/(word) mul16u_compare::a#14 ) - (byte*) BGCOL#7 ← phi( mul16u_compare::@15/(byte*) BGCOL#11 mul16u_compare::@6/(byte*) BGCOL#12 ) (byte) mul16u_compare::j#4 ← phi( mul16u_compare::@15/(byte) mul16u_compare::j#6 mul16u_compare::@6/(byte) mul16u_compare::j#7 ) (byte) mul16u_compare::ok#4 ← phi( mul16u_compare::@15/(byte) mul16u_compare::ok#0 mul16u_compare::@6/(byte) mul16u_compare::ok#1 ) (dword) mul16u_compare::mn#1 ← phi( mul16u_compare::@15/(dword) mul16u_compare::mn#3 mul16u_compare::@6/(dword) mul16u_compare::mn#4 ) @@ -783,7 +772,6 @@ mul16u_compare::@6: scope:[mul16u_compare] from mul16u_compare::@15 (dword) mul16u_compare::mf#5 ← phi( mul16u_compare::@15/(dword) mul16u_compare::mf#0 ) (word) mul16u_compare::b#14 ← phi( mul16u_compare::@15/(word) mul16u_compare::b#13 ) (word) mul16u_compare::a#14 ← phi( mul16u_compare::@15/(word) mul16u_compare::a#13 ) - (byte*) BGCOL#12 ← phi( mul16u_compare::@15/(byte*) BGCOL#11 ) (byte) mul16u_compare::j#7 ← phi( mul16u_compare::@15/(byte) mul16u_compare::j#6 ) (dword) mul16u_compare::mn#4 ← phi( mul16u_compare::@15/(dword) mul16u_compare::mn#3 ) (dword) mul16u_compare::ms#5 ← phi( mul16u_compare::@15/(dword) mul16u_compare::ms#1 ) @@ -798,7 +786,6 @@ mul16u_compare::@4: scope:[mul16u_compare] from mul16u_compare::@3 mul16u_compa (dword) mul16u_compare::ms#6 ← phi( mul16u_compare::@3/(dword) mul16u_compare::ms#2 mul16u_compare::@7/(dword) mul16u_compare::ms#7 ) (word) mul16u_compare::b#8 ← phi( mul16u_compare::@3/(word) mul16u_compare::b#10 mul16u_compare::@7/(word) mul16u_compare::b#11 ) (word) mul16u_compare::a#8 ← phi( mul16u_compare::@3/(word) mul16u_compare::a#10 mul16u_compare::@7/(word) mul16u_compare::a#11 ) - (byte*) BGCOL#5 ← phi( mul16u_compare::@3/(byte*) BGCOL#7 mul16u_compare::@7/(byte*) BGCOL#8 ) (byte) mul16u_compare::j#3 ← phi( mul16u_compare::@3/(byte) mul16u_compare::j#4 mul16u_compare::@7/(byte) mul16u_compare::j#5 ) (byte) mul16u_compare::ok#3 ← phi( mul16u_compare::@3/(byte) mul16u_compare::ok#4 mul16u_compare::@7/(byte) mul16u_compare::ok#2 ) (bool~) mul16u_compare::$10 ← (byte) mul16u_compare::ok#3 == (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -814,12 +801,10 @@ mul16u_compare::@7: scope:[mul16u_compare] from mul16u_compare::@3 (dword) mul16u_compare::ms#7 ← phi( mul16u_compare::@3/(dword) mul16u_compare::ms#2 ) (word) mul16u_compare::b#11 ← phi( mul16u_compare::@3/(word) mul16u_compare::b#10 ) (word) mul16u_compare::a#11 ← phi( mul16u_compare::@3/(word) mul16u_compare::a#10 ) - (byte*) BGCOL#8 ← phi( mul16u_compare::@3/(byte*) BGCOL#7 ) (byte) mul16u_compare::j#5 ← phi( mul16u_compare::@3/(byte) mul16u_compare::j#4 ) (byte) mul16u_compare::ok#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:mul16u_compare::@4 mul16u_compare::@5: scope:[mul16u_compare] from mul16u_compare::@4 - (byte*) BGCOL#22 ← phi( mul16u_compare::@4/(byte*) BGCOL#5 ) (byte*) print_line_cursor#65 ← phi( mul16u_compare::@4/(byte*) print_line_cursor#55 ) (byte*) print_char_cursor#161 ← phi( mul16u_compare::@4/(byte*) print_char_cursor#153 ) (byte) mul16u_compare::i#3 ← phi( mul16u_compare::@4/(byte) mul16u_compare::i#4 ) @@ -838,8 +823,7 @@ mul16u_compare::@8: scope:[mul16u_compare] from mul16u_compare::@4 (dword) mul16u_compare::ms#3 ← phi( mul16u_compare::@4/(dword) mul16u_compare::ms#6 ) (word) mul16u_compare::b#5 ← phi( mul16u_compare::@4/(word) mul16u_compare::b#8 ) (word) mul16u_compare::a#5 ← phi( mul16u_compare::@4/(word) mul16u_compare::a#8 ) - (byte*) BGCOL#2 ← phi( mul16u_compare::@4/(byte*) BGCOL#5 ) - *((byte*) BGCOL#2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 + *((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 (word) mul16u_error::a#0 ← (word) mul16u_compare::a#5 (word) mul16u_error::b#0 ← (word) mul16u_compare::b#5 (dword) mul16u_error::ms#0 ← (dword) mul16u_compare::ms#3 @@ -861,7 +845,6 @@ mul16u_compare::@return: scope:[mul16u_compare] from mul16u_compare::@16 mul16u return to:@return mul16u_compare::@10: scope:[mul16u_compare] from mul16u_compare::@5 - (byte*) BGCOL#28 ← phi( mul16u_compare::@5/(byte*) BGCOL#22 ) (word) mul16u_compare::b#12 ← phi( mul16u_compare::@5/(word) mul16u_compare::b#7 ) (word) mul16u_compare::a#12 ← phi( mul16u_compare::@5/(word) mul16u_compare::a#7 ) (byte*) print_line_cursor#56 ← phi( mul16u_compare::@5/(byte*) print_line_cursor#65 ) @@ -1016,7 +999,6 @@ mul16u_error::@return: scope:[mul16u_error] from mul16u_error::@11 to:@return mul16s_compare: scope:[mul16s_compare] from main::@3 (byte*) print_line_cursor#100 ← phi( main::@3/(byte*) print_line_cursor#6 ) - (byte*) BGCOL#29 ← phi( main::@3/(byte*) BGCOL#32 ) (byte*) print_char_cursor#154 ← phi( main::@3/(byte*) print_char_cursor#25 ) (signed word/signed dword~) mul16s_compare::$0 ← - (word/signed word/dword/signed dword) $7fff (signed word) mul16s_compare::a#0 ← (signed word/signed dword~) mul16s_compare::$0 @@ -1027,7 +1009,6 @@ mul16s_compare: scope:[mul16s_compare] from main::@3 mul16s_compare::@1: scope:[mul16s_compare] from mul16s_compare mul16s_compare::@10 (byte*) print_line_cursor#96 ← phi( mul16s_compare/(byte*) print_line_cursor#100 mul16s_compare::@10/(byte*) print_line_cursor#59 ) (byte) mul16s_compare::i#13 ← phi( mul16s_compare/(byte) mul16s_compare::i#0 mul16s_compare::@10/(byte) mul16s_compare::i#1 ) - (byte*) BGCOL#26 ← phi( mul16s_compare/(byte*) BGCOL#29 mul16s_compare::@10/(byte*) BGCOL#30 ) (signed word) mul16s_compare::b#9 ← phi( mul16s_compare/(signed word) mul16s_compare::b#0 mul16s_compare::@10/(signed word) mul16s_compare::b#12 ) (signed word) mul16s_compare::a#9 ← phi( mul16s_compare/(signed word) mul16s_compare::a#0 mul16s_compare::@10/(signed word) mul16s_compare::a#12 ) (byte*) print_char_cursor#143 ← phi( mul16s_compare/(byte*) print_char_cursor#154 mul16s_compare::@10/(byte*) print_char_cursor#155 ) @@ -1037,7 +1018,6 @@ mul16s_compare::@1: scope:[mul16s_compare] from mul16s_compare mul16s_compare:: mul16s_compare::@12: scope:[mul16s_compare] from mul16s_compare::@1 (byte*) print_line_cursor#92 ← phi( mul16s_compare::@1/(byte*) print_line_cursor#96 ) (byte) mul16s_compare::i#12 ← phi( mul16s_compare::@1/(byte) mul16s_compare::i#13 ) - (byte*) BGCOL#23 ← phi( mul16s_compare::@1/(byte*) BGCOL#26 ) (signed word) mul16s_compare::b#6 ← phi( mul16s_compare::@1/(signed word) mul16s_compare::b#9 ) (signed word) mul16s_compare::a#6 ← phi( mul16s_compare::@1/(signed word) mul16s_compare::a#9 ) (byte*) print_char_cursor#109 ← phi( mul16s_compare::@1/(byte*) print_char_cursor#2 ) @@ -1048,7 +1028,6 @@ mul16s_compare::@2: scope:[mul16s_compare] from mul16s_compare::@12 mul16s_comp (byte*) print_line_cursor#88 ← phi( mul16s_compare::@12/(byte*) print_line_cursor#92 mul16s_compare::@5/(byte*) print_line_cursor#69 ) (byte*) print_char_cursor#175 ← phi( mul16s_compare::@12/(byte*) print_char_cursor#46 mul16s_compare::@5/(byte*) print_char_cursor#164 ) (byte) mul16s_compare::i#11 ← phi( mul16s_compare::@12/(byte) mul16s_compare::i#12 mul16s_compare::@5/(byte) mul16s_compare::i#3 ) - (byte*) BGCOL#20 ← phi( mul16s_compare::@12/(byte*) BGCOL#23 mul16s_compare::@5/(byte*) BGCOL#24 ) (byte) mul16s_compare::j#10 ← phi( mul16s_compare::@12/(byte) mul16s_compare::j#0 mul16s_compare::@5/(byte) mul16s_compare::j#1 ) (signed word) mul16s_compare::b#2 ← phi( mul16s_compare::@12/(signed word) mul16s_compare::b#6 mul16s_compare::@5/(signed word) mul16s_compare::b#7 ) (signed word) mul16s_compare::a#2 ← phi( mul16s_compare::@12/(signed word) mul16s_compare::a#6 mul16s_compare::@5/(signed word) mul16s_compare::a#7 ) @@ -1065,7 +1044,6 @@ mul16s_compare::@13: scope:[mul16s_compare] from mul16s_compare::@2 (byte*) print_line_cursor#84 ← phi( mul16s_compare::@2/(byte*) print_line_cursor#88 ) (byte*) print_char_cursor#173 ← phi( mul16s_compare::@2/(byte*) print_char_cursor#175 ) (byte) mul16s_compare::i#10 ← phi( mul16s_compare::@2/(byte) mul16s_compare::i#11 ) - (byte*) BGCOL#18 ← phi( mul16s_compare::@2/(byte*) BGCOL#20 ) (byte) mul16s_compare::j#9 ← phi( mul16s_compare::@2/(byte) mul16s_compare::j#10 ) (signed word) mul16s_compare::b#3 ← phi( mul16s_compare::@2/(signed word) mul16s_compare::b#1 ) (signed word) mul16s_compare::a#3 ← phi( mul16s_compare::@2/(signed word) mul16s_compare::a#1 ) @@ -1081,7 +1059,6 @@ mul16s_compare::@14: scope:[mul16s_compare] from mul16s_compare::@13 (byte*) print_line_cursor#80 ← phi( mul16s_compare::@13/(byte*) print_line_cursor#84 ) (byte*) print_char_cursor#171 ← phi( mul16s_compare::@13/(byte*) print_char_cursor#173 ) (byte) mul16s_compare::i#9 ← phi( mul16s_compare::@13/(byte) mul16s_compare::i#10 ) - (byte*) BGCOL#16 ← phi( mul16s_compare::@13/(byte*) BGCOL#18 ) (byte) mul16s_compare::j#8 ← phi( mul16s_compare::@13/(byte) mul16s_compare::j#9 ) (signed dword) mul16s_compare::ms#4 ← phi( mul16s_compare::@13/(signed dword) mul16s_compare::ms#0 ) (signed word) mul16s_compare::b#4 ← phi( mul16s_compare::@13/(signed word) mul16s_compare::b#3 ) @@ -1100,7 +1077,6 @@ mul16s_compare::@15: scope:[mul16s_compare] from mul16s_compare::@14 (byte) mul16s_compare::i#7 ← phi( mul16s_compare::@14/(byte) mul16s_compare::i#9 ) (signed word) mul16s_compare::b#13 ← phi( mul16s_compare::@14/(signed word) mul16s_compare::b#4 ) (signed word) mul16s_compare::a#13 ← phi( mul16s_compare::@14/(signed word) mul16s_compare::a#4 ) - (byte*) BGCOL#13 ← phi( mul16s_compare::@14/(byte*) BGCOL#16 ) (byte) mul16s_compare::j#6 ← phi( mul16s_compare::@14/(byte) mul16s_compare::j#8 ) (signed dword) mul16s_compare::mn#3 ← phi( mul16s_compare::@14/(signed dword) mul16s_compare::mn#0 ) (signed dword) mul16s_compare::ms#1 ← phi( mul16s_compare::@14/(signed dword) mul16s_compare::ms#4 ) @@ -1119,7 +1095,6 @@ mul16s_compare::@3: scope:[mul16s_compare] from mul16s_compare::@15 mul16s_comp (signed dword) mul16s_compare::mf#3 ← phi( mul16s_compare::@15/(signed dword) mul16s_compare::mf#0 mul16s_compare::@6/(signed dword) mul16s_compare::mf#5 ) (signed word) mul16s_compare::b#10 ← phi( mul16s_compare::@15/(signed word) mul16s_compare::b#13 mul16s_compare::@6/(signed word) mul16s_compare::b#14 ) (signed word) mul16s_compare::a#10 ← phi( mul16s_compare::@15/(signed word) mul16s_compare::a#13 mul16s_compare::@6/(signed word) mul16s_compare::a#14 ) - (byte*) BGCOL#9 ← phi( mul16s_compare::@15/(byte*) BGCOL#13 mul16s_compare::@6/(byte*) BGCOL#14 ) (byte) mul16s_compare::j#4 ← phi( mul16s_compare::@15/(byte) mul16s_compare::j#6 mul16s_compare::@6/(byte) mul16s_compare::j#7 ) (byte) mul16s_compare::ok#4 ← phi( mul16s_compare::@15/(byte) mul16s_compare::ok#0 mul16s_compare::@6/(byte) mul16s_compare::ok#1 ) (signed dword) mul16s_compare::mn#1 ← phi( mul16s_compare::@15/(signed dword) mul16s_compare::mn#3 mul16s_compare::@6/(signed dword) mul16s_compare::mn#4 ) @@ -1135,7 +1110,6 @@ mul16s_compare::@6: scope:[mul16s_compare] from mul16s_compare::@15 (signed dword) mul16s_compare::mf#5 ← phi( mul16s_compare::@15/(signed dword) mul16s_compare::mf#0 ) (signed word) mul16s_compare::b#14 ← phi( mul16s_compare::@15/(signed word) mul16s_compare::b#13 ) (signed word) mul16s_compare::a#14 ← phi( mul16s_compare::@15/(signed word) mul16s_compare::a#13 ) - (byte*) BGCOL#14 ← phi( mul16s_compare::@15/(byte*) BGCOL#13 ) (byte) mul16s_compare::j#7 ← phi( mul16s_compare::@15/(byte) mul16s_compare::j#6 ) (signed dword) mul16s_compare::mn#4 ← phi( mul16s_compare::@15/(signed dword) mul16s_compare::mn#3 ) (signed dword) mul16s_compare::ms#5 ← phi( mul16s_compare::@15/(signed dword) mul16s_compare::ms#1 ) @@ -1150,7 +1124,6 @@ mul16s_compare::@4: scope:[mul16s_compare] from mul16s_compare::@3 mul16s_compa (signed dword) mul16s_compare::ms#6 ← phi( mul16s_compare::@3/(signed dword) mul16s_compare::ms#2 mul16s_compare::@7/(signed dword) mul16s_compare::ms#7 ) (signed word) mul16s_compare::b#8 ← phi( mul16s_compare::@3/(signed word) mul16s_compare::b#10 mul16s_compare::@7/(signed word) mul16s_compare::b#11 ) (signed word) mul16s_compare::a#8 ← phi( mul16s_compare::@3/(signed word) mul16s_compare::a#10 mul16s_compare::@7/(signed word) mul16s_compare::a#11 ) - (byte*) BGCOL#6 ← phi( mul16s_compare::@3/(byte*) BGCOL#9 mul16s_compare::@7/(byte*) BGCOL#10 ) (byte) mul16s_compare::j#3 ← phi( mul16s_compare::@3/(byte) mul16s_compare::j#4 mul16s_compare::@7/(byte) mul16s_compare::j#5 ) (byte) mul16s_compare::ok#3 ← phi( mul16s_compare::@3/(byte) mul16s_compare::ok#4 mul16s_compare::@7/(byte) mul16s_compare::ok#2 ) (bool~) mul16s_compare::$12 ← (byte) mul16s_compare::ok#3 == (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -1166,12 +1139,10 @@ mul16s_compare::@7: scope:[mul16s_compare] from mul16s_compare::@3 (signed dword) mul16s_compare::ms#7 ← phi( mul16s_compare::@3/(signed dword) mul16s_compare::ms#2 ) (signed word) mul16s_compare::b#11 ← phi( mul16s_compare::@3/(signed word) mul16s_compare::b#10 ) (signed word) mul16s_compare::a#11 ← phi( mul16s_compare::@3/(signed word) mul16s_compare::a#10 ) - (byte*) BGCOL#10 ← phi( mul16s_compare::@3/(byte*) BGCOL#9 ) (byte) mul16s_compare::j#5 ← phi( mul16s_compare::@3/(byte) mul16s_compare::j#4 ) (byte) mul16s_compare::ok#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:mul16s_compare::@4 mul16s_compare::@5: scope:[mul16s_compare] from mul16s_compare::@4 - (byte*) BGCOL#24 ← phi( mul16s_compare::@4/(byte*) BGCOL#6 ) (byte*) print_line_cursor#69 ← phi( mul16s_compare::@4/(byte*) print_line_cursor#58 ) (byte*) print_char_cursor#164 ← phi( mul16s_compare::@4/(byte*) print_char_cursor#156 ) (byte) mul16s_compare::i#3 ← phi( mul16s_compare::@4/(byte) mul16s_compare::i#4 ) @@ -1190,8 +1161,7 @@ mul16s_compare::@8: scope:[mul16s_compare] from mul16s_compare::@4 (signed dword) mul16s_compare::ms#3 ← phi( mul16s_compare::@4/(signed dword) mul16s_compare::ms#6 ) (signed word) mul16s_compare::b#5 ← phi( mul16s_compare::@4/(signed word) mul16s_compare::b#8 ) (signed word) mul16s_compare::a#5 ← phi( mul16s_compare::@4/(signed word) mul16s_compare::a#8 ) - (byte*) BGCOL#3 ← phi( mul16s_compare::@4/(byte*) BGCOL#6 ) - *((byte*) BGCOL#3) ← (byte/signed byte/word/signed word/dword/signed dword) 2 + *((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 (signed word) mul16s_error::a#0 ← (signed word) mul16s_compare::a#5 (signed word) mul16s_error::b#0 ← (signed word) mul16s_compare::b#5 (signed dword) mul16s_error::ms#0 ← (signed dword) mul16s_compare::ms#3 @@ -1213,7 +1183,6 @@ mul16s_compare::@return: scope:[mul16s_compare] from mul16s_compare::@16 mul16s return to:@return mul16s_compare::@10: scope:[mul16s_compare] from mul16s_compare::@5 - (byte*) BGCOL#30 ← phi( mul16s_compare::@5/(byte*) BGCOL#24 ) (signed word) mul16s_compare::b#12 ← phi( mul16s_compare::@5/(signed word) mul16s_compare::b#7 ) (signed word) mul16s_compare::a#12 ← phi( mul16s_compare::@5/(signed word) mul16s_compare::a#7 ) (byte*) print_line_cursor#59 ← phi( mul16s_compare::@5/(byte*) print_line_cursor#69 ) @@ -1370,7 +1339,6 @@ mul16s_error::@return: scope:[mul16s_error] from mul16s_error::@11 (byte*) print_screen#5 ← phi( @33/(byte*) print_screen#6 ) (byte*) print_char_cursor#147 ← phi( @33/(byte*) print_char_cursor#157 ) (byte*) print_line_cursor#54 ← phi( @33/(byte*) print_line_cursor#61 ) - (byte*) BGCOL#4 ← phi( @33/(byte*) BGCOL#0 ) call main to:@41 @41: scope:[] from @40 @@ -1392,39 +1360,6 @@ SYMBOL TABLE SSA (label) @end (byte*) BGCOL (byte*) BGCOL#0 -(byte*) BGCOL#1 -(byte*) BGCOL#10 -(byte*) BGCOL#11 -(byte*) BGCOL#12 -(byte*) BGCOL#13 -(byte*) BGCOL#14 -(byte*) BGCOL#15 -(byte*) BGCOL#16 -(byte*) BGCOL#17 -(byte*) BGCOL#18 -(byte*) BGCOL#19 -(byte*) BGCOL#2 -(byte*) BGCOL#20 -(byte*) BGCOL#21 -(byte*) BGCOL#22 -(byte*) BGCOL#23 -(byte*) BGCOL#24 -(byte*) BGCOL#25 -(byte*) BGCOL#26 -(byte*) BGCOL#27 -(byte*) BGCOL#28 -(byte*) BGCOL#29 -(byte*) BGCOL#3 -(byte*) BGCOL#30 -(byte*) BGCOL#31 -(byte*) BGCOL#32 -(byte*) BGCOL#33 -(byte*) BGCOL#4 -(byte*) BGCOL#5 -(byte*) BGCOL#6 -(byte*) BGCOL#7 -(byte*) BGCOL#8 -(byte*) BGCOL#9 (void()) main() (label) main::@1 (label) main::@2 @@ -2664,7 +2599,6 @@ Alias (signed dword) mulf16s::return#0 = (signed dword~) mulf16s::$15 (signed dw Alias (dword) mulf16s::m#5 = (dword) mulf16s::m#6 Alias (signed word) mulf16s::a#3 = (signed word) mulf16s::a#4 Alias (word~) mulf16s::$17 = (word~) mulf16s::$14 -Alias (byte*) BGCOL#1 = (byte*) BGCOL#33 (byte*) BGCOL#31 (byte*) BGCOL#32 Alias (byte*) print_line_cursor#26 = (byte*) print_line_cursor#5 (byte*) print_line_cursor#45 Alias (byte*) print_char_cursor#138 = (byte*) print_char_cursor#24 (byte*) print_char_cursor#87 Alias (byte*) print_char_cursor#25 = (byte*) print_char_cursor#88 @@ -2684,7 +2618,6 @@ Alias (signed dword) muls16s::return#0 = (signed dword) muls16s::m#4 (signed dwo Alias (signed dword) muls16s::m#2 = (signed dword~) muls16s::$5 Alias (word) mul16u_compare::a#6 = (word) mul16u_compare::a#9 Alias (word) mul16u_compare::b#6 = (word) mul16u_compare::b#9 -Alias (byte*) BGCOL#21 = (byte*) BGCOL#25 Alias (byte) mul16u_compare::i#12 = (byte) mul16u_compare::i#13 Alias (byte*) print_line_cursor#90 = (byte*) print_line_cursor#94 Alias (byte*) print_char_cursor#28 = (byte*) print_char_cursor#91 @@ -2692,7 +2625,6 @@ Alias (word) mul16u_compare::a#1 = (word/signed dword/dword~) mul16u_compare::$1 Alias (word) mul16u_compare::b#1 = (word/signed dword/dword~) mul16u_compare::$2 (word) mul16u_compare::b#3 (word) mul16u_compare::b#4 (word) mul16u_compare::b#13 (word) mul16u_compare::b#14 Alias (dword) muls16u::return#2 = (dword) muls16u::return#4 Alias (byte) mul16u_compare::j#10 = (byte) mul16u_compare::j#9 (byte) mul16u_compare::j#8 (byte) mul16u_compare::j#6 (byte) mul16u_compare::j#7 -Alias (byte*) BGCOL#11 = (byte*) BGCOL#17 (byte*) BGCOL#19 (byte*) BGCOL#15 (byte*) BGCOL#12 Alias (byte) mul16u_compare::i#10 = (byte) mul16u_compare::i#11 (byte) mul16u_compare::i#9 (byte) mul16u_compare::i#7 (byte) mul16u_compare::i#8 Alias (byte*) print_char_cursor#166 = (byte*) print_char_cursor#172 (byte*) print_char_cursor#174 (byte*) print_char_cursor#170 (byte*) print_char_cursor#167 Alias (byte*) print_line_cursor#72 = (byte*) print_line_cursor#82 (byte*) print_line_cursor#86 (byte*) print_line_cursor#78 (byte*) print_line_cursor#73 @@ -2702,7 +2634,6 @@ Alias (dword) mul16u_compare::mn#0 = (dword~) mul16u_compare::$4 (dword) mul16u_ Alias (dword) mulf16u::return#3 = (dword) mulf16u::return#6 Alias (dword) mul16u_compare::mf#0 = (dword~) mul16u_compare::$5 (dword) mul16u_compare::mf#5 Alias (byte) mul16u_compare::j#4 = (byte) mul16u_compare::j#5 -Alias (byte*) BGCOL#7 = (byte*) BGCOL#8 Alias (word) mul16u_compare::a#10 = (word) mul16u_compare::a#11 Alias (word) mul16u_compare::b#10 = (word) mul16u_compare::b#11 Alias (dword) mul16u_compare::ms#2 = (dword) mul16u_compare::ms#7 @@ -2717,7 +2648,6 @@ Alias (word) mul16u_compare::b#12 = (word) mul16u_compare::b#7 (word) mul16u_com Alias (byte) mul16u_compare::i#2 = (byte) mul16u_compare::i#3 (byte) mul16u_compare::i#4 Alias (byte*) print_char_cursor#140 = (byte*) print_char_cursor#161 (byte*) print_char_cursor#153 (byte*) print_char_cursor#152 (byte*) print_char_cursor#141 Alias (byte*) print_line_cursor#46 = (byte*) print_line_cursor#65 (byte*) print_line_cursor#55 (byte*) print_line_cursor#56 (byte*) print_line_cursor#47 -Alias (byte*) BGCOL#2 = (byte*) BGCOL#22 (byte*) BGCOL#5 (byte*) BGCOL#28 Alias (dword) mul16u_compare::ms#3 = (dword) mul16u_compare::ms#6 Alias (dword) mul16u_compare::mn#2 = (dword) mul16u_compare::mn#5 Alias (dword) mul16u_compare::mf#1 = (dword) mul16u_compare::mf#2 @@ -2752,7 +2682,6 @@ Alias (signed word) mul16s_compare::a#0 = (signed word/signed dword~) mul16s_com Alias (signed word) mul16s_compare::b#0 = (signed word/signed dword~) mul16s_compare::$1 Alias (signed word) mul16s_compare::a#6 = (signed word) mul16s_compare::a#9 Alias (signed word) mul16s_compare::b#6 = (signed word) mul16s_compare::b#9 -Alias (byte*) BGCOL#23 = (byte*) BGCOL#26 Alias (byte) mul16s_compare::i#12 = (byte) mul16s_compare::i#13 Alias (byte*) print_line_cursor#92 = (byte*) print_line_cursor#96 Alias (byte*) print_char_cursor#109 = (byte*) print_char_cursor#46 @@ -2760,7 +2689,6 @@ Alias (signed word) mul16s_compare::a#1 = (signed dword/signed word~) mul16s_com Alias (signed word) mul16s_compare::b#1 = (signed dword/signed word~) mul16s_compare::$4 (signed word) mul16s_compare::b#3 (signed word) mul16s_compare::b#4 (signed word) mul16s_compare::b#13 (signed word) mul16s_compare::b#14 Alias (signed dword) muls16s::return#2 = (signed dword) muls16s::return#4 Alias (byte) mul16s_compare::j#10 = (byte) mul16s_compare::j#9 (byte) mul16s_compare::j#8 (byte) mul16s_compare::j#6 (byte) mul16s_compare::j#7 -Alias (byte*) BGCOL#13 = (byte*) BGCOL#18 (byte*) BGCOL#20 (byte*) BGCOL#16 (byte*) BGCOL#14 Alias (byte) mul16s_compare::i#10 = (byte) mul16s_compare::i#11 (byte) mul16s_compare::i#9 (byte) mul16s_compare::i#7 (byte) mul16s_compare::i#8 Alias (byte*) print_char_cursor#168 = (byte*) print_char_cursor#173 (byte*) print_char_cursor#175 (byte*) print_char_cursor#171 (byte*) print_char_cursor#169 Alias (byte*) print_line_cursor#75 = (byte*) print_line_cursor#84 (byte*) print_line_cursor#88 (byte*) print_line_cursor#80 (byte*) print_line_cursor#76 @@ -2770,7 +2698,6 @@ Alias (signed dword) mul16s_compare::mn#0 = (signed dword~) mul16s_compare::$6 ( Alias (signed dword) mulf16s::return#2 = (signed dword) mulf16s::return#4 Alias (signed dword) mul16s_compare::mf#0 = (signed dword~) mul16s_compare::$7 (signed dword) mul16s_compare::mf#5 Alias (byte) mul16s_compare::j#4 = (byte) mul16s_compare::j#5 -Alias (byte*) BGCOL#10 = (byte*) BGCOL#9 Alias (signed word) mul16s_compare::a#10 = (signed word) mul16s_compare::a#11 Alias (signed word) mul16s_compare::b#10 = (signed word) mul16s_compare::b#11 Alias (signed dword) mul16s_compare::ms#2 = (signed dword) mul16s_compare::ms#7 @@ -2785,7 +2712,6 @@ Alias (signed word) mul16s_compare::b#12 = (signed word) mul16s_compare::b#7 (si Alias (byte) mul16s_compare::i#2 = (byte) mul16s_compare::i#3 (byte) mul16s_compare::i#4 Alias (byte*) print_char_cursor#144 = (byte*) print_char_cursor#164 (byte*) print_char_cursor#156 (byte*) print_char_cursor#155 (byte*) print_char_cursor#145 Alias (byte*) print_line_cursor#50 = (byte*) print_line_cursor#69 (byte*) print_line_cursor#58 (byte*) print_line_cursor#59 (byte*) print_line_cursor#51 -Alias (byte*) BGCOL#24 = (byte*) BGCOL#6 (byte*) BGCOL#3 (byte*) BGCOL#30 Alias (signed dword) mul16s_compare::ms#3 = (signed dword) mul16s_compare::ms#6 Alias (signed dword) mul16s_compare::mn#2 = (signed dword) mul16s_compare::mn#5 Alias (signed dword) mul16s_compare::mf#1 = (signed dword) mul16s_compare::mf#2 @@ -2816,7 +2742,6 @@ Alias (byte*) print_char_cursor#123 = (byte*) print_char_cursor#60 Alias (byte*) print_char_cursor#124 = (byte*) print_char_cursor#61 Alias (byte*) print_line_cursor#19 = (byte*) print_line_cursor#40 (byte*) print_line_cursor#41 (byte*) print_line_cursor#20 Alias (byte*) print_char_cursor#125 = (byte*) print_char_cursor#62 (byte*) print_char_cursor#126 (byte*) print_char_cursor#63 -Alias (byte*) BGCOL#0 = (byte*) BGCOL#4 Alias (byte*) print_line_cursor#21 = (byte*) print_line_cursor#42 Alias (byte*) print_char_cursor#127 = (byte*) print_char_cursor#64 Successful SSA optimization Pass2AliasElimination @@ -2835,7 +2760,6 @@ Alias (signed word) mulf16s::a#1 = (signed word) mulf16s::a#3 Alias (dword) mul16u_compare::ms#0 = (dword) mul16u_compare::ms#2 (dword) mul16u_compare::ms#3 Alias (dword) mul16u_compare::mn#0 = (dword) mul16u_compare::mn#1 (dword) mul16u_compare::mn#2 Alias (byte) mul16u_compare::j#10 = (byte) mul16u_compare::j#4 (byte) mul16u_compare::j#2 -Alias (byte*) BGCOL#11 = (byte*) BGCOL#7 (byte*) BGCOL#2 Alias (word) mul16u_compare::a#1 = (word) mul16u_compare::a#10 (word) mul16u_compare::a#12 Alias (word) mul16u_compare::b#1 = (word) mul16u_compare::b#10 (word) mul16u_compare::b#12 Alias (dword) mul16u_compare::mf#0 = (dword) mul16u_compare::mf#3 (dword) mul16u_compare::mf#1 @@ -2845,7 +2769,6 @@ Alias (byte*) print_line_cursor#46 = (byte*) print_line_cursor#63 (byte*) print_ Alias (signed dword) mul16s_compare::ms#0 = (signed dword) mul16s_compare::ms#2 (signed dword) mul16s_compare::ms#3 Alias (signed dword) mul16s_compare::mn#0 = (signed dword) mul16s_compare::mn#1 (signed dword) mul16s_compare::mn#2 Alias (byte) mul16s_compare::j#10 = (byte) mul16s_compare::j#4 (byte) mul16s_compare::j#2 -Alias (byte*) BGCOL#10 = (byte*) BGCOL#13 (byte*) BGCOL#24 Alias (signed word) mul16s_compare::a#1 = (signed word) mul16s_compare::a#10 (signed word) mul16s_compare::a#12 Alias (signed word) mul16s_compare::b#1 = (signed word) mul16s_compare::b#10 (signed word) mul16s_compare::b#12 Alias (signed dword) mul16s_compare::mf#0 = (signed dword) mul16s_compare::mf#3 (signed dword) mul16s_compare::mf#1 @@ -2861,11 +2784,9 @@ Self Phi Eliminated (signed word) muls16s::b#1 Self Phi Eliminated (signed word) muls16s::a#3 Self Phi Eliminated (signed word) muls16s::b#2 Self Phi Eliminated (signed word) muls16s::a#4 -Self Phi Eliminated (byte*) BGCOL#11 Self Phi Eliminated (byte) mul16u_compare::i#10 Self Phi Eliminated (byte*) print_char_cursor#140 Self Phi Eliminated (byte*) print_line_cursor#46 -Self Phi Eliminated (byte*) BGCOL#10 Self Phi Eliminated (byte) mul16s_compare::i#10 Self Phi Eliminated (byte*) print_char_cursor#144 Self Phi Eliminated (byte*) print_line_cursor#50 @@ -2887,7 +2808,6 @@ Redundant Phi (signed word) mul16s::a#1 (signed word) mul16s::a#0 Redundant Phi (signed word) mul16s::b#1 (signed word) mul16s::b#0 Redundant Phi (signed word) mulf16s::a#1 (signed word) mulf16s::a#0 Redundant Phi (signed word) mulf16s::b#1 (signed word) mulf16s::b#0 -Redundant Phi (byte*) BGCOL#1 (byte*) BGCOL#0 Redundant Phi (byte*) print_screen#4 (byte*) print_line_cursor#0 Redundant Phi (byte*) print_line_cursor#44 (byte*) print_line_cursor#0 Redundant Phi (byte*) print_char_cursor#137 (byte*) print_line_cursor#0 @@ -2908,10 +2828,8 @@ Redundant Phi (signed word) muls16s::a#3 (signed word) muls16s::a#1 Redundant Phi (signed word) muls16s::b#2 (signed word) muls16s::b#3 Redundant Phi (signed word) muls16s::a#4 (signed word) muls16s::a#1 Redundant Phi (byte*) print_char_cursor#151 (byte*) print_char_cursor#138 -Redundant Phi (byte*) BGCOL#27 (byte*) BGCOL#1 Redundant Phi (byte*) print_line_cursor#98 (byte*) print_line_cursor#26 Redundant Phi (byte*) print_char_cursor#28 (byte*) print_char_cursor#128 -Redundant Phi (byte*) BGCOL#11 (byte*) BGCOL#21 Redundant Phi (byte) mul16u_compare::i#10 (byte) mul16u_compare::i#12 Redundant Phi (byte*) print_char_cursor#140 (byte*) print_char_cursor#28 Redundant Phi (byte*) print_line_cursor#46 (byte*) print_line_cursor#90 @@ -2942,10 +2860,8 @@ Redundant Phi (byte*) print_char_cursor#106 (byte*) print_char_cursor#12 Redundant Phi (byte*) print_line_cursor#13 (byte*) print_line_cursor#1 Redundant Phi (byte*) print_char_cursor#107 (byte*) print_line_cursor#1 Redundant Phi (byte*) print_char_cursor#154 (byte*) print_char_cursor#25 -Redundant Phi (byte*) BGCOL#29 (byte*) BGCOL#1 Redundant Phi (byte*) print_line_cursor#100 (byte*) print_line_cursor#27 Redundant Phi (byte*) print_char_cursor#109 (byte*) print_char_cursor#128 -Redundant Phi (byte*) BGCOL#10 (byte*) BGCOL#23 Redundant Phi (byte) mul16s_compare::i#10 (byte) mul16s_compare::i#12 Redundant Phi (byte*) print_char_cursor#144 (byte*) print_char_cursor#109 Redundant Phi (byte*) print_line_cursor#50 (byte*) print_line_cursor#92 @@ -3130,14 +3046,10 @@ Culled Empty Block (label) mul16s_compare::@19 Culled Empty Block (label) mul16s_error::@11 Culled Empty Block (label) @41 Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte*) BGCOL#21 Self Phi Eliminated (byte*) print_line_cursor#90 -Self Phi Eliminated (byte*) BGCOL#23 Self Phi Eliminated (byte*) print_line_cursor#92 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) BGCOL#21 (const byte*) BGCOL#0 Redundant Phi (byte*) print_line_cursor#90 (const byte*) print_line_cursor#0 -Redundant Phi (byte*) BGCOL#23 (const byte*) BGCOL#0 Redundant Phi (byte*) print_line_cursor#92 (byte*) print_line_cursor#1 Successful SSA optimization Pass2RedundantPhiElimination Inlining constant with var siblings (const byte*) print_str::str#1 diff --git a/src/test/ref/test-multiply-8bit.log b/src/test/ref/test-multiply-8bit.log index 9689cd744..055db59bd 100644 --- a/src/test/ref/test-multiply-8bit.log +++ b/src/test/ref/test-multiply-8bit.log @@ -1,3 +1,5 @@ +Identified constant variable (byte*) BGCOL +Identified constant variable (byte*) mulf_init_asm::mem Inlined call call mulf8s_prepare (signed byte) mulf8s::a CONTROL FLOW GRAPH SSA @@ -569,12 +571,10 @@ main: scope:[main] from @42 (byte*) print_char_cursor#141 ← phi( @42/(byte*) print_char_cursor#151 ) (byte*) print_line_cursor#46 ← phi( @42/(byte*) print_line_cursor#56 ) (byte*) print_screen#4 ← phi( @42/(byte*) print_screen#5 ) - (byte*) BGCOL#1 ← phi( @42/(byte*) BGCOL#5 ) - *((byte*) BGCOL#1) ← (byte/signed byte/word/signed word/dword/signed dword) 5 + *((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5 call print_cls to:main::@1 main::@1: scope:[main] from main - (byte*) BGCOL#24 ← phi( main/(byte*) BGCOL#1 ) (byte*) print_char_cursor#87 ← phi( main/(byte*) print_char_cursor#21 ) (byte*) print_line_cursor#27 ← phi( main/(byte*) print_line_cursor#4 ) (byte*) print_line_cursor#5 ← (byte*) print_line_cursor#27 @@ -582,19 +582,16 @@ main::@1: scope:[main] from main call mulf_init to:main::@2 main::@2: scope:[main] from main::@1 - (byte*) BGCOL#21 ← phi( main::@1/(byte*) BGCOL#24 ) (byte*) print_line_cursor#57 ← phi( main::@1/(byte*) print_line_cursor#5 ) (byte*) print_char_cursor#155 ← phi( main::@1/(byte*) print_char_cursor#22 ) call mulf_init_asm to:main::@3 main::@3: scope:[main] from main::@2 - (byte*) BGCOL#16 ← phi( main::@2/(byte*) BGCOL#21 ) (byte*) print_line_cursor#47 ← phi( main::@2/(byte*) print_line_cursor#57 ) (byte*) print_char_cursor#142 ← phi( main::@2/(byte*) print_char_cursor#155 ) call mulf_tables_cmp to:main::@4 main::@4: scope:[main] from main::@3 - (byte*) BGCOL#37 ← phi( main::@3/(byte*) BGCOL#16 ) (byte*) print_line_cursor#28 ← phi( main::@3/(byte*) print_line_cursor#10 ) (byte*) print_char_cursor#88 ← phi( main::@3/(byte*) print_char_cursor#31 ) (byte*) print_char_cursor#23 ← (byte*) print_char_cursor#88 @@ -602,7 +599,6 @@ main::@4: scope:[main] from main::@3 call mul8u_compare to:main::@5 main::@5: scope:[main] from main::@4 - (byte*) BGCOL#38 ← phi( main::@4/(byte*) BGCOL#37 ) (byte*) print_line_cursor#29 ← phi( main::@4/(byte*) print_line_cursor#13 ) (byte*) print_char_cursor#89 ← phi( main::@4/(byte*) print_char_cursor#35 ) (byte*) print_char_cursor#24 ← (byte*) print_char_cursor#89 @@ -721,7 +717,6 @@ muls8s::@return: scope:[muls8s] from muls8s::@4 (byte*) print_screen#6 ← phi( @33/(byte*) print_screen#7 ) (byte*) print_char_cursor#162 ← phi( @33/(byte*) print_char_cursor#163 ) (byte*) print_line_cursor#66 ← phi( @33/(byte*) print_line_cursor#67 ) - (byte*) BGCOL#15 ← phi( @33/(byte*) BGCOL#0 ) (byte[$200]) mula_sqr1_lo#0 ← { fill( $200, 0) } (byte[$200]) mula_sqr1_hi#0 ← { fill( $200, 0) } (byte[$200]) mula_sqr2_lo#0 ← { fill( $200, 0) } @@ -741,14 +736,12 @@ mulf_init_asm::@return: scope:[mulf_init_asm] from mulf_init_asm mulf_tables_cmp: scope:[mulf_tables_cmp] from main::@3 (byte*) print_line_cursor#90 ← phi( main::@3/(byte*) print_line_cursor#47 ) (byte*) print_char_cursor#164 ← phi( main::@3/(byte*) print_char_cursor#142 ) - (byte*) BGCOL#9 ← phi( main::@3/(byte*) BGCOL#16 ) (byte*) mulf_tables_cmp::asm_sqr#0 ← (byte[$200]) mula_sqr1_lo#0 (byte*) mulf_tables_cmp::kc_sqr#0 ← (byte[$200]) mulf_sqr1_lo#0 to:mulf_tables_cmp::@1 mulf_tables_cmp::@1: scope:[mulf_tables_cmp] from mulf_tables_cmp mulf_tables_cmp::@2 (byte*) print_line_cursor#79 ← phi( mulf_tables_cmp/(byte*) print_line_cursor#90 mulf_tables_cmp::@2/(byte*) print_line_cursor#69 ) (byte*) print_char_cursor#156 ← phi( mulf_tables_cmp/(byte*) print_char_cursor#164 mulf_tables_cmp::@2/(byte*) print_char_cursor#157 ) - (byte*) BGCOL#6 ← phi( mulf_tables_cmp/(byte*) BGCOL#9 mulf_tables_cmp::@2/(byte*) BGCOL#10 ) (byte*) mulf_tables_cmp::asm_sqr#2 ← phi( mulf_tables_cmp/(byte*) mulf_tables_cmp::asm_sqr#0 mulf_tables_cmp::@2/(byte*) mulf_tables_cmp::asm_sqr#1 ) (byte*) mulf_tables_cmp::kc_sqr#2 ← phi( mulf_tables_cmp/(byte*) mulf_tables_cmp::kc_sqr#0 mulf_tables_cmp::@2/(byte*) mulf_tables_cmp::kc_sqr#1 ) (bool~) mulf_tables_cmp::$0 ← *((byte*) mulf_tables_cmp::kc_sqr#2) != *((byte*) mulf_tables_cmp::asm_sqr#2) @@ -758,7 +751,6 @@ mulf_tables_cmp::@1: scope:[mulf_tables_cmp] from mulf_tables_cmp mulf_tables_c mulf_tables_cmp::@2: scope:[mulf_tables_cmp] from mulf_tables_cmp::@1 (byte*) print_line_cursor#69 ← phi( mulf_tables_cmp::@1/(byte*) print_line_cursor#79 ) (byte*) print_char_cursor#157 ← phi( mulf_tables_cmp::@1/(byte*) print_char_cursor#156 ) - (byte*) BGCOL#10 ← phi( mulf_tables_cmp::@1/(byte*) BGCOL#6 ) (byte*) mulf_tables_cmp::kc_sqr#3 ← phi( mulf_tables_cmp::@1/(byte*) mulf_tables_cmp::kc_sqr#2 ) (byte*) mulf_tables_cmp::asm_sqr#3 ← phi( mulf_tables_cmp::@1/(byte*) mulf_tables_cmp::asm_sqr#2 ) (byte*) mulf_tables_cmp::asm_sqr#1 ← ++ (byte*) mulf_tables_cmp::asm_sqr#3 @@ -773,8 +765,7 @@ mulf_tables_cmp::@3: scope:[mulf_tables_cmp] from mulf_tables_cmp::@1 (byte*) mulf_tables_cmp::kc_sqr#7 ← phi( mulf_tables_cmp::@1/(byte*) mulf_tables_cmp::kc_sqr#2 ) (byte*) mulf_tables_cmp::asm_sqr#5 ← phi( mulf_tables_cmp::@1/(byte*) mulf_tables_cmp::asm_sqr#2 ) (byte*) print_char_cursor#143 ← phi( mulf_tables_cmp::@1/(byte*) print_char_cursor#156 ) - (byte*) BGCOL#2 ← phi( mulf_tables_cmp::@1/(byte*) BGCOL#6 ) - *((byte*) BGCOL#2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 + *((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 (byte*) print_str::str#1 ← (const string) mulf_tables_cmp::str call print_str to:mulf_tables_cmp::@6 @@ -838,20 +829,17 @@ mulf_tables_cmp::@11: scope:[mulf_tables_cmp] from mulf_tables_cmp::@10 mul8u_compare: scope:[mul8u_compare] from main::@4 (byte*) print_line_cursor#108 ← phi( main::@4/(byte*) print_line_cursor#6 ) (byte*) print_char_cursor#185 ← phi( main::@4/(byte*) print_char_cursor#23 ) - (byte*) BGCOL#33 ← phi( main::@4/(byte*) BGCOL#37 ) (byte) mul8u_compare::a#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:mul8u_compare::@1 mul8u_compare::@1: scope:[mul8u_compare] from mul8u_compare mul8u_compare::@10 (byte*) print_line_cursor#104 ← phi( mul8u_compare/(byte*) print_line_cursor#108 mul8u_compare::@10/(byte*) print_line_cursor#72 ) (byte*) print_char_cursor#183 ← phi( mul8u_compare/(byte*) print_char_cursor#185 mul8u_compare::@10/(byte*) print_char_cursor#159 ) - (byte*) BGCOL#29 ← phi( mul8u_compare/(byte*) BGCOL#33 mul8u_compare::@10/(byte*) BGCOL#34 ) (byte) mul8u_compare::a#7 ← phi( mul8u_compare/(byte) mul8u_compare::a#0 mul8u_compare::@10/(byte) mul8u_compare::a#1 ) (byte) mul8u_compare::b#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:mul8u_compare::@2 mul8u_compare::@2: scope:[mul8u_compare] from mul8u_compare::@1 mul8u_compare::@5 (byte*) print_line_cursor#100 ← phi( mul8u_compare::@1/(byte*) print_line_cursor#104 mul8u_compare::@5/(byte*) print_line_cursor#83 ) (byte*) print_char_cursor#181 ← phi( mul8u_compare::@1/(byte*) print_char_cursor#183 mul8u_compare::@5/(byte*) print_char_cursor#167 ) - (byte*) BGCOL#27 ← phi( mul8u_compare::@1/(byte*) BGCOL#29 mul8u_compare::@5/(byte*) BGCOL#30 ) (byte) mul8u_compare::b#2 ← phi( mul8u_compare::@1/(byte) mul8u_compare::b#0 mul8u_compare::@5/(byte) mul8u_compare::b#1 ) (byte) mul8u_compare::a#2 ← phi( mul8u_compare::@1/(byte) mul8u_compare::a#7 mul8u_compare::@5/(byte) mul8u_compare::a#8 ) (byte) muls8u::a#0 ← (byte) mul8u_compare::a#2 @@ -862,7 +850,6 @@ mul8u_compare::@2: scope:[mul8u_compare] from mul8u_compare::@1 mul8u_compare:: mul8u_compare::@12: scope:[mul8u_compare] from mul8u_compare::@2 (byte*) print_line_cursor#96 ← phi( mul8u_compare::@2/(byte*) print_line_cursor#100 ) (byte*) print_char_cursor#179 ← phi( mul8u_compare::@2/(byte*) print_char_cursor#181 ) - (byte*) BGCOL#25 ← phi( mul8u_compare::@2/(byte*) BGCOL#27 ) (byte) mul8u_compare::b#3 ← phi( mul8u_compare::@2/(byte) mul8u_compare::b#2 ) (byte) mul8u_compare::a#3 ← phi( mul8u_compare::@2/(byte) mul8u_compare::a#2 ) (word) muls8u::return#4 ← phi( mul8u_compare::@2/(word) muls8u::return#2 ) @@ -876,7 +863,6 @@ mul8u_compare::@12: scope:[mul8u_compare] from mul8u_compare::@2 mul8u_compare::@13: scope:[mul8u_compare] from mul8u_compare::@12 (byte*) print_line_cursor#92 ← phi( mul8u_compare::@12/(byte*) print_line_cursor#96 ) (byte*) print_char_cursor#177 ← phi( mul8u_compare::@12/(byte*) print_char_cursor#179 ) - (byte*) BGCOL#22 ← phi( mul8u_compare::@12/(byte*) BGCOL#25 ) (word) mul8u_compare::ms#4 ← phi( mul8u_compare::@12/(word) mul8u_compare::ms#0 ) (byte) mul8u_compare::b#4 ← phi( mul8u_compare::@12/(byte) mul8u_compare::b#3 ) (byte) mul8u_compare::a#4 ← phi( mul8u_compare::@12/(byte) mul8u_compare::a#3 ) @@ -892,7 +878,6 @@ mul8u_compare::@14: scope:[mul8u_compare] from mul8u_compare::@13 (byte*) print_line_cursor#81 ← phi( mul8u_compare::@13/(byte*) print_line_cursor#92 ) (byte*) print_char_cursor#172 ← phi( mul8u_compare::@13/(byte*) print_char_cursor#177 ) (byte) mul8u_compare::a#12 ← phi( mul8u_compare::@13/(byte) mul8u_compare::a#4 ) - (byte*) BGCOL#17 ← phi( mul8u_compare::@13/(byte*) BGCOL#22 ) (byte) mul8u_compare::b#10 ← phi( mul8u_compare::@13/(byte) mul8u_compare::b#4 ) (word) mul8u_compare::mf#1 ← phi( mul8u_compare::@13/(word) mul8u_compare::mf#0 ) (word) mul8u_compare::ms#1 ← phi( mul8u_compare::@13/(word) mul8u_compare::ms#4 ) @@ -909,7 +894,6 @@ mul8u_compare::@3: scope:[mul8u_compare] from mul8u_compare::@14 mul8u_compare: (byte*) print_char_cursor#165 ← phi( mul8u_compare::@14/(byte*) print_char_cursor#172 mul8u_compare::@6/(byte*) print_char_cursor#173 ) (word) mul8u_compare::mf#4 ← phi( mul8u_compare::@14/(word) mul8u_compare::mf#1 mul8u_compare::@6/(word) mul8u_compare::mf#6 ) (byte) mul8u_compare::a#10 ← phi( mul8u_compare::@14/(byte) mul8u_compare::a#12 mul8u_compare::@6/(byte) mul8u_compare::a#13 ) - (byte*) BGCOL#11 ← phi( mul8u_compare::@14/(byte*) BGCOL#17 mul8u_compare::@6/(byte*) BGCOL#18 ) (byte) mul8u_compare::b#8 ← phi( mul8u_compare::@14/(byte) mul8u_compare::b#10 mul8u_compare::@6/(byte) mul8u_compare::b#11 ) (byte) mul8u_compare::ok#4 ← phi( mul8u_compare::@14/(byte) mul8u_compare::ok#0 mul8u_compare::@6/(byte) mul8u_compare::ok#1 ) (word) mul8u_compare::mn#1 ← phi( mul8u_compare::@14/(word) mul8u_compare::mn#0 mul8u_compare::@6/(word) mul8u_compare::mn#3 ) @@ -923,7 +907,6 @@ mul8u_compare::@6: scope:[mul8u_compare] from mul8u_compare::@14 (byte*) print_char_cursor#173 ← phi( mul8u_compare::@14/(byte*) print_char_cursor#172 ) (word) mul8u_compare::mf#6 ← phi( mul8u_compare::@14/(word) mul8u_compare::mf#1 ) (byte) mul8u_compare::a#13 ← phi( mul8u_compare::@14/(byte) mul8u_compare::a#12 ) - (byte*) BGCOL#18 ← phi( mul8u_compare::@14/(byte*) BGCOL#17 ) (byte) mul8u_compare::b#11 ← phi( mul8u_compare::@14/(byte) mul8u_compare::b#10 ) (word) mul8u_compare::mn#3 ← phi( mul8u_compare::@14/(word) mul8u_compare::mn#0 ) (word) mul8u_compare::ms#5 ← phi( mul8u_compare::@14/(word) mul8u_compare::ms#1 ) @@ -936,7 +919,6 @@ mul8u_compare::@4: scope:[mul8u_compare] from mul8u_compare::@3 mul8u_compare:: (word) mul8u_compare::mn#4 ← phi( mul8u_compare::@3/(word) mul8u_compare::mn#1 mul8u_compare::@7/(word) mul8u_compare::mn#5 ) (word) mul8u_compare::ms#6 ← phi( mul8u_compare::@3/(word) mul8u_compare::ms#2 mul8u_compare::@7/(word) mul8u_compare::ms#7 ) (byte) mul8u_compare::a#9 ← phi( mul8u_compare::@3/(byte) mul8u_compare::a#10 mul8u_compare::@7/(byte) mul8u_compare::a#11 ) - (byte*) BGCOL#7 ← phi( mul8u_compare::@3/(byte*) BGCOL#11 mul8u_compare::@7/(byte*) BGCOL#12 ) (byte) mul8u_compare::b#7 ← phi( mul8u_compare::@3/(byte) mul8u_compare::b#8 mul8u_compare::@7/(byte) mul8u_compare::b#9 ) (byte) mul8u_compare::ok#3 ← phi( mul8u_compare::@3/(byte) mul8u_compare::ok#4 mul8u_compare::@7/(byte) mul8u_compare::ok#2 ) (bool~) mul8u_compare::$7 ← (byte) mul8u_compare::ok#3 == (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -950,12 +932,10 @@ mul8u_compare::@7: scope:[mul8u_compare] from mul8u_compare::@3 (word) mul8u_compare::mn#5 ← phi( mul8u_compare::@3/(word) mul8u_compare::mn#1 ) (word) mul8u_compare::ms#7 ← phi( mul8u_compare::@3/(word) mul8u_compare::ms#2 ) (byte) mul8u_compare::a#11 ← phi( mul8u_compare::@3/(byte) mul8u_compare::a#10 ) - (byte*) BGCOL#12 ← phi( mul8u_compare::@3/(byte*) BGCOL#11 ) (byte) mul8u_compare::b#9 ← phi( mul8u_compare::@3/(byte) mul8u_compare::b#8 ) (byte) mul8u_compare::ok#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:mul8u_compare::@4 mul8u_compare::@5: scope:[mul8u_compare] from mul8u_compare::@4 - (byte*) BGCOL#30 ← phi( mul8u_compare::@4/(byte*) BGCOL#7 ) (byte*) print_line_cursor#83 ← phi( mul8u_compare::@4/(byte*) print_line_cursor#60 ) (byte*) print_char_cursor#167 ← phi( mul8u_compare::@4/(byte*) print_char_cursor#158 ) (byte) mul8u_compare::a#8 ← phi( mul8u_compare::@4/(byte) mul8u_compare::a#9 ) @@ -972,8 +952,7 @@ mul8u_compare::@8: scope:[mul8u_compare] from mul8u_compare::@4 (word) mul8u_compare::ms#3 ← phi( mul8u_compare::@4/(word) mul8u_compare::ms#6 ) (byte) mul8u_compare::b#6 ← phi( mul8u_compare::@4/(byte) mul8u_compare::b#7 ) (byte) mul8u_compare::a#5 ← phi( mul8u_compare::@4/(byte) mul8u_compare::a#9 ) - (byte*) BGCOL#3 ← phi( mul8u_compare::@4/(byte*) BGCOL#7 ) - *((byte*) BGCOL#3) ← (byte/signed byte/word/signed word/dword/signed dword) 2 + *((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 (byte) mul8u_error::a#0 ← (byte) mul8u_compare::a#5 (byte) mul8u_error::b#0 ← (byte) mul8u_compare::b#6 (word) mul8u_error::ms#0 ← (word) mul8u_compare::ms#3 @@ -995,7 +974,6 @@ mul8u_compare::@return: scope:[mul8u_compare] from mul8u_compare::@15 mul8u_com return to:@return mul8u_compare::@10: scope:[mul8u_compare] from mul8u_compare::@5 - (byte*) BGCOL#34 ← phi( mul8u_compare::@5/(byte*) BGCOL#30 ) (byte*) print_line_cursor#72 ← phi( mul8u_compare::@5/(byte*) print_line_cursor#83 ) (byte*) print_char_cursor#159 ← phi( mul8u_compare::@5/(byte*) print_char_cursor#167 ) (byte) mul8u_compare::a#6 ← phi( mul8u_compare::@5/(byte) mul8u_compare::a#8 ) @@ -1142,14 +1120,12 @@ mul8u_error::@return: scope:[mul8u_error] from mul8u_error::@11 mul8s_compare: scope:[mul8s_compare] from main::@5 (byte*) print_line_cursor#110 ← phi( main::@5/(byte*) print_line_cursor#7 ) (byte*) print_char_cursor#186 ← phi( main::@5/(byte*) print_char_cursor#24 ) - (byte*) BGCOL#35 ← phi( main::@5/(byte*) BGCOL#38 ) (signed byte/signed word/signed dword~) mul8s_compare::$0 ← - (byte/word/signed word/dword/signed dword) $80 (signed byte) mul8s_compare::a#0 ← (signed byte/signed word/signed dword~) mul8s_compare::$0 to:mul8s_compare::@1 mul8s_compare::@1: scope:[mul8s_compare] from mul8s_compare mul8s_compare::@10 (byte*) print_line_cursor#106 ← phi( mul8s_compare/(byte*) print_line_cursor#110 mul8s_compare::@10/(byte*) print_line_cursor#76 ) (byte*) print_char_cursor#184 ← phi( mul8s_compare/(byte*) print_char_cursor#186 mul8s_compare::@10/(byte*) print_char_cursor#161 ) - (byte*) BGCOL#31 ← phi( mul8s_compare/(byte*) BGCOL#35 mul8s_compare::@10/(byte*) BGCOL#36 ) (signed byte) mul8s_compare::a#7 ← phi( mul8s_compare/(signed byte) mul8s_compare::a#0 mul8s_compare::@10/(signed byte) mul8s_compare::a#1 ) (signed byte/signed word/signed dword~) mul8s_compare::$1 ← - (byte/word/signed word/dword/signed dword) $80 (signed byte) mul8s_compare::b#0 ← (signed byte/signed word/signed dword~) mul8s_compare::$1 @@ -1157,7 +1133,6 @@ mul8s_compare::@1: scope:[mul8s_compare] from mul8s_compare mul8s_compare::@10 mul8s_compare::@2: scope:[mul8s_compare] from mul8s_compare::@1 mul8s_compare::@5 (byte*) print_line_cursor#102 ← phi( mul8s_compare::@1/(byte*) print_line_cursor#106 mul8s_compare::@5/(byte*) print_line_cursor#87 ) (byte*) print_char_cursor#182 ← phi( mul8s_compare::@1/(byte*) print_char_cursor#184 mul8s_compare::@5/(byte*) print_char_cursor#170 ) - (byte*) BGCOL#28 ← phi( mul8s_compare::@1/(byte*) BGCOL#31 mul8s_compare::@5/(byte*) BGCOL#32 ) (signed byte) mul8s_compare::b#2 ← phi( mul8s_compare::@1/(signed byte) mul8s_compare::b#0 mul8s_compare::@5/(signed byte) mul8s_compare::b#1 ) (signed byte) mul8s_compare::a#2 ← phi( mul8s_compare::@1/(signed byte) mul8s_compare::a#7 mul8s_compare::@5/(signed byte) mul8s_compare::a#8 ) (signed byte) muls8s::a#0 ← (signed byte) mul8s_compare::a#2 @@ -1168,7 +1143,6 @@ mul8s_compare::@2: scope:[mul8s_compare] from mul8s_compare::@1 mul8s_compare:: mul8s_compare::@12: scope:[mul8s_compare] from mul8s_compare::@2 (byte*) print_line_cursor#98 ← phi( mul8s_compare::@2/(byte*) print_line_cursor#102 ) (byte*) print_char_cursor#180 ← phi( mul8s_compare::@2/(byte*) print_char_cursor#182 ) - (byte*) BGCOL#26 ← phi( mul8s_compare::@2/(byte*) BGCOL#28 ) (signed byte) mul8s_compare::b#3 ← phi( mul8s_compare::@2/(signed byte) mul8s_compare::b#2 ) (signed byte) mul8s_compare::a#3 ← phi( mul8s_compare::@2/(signed byte) mul8s_compare::a#2 ) (signed word) muls8s::return#4 ← phi( mul8s_compare::@2/(signed word) muls8s::return#2 ) @@ -1182,7 +1156,6 @@ mul8s_compare::@12: scope:[mul8s_compare] from mul8s_compare::@2 mul8s_compare::@13: scope:[mul8s_compare] from mul8s_compare::@12 (byte*) print_line_cursor#94 ← phi( mul8s_compare::@12/(byte*) print_line_cursor#98 ) (byte*) print_char_cursor#178 ← phi( mul8s_compare::@12/(byte*) print_char_cursor#180 ) - (byte*) BGCOL#23 ← phi( mul8s_compare::@12/(byte*) BGCOL#26 ) (signed word) mul8s_compare::ms#4 ← phi( mul8s_compare::@12/(signed word) mul8s_compare::ms#0 ) (signed byte) mul8s_compare::b#4 ← phi( mul8s_compare::@12/(signed byte) mul8s_compare::b#3 ) (signed byte) mul8s_compare::a#4 ← phi( mul8s_compare::@12/(signed byte) mul8s_compare::a#3 ) @@ -1198,7 +1171,6 @@ mul8s_compare::@14: scope:[mul8s_compare] from mul8s_compare::@13 (byte*) print_line_cursor#85 ← phi( mul8s_compare::@13/(byte*) print_line_cursor#94 ) (byte*) print_char_cursor#174 ← phi( mul8s_compare::@13/(byte*) print_char_cursor#178 ) (signed byte) mul8s_compare::a#12 ← phi( mul8s_compare::@13/(signed byte) mul8s_compare::a#4 ) - (byte*) BGCOL#19 ← phi( mul8s_compare::@13/(byte*) BGCOL#23 ) (signed byte) mul8s_compare::b#10 ← phi( mul8s_compare::@13/(signed byte) mul8s_compare::b#4 ) (signed word) mul8s_compare::mf#1 ← phi( mul8s_compare::@13/(signed word) mul8s_compare::mf#0 ) (signed word) mul8s_compare::ms#1 ← phi( mul8s_compare::@13/(signed word) mul8s_compare::ms#4 ) @@ -1215,7 +1187,6 @@ mul8s_compare::@3: scope:[mul8s_compare] from mul8s_compare::@14 mul8s_compare: (byte*) print_char_cursor#168 ← phi( mul8s_compare::@14/(byte*) print_char_cursor#174 mul8s_compare::@6/(byte*) print_char_cursor#175 ) (signed word) mul8s_compare::mf#4 ← phi( mul8s_compare::@14/(signed word) mul8s_compare::mf#1 mul8s_compare::@6/(signed word) mul8s_compare::mf#6 ) (signed byte) mul8s_compare::a#10 ← phi( mul8s_compare::@14/(signed byte) mul8s_compare::a#12 mul8s_compare::@6/(signed byte) mul8s_compare::a#13 ) - (byte*) BGCOL#13 ← phi( mul8s_compare::@14/(byte*) BGCOL#19 mul8s_compare::@6/(byte*) BGCOL#20 ) (signed byte) mul8s_compare::b#8 ← phi( mul8s_compare::@14/(signed byte) mul8s_compare::b#10 mul8s_compare::@6/(signed byte) mul8s_compare::b#11 ) (byte) mul8s_compare::ok#4 ← phi( mul8s_compare::@14/(byte) mul8s_compare::ok#0 mul8s_compare::@6/(byte) mul8s_compare::ok#1 ) (signed word) mul8s_compare::mn#1 ← phi( mul8s_compare::@14/(signed word) mul8s_compare::mn#0 mul8s_compare::@6/(signed word) mul8s_compare::mn#3 ) @@ -1229,7 +1200,6 @@ mul8s_compare::@6: scope:[mul8s_compare] from mul8s_compare::@14 (byte*) print_char_cursor#175 ← phi( mul8s_compare::@14/(byte*) print_char_cursor#174 ) (signed word) mul8s_compare::mf#6 ← phi( mul8s_compare::@14/(signed word) mul8s_compare::mf#1 ) (signed byte) mul8s_compare::a#13 ← phi( mul8s_compare::@14/(signed byte) mul8s_compare::a#12 ) - (byte*) BGCOL#20 ← phi( mul8s_compare::@14/(byte*) BGCOL#19 ) (signed byte) mul8s_compare::b#11 ← phi( mul8s_compare::@14/(signed byte) mul8s_compare::b#10 ) (signed word) mul8s_compare::mn#3 ← phi( mul8s_compare::@14/(signed word) mul8s_compare::mn#0 ) (signed word) mul8s_compare::ms#5 ← phi( mul8s_compare::@14/(signed word) mul8s_compare::ms#1 ) @@ -1242,7 +1212,6 @@ mul8s_compare::@4: scope:[mul8s_compare] from mul8s_compare::@3 mul8s_compare:: (signed word) mul8s_compare::mn#4 ← phi( mul8s_compare::@3/(signed word) mul8s_compare::mn#1 mul8s_compare::@7/(signed word) mul8s_compare::mn#5 ) (signed word) mul8s_compare::ms#6 ← phi( mul8s_compare::@3/(signed word) mul8s_compare::ms#2 mul8s_compare::@7/(signed word) mul8s_compare::ms#7 ) (signed byte) mul8s_compare::a#9 ← phi( mul8s_compare::@3/(signed byte) mul8s_compare::a#10 mul8s_compare::@7/(signed byte) mul8s_compare::a#11 ) - (byte*) BGCOL#8 ← phi( mul8s_compare::@3/(byte*) BGCOL#13 mul8s_compare::@7/(byte*) BGCOL#14 ) (signed byte) mul8s_compare::b#7 ← phi( mul8s_compare::@3/(signed byte) mul8s_compare::b#8 mul8s_compare::@7/(signed byte) mul8s_compare::b#9 ) (byte) mul8s_compare::ok#3 ← phi( mul8s_compare::@3/(byte) mul8s_compare::ok#4 mul8s_compare::@7/(byte) mul8s_compare::ok#2 ) (bool~) mul8s_compare::$9 ← (byte) mul8s_compare::ok#3 == (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -1256,12 +1225,10 @@ mul8s_compare::@7: scope:[mul8s_compare] from mul8s_compare::@3 (signed word) mul8s_compare::mn#5 ← phi( mul8s_compare::@3/(signed word) mul8s_compare::mn#1 ) (signed word) mul8s_compare::ms#7 ← phi( mul8s_compare::@3/(signed word) mul8s_compare::ms#2 ) (signed byte) mul8s_compare::a#11 ← phi( mul8s_compare::@3/(signed byte) mul8s_compare::a#10 ) - (byte*) BGCOL#14 ← phi( mul8s_compare::@3/(byte*) BGCOL#13 ) (signed byte) mul8s_compare::b#9 ← phi( mul8s_compare::@3/(signed byte) mul8s_compare::b#8 ) (byte) mul8s_compare::ok#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:mul8s_compare::@4 mul8s_compare::@5: scope:[mul8s_compare] from mul8s_compare::@4 - (byte*) BGCOL#32 ← phi( mul8s_compare::@4/(byte*) BGCOL#8 ) (byte*) print_line_cursor#87 ← phi( mul8s_compare::@4/(byte*) print_line_cursor#63 ) (byte*) print_char_cursor#170 ← phi( mul8s_compare::@4/(byte*) print_char_cursor#160 ) (signed byte) mul8s_compare::a#8 ← phi( mul8s_compare::@4/(signed byte) mul8s_compare::a#9 ) @@ -1279,8 +1246,7 @@ mul8s_compare::@8: scope:[mul8s_compare] from mul8s_compare::@4 (signed word) mul8s_compare::ms#3 ← phi( mul8s_compare::@4/(signed word) mul8s_compare::ms#6 ) (signed byte) mul8s_compare::b#6 ← phi( mul8s_compare::@4/(signed byte) mul8s_compare::b#7 ) (signed byte) mul8s_compare::a#5 ← phi( mul8s_compare::@4/(signed byte) mul8s_compare::a#9 ) - (byte*) BGCOL#4 ← phi( mul8s_compare::@4/(byte*) BGCOL#8 ) - *((byte*) BGCOL#4) ← (byte/signed byte/word/signed word/dword/signed dword) 2 + *((byte*) BGCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 (signed byte) mul8s_error::a#0 ← (signed byte) mul8s_compare::a#5 (signed byte) mul8s_error::b#0 ← (signed byte) mul8s_compare::b#6 (signed word) mul8s_error::ms#0 ← (signed word) mul8s_compare::ms#3 @@ -1302,7 +1268,6 @@ mul8s_compare::@return: scope:[mul8s_compare] from mul8s_compare::@15 mul8s_com return to:@return mul8s_compare::@10: scope:[mul8s_compare] from mul8s_compare::@5 - (byte*) BGCOL#36 ← phi( mul8s_compare::@5/(byte*) BGCOL#32 ) (byte*) print_line_cursor#76 ← phi( mul8s_compare::@5/(byte*) print_line_cursor#87 ) (byte*) print_char_cursor#161 ← phi( mul8s_compare::@5/(byte*) print_char_cursor#170 ) (signed byte) mul8s_compare::a#6 ← phi( mul8s_compare::@5/(signed byte) mul8s_compare::a#8 ) @@ -1451,7 +1416,6 @@ mul8s_error::@return: scope:[mul8s_error] from mul8s_error::@11 (byte*) print_screen#5 ← phi( @36/(byte*) print_screen#6 ) (byte*) print_char_cursor#151 ← phi( @36/(byte*) print_char_cursor#162 ) (byte*) print_line_cursor#56 ← phi( @36/(byte*) print_line_cursor#66 ) - (byte*) BGCOL#5 ← phi( @36/(byte*) BGCOL#15 ) call main to:@43 @43: scope:[] from @42 @@ -1474,44 +1438,6 @@ SYMBOL TABLE SSA (label) @end (byte*) BGCOL (byte*) BGCOL#0 -(byte*) BGCOL#1 -(byte*) BGCOL#10 -(byte*) BGCOL#11 -(byte*) BGCOL#12 -(byte*) BGCOL#13 -(byte*) BGCOL#14 -(byte*) BGCOL#15 -(byte*) BGCOL#16 -(byte*) BGCOL#17 -(byte*) BGCOL#18 -(byte*) BGCOL#19 -(byte*) BGCOL#2 -(byte*) BGCOL#20 -(byte*) BGCOL#21 -(byte*) BGCOL#22 -(byte*) BGCOL#23 -(byte*) BGCOL#24 -(byte*) BGCOL#25 -(byte*) BGCOL#26 -(byte*) BGCOL#27 -(byte*) BGCOL#28 -(byte*) BGCOL#29 -(byte*) BGCOL#3 -(byte*) BGCOL#30 -(byte*) BGCOL#31 -(byte*) BGCOL#32 -(byte*) BGCOL#33 -(byte*) BGCOL#34 -(byte*) BGCOL#35 -(byte*) BGCOL#36 -(byte*) BGCOL#37 -(byte*) BGCOL#38 -(byte*) BGCOL#4 -(byte*) BGCOL#5 -(byte*) BGCOL#6 -(byte*) BGCOL#7 -(byte*) BGCOL#8 -(byte*) BGCOL#9 (void()) main() (label) main::@1 (label) main::@2 @@ -2795,7 +2721,6 @@ Alias (signed byte) mulf8s::b#1 = (signed byte) mulf8s::b#3 (signed byte) mulf8s Alias (byte) mulf8u_prepare::a#1 = (byte) mulf8s::mulf8s_prepare1_$0#0 Alias (signed word) mulf8s_prepared::return#2 = (signed word) mulf8s_prepared::return#4 Alias (signed word) mulf8s::return#0 = (signed word~) mulf8s::$1 (signed word) mulf8s::return#3 (signed word) mulf8s::return#1 -Alias (byte*) BGCOL#1 = (byte*) BGCOL#24 (byte*) BGCOL#21 (byte*) BGCOL#16 (byte*) BGCOL#37 (byte*) BGCOL#38 Alias (byte*) print_line_cursor#27 = (byte*) print_line_cursor#5 (byte*) print_line_cursor#57 (byte*) print_line_cursor#47 Alias (byte*) print_char_cursor#142 = (byte*) print_char_cursor#22 (byte*) print_char_cursor#87 (byte*) print_char_cursor#155 Alias (byte*) print_char_cursor#23 = (byte*) print_char_cursor#88 @@ -2815,10 +2740,8 @@ Alias (signed byte) muls8s::a#1 = (signed byte) muls8s::a#6 (signed byte) muls8s Alias (signed word) muls8s::m#1 = (signed word~) muls8s::$3 Alias (signed word) muls8s::return#0 = (signed word) muls8s::m#4 (signed word) muls8s::return#3 (signed word) muls8s::return#1 Alias (signed word) muls8s::m#2 = (signed word~) muls8s::$5 -Alias (byte*) BGCOL#0 = (byte*) BGCOL#15 (byte*) BGCOL#5 Alias (byte*) mulf_tables_cmp::asm_sqr#2 = (byte*) mulf_tables_cmp::asm_sqr#3 (byte*) mulf_tables_cmp::asm_sqr#5 (byte*) mulf_tables_cmp::asm_sqr#4 Alias (byte*) mulf_tables_cmp::kc_sqr#2 = (byte*) mulf_tables_cmp::kc_sqr#3 (byte*) mulf_tables_cmp::kc_sqr#7 (byte*) mulf_tables_cmp::kc_sqr#6 (byte*) mulf_tables_cmp::kc_sqr#5 (byte*) mulf_tables_cmp::kc_sqr#4 -Alias (byte*) BGCOL#10 = (byte*) BGCOL#6 (byte*) BGCOL#2 Alias (byte*) print_char_cursor#143 = (byte*) print_char_cursor#157 (byte*) print_char_cursor#156 (byte*) print_char_cursor#144 Alias (byte*) print_line_cursor#48 = (byte*) print_line_cursor#69 (byte*) print_line_cursor#79 (byte*) print_line_cursor#91 (byte*) print_line_cursor#80 (byte*) print_line_cursor#68 (byte*) print_line_cursor#58 (byte*) print_line_cursor#59 (byte*) print_line_cursor#49 Alias (byte*) print_char_cursor#27 = (byte*) print_char_cursor#92 @@ -2835,7 +2758,6 @@ Alias (byte*) print_char_cursor#33 = (byte*) print_char_cursor#98 Alias (word) muls8u::return#2 = (word) muls8u::return#4 Alias (byte) mul8u_compare::a#12 = (byte) mul8u_compare::a#3 (byte) mul8u_compare::a#2 (byte) mul8u_compare::a#4 (byte) mul8u_compare::a#13 Alias (byte) mul8u_compare::b#10 = (byte) mul8u_compare::b#3 (byte) mul8u_compare::b#2 (byte) mul8u_compare::b#4 (byte) mul8u_compare::b#11 -Alias (byte*) BGCOL#17 = (byte*) BGCOL#25 (byte*) BGCOL#27 (byte*) BGCOL#22 (byte*) BGCOL#18 Alias (byte*) print_char_cursor#172 = (byte*) print_char_cursor#179 (byte*) print_char_cursor#181 (byte*) print_char_cursor#177 (byte*) print_char_cursor#173 Alias (byte*) print_line_cursor#100 = (byte*) print_line_cursor#96 (byte*) print_line_cursor#92 (byte*) print_line_cursor#81 (byte*) print_line_cursor#82 Alias (word) mul8u_compare::ms#0 = (word~) mul8u_compare::$0 (word) mul8u_compare::ms#4 (word) mul8u_compare::ms#1 (word) mul8u_compare::ms#5 @@ -2844,7 +2766,6 @@ Alias (word) mul8u_compare::mf#0 = (word~) mul8u_compare::$1 (word) mul8u_compar Alias (word) mul8u::return#3 = (word) mul8u::return#6 Alias (word) mul8u_compare::mn#0 = (word~) mul8u_compare::$2 (word) mul8u_compare::mn#3 Alias (byte) mul8u_compare::b#8 = (byte) mul8u_compare::b#9 -Alias (byte*) BGCOL#11 = (byte*) BGCOL#12 Alias (byte) mul8u_compare::a#10 = (byte) mul8u_compare::a#11 Alias (word) mul8u_compare::ms#2 = (word) mul8u_compare::ms#7 Alias (word) mul8u_compare::mn#1 = (word) mul8u_compare::mn#5 @@ -2855,7 +2776,6 @@ Alias (byte) mul8u_compare::b#5 = (byte) mul8u_compare::b#7 (byte) mul8u_compare Alias (byte) mul8u_compare::a#5 = (byte) mul8u_compare::a#8 (byte) mul8u_compare::a#9 (byte) mul8u_compare::a#6 Alias (byte*) print_char_cursor#145 = (byte*) print_char_cursor#167 (byte*) print_char_cursor#158 (byte*) print_char_cursor#159 (byte*) print_char_cursor#146 Alias (byte*) print_line_cursor#50 = (byte*) print_line_cursor#83 (byte*) print_line_cursor#60 (byte*) print_line_cursor#72 (byte*) print_line_cursor#61 (byte*) print_line_cursor#51 -Alias (byte*) BGCOL#3 = (byte*) BGCOL#30 (byte*) BGCOL#7 (byte*) BGCOL#34 Alias (word) mul8u_compare::ms#3 = (word) mul8u_compare::ms#6 Alias (word) mul8u_compare::mn#2 = (word) mul8u_compare::mn#4 Alias (word) mul8u_compare::mf#2 = (word) mul8u_compare::mf#3 @@ -2889,7 +2809,6 @@ Alias (signed byte) mul8s_compare::b#0 = (signed byte/signed word/signed dword~) Alias (signed word) muls8s::return#2 = (signed word) muls8s::return#4 Alias (signed byte) mul8s_compare::a#12 = (signed byte) mul8s_compare::a#3 (signed byte) mul8s_compare::a#2 (signed byte) mul8s_compare::a#4 (signed byte) mul8s_compare::a#13 Alias (signed byte) mul8s_compare::b#10 = (signed byte) mul8s_compare::b#3 (signed byte) mul8s_compare::b#2 (signed byte) mul8s_compare::b#4 (signed byte) mul8s_compare::b#11 -Alias (byte*) BGCOL#19 = (byte*) BGCOL#26 (byte*) BGCOL#28 (byte*) BGCOL#23 (byte*) BGCOL#20 Alias (byte*) print_char_cursor#174 = (byte*) print_char_cursor#180 (byte*) print_char_cursor#182 (byte*) print_char_cursor#178 (byte*) print_char_cursor#175 Alias (byte*) print_line_cursor#102 = (byte*) print_line_cursor#98 (byte*) print_line_cursor#94 (byte*) print_line_cursor#85 (byte*) print_line_cursor#86 Alias (signed word) mul8s_compare::ms#0 = (signed word~) mul8s_compare::$2 (signed word) mul8s_compare::ms#4 (signed word) mul8s_compare::ms#1 (signed word) mul8s_compare::ms#5 @@ -2898,7 +2817,6 @@ Alias (signed word) mul8s_compare::mf#0 = (signed word~) mul8s_compare::$3 (sign Alias (signed word) mul8s::return#2 = (signed word) mul8s::return#4 Alias (signed word) mul8s_compare::mn#0 = (signed word~) mul8s_compare::$4 (signed word) mul8s_compare::mn#3 Alias (signed byte) mul8s_compare::b#8 = (signed byte) mul8s_compare::b#9 -Alias (byte*) BGCOL#13 = (byte*) BGCOL#14 Alias (signed byte) mul8s_compare::a#10 = (signed byte) mul8s_compare::a#11 Alias (signed word) mul8s_compare::ms#2 = (signed word) mul8s_compare::ms#7 Alias (signed word) mul8s_compare::mn#1 = (signed word) mul8s_compare::mn#5 @@ -2909,7 +2827,6 @@ Alias (signed byte) mul8s_compare::b#5 = (signed byte) mul8s_compare::b#7 (signe Alias (signed byte) mul8s_compare::a#5 = (signed byte) mul8s_compare::a#8 (signed byte) mul8s_compare::a#9 (signed byte) mul8s_compare::a#6 Alias (byte*) print_char_cursor#148 = (byte*) print_char_cursor#170 (byte*) print_char_cursor#160 (byte*) print_char_cursor#161 (byte*) print_char_cursor#149 Alias (byte*) print_line_cursor#53 = (byte*) print_line_cursor#87 (byte*) print_line_cursor#63 (byte*) print_line_cursor#76 (byte*) print_line_cursor#64 (byte*) print_line_cursor#54 -Alias (byte*) BGCOL#32 = (byte*) BGCOL#8 (byte*) BGCOL#4 (byte*) BGCOL#36 Alias (signed word) mul8s_compare::ms#3 = (signed word) mul8s_compare::ms#6 Alias (signed word) mul8s_compare::mn#2 = (signed word) mul8s_compare::mn#4 Alias (signed word) mul8s_compare::mf#2 = (signed word) mul8s_compare::mf#3 @@ -2955,7 +2872,6 @@ Alias (signed byte) mulf8s_prepared::b#1 = (signed byte) mulf8s_prepared::b#2 Alias (word) mul8u_compare::ms#0 = (word) mul8u_compare::ms#2 (word) mul8u_compare::ms#3 Alias (word) mul8u_compare::mn#0 = (word) mul8u_compare::mn#1 (word) mul8u_compare::mn#2 Alias (byte) mul8u_compare::b#10 = (byte) mul8u_compare::b#8 (byte) mul8u_compare::b#5 -Alias (byte*) BGCOL#11 = (byte*) BGCOL#17 (byte*) BGCOL#3 Alias (byte) mul8u_compare::a#10 = (byte) mul8u_compare::a#12 (byte) mul8u_compare::a#5 Alias (word) mul8u_compare::mf#0 = (word) mul8u_compare::mf#4 (word) mul8u_compare::mf#2 Alias (byte*) print_char_cursor#145 = (byte*) print_char_cursor#165 (byte*) print_char_cursor#172 @@ -2963,7 +2879,6 @@ Alias (byte*) print_line_cursor#100 = (byte*) print_line_cursor#70 (byte*) print Alias (signed word) mul8s_compare::ms#0 = (signed word) mul8s_compare::ms#2 (signed word) mul8s_compare::ms#3 Alias (signed word) mul8s_compare::mn#0 = (signed word) mul8s_compare::mn#1 (signed word) mul8s_compare::mn#2 Alias (signed byte) mul8s_compare::b#10 = (signed byte) mul8s_compare::b#8 (signed byte) mul8s_compare::b#5 -Alias (byte*) BGCOL#13 = (byte*) BGCOL#19 (byte*) BGCOL#32 Alias (signed byte) mul8s_compare::a#10 = (signed byte) mul8s_compare::a#12 (signed byte) mul8s_compare::a#5 Alias (signed word) mul8s_compare::mf#0 = (signed word) mul8s_compare::mf#4 (signed word) mul8s_compare::mf#2 Alias (byte*) print_char_cursor#148 = (byte*) print_char_cursor#168 (byte*) print_char_cursor#174 @@ -2977,15 +2892,12 @@ Self Phi Eliminated (signed byte) muls8s::b#1 Self Phi Eliminated (signed byte) muls8s::a#3 Self Phi Eliminated (signed byte) muls8s::b#2 Self Phi Eliminated (signed byte) muls8s::a#4 -Self Phi Eliminated (byte*) BGCOL#10 Self Phi Eliminated (byte*) print_char_cursor#143 Self Phi Eliminated (byte*) print_line_cursor#48 Self Phi Eliminated (byte) mul8u_compare::a#10 -Self Phi Eliminated (byte*) BGCOL#11 Self Phi Eliminated (byte*) print_char_cursor#145 Self Phi Eliminated (byte*) print_line_cursor#100 Self Phi Eliminated (signed byte) mul8s_compare::a#10 -Self Phi Eliminated (byte*) BGCOL#13 Self Phi Eliminated (byte*) print_char_cursor#148 Self Phi Eliminated (byte*) print_line_cursor#102 Successful SSA optimization Pass2SelfPhiElimination @@ -3008,7 +2920,6 @@ Redundant Phi (byte) mulf8u::b#1 (byte) mulf8u::b#0 Redundant Phi (signed byte) mulf8s_prepared::b#1 (signed byte) mulf8s_prepared::b#0 Redundant Phi (signed byte) mulf8s::mulf8s_prepare1_a#0 (signed byte) mulf8s::a#0 Redundant Phi (signed byte) mulf8s::b#1 (signed byte) mulf8s::b#0 -Redundant Phi (byte*) BGCOL#1 (byte*) BGCOL#0 Redundant Phi (byte*) print_screen#4 (byte*) print_line_cursor#0 Redundant Phi (byte*) print_line_cursor#46 (byte*) print_line_cursor#0 Redundant Phi (byte*) print_char_cursor#141 (byte*) print_line_cursor#0 @@ -3030,10 +2941,8 @@ Redundant Phi (signed byte) muls8s::b#1 (signed byte) muls8s::b#3 Redundant Phi (signed byte) muls8s::a#3 (signed byte) muls8s::a#1 Redundant Phi (signed byte) muls8s::b#2 (signed byte) muls8s::b#3 Redundant Phi (signed byte) muls8s::a#4 (signed byte) muls8s::a#1 -Redundant Phi (byte*) BGCOL#9 (byte*) BGCOL#1 Redundant Phi (byte*) print_char_cursor#164 (byte*) print_char_cursor#142 Redundant Phi (byte*) print_line_cursor#90 (byte*) print_line_cursor#27 -Redundant Phi (byte*) BGCOL#10 (byte*) BGCOL#9 Redundant Phi (byte*) print_char_cursor#143 (byte*) print_char_cursor#164 Redundant Phi (byte*) print_line_cursor#48 (byte*) print_line_cursor#90 Redundant Phi (byte*) print_char_cursor#27 (byte*) print_char_cursor#132 @@ -3043,11 +2952,9 @@ Redundant Phi (byte*) print_char_cursor#30 (byte*) print_char_cursor#13 Redundant Phi (byte*) print_char_cursor#32 (byte*) print_char_cursor#132 Redundant Phi (byte*) print_line_cursor#11 (byte*) print_line_cursor#1 Redundant Phi (byte*) print_char_cursor#33 (byte*) print_line_cursor#1 -Redundant Phi (byte*) BGCOL#33 (byte*) BGCOL#1 Redundant Phi (byte*) print_char_cursor#185 (byte*) print_char_cursor#23 Redundant Phi (byte*) print_line_cursor#108 (byte*) print_line_cursor#28 Redundant Phi (byte) mul8u_compare::a#10 (byte) mul8u_compare::a#7 -Redundant Phi (byte*) BGCOL#11 (byte*) BGCOL#29 Redundant Phi (byte*) print_char_cursor#145 (byte*) print_char_cursor#183 Redundant Phi (byte*) print_line_cursor#100 (byte*) print_line_cursor#104 Redundant Phi (byte*) print_char_cursor#34 (byte*) print_char_cursor#113 @@ -3074,11 +2981,9 @@ Redundant Phi (byte*) print_char_cursor#111 (byte*) print_char_cursor#132 Redundant Phi (byte*) print_char_cursor#112 (byte*) print_char_cursor#13 Redundant Phi (byte*) print_line_cursor#15 (byte*) print_line_cursor#1 Redundant Phi (byte*) print_char_cursor#113 (byte*) print_line_cursor#1 -Redundant Phi (byte*) BGCOL#35 (byte*) BGCOL#1 Redundant Phi (byte*) print_char_cursor#186 (byte*) print_char_cursor#24 Redundant Phi (byte*) print_line_cursor#110 (byte*) print_line_cursor#29 Redundant Phi (signed byte) mul8s_compare::a#10 (signed byte) mul8s_compare::a#7 -Redundant Phi (byte*) BGCOL#13 (byte*) BGCOL#31 Redundant Phi (byte*) print_char_cursor#148 (byte*) print_char_cursor#184 Redundant Phi (byte*) print_line_cursor#102 (byte*) print_line_cursor#106 Redundant Phi (byte*) print_char_cursor#115 (byte*) print_char_cursor#129 @@ -3280,17 +3185,13 @@ Culled Empty Block (label) @43 Successful SSA optimization Pass2CullEmptyBlocks Alias (word) mulf8u_prepared::return#0 = (word~) mulf8u_prepared::$0 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) BGCOL#29 Self Phi Eliminated (byte*) print_char_cursor#183 Self Phi Eliminated (byte*) print_line_cursor#104 -Self Phi Eliminated (byte*) BGCOL#31 Self Phi Eliminated (byte*) print_char_cursor#184 Self Phi Eliminated (byte*) print_line_cursor#106 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) BGCOL#29 (const byte*) BGCOL#0 Redundant Phi (byte*) print_char_cursor#183 (byte*) print_char_cursor#31 Redundant Phi (byte*) print_line_cursor#104 (byte*) print_line_cursor#10 -Redundant Phi (byte*) BGCOL#31 (const byte*) BGCOL#0 Redundant Phi (byte*) print_char_cursor#184 (byte*) print_line_cursor#1 Redundant Phi (byte*) print_line_cursor#106 (byte*) print_line_cursor#1 Successful SSA optimization Pass2RedundantPhiElimination diff --git a/src/test/ref/test-word-size-arrays.log b/src/test/ref/test-word-size-arrays.log index 478e67689..6d239aa28 100644 --- a/src/test/ref/test-word-size-arrays.log +++ b/src/test/ref/test-word-size-arrays.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -8,24 +9,21 @@ main: scope:[main] from @1 (word) main::line#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@4 - (byte*) main::screen#3 ← phi( main/(byte*) main::screen#0 main::@4/(byte*) main::screen#5 ) (word) main::line#6 ← phi( main/(word) main::line#1 main::@4/(word) main::line#2 ) (byte) main::c#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::screen#1 ← phi( main::@1/(byte*) main::screen#3 main::@2/(byte*) main::screen#1 ) (byte) main::c#4 ← phi( main::@1/(byte) main::c#0 main::@2/(byte) main::c#1 ) (word) main::line#3 ← phi( main::@1/(word) main::line#6 main::@2/(word) main::line#3 ) (word~) main::$0 ← (word) main::line#3 + (byte) main::c#4 (word~) main::$1 ← (word) main::line#3 + (byte) main::c#4 (word/signed dword/dword~) main::$2 ← (word~) main::$1 + (byte/signed byte/word/signed word/dword/signed dword) $28 - *((byte*) main::screen#1 + (word~) main::$0) ← *((byte*) main::screen#1 + (word/signed dword/dword~) main::$2) + *((byte*) main::screen#0 + (word~) main::$0) ← *((byte*) main::screen#0 + (word/signed dword/dword~) main::$2) (byte) main::c#1 ← ++ (byte) main::c#4 (bool~) main::$3 ← (byte) main::c#1 < (byte/signed byte/word/signed word/dword/signed dword) $28 if((bool~) main::$3) goto main::@2 to:main::@4 main::@4: scope:[main] from main::@2 - (byte*) main::screen#5 ← phi( main::@2/(byte*) main::screen#1 ) (word) main::line#4 ← phi( main::@2/(word) main::line#3 ) (word) main::line#2 ← (word) main::line#4 + (byte/signed byte/word/signed word/dword/signed dword) $28 (word/signed word/dword/signed dword~) main::$4 ← (byte/signed byte/word/signed word/dword/signed dword) $28 * (byte/signed byte/word/signed word/dword/signed dword) $18 @@ -33,16 +31,14 @@ main::@4: scope:[main] from main::@2 if((bool~) main::$5) goto main::@1 to:main::@5 main::@5: scope:[main] from main::@4 - (byte*) main::screen#4 ← phi( main::@4/(byte*) main::screen#5 ) (word) main::line#7 ← phi( main::@4/(word) main::line#2 ) (byte) main::c#2 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@3 main::@3: scope:[main] from main::@3 main::@5 - (byte*) main::screen#2 ← phi( main::@3/(byte*) main::screen#2 main::@5/(byte*) main::screen#4 ) (byte) main::c#5 ← phi( main::@3/(byte) main::c#3 main::@5/(byte) main::c#2 ) (word) main::line#5 ← phi( main::@3/(word) main::line#5 main::@5/(word) main::line#7 ) (word~) main::$6 ← (word) main::line#5 + (byte) main::c#5 - *((byte*) main::screen#2 + (word~) main::$6) ← (byte) ' ' + *((byte*) main::screen#0 + (word~) main::$6) ← (byte) ' ' (byte) main::c#3 ← ++ (byte) main::c#5 (bool~) main::$7 ← (byte) main::c#3 < (byte/signed byte/word/signed word/dword/signed dword) $28 if((bool~) main::$7) goto main::@3 @@ -95,27 +91,17 @@ SYMBOL TABLE SSA (word) main::line#7 (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::screen#5 Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (word) main::line#3 = (word) main::line#4 -Alias (byte*) main::screen#1 = (byte*) main::screen#5 (byte*) main::screen#4 Alias (word) main::line#2 = (word) main::line#7 Successful SSA optimization Pass2AliasElimination Self Phi Eliminated (word) main::line#3 -Self Phi Eliminated (byte*) main::screen#1 Self Phi Eliminated (word) main::line#5 -Self Phi Eliminated (byte*) main::screen#2 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (word) main::line#3 (word) main::line#6 -Redundant Phi (byte*) main::screen#1 (byte*) main::screen#3 Redundant Phi (word) main::line#5 (word) main::line#2 -Redundant Phi (byte*) main::screen#2 (byte*) main::screen#1 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$3 [12] if((byte) main::c#1<(byte/signed byte/word/signed word/dword/signed dword) $28) goto main::@2 Simple Condition (bool~) main::$5 [17] if((word) main::line#2<(word/signed word/dword/signed dword~) main::$4) goto main::@1 @@ -128,16 +114,12 @@ Constant (const byte) main::c#0 = 0 Constant (const word/signed word/dword/signed dword) main::$4 = $28*$18 Constant (const byte) main::c#2 = 0 Successful SSA optimization Pass2ConstantIdentification -Successful SSA optimization PassNEliminateUnusedVars -Culled Empty Block (label) main::@5 -Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte*) main::screen#3 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::screen#3 (const byte*) main::screen#0 -Successful SSA optimization Pass2RedundantPhiElimination Consolidated array index constant in assignment *(main::screen#0+$28 + main::$2) Successful SSA optimization Pass2ConstantAdditionElimination Inferred type updated to word in [4] (word/signed dword/dword~) main::$2 ← (word~) main::$1 +Successful SSA optimization PassNEliminateUnusedVars +Culled Empty Block (label) main::@5 +Successful SSA optimization Pass2CullEmptyBlocks Alias (word~) main::$2 = (word~) main::$1 Successful SSA optimization Pass2AliasElimination Inlining constant with var siblings (const word) main::line#1 diff --git a/src/test/ref/true-inline-words.log b/src/test/ref/true-inline-words.log index 0997b9f59..968a22f72 100644 --- a/src/test/ref/true-inline-words.log +++ b/src/test/ref/true-inline-words.log @@ -1,3 +1,6 @@ +Identified constant variable (byte) main::b +Identified constant variable (byte*) main::pos +Identified constant variable (byte*) main::bgcol CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -17,12 +20,10 @@ main: scope:[main] from @1 if((bool~) main::$2) goto main::@1 to:main::@3 main::@1: scope:[main] from main - (byte*) main::bgcol#1 ← phi( main/(byte*) main::bgcol#0 ) - *((byte*) main::bgcol#1) ← (byte/signed byte/word/signed word/dword/signed dword) 5 + *((byte*) main::bgcol#0) ← (byte/signed byte/word/signed word/dword/signed dword) 5 to:main::@return main::@3: scope:[main] from main - (byte*) main::bgcol#2 ← phi( main/(byte*) main::bgcol#0 ) - *((byte*) main::bgcol#2) ← (byte/signed byte/word/signed word/dword/signed dword) 2 + *((byte*) main::bgcol#0) ← (byte/signed byte/word/signed word/dword/signed dword) 2 to:main::@return main::@return: scope:[main] from main::@1 main::@3 return @@ -50,8 +51,6 @@ SYMBOL TABLE SSA (byte) main::b#0 (byte*) main::bgcol (byte*) main::bgcol#0 -(byte*) main::bgcol#1 -(byte*) main::bgcol#2 (byte[]) main::bs (byte[]) main::bs#0 (byte*) main::pos @@ -66,7 +65,6 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (word) main::w2#0 = (byte/signed byte/word/signed word/dword/signed dword*/word~) main::$1 -Alias (byte*) main::bgcol#0 = (byte*) main::bgcol#1 (byte*) main::bgcol#2 Successful SSA optimization Pass2AliasElimination Simple Condition (bool~) main::$2 [11] if(*((byte*) main::pos#0)==(byte) 'm') goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification diff --git a/src/test/ref/type-mix.log b/src/test/ref/type-mix.log index c7767b34d..da6a92269 100644 --- a/src/test/ref/type-mix.log +++ b/src/test/ref/type-mix.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -9,12 +10,11 @@ main: scope:[main] from @1 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::SCREEN#1 ← phi( main/(byte*) main::SCREEN#0 main::@1/(byte*) main::SCREEN#1 ) (signed word) main::w#2 ← phi( main/(signed word) main::w#0 main::@1/(signed word) main::w#1 ) (signed word/signed dword~) main::$0 ← (signed word) main::w#2 - (byte/signed byte/word/signed word/dword/signed dword) $c (signed word) main::w#1 ← (signed word/signed dword~) main::$0 (byte~) main::$1 ← < (signed word) main::w#1 - *((byte*) main::SCREEN#1 + (byte) main::i#2) ← (byte~) main::$1 + *((byte*) main::SCREEN#0 + (byte) main::i#2) ← (byte~) main::$1 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$a) (bool~) main::$2 ← (byte) main::i#1 != rangelast(0,$a) if((bool~) main::$2) goto main::@1 @@ -42,7 +42,6 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::SCREEN (byte*) main::SCREEN#0 -(byte*) main::SCREEN#1 (byte) main::i (byte) main::i#0 (byte) main::i#1 @@ -56,10 +55,6 @@ Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (signed word) main::w#1 = (signed word/signed dword~) main::$0 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$2 [10] if((byte) main::i#1!=rangelast(0,$a)) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const signed word) main::w#0 = 0 diff --git a/src/test/ref/uninitialized.log b/src/test/ref/uninitialized.log index da097e440..0606afc73 100644 --- a/src/test/ref/uninitialized.log +++ b/src/test/ref/uninitialized.log @@ -1,3 +1,6 @@ +Identified constant variable (byte) b +Identified constant variable (word) w +Identified constant variable (byte*) ptr CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -7,18 +10,15 @@ CONTROL FLOW GRAPH SSA (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@1 main: scope:[main] from @1 - (byte*) ptr#1 ← phi( @1/(byte*) ptr#2 ) - (word) w#1 ← phi( @1/(word) w#2 ) - (byte) b#1 ← phi( @1/(byte) b#2 ) - *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) b#1 - (byte~) main::$0 ← < (word) w#1 + *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) b#0 + (byte~) main::$0 ← < (word) w#0 *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte~) main::$0 - (byte~) main::$1 ← > (word) w#1 + (byte~) main::$1 ← > (word) w#0 *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) ← (byte~) main::$1 - (byte~) main::$2 ← < (byte*) ptr#1 + (byte~) main::$2 ← < (byte*) ptr#0 (byte~) main::$3 ← ((byte)) (byte~) main::$2 *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte~) main::$3 - (byte~) main::$4 ← > (byte*) ptr#1 + (byte~) main::$4 ← > (byte*) ptr#0 (byte~) main::$5 ← ((byte)) (byte~) main::$4 *((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 5) ← (byte~) main::$5 to:main::@return @@ -26,9 +26,6 @@ main::@return: scope:[main] from main return to:@return @1: scope:[] from @begin - (byte*) ptr#2 ← phi( @begin/(byte*) ptr#0 ) - (word) w#2 ← phi( @begin/(word) w#0 ) - (byte) b#2 ← phi( @begin/(byte) b#0 ) call main to:@2 @2: scope:[] from @1 @@ -44,8 +41,6 @@ SYMBOL TABLE SSA (byte*) SCREEN#0 (byte) b (byte) b#0 -(byte) b#1 -(byte) b#2 (void()) main() (byte~) main::$0 (byte~) main::$1 @@ -56,23 +51,11 @@ SYMBOL TABLE SSA (label) main::@return (byte*) ptr (byte*) ptr#0 -(byte*) ptr#1 -(byte*) ptr#2 (word) w (word) w#0 -(word) w#1 -(word) w#2 Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte) b#0 = (byte) b#2 -Alias (word) w#0 = (word) w#2 -Alias (byte*) ptr#0 = (byte*) ptr#2 -Successful SSA optimization Pass2AliasElimination -Redundant Phi (byte) b#1 (byte) b#0 -Redundant Phi (word) w#1 (word) w#0 -Redundant Phi (byte*) ptr#1 (byte*) ptr#0 -Successful SSA optimization Pass2RedundantPhiElimination Constant (const byte) b#0 = 0 Constant (const word) w#0 = 0 Constant (const byte*) ptr#0 = 0 diff --git a/src/test/ref/unroll-loop-modifyvar.log b/src/test/ref/unroll-loop-modifyvar.log index d8a11b65c..3b63df52f 100644 --- a/src/test/ref/unroll-loop-modifyvar.log +++ b/src/test/ref/unroll-loop-modifyvar.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -7,17 +8,15 @@ main: scope:[main] from @1 (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::SCREEN#0 + (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) $e 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 + *((byte*) main::SCREEN#0 + (byte) main::a#3) ← (byte) main::a#3 to:main::@return main::@return: scope:[main] from main::@2 return @@ -41,8 +40,6 @@ SYMBOL TABLE SSA (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 @@ -52,12 +49,7 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::a#1 = (byte) main::a#3 -Alias (byte*) main::SCREEN#1 = (byte*) main::SCREEN#2 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::SCREEN#1 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$0 [6] unroll if((byte) main::a#1<(byte/signed byte/word/signed word/dword/signed dword) $e) goto main::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) main::SCREEN#0 = ((byte*))$400 diff --git a/src/test/ref/unroll-screenfill-for-double.log b/src/test/ref/unroll-screenfill-for-double.log index a9a17a01a..6c92642cc 100644 --- a/src/test/ref/unroll-screenfill-for-double.log +++ b/src/test/ref/unroll-screenfill-for-double.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -8,22 +9,19 @@ main: scope:[main] from @1 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) $28 - (byte*~) main::$1 ← (byte*) main::SCREEN#1 + (byte/signed word/word/dword/signed dword~) main::$0 + (byte*~) main::$1 ← (byte*) main::SCREEN#0 + (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,$a) (bool~) main::$2 ← (byte) main::line#1 != rangelast(0,$a) 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,$a) (bool~) main::$3 ← (byte) main::x#1 != rangelast(0,$a) @@ -55,9 +53,6 @@ SYMBOL TABLE SSA (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 @@ -72,12 +67,9 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::x#2 = (byte) main::x#3 -Alias (byte*) main::SCREEN#1 = (byte*) main::SCREEN#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::SCREEN#1 Self Phi Eliminated (byte) main::x#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#2 Redundant Phi (byte) main::x#2 (byte) main::x#4 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$2 [10] unroll if((byte) main::line#1!=rangelast(0,$a)) goto main::@2 @@ -91,10 +83,6 @@ Resolved ranged next value main::line#1 ← ++ main::line#2 to ++ Resolved ranged comparison value unroll if(main::line#1!=rangelast(0,$a)) goto main::@2 to (byte/signed byte/word/signed word/dword/signed dword) $b Resolved ranged next value main::x#1 ← ++ main::x#4 to ++ Resolved ranged comparison value unroll if(main::x#1!=rangelast(0,$a)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) $b -Self Phi Eliminated (byte*) main::SCREEN#2 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#2 (const byte*) main::SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Unrolling loop Loop head: main::@2 tails: main::@2 blocks: main::@2 Successful SSA optimization Pass2LoopUnroll Redundant Phi (byte) main::line#2 (const byte) main::line#0 diff --git a/src/test/ref/unroll-screenfill-for.log b/src/test/ref/unroll-screenfill-for.log index c61ea0d62..8752e9f27 100644 --- a/src/test/ref/unroll-screenfill-for.log +++ b/src/test/ref/unroll-screenfill-for.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -8,22 +9,19 @@ main: scope:[main] from @1 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) $28 - (byte*~) main::$1 ← (byte*) main::SCREEN#1 + (byte/signed word/word/dword/signed dword~) main::$0 + (byte*~) main::$1 ← (byte*) main::SCREEN#0 + (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,$18) (bool~) main::$2 ← (byte) main::line#1 != rangelast(0,$18) 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,$27) (bool~) main::$3 ← (byte) main::x#1 != rangelast(0,$27) @@ -55,9 +53,6 @@ SYMBOL TABLE SSA (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 @@ -72,12 +67,9 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) main::x#2 = (byte) main::x#3 -Alias (byte*) main::SCREEN#1 = (byte*) main::SCREEN#3 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::SCREEN#1 Self Phi Eliminated (byte) main::x#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#2 Redundant Phi (byte) main::x#2 (byte) main::x#4 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$2 [10] unroll if((byte) main::line#1!=rangelast(0,$18)) goto main::@2 @@ -91,10 +83,6 @@ Resolved ranged next value main::line#1 ← ++ main::line#2 to ++ Resolved ranged comparison value unroll if(main::line#1!=rangelast(0,$18)) goto main::@2 to (byte/signed byte/word/signed word/dword/signed dword) $19 Resolved ranged next value main::x#1 ← ++ main::x#4 to ++ Resolved ranged comparison value if(main::x#1!=rangelast(0,$27)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) $28 -Self Phi Eliminated (byte*) main::SCREEN#2 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#2 (const byte*) main::SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Unrolling loop Loop head: main::@2 tails: main::@2 blocks: main::@2 Successful SSA optimization Pass2LoopUnroll Redundant Phi (byte) main::line#2 (const byte) main::line#0 diff --git a/src/test/ref/unroll-screenfill-while.log b/src/test/ref/unroll-screenfill-while.log index 03e1efde7..9c3946f0b 100644 --- a/src/test/ref/unroll-screenfill-while.log +++ b/src/test/ref/unroll-screenfill-while.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -8,27 +9,23 @@ main: scope:[main] from @1 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) $19 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) $28 - (byte*~) main::$2 ← (byte*) main::SCREEN#1 + (byte/signed word/word/dword/signed dword~) main::$1 + (byte*~) main::$2 ← (byte*) main::SCREEN#0 + (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,$27) (bool~) main::$3 ← (byte) main::x#1 != rangelast(0,$27) @@ -61,10 +58,6 @@ SYMBOL TABLE SSA (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 @@ -81,13 +74,10 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful 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 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::SCREEN#1 Self Phi Eliminated (byte) main::x#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#3 Redundant Phi (byte) main::x#2 (byte) main::x#5 Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) main::$0 [6] unroll if((byte) main::line#2!=(byte/signed byte/word/signed word/dword/signed dword) $19) goto main::@3 @@ -99,10 +89,6 @@ Constant (const byte) main::line#0 = 0 Successful SSA optimization Pass2ConstantIdentification Resolved ranged next value main::x#1 ← ++ main::x#5 to ++ Resolved ranged comparison value if(main::x#1!=rangelast(0,$27)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) $28 -Self Phi Eliminated (byte*) main::SCREEN#3 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#3 (const byte*) main::SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Unrolling loop Loop head: main::@2 tails: main::@3 blocks: main::@3 main::@2 Successful SSA optimization Pass2LoopUnroll Redundant Phi (byte) main::line#2 (const byte) main::line#0 diff --git a/src/test/ref/unused-method.log b/src/test/ref/unused-method.log index df0d1de36..8bdb4965f 100644 --- a/src/test/ref/unused-method.log +++ b/src/test/ref/unused-method.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/unused-vars.log b/src/test/ref/unused-vars.log index 016eb6098..fd0800af4 100644 --- a/src/test/ref/unused-vars.log +++ b/src/test/ref/unused-vars.log @@ -1,3 +1,7 @@ +Identified constant variable (byte) c +Identified constant variable (word) d +Identified constant variable (byte) main::col +Identified constant variable (byte*) main::COLS CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -12,7 +16,6 @@ CONTROL FLOW GRAPH SSA (word) d#0 ← (word/signed word/dword/signed dword) $3e8 to:@2 main: scope:[main] from @2 - (word) d#2 ← phi( @2/(word) d#3 ) (byte) b#13 ← phi( @2/(byte) b#14 ) (byte) main::col#0 ← (byte/signed byte/word/signed word/dword/signed dword) 2 (byte*) main::COLS#0 ← ((byte*)) (word/dword/signed dword) $d800 @@ -22,9 +25,6 @@ main: scope:[main] from @2 (byte) s::return#0 ← (byte) s::return#2 to:main::@3 main::@3: scope:[main] from main - (byte*) main::COLS#2 ← phi( main/(byte*) main::COLS#0 ) - (byte) main::col#2 ← phi( main/(byte) main::col#0 ) - (word) d#1 ← phi( main/(word) d#2 ) (byte) b#7 ← phi( main/(byte) b#5 ) (byte) s::return#3 ← phi( main/(byte) s::return#0 ) (byte~) main::$2 ← (byte) s::return#3 @@ -32,7 +32,7 @@ main::@3: scope:[main] from main (byte/signed word/word/dword/signed dword~) main::$3 ← (byte/signed word/word/dword/signed dword/signed byte~) main::$1 + (byte~) main::$2 (byte) main::e#0 ← (byte/signed word/word/dword/signed dword~) main::$3 (word/signed word/dword/signed dword~) main::$4 ← (word/signed word/dword/signed dword) $7d0 + (word/signed word/dword/signed dword) $7d0 - (word/signed dword/dword~) main::$5 ← (word/signed word/dword/signed dword~) main::$4 + (word) d#1 + (word/signed dword/dword~) main::$5 ← (word/signed word/dword/signed dword~) main::$4 + (word) d#0 (word/signed dword/dword~) main::$6 ← (word/signed dword/dword~) main::$5 + (byte) b#1 (word) main::f#0 ← (word/signed dword/dword~) main::$6 (byte) b#2 ← ++ (byte) b#1 @@ -43,11 +43,9 @@ main::@3: scope:[main] from main main::@1: scope:[main] from main::@1 main::@3 (byte) b#8 ← phi( main::@1/(byte) b#8 main::@3/(byte) b#2 ) (byte) main::i#2 ← phi( main::@1/(byte) main::i#1 main::@3/(byte) main::i#0 ) - (byte*) main::COLS#1 ← phi( main::@1/(byte*) main::COLS#1 main::@3/(byte*) main::COLS#2 ) - (byte) main::col#1 ← phi( main::@1/(byte) main::col#1 main::@3/(byte) main::col#2 ) (signed byte/signed word/signed dword~) main::$7 ← - (byte/signed byte/word/signed word/dword/signed dword) $d (signed byte) main::x#0 ← (signed byte/signed word/signed dword~) main::$7 - *((byte*) main::COLS#1 + (byte) main::i#2) ← (byte) main::col#1 + *((byte*) main::COLS#0 + (byte) main::i#2) ← (byte) main::col#0 *((byte*) SCREEN#0 + (byte) main::i#2) ← (byte) b#8 (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,$64) (bool~) main::$8 ← (byte) main::i#1 != rangelast(0,$64) @@ -71,7 +69,6 @@ s::@return: scope:[s] from s return to:@return @2: scope:[] from @begin - (word) d#3 ← phi( @begin/(word) d#0 ) (byte) b#14 ← phi( @begin/(byte) b#0 ) call main to:@3 @@ -116,9 +113,6 @@ SYMBOL TABLE SSA (byte) c2#0 (word) d (word) d#0 -(word) d#1 -(word) d#2 -(word) d#3 (void()) main() (byte/signed byte/word/signed word/dword/signed dword~) main::$0 (byte/signed word/word/dword/signed dword/signed byte~) main::$1 @@ -135,12 +129,8 @@ SYMBOL TABLE SSA (label) main::@return (byte*) main::COLS (byte*) main::COLS#0 -(byte*) main::COLS#1 -(byte*) main::COLS#2 (byte) main::col (byte) main::col#0 -(byte) main::col#1 -(byte) main::col#2 (byte) main::e (byte) main::e#0 (word) main::f @@ -168,9 +158,6 @@ SYMBOL TABLE SSA Alias (byte) b#0 = (byte/signed byte/word/signed word/dword/signed dword~) $0 (byte) b#14 Alias (byte) s::return#0 = (byte) s::return#3 -Alias (word) d#1 = (word) d#2 -Alias (byte) main::col#0 = (byte) main::col#2 -Alias (byte*) main::COLS#0 = (byte*) main::COLS#2 Alias (byte) b#1 = (byte) b#7 Alias (byte) main::e#0 = (byte/signed word/word/dword/signed dword~) main::$3 Alias (word) main::f#0 = (word/signed dword/dword~) main::$6 @@ -178,18 +165,12 @@ Alias (signed byte) main::x#0 = (signed byte/signed word/signed dword~) main::$7 Alias (byte) b#3 = (byte) b#9 (byte) b#8 Alias (byte) s::return#1 = (byte) s::return#4 (byte) s::return#2 Alias (byte) b#11 = (byte) b#4 (byte) b#5 -Alias (word) d#0 = (word) d#3 Alias (byte) b#12 = (byte) b#6 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte) main::col#1 -Self Phi Eliminated (byte*) main::COLS#1 Self Phi Eliminated (byte) b#3 Successful SSA optimization Pass2SelfPhiElimination Redundant Phi (byte) b#13 (byte) b#0 -Redundant Phi (word) d#1 (word) d#0 Redundant Phi (byte) b#1 (byte) b#11 -Redundant Phi (byte) main::col#1 (byte) main::col#0 -Redundant Phi (byte*) main::COLS#1 (byte*) main::COLS#0 Redundant Phi (byte) b#3 (byte) b#2 Redundant Phi (byte) b#10 (byte) b#13 Redundant Phi (byte) b#12 (byte) b#3 diff --git a/src/test/ref/unusedblockproblem.log b/src/test/ref/unusedblockproblem.log index 030099e18..6716cab76 100644 --- a/src/test/ref/unusedblockproblem.log +++ b/src/test/ref/unusedblockproblem.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -6,21 +7,17 @@ main: scope:[main] from @1 (byte*) main::SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 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) + *((byte*) main::SCREEN#0) ← ++ *((byte*) main::SCREEN#0) 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::SCREEN#0 + (byte) main::line#2) ← (byte) main::line#2 (byte) main::line#1 ← (byte) main::line#2 + rangenext(0,$18) (bool~) main::$0 ← (byte) main::line#1 != rangelast(0,$18) if((bool~) main::$0) goto main::@4 @@ -49,10 +46,6 @@ SYMBOL TABLE SSA (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 @@ -60,15 +53,7 @@ SYMBOL TABLE SSA Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) main::SCREEN#1 = (byte*) main::SCREEN#3 (byte*) main::SCREEN#4 -Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::SCREEN#1 -Self Phi Eliminated (byte*) main::SCREEN#2 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::SCREEN#1 (byte*) main::SCREEN#0 -Redundant Phi (byte*) main::SCREEN#2 (byte*) main::SCREEN#1 -Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) main::$0 [11] if((byte) main::line#1!=rangelast(0,$18)) goto main::@4 +Simple Condition (bool~) main::$0 [8] if((byte) main::line#1!=rangelast(0,$18)) goto main::@4 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) main::SCREEN#0 = ((byte*))$400 Constant (const byte) main::line#0 = 0 diff --git a/src/test/ref/useglobal.log b/src/test/ref/useglobal.log index b10c3d1a0..4a99787b1 100644 --- a/src/test/ref/useglobal.log +++ b/src/test/ref/useglobal.log @@ -1,17 +1,16 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from (byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) $400 to:@1 main: scope:[main] from @1 - (byte*) SCREEN#1 ← phi( @1/(byte*) SCREEN#2 ) - *((byte*) SCREEN#1) ← (byte/signed byte/word/signed word/dword/signed dword) 1 + *((byte*) SCREEN#0) ← (byte/signed byte/word/signed word/dword/signed dword) 1 to:main::@return main::@return: scope:[main] from main return to:@return @1: scope:[] from @begin - (byte*) SCREEN#2 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@2 @2: scope:[] from @1 @@ -25,17 +24,11 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 (void()) main() (label) main::@return Culled Empty Block (label) @2 Successful SSA optimization Pass2CullEmptyBlocks -Alias (byte*) SCREEN#0 = (byte*) SCREEN#2 -Successful SSA optimization Pass2AliasElimination -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#0 -Successful SSA optimization Pass2RedundantPhiElimination Constant (const byte*) SCREEN#0 = ((byte*))$400 Successful SSA optimization Pass2ConstantIdentification Adding NOP phi() at start of @begin diff --git a/src/test/ref/useuninitialized.log b/src/test/ref/useuninitialized.log index 17b1062db..4a8ba46be 100644 --- a/src/test/ref/useuninitialized.log +++ b/src/test/ref/useuninitialized.log @@ -1,3 +1,5 @@ +Identified constant variable (byte) w +Identified constant variable (byte*) main::screen CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/var-register.log b/src/test/ref/var-register.log index 9f130c57d..3ebc84c24 100644 --- a/src/test/ref/var-register.log +++ b/src/test/ref/var-register.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) print::SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from diff --git a/src/test/ref/voronoi.log b/src/test/ref/voronoi.log index d801143f4..d417c5fcd 100644 --- a/src/test/ref/voronoi.log +++ b/src/test/ref/voronoi.log @@ -1,3 +1,7 @@ +Identified constant variable (byte*) SCREEN +Identified constant variable (byte*) COLORS +Identified constant variable (byte) FILL +Identified constant variable (byte) numpoints CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -10,29 +14,17 @@ CONTROL FLOW GRAPH SSA (byte[]) COLS#0 ← { (byte/signed byte/word/signed word/dword/signed dword) 1, (byte/signed byte/word/signed word/dword/signed dword) 2, (byte/signed byte/word/signed word/dword/signed dword) 3, (byte/signed byte/word/signed word/dword/signed dword) 4, (byte/signed byte/word/signed word/dword/signed dword) 5, (byte/signed byte/word/signed word/dword/signed dword) 7 } to:@5 main: scope:[main] from @5 - (byte) numpoints#22 ← phi( @5/(byte) numpoints#24 ) - (byte*) COLORS#5 ← phi( @5/(byte*) COLORS#7 ) - (byte) FILL#3 ← phi( @5/(byte) FILL#4 ) - (byte*) SCREEN#3 ← phi( @5/(byte*) SCREEN#4 ) call initscreen to:main::@3 main::@3: scope:[main] from main - (byte) numpoints#20 ← phi( main/(byte) numpoints#22 ) - (byte*) COLORS#3 ← phi( main/(byte*) COLORS#5 ) to:main::@1 main::@1: scope:[main] from main::@3 main::@5 - (byte) numpoints#19 ← phi( main::@3/(byte) numpoints#20 main::@5/(byte) numpoints#21 ) - (byte*) COLORS#2 ← phi( main::@3/(byte*) COLORS#3 main::@5/(byte*) COLORS#4 ) call render to:main::@4 main::@4: scope:[main] from main::@1 - (byte) numpoints#23 ← phi( main::@1/(byte) numpoints#19 ) - (byte*) COLORS#6 ← phi( main::@1/(byte*) COLORS#2 ) call animate to:main::@5 main::@5: scope:[main] from main::@4 - (byte) numpoints#21 ← phi( main::@4/(byte) numpoints#23 ) - (byte*) COLORS#4 ← phi( main::@4/(byte*) COLORS#6 ) if(true) goto main::@1 to:main::@return main::@return: scope:[main] from main::@5 @@ -105,17 +97,13 @@ animate::@return: scope:[animate] from animate::@12 animate::@5 animate::@6 return to:@return initscreen: scope:[initscreen] from main - (byte) FILL#2 ← phi( main/(byte) FILL#3 ) - (byte*) SCREEN#1 ← phi( main/(byte*) SCREEN#3 ) - (byte*) initscreen::screen#0 ← (byte*) SCREEN#1 + (byte*) initscreen::screen#0 ← (byte*) SCREEN#0 to:initscreen::@1 initscreen::@1: scope:[initscreen] from initscreen initscreen::@1 - (byte*) SCREEN#2 ← phi( initscreen/(byte*) SCREEN#1 initscreen::@1/(byte*) SCREEN#2 ) (byte*) initscreen::screen#2 ← phi( initscreen/(byte*) initscreen::screen#0 initscreen::@1/(byte*) initscreen::screen#1 ) - (byte) FILL#1 ← phi( initscreen/(byte) FILL#2 initscreen::@1/(byte) FILL#1 ) - *((byte*) initscreen::screen#2) ← (byte) FILL#1 + *((byte*) initscreen::screen#2) ← (byte) FILL#0 (byte*) initscreen::screen#1 ← ++ (byte*) initscreen::screen#2 - (byte*~) initscreen::$0 ← (byte*) SCREEN#2 + (word/signed word/dword/signed dword) $3e8 + (byte*~) initscreen::$0 ← (byte*) SCREEN#0 + (word/signed word/dword/signed dword) $3e8 (bool~) initscreen::$1 ← (byte*) initscreen::screen#1 < (byte*~) initscreen::$0 if((bool~) initscreen::$1) goto initscreen::@1 to:initscreen::@return @@ -123,19 +111,15 @@ initscreen::@return: scope:[initscreen] from initscreen::@1 return to:@return render: scope:[render] from main::@1 - (byte) numpoints#17 ← phi( main::@1/(byte) numpoints#19 ) - (byte*) COLORS#1 ← phi( main::@1/(byte*) COLORS#2 ) - (byte*) render::colline#0 ← (byte*) COLORS#1 + (byte*) render::colline#0 ← (byte*) COLORS#0 (byte) render::y#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:render::@1 render::@1: scope:[render] from render render::@3 - (byte) numpoints#15 ← phi( render/(byte) numpoints#17 render::@3/(byte) numpoints#18 ) (byte*) render::colline#5 ← phi( render/(byte*) render::colline#0 render::@3/(byte*) render::colline#1 ) (byte) render::y#4 ← phi( render/(byte) render::y#0 render::@3/(byte) render::y#1 ) (byte) render::x#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:render::@2 render::@2: scope:[render] from render::@1 render::@5 - (byte) numpoints#14 ← phi( render::@1/(byte) numpoints#15 render::@5/(byte) numpoints#16 ) (byte*) render::colline#4 ← phi( render::@1/(byte*) render::colline#5 render::@5/(byte*) render::colline#2 ) (byte) render::y#2 ← phi( render::@1/(byte) render::y#4 render::@5/(byte) render::y#5 ) (byte) render::x#2 ← phi( render::@1/(byte) render::x#0 render::@5/(byte) render::x#1 ) @@ -145,7 +129,6 @@ render::@2: scope:[render] from render::@1 render::@5 (byte) findcol::return#0 ← (byte) findcol::return#2 to:render::@5 render::@5: scope:[render] from render::@2 - (byte) numpoints#16 ← phi( render::@2/(byte) numpoints#14 ) (byte) render::y#5 ← phi( render::@2/(byte) render::y#2 ) (byte) render::x#3 ← phi( render::@2/(byte) render::x#2 ) (byte*) render::colline#2 ← phi( render::@2/(byte*) render::colline#4 ) @@ -158,7 +141,6 @@ render::@5: scope:[render] from render::@2 if((bool~) render::$1) goto render::@2 to:render::@3 render::@3: scope:[render] from render::@5 - (byte) numpoints#18 ← phi( render::@5/(byte) numpoints#16 ) (byte) render::y#3 ← phi( render::@5/(byte) render::y#5 ) (byte*) render::colline#3 ← phi( render::@5/(byte*) render::colline#2 ) (byte*~) render::$2 ← (byte*) render::colline#3 + (byte/signed byte/word/signed word/dword/signed dword) $28 @@ -171,7 +153,6 @@ render::@return: scope:[render] from render::@3 return to:@return findcol: scope:[findcol] from render::@2 - (byte) numpoints#12 ← phi( render::@2/(byte) numpoints#14 ) (byte) findcol::y#8 ← phi( render::@2/(byte) findcol::y#0 ) (byte) findcol::x#5 ← phi( render::@2/(byte) findcol::x#0 ) (byte) findcol::mindiff#0 ← (byte/word/signed word/dword/signed dword) $ff @@ -180,7 +161,6 @@ findcol: scope:[findcol] from render::@2 to:findcol::@1 findcol::@1: scope:[findcol] from findcol findcol::@8 (byte) findcol::mincol#11 ← phi( findcol/(byte) findcol::mincol#0 findcol::@8/(byte) findcol::mincol#3 ) - (byte) numpoints#10 ← phi( findcol/(byte) numpoints#12 findcol::@8/(byte) numpoints#1 ) (byte) findcol::mindiff#9 ← phi( findcol/(byte) findcol::mindiff#0 findcol::@8/(byte) findcol::mindiff#11 ) (byte) findcol::y#5 ← phi( findcol/(byte) findcol::y#8 findcol::@8/(byte) findcol::y#9 ) (byte) findcol::x#1 ← phi( findcol/(byte) findcol::x#5 findcol::@8/(byte) findcol::x#6 ) @@ -193,7 +173,6 @@ findcol::@1: scope:[findcol] from findcol findcol::@8 to:findcol::@9 findcol::@2: scope:[findcol] from findcol::@1 findcol::@3 (byte) findcol::mincol#10 ← phi( findcol::@1/(byte) findcol::mincol#11 findcol::@3/(byte) findcol::mincol#12 ) - (byte) numpoints#9 ← phi( findcol::@1/(byte) numpoints#10 findcol::@3/(byte) numpoints#11 ) (byte) findcol::i#11 ← phi( findcol::@1/(byte) findcol::i#2 findcol::@3/(byte) findcol::i#12 ) (byte) findcol::mindiff#8 ← phi( findcol::@1/(byte) findcol::mindiff#9 findcol::@3/(byte) findcol::mindiff#10 ) (byte) findcol::yp#7 ← phi( findcol::@1/(byte) findcol::yp#0 findcol::@3/(byte) findcol::yp#8 ) @@ -206,7 +185,6 @@ findcol::@2: scope:[findcol] from findcol::@1 findcol::@3 to:findcol::@12 findcol::@9: scope:[findcol] from findcol::@1 (byte) findcol::mincol#13 ← phi( findcol::@1/(byte) findcol::mincol#11 ) - (byte) numpoints#13 ← phi( findcol::@1/(byte) numpoints#10 ) (byte) findcol::i#13 ← phi( findcol::@1/(byte) findcol::i#2 ) (byte) findcol::mindiff#12 ← phi( findcol::@1/(byte) findcol::mindiff#9 ) (byte) findcol::xp#5 ← phi( findcol::@1/(byte) findcol::xp#0 ) @@ -219,7 +197,6 @@ findcol::@9: scope:[findcol] from findcol::@1 to:findcol::@10 findcol::@3: scope:[findcol] from findcol::@9 (byte) findcol::mincol#12 ← phi( findcol::@9/(byte) findcol::mincol#13 ) - (byte) numpoints#11 ← phi( findcol::@9/(byte) numpoints#13 ) (byte) findcol::i#12 ← phi( findcol::@9/(byte) findcol::i#13 ) (byte) findcol::mindiff#10 ← phi( findcol::@9/(byte) findcol::mindiff#12 ) (byte) findcol::yp#8 ← phi( findcol::@9/(byte) findcol::yp#1 ) @@ -237,7 +214,6 @@ findcol::@return: scope:[findcol] from findcol::@10 findcol::@17 to:@return findcol::@4: scope:[findcol] from findcol::@2 (byte) findcol::mincol#9 ← phi( findcol::@2/(byte) findcol::mincol#10 ) - (byte) numpoints#8 ← phi( findcol::@2/(byte) numpoints#9 ) (byte) findcol::i#10 ← phi( findcol::@2/(byte) findcol::i#11 ) (byte) findcol::mindiff#7 ← phi( findcol::@2/(byte) findcol::mindiff#8 ) (byte) findcol::yp#6 ← phi( findcol::@2/(byte) findcol::yp#7 ) @@ -249,7 +225,6 @@ findcol::@4: scope:[findcol] from findcol::@2 to:findcol::@5 findcol::@12: scope:[findcol] from findcol::@2 (byte) findcol::mincol#8 ← phi( findcol::@2/(byte) findcol::mincol#10 ) - (byte) numpoints#7 ← phi( findcol::@2/(byte) numpoints#9 ) (byte) findcol::i#9 ← phi( findcol::@2/(byte) findcol::i#11 ) (byte) findcol::mindiff#6 ← phi( findcol::@2/(byte) findcol::mindiff#8 ) (byte) findcol::yp#5 ← phi( findcol::@2/(byte) findcol::yp#7 ) @@ -262,7 +237,6 @@ findcol::@12: scope:[findcol] from findcol::@2 findcol::@5: scope:[findcol] from findcol::@12 findcol::@4 (byte) findcol::mincol#7 ← phi( findcol::@12/(byte) findcol::mincol#8 findcol::@4/(byte) findcol::mincol#9 ) (byte) findcol::x#13 ← phi( findcol::@12/(byte) findcol::x#4 findcol::@4/(byte) findcol::x#3 ) - (byte) numpoints#6 ← phi( findcol::@12/(byte) numpoints#7 findcol::@4/(byte) numpoints#8 ) (byte) findcol::i#8 ← phi( findcol::@12/(byte) findcol::i#9 findcol::@4/(byte) findcol::i#10 ) (byte) findcol::mindiff#5 ← phi( findcol::@12/(byte) findcol::mindiff#6 findcol::@4/(byte) findcol::mindiff#7 ) (byte) findcol::diff#9 ← phi( findcol::@12/(byte) findcol::diff#2 findcol::@4/(byte) findcol::diff#1 ) @@ -274,7 +248,6 @@ findcol::@5: scope:[findcol] from findcol::@12 findcol::@4 findcol::@6: scope:[findcol] from findcol::@5 (byte) findcol::mincol#6 ← phi( findcol::@5/(byte) findcol::mincol#7 ) (byte) findcol::x#12 ← phi( findcol::@5/(byte) findcol::x#13 ) - (byte) numpoints#5 ← phi( findcol::@5/(byte) numpoints#6 ) (byte) findcol::i#7 ← phi( findcol::@5/(byte) findcol::i#8 ) (byte) findcol::mindiff#4 ← phi( findcol::@5/(byte) findcol::mindiff#5 ) (byte) findcol::diff#5 ← phi( findcol::@5/(byte) findcol::diff#9 ) @@ -287,7 +260,6 @@ findcol::@6: scope:[findcol] from findcol::@5 findcol::@14: scope:[findcol] from findcol::@5 (byte) findcol::mincol#5 ← phi( findcol::@5/(byte) findcol::mincol#7 ) (byte) findcol::x#11 ← phi( findcol::@5/(byte) findcol::x#13 ) - (byte) numpoints#4 ← phi( findcol::@5/(byte) numpoints#6 ) (byte) findcol::i#6 ← phi( findcol::@5/(byte) findcol::i#8 ) (byte) findcol::mindiff#3 ← phi( findcol::@5/(byte) findcol::mindiff#5 ) (byte) findcol::diff#6 ← phi( findcol::@5/(byte) findcol::diff#9 ) @@ -301,7 +273,6 @@ findcol::@7: scope:[findcol] from findcol::@14 findcol::@6 (byte) findcol::y#13 ← phi( findcol::@14/(byte) findcol::y#4 findcol::@6/(byte) findcol::y#3 ) (byte) findcol::mincol#4 ← phi( findcol::@14/(byte) findcol::mincol#5 findcol::@6/(byte) findcol::mincol#6 ) (byte) findcol::x#10 ← phi( findcol::@14/(byte) findcol::x#11 findcol::@6/(byte) findcol::x#12 ) - (byte) numpoints#3 ← phi( findcol::@14/(byte) numpoints#4 findcol::@6/(byte) numpoints#5 ) (byte) findcol::i#5 ← phi( findcol::@14/(byte) findcol::i#6 findcol::@6/(byte) findcol::i#7 ) (byte) findcol::mindiff#2 ← phi( findcol::@14/(byte) findcol::mindiff#3 findcol::@6/(byte) findcol::mindiff#4 ) (byte) findcol::diff#7 ← phi( findcol::@14/(byte) findcol::diff#4 findcol::@6/(byte) findcol::diff#3 ) @@ -314,16 +285,14 @@ findcol::@8: scope:[findcol] from findcol::@16 findcol::@7 (byte) findcol::y#9 ← phi( findcol::@16/(byte) findcol::y#12 findcol::@7/(byte) findcol::y#13 ) (byte) findcol::mincol#3 ← phi( findcol::@16/(byte) findcol::mincol#1 findcol::@7/(byte) findcol::mincol#4 ) (byte) findcol::x#6 ← phi( findcol::@16/(byte) findcol::x#9 findcol::@7/(byte) findcol::x#10 ) - (byte) numpoints#1 ← phi( findcol::@16/(byte) numpoints#2 findcol::@7/(byte) numpoints#3 ) (byte) findcol::i#3 ← phi( findcol::@16/(byte) findcol::i#4 findcol::@7/(byte) findcol::i#5 ) (byte) findcol::i#1 ← ++ (byte) findcol::i#3 - (bool~) findcol::$14 ← (byte) findcol::i#1 < (byte) numpoints#1 + (bool~) findcol::$14 ← (byte) findcol::i#1 < (byte) numpoints#0 if((bool~) findcol::$14) goto findcol::@1 to:findcol::@17 findcol::@16: scope:[findcol] from findcol::@7 (byte) findcol::y#12 ← phi( findcol::@7/(byte) findcol::y#13 ) (byte) findcol::x#9 ← phi( findcol::@7/(byte) findcol::x#10 ) - (byte) numpoints#2 ← phi( findcol::@7/(byte) numpoints#3 ) (byte) findcol::i#4 ← phi( findcol::@7/(byte) findcol::i#5 ) (byte) findcol::diff#8 ← phi( findcol::@7/(byte) findcol::diff#7 ) (byte) findcol::mindiff#1 ← (byte) findcol::diff#8 @@ -334,10 +303,6 @@ findcol::@17: scope:[findcol] from findcol::@8 (byte) findcol::return#3 ← (byte) findcol::mincol#2 to:findcol::@return @5: scope:[] from @begin - (byte) numpoints#24 ← phi( @begin/(byte) numpoints#0 ) - (byte*) COLORS#7 ← phi( @begin/(byte*) COLORS#0 ) - (byte) FILL#4 ← phi( @begin/(byte) FILL#0 ) - (byte*) SCREEN#4 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@6 @6: scope:[] from @5 @@ -351,27 +316,12 @@ SYMBOL TABLE SSA (label) @end (byte*) COLORS (byte*) COLORS#0 -(byte*) COLORS#1 -(byte*) COLORS#2 -(byte*) COLORS#3 -(byte*) COLORS#4 -(byte*) COLORS#5 -(byte*) COLORS#6 -(byte*) COLORS#7 (byte[]) COLS (byte[]) COLS#0 (byte) FILL (byte) FILL#0 -(byte) FILL#1 -(byte) FILL#2 -(byte) FILL#3 -(byte) FILL#4 (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 (byte[]) XPOS (byte[]) XPOS#0 (byte[]) YPOS @@ -566,30 +516,6 @@ SYMBOL TABLE SSA (label) main::@return (byte) numpoints (byte) numpoints#0 -(byte) numpoints#1 -(byte) numpoints#10 -(byte) numpoints#11 -(byte) numpoints#12 -(byte) numpoints#13 -(byte) numpoints#14 -(byte) numpoints#15 -(byte) numpoints#16 -(byte) numpoints#17 -(byte) numpoints#18 -(byte) numpoints#19 -(byte) numpoints#2 -(byte) numpoints#20 -(byte) numpoints#21 -(byte) numpoints#22 -(byte) numpoints#23 -(byte) numpoints#24 -(byte) numpoints#3 -(byte) numpoints#4 -(byte) numpoints#5 -(byte) numpoints#6 -(byte) numpoints#7 -(byte) numpoints#8 -(byte) numpoints#9 (void()) render() (byte~) render::$0 (bool~) render::$1 @@ -622,29 +548,25 @@ SYMBOL TABLE SSA (byte) render::y#4 (byte) render::y#5 +Culled Empty Block (label) main::@3 Culled Empty Block (label) animate::@5 Culled Empty Block (label) animate::@6 Culled Empty Block (label) @6 Successful SSA optimization Pass2CullEmptyBlocks -Inversing boolean not [20] (bool~) animate::$2 ← *((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) != (byte/signed byte/word/signed word/dword/signed dword) $28 from [19] (bool~) animate::$1 ← *((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) == (byte/signed byte/word/signed word/dword/signed dword) $28 -Inversing boolean not [25] (bool~) animate::$5 ← *((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) != (byte/signed byte/word/signed word/dword/signed dword) $19 from [24] (bool~) animate::$4 ← *((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) == (byte/signed byte/word/signed word/dword/signed dword) $19 -Inversing boolean not [31] (bool~) animate::$8 ← *((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) != (byte/word/signed word/dword/signed dword) $ff from [30] (bool~) animate::$7 ← *((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) == (byte/word/signed word/dword/signed dword) $ff -Inversing boolean not [37] (bool~) animate::$11 ← *((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) != (byte/signed byte/word/signed word/dword/signed dword) $19 from [36] (bool~) animate::$10 ← *((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) == (byte/signed byte/word/signed word/dword/signed dword) $19 -Inversing boolean not [43] (bool~) animate::$14 ← *((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) != (byte/word/signed word/dword/signed dword) $ff from [42] (bool~) animate::$13 ← *((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) == (byte/word/signed word/dword/signed dword) $ff -Inversing boolean not [50] (bool~) animate::$17 ← *((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) < (byte/signed byte/word/signed word/dword/signed dword) $28 from [49] (bool~) animate::$16 ← *((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) >= (byte/signed byte/word/signed word/dword/signed dword) $28 -Inversing boolean not [96] (bool~) findcol::$1 ← (byte) findcol::x#1 != (byte) findcol::xp#0 from [95] (bool~) findcol::$0 ← (byte) findcol::x#1 == (byte) findcol::xp#0 -Inversing boolean not [104] (bool~) findcol::$3 ← (byte) findcol::y#1 != (byte) findcol::yp#1 from [103] (bool~) findcol::$2 ← (byte) findcol::y#1 == (byte) findcol::yp#1 -Inversing boolean not [130] (bool~) findcol::$13 ← (byte) findcol::diff#7 >= (byte) findcol::mindiff#2 from [129] (bool~) findcol::$12 ← (byte) findcol::diff#7 < (byte) findcol::mindiff#2 +Inversing boolean not [15] (bool~) animate::$2 ← *((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) != (byte/signed byte/word/signed word/dword/signed dword) $28 from [14] (bool~) animate::$1 ← *((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) == (byte/signed byte/word/signed word/dword/signed dword) $28 +Inversing boolean not [20] (bool~) animate::$5 ← *((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) != (byte/signed byte/word/signed word/dword/signed dword) $19 from [19] (bool~) animate::$4 ← *((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) == (byte/signed byte/word/signed word/dword/signed dword) $19 +Inversing boolean not [26] (bool~) animate::$8 ← *((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) != (byte/word/signed word/dword/signed dword) $ff from [25] (bool~) animate::$7 ← *((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) == (byte/word/signed word/dword/signed dword) $ff +Inversing boolean not [32] (bool~) animate::$11 ← *((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) != (byte/signed byte/word/signed word/dword/signed dword) $19 from [31] (bool~) animate::$10 ← *((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) == (byte/signed byte/word/signed word/dword/signed dword) $19 +Inversing boolean not [38] (bool~) animate::$14 ← *((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) != (byte/word/signed word/dword/signed dword) $ff from [37] (bool~) animate::$13 ← *((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) == (byte/word/signed word/dword/signed dword) $ff +Inversing boolean not [45] (bool~) animate::$17 ← *((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) < (byte/signed byte/word/signed word/dword/signed dword) $28 from [44] (bool~) animate::$16 ← *((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 3) >= (byte/signed byte/word/signed word/dword/signed dword) $28 +Inversing boolean not [89] (bool~) findcol::$1 ← (byte) findcol::x#1 != (byte) findcol::xp#0 from [88] (bool~) findcol::$0 ← (byte) findcol::x#1 == (byte) findcol::xp#0 +Inversing boolean not [97] (bool~) findcol::$3 ← (byte) findcol::y#1 != (byte) findcol::yp#1 from [96] (bool~) findcol::$2 ← (byte) findcol::y#1 == (byte) findcol::yp#1 +Inversing boolean not [123] (bool~) findcol::$13 ← (byte) findcol::diff#7 >= (byte) findcol::mindiff#2 from [122] (bool~) findcol::$12 ← (byte) findcol::diff#7 < (byte) findcol::mindiff#2 Successful SSA optimization Pass2UnaryNotSimplification -Alias (byte*) COLORS#3 = (byte*) COLORS#5 -Alias (byte) numpoints#20 = (byte) numpoints#22 -Alias (byte*) COLORS#2 = (byte*) COLORS#6 (byte*) COLORS#4 -Alias (byte) numpoints#19 = (byte) numpoints#23 (byte) numpoints#21 Alias (byte) findcol::return#0 = (byte) findcol::return#4 Alias (byte*) render::colline#2 = (byte*) render::colline#4 (byte*) render::colline#3 Alias (byte) render::x#2 = (byte) render::x#3 Alias (byte) render::y#2 = (byte) render::y#5 (byte) render::y#3 -Alias (byte) numpoints#14 = (byte) numpoints#16 (byte) numpoints#18 Alias (byte) render::col#0 = (byte~) render::$0 Alias (byte*) render::colline#1 = (byte*~) render::$2 Alias (byte) findcol::y#1 = (byte) findcol::y#5 (byte) findcol::y#11 @@ -653,7 +575,6 @@ Alias (byte) findcol::x#1 = (byte) findcol::x#8 (byte) findcol::x#7 Alias (byte) findcol::xp#0 = (byte) findcol::xp#5 (byte) findcol::xp#4 Alias (byte) findcol::mindiff#10 = (byte) findcol::mindiff#12 (byte) findcol::mindiff#9 Alias (byte) findcol::i#12 = (byte) findcol::i#13 (byte) findcol::i#2 -Alias (byte) numpoints#10 = (byte) numpoints#13 (byte) numpoints#11 Alias (byte) findcol::mincol#11 = (byte) findcol::mincol#13 (byte) findcol::mincol#12 Alias (byte) findcol::return#2 = (byte) findcol::return#5 Alias (byte) findcol::xp#1 = (byte) findcol::xp#2 (byte) findcol::xp#3 @@ -662,7 +583,6 @@ Alias (byte) findcol::y#10 = (byte) findcol::y#7 (byte) findcol::y#6 Alias (byte) findcol::yp#5 = (byte) findcol::yp#6 (byte) findcol::yp#7 Alias (byte) findcol::mindiff#6 = (byte) findcol::mindiff#7 (byte) findcol::mindiff#8 Alias (byte) findcol::i#10 = (byte) findcol::i#11 (byte) findcol::i#9 -Alias (byte) numpoints#7 = (byte) numpoints#8 (byte) numpoints#9 Alias (byte) findcol::mincol#10 = (byte) findcol::mincol#9 (byte) findcol::mincol#8 Alias (byte) findcol::diff#1 = (byte~) findcol::$6 Alias (byte) findcol::diff#2 = (byte~) findcol::$5 @@ -671,21 +591,15 @@ Alias (byte) findcol::y#2 = (byte) findcol::y#3 (byte) findcol::y#4 Alias (byte) findcol::diff#5 = (byte) findcol::diff#9 (byte) findcol::diff#6 Alias (byte) findcol::mindiff#3 = (byte) findcol::mindiff#4 (byte) findcol::mindiff#5 Alias (byte) findcol::i#6 = (byte) findcol::i#7 (byte) findcol::i#8 -Alias (byte) numpoints#4 = (byte) numpoints#5 (byte) numpoints#6 Alias (byte) findcol::x#11 = (byte) findcol::x#12 (byte) findcol::x#13 Alias (byte) findcol::mincol#5 = (byte) findcol::mincol#6 (byte) findcol::mincol#7 Alias (byte) findcol::diff#3 = (byte~) findcol::$11 Alias (byte) findcol::diff#4 = (byte~) findcol::$9 Alias (byte) findcol::diff#7 = (byte) findcol::diff#8 (byte) findcol::mindiff#1 Alias (byte) findcol::i#4 = (byte) findcol::i#5 -Alias (byte) numpoints#2 = (byte) numpoints#3 Alias (byte) findcol::x#10 = (byte) findcol::x#9 Alias (byte) findcol::y#12 = (byte) findcol::y#13 Alias (byte) findcol::mincol#2 = (byte) findcol::mincol#3 (byte) findcol::return#3 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#4 -Alias (byte) FILL#0 = (byte) FILL#4 -Alias (byte*) COLORS#0 = (byte*) COLORS#7 -Alias (byte) numpoints#0 = (byte) numpoints#24 Successful SSA optimization Pass2AliasElimination Alias (byte) findcol::x#1 = (byte) findcol::x#2 (byte) findcol::x#11 (byte) findcol::x#10 (byte) findcol::x#6 Alias (byte) findcol::xp#0 = (byte) findcol::xp#1 @@ -693,57 +607,35 @@ Alias (byte) findcol::y#1 = (byte) findcol::y#10 (byte) findcol::y#2 (byte) find Alias (byte) findcol::yp#0 = (byte) findcol::yp#5 (byte) findcol::yp#2 Alias (byte) findcol::mindiff#10 = (byte) findcol::mindiff#6 (byte) findcol::mindiff#3 (byte) findcol::mindiff#2 Alias (byte) findcol::i#10 = (byte) findcol::i#12 (byte) findcol::i#6 (byte) findcol::i#4 (byte) findcol::i#3 -Alias (byte) numpoints#1 = (byte) numpoints#7 (byte) numpoints#10 (byte) numpoints#4 (byte) numpoints#2 Alias (byte) findcol::mincol#10 = (byte) findcol::mincol#11 (byte) findcol::mincol#5 (byte) findcol::mincol#4 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) COLORS#2 -Self Phi Eliminated (byte) numpoints#19 -Self Phi Eliminated (byte) FILL#1 -Self Phi Eliminated (byte*) SCREEN#2 Self Phi Eliminated (byte) render::y#2 Self Phi Eliminated (byte*) render::colline#2 -Self Phi Eliminated (byte) numpoints#14 Self Phi Eliminated (byte) findcol::x#1 Self Phi Eliminated (byte) findcol::y#1 -Self Phi Eliminated (byte) numpoints#1 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#3 (byte*) SCREEN#0 -Redundant Phi (byte) FILL#3 (byte) FILL#0 -Redundant Phi (byte*) COLORS#3 (byte*) COLORS#0 -Redundant Phi (byte) numpoints#20 (byte) numpoints#0 -Redundant Phi (byte*) COLORS#2 (byte*) COLORS#3 -Redundant Phi (byte) numpoints#19 (byte) numpoints#20 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#3 -Redundant Phi (byte) FILL#2 (byte) FILL#3 -Redundant Phi (byte) FILL#1 (byte) FILL#2 -Redundant Phi (byte*) SCREEN#2 (byte*) SCREEN#1 -Redundant Phi (byte*) COLORS#1 (byte*) COLORS#2 -Redundant Phi (byte) numpoints#17 (byte) numpoints#19 Redundant Phi (byte) render::y#2 (byte) render::y#4 Redundant Phi (byte*) render::colline#2 (byte*) render::colline#5 -Redundant Phi (byte) numpoints#14 (byte) numpoints#15 Redundant Phi (byte) findcol::x#5 (byte) findcol::x#0 Redundant Phi (byte) findcol::y#8 (byte) findcol::y#0 -Redundant Phi (byte) numpoints#12 (byte) numpoints#14 Redundant Phi (byte) findcol::x#1 (byte) findcol::x#5 Redundant Phi (byte) findcol::y#1 (byte) findcol::y#8 -Redundant Phi (byte) numpoints#1 (byte) numpoints#12 Successful SSA optimization Pass2RedundantPhiElimination -Simple Condition (bool~) animate::$2 [21] if(*((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto animate::@1 -Simple Condition (bool~) animate::$5 [26] if(*((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) $19) goto animate::@2 -Simple Condition (bool~) animate::$8 [32] if(*((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 1)!=(byte/word/signed word/dword/signed dword) $ff) goto animate::@3 -Simple Condition (bool~) animate::$11 [38] if(*((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 2)!=(byte/signed byte/word/signed word/dword/signed dword) $19) goto animate::@4 -Simple Condition (bool~) animate::$14 [44] if(*((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 3)!=(byte/word/signed word/dword/signed dword) $ff) goto animate::@return -Simple Condition (bool~) animate::$17 [51] if(*((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 3)<(byte/signed byte/word/signed word/dword/signed dword) $28) goto animate::@return -Simple Condition (bool~) initscreen::$1 [62] if((byte*) initscreen::screen#1<(byte*~) initscreen::$0) goto initscreen::@1 -Simple Condition (bool~) render::$1 [80] if((byte) render::x#1!=rangelast(0,$27)) goto render::@2 -Simple Condition (bool~) render::$3 [86] if((byte) render::y#1!=rangelast(0,$18)) goto render::@1 -Simple Condition (bool~) findcol::$1 [97] if((byte) findcol::x#0!=(byte) findcol::xp#0) goto findcol::@2 -Simple Condition (bool~) findcol::$4 [101] if((byte) findcol::x#0<(byte) findcol::xp#0) goto findcol::@4 -Simple Condition (bool~) findcol::$3 [105] if((byte) findcol::y#0!=(byte) findcol::yp#0) goto findcol::@3 -Simple Condition (bool~) findcol::$7 [119] if((byte) findcol::y#0<(byte) findcol::yp#0) goto findcol::@6 -Simple Condition (bool~) findcol::$13 [131] if((byte) findcol::diff#7>=(byte) findcol::mindiff#10) goto findcol::@8 -Simple Condition (bool~) findcol::$14 [135] if((byte) findcol::i#1<(byte) numpoints#15) goto findcol::@1 +Simple Condition (bool~) animate::$2 [16] if(*((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) $28) goto animate::@1 +Simple Condition (bool~) animate::$5 [21] if(*((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 0)!=(byte/signed byte/word/signed word/dword/signed dword) $19) goto animate::@2 +Simple Condition (bool~) animate::$8 [27] if(*((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 1)!=(byte/word/signed word/dword/signed dword) $ff) goto animate::@3 +Simple Condition (bool~) animate::$11 [33] if(*((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 2)!=(byte/signed byte/word/signed word/dword/signed dword) $19) goto animate::@4 +Simple Condition (bool~) animate::$14 [39] if(*((byte[]) YPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 3)!=(byte/word/signed word/dword/signed dword) $ff) goto animate::@return +Simple Condition (bool~) animate::$17 [46] if(*((byte[]) XPOS#0 + (byte/signed byte/word/signed word/dword/signed dword) 3)<(byte/signed byte/word/signed word/dword/signed dword) $28) goto animate::@return +Simple Condition (bool~) initscreen::$1 [56] if((byte*) initscreen::screen#1<(byte*~) initscreen::$0) goto initscreen::@1 +Simple Condition (bool~) render::$1 [73] if((byte) render::x#1!=rangelast(0,$27)) goto render::@2 +Simple Condition (bool~) render::$3 [79] if((byte) render::y#1!=rangelast(0,$18)) goto render::@1 +Simple Condition (bool~) findcol::$1 [90] if((byte) findcol::x#0!=(byte) findcol::xp#0) goto findcol::@2 +Simple Condition (bool~) findcol::$4 [94] if((byte) findcol::x#0<(byte) findcol::xp#0) goto findcol::@4 +Simple Condition (bool~) findcol::$3 [98] if((byte) findcol::y#0!=(byte) findcol::yp#0) goto findcol::@3 +Simple Condition (bool~) findcol::$7 [112] if((byte) findcol::y#0<(byte) findcol::yp#0) goto findcol::@6 +Simple Condition (bool~) findcol::$13 [124] if((byte) findcol::diff#7>=(byte) findcol::mindiff#10) goto findcol::@8 +Simple Condition (bool~) findcol::$14 [128] if((byte) findcol::i#1<(byte) numpoints#0) goto findcol::@1 Successful SSA optimization Pass2ConditionalJumpSimplification Constant (const byte*) SCREEN#0 = ((byte*))$400 Constant (const byte*) COLORS#0 = ((byte*))$d800 @@ -799,16 +691,11 @@ Resolved ranged next value render::x#1 ← ++ render::x#2 to ++ Resolved ranged comparison value if(render::x#1!=rangelast(0,$27)) goto render::@2 to (byte/signed byte/word/signed word/dword/signed dword) $28 Resolved ranged next value render::y#1 ← ++ render::y#4 to ++ Resolved ranged comparison value if(render::y#1!=rangelast(0,$18)) goto render::@1 to (byte/signed byte/word/signed word/dword/signed dword) $19 -Culled Empty Block (label) main::@3 Culled Empty Block (label) main::@5 Culled Empty Block (label) findcol::@3 Culled Empty Block (label) findcol::@10 Culled Empty Block (label) findcol::@17 Successful SSA optimization Pass2CullEmptyBlocks -Self Phi Eliminated (byte) numpoints#15 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte) numpoints#15 (const byte) numpoints#0 -Successful SSA optimization Pass2RedundantPhiElimination Inlining constant with var siblings (const byte*) initscreen::screen#0 Inlining constant with var siblings (const byte) render::y#0 Inlining constant with var siblings (const byte) render::x#0 diff --git a/src/test/ref/zpparammin.log b/src/test/ref/zpparammin.log index ecaebecad..84c048228 100644 --- a/src/test/ref/zpparammin.log +++ b/src/test/ref/zpparammin.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) SCREEN CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -7,12 +8,10 @@ CONTROL FLOW GRAPH SSA to:@3 main: scope:[main] from @3 (byte*) SCREEN2#4 ← phi( @3/(byte*) SCREEN2#5 ) - (byte*) SCREEN#3 ← phi( @3/(byte*) SCREEN#5 ) (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@1 main::@1: scope:[main] from main main::@4 (byte*) SCREEN2#3 ← phi( main/(byte*) SCREEN2#4 main::@4/(byte*) SCREEN2#1 ) - (byte*) SCREEN#2 ← phi( main/(byte*) SCREEN#3 main::@4/(byte*) SCREEN#4 ) (byte) main::i#2 ← phi( main/(byte) main::i#0 main::@4/(byte) main::i#1 ) (byte/signed word/word/dword/signed dword~) main::$0 ← (byte) main::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 1 (byte/signed word/word/dword/signed dword~) main::$1 ← (byte) main::i#2 + (byte/signed byte/word/signed word/dword/signed dword) 2 @@ -25,10 +24,9 @@ main::@1: scope:[main] from main main::@4 main::@3: scope:[main] from main::@1 (byte*) SCREEN2#2 ← phi( main::@1/(byte*) SCREEN2#3 ) (byte) main::i#3 ← phi( main::@1/(byte) main::i#2 ) - (byte*) SCREEN#1 ← phi( main::@1/(byte*) SCREEN#2 ) (byte) sum::return#3 ← phi( main::@1/(byte) sum::return#0 ) (byte~) main::$2 ← (byte) sum::return#3 - *((byte*) SCREEN#1 + (byte) main::i#3) ← (byte~) main::$2 + *((byte*) SCREEN#0 + (byte) main::i#3) ← (byte~) main::$2 (byte/signed word/word/dword/signed dword~) main::$3 ← (byte) main::i#3 + (byte/signed byte/word/signed word/dword/signed dword) 1 (byte/signed word/word/dword/signed dword~) main::$4 ← (byte) main::i#3 + (byte/signed byte/word/signed word/dword/signed dword) 2 (byte) sum2::a#0 ← (byte) main::i#3 @@ -38,7 +36,6 @@ main::@3: scope:[main] from main::@1 (byte) sum2::return#0 ← (byte) sum2::return#2 to:main::@4 main::@4: scope:[main] from main::@3 - (byte*) SCREEN#4 ← phi( main::@3/(byte*) SCREEN#1 ) (byte) main::i#4 ← phi( main::@3/(byte) main::i#3 ) (byte*) SCREEN2#1 ← phi( main::@3/(byte*) SCREEN2#2 ) (byte) sum2::return#3 ← phi( main::@3/(byte) sum2::return#0 ) @@ -79,7 +76,6 @@ sum2::@return: scope:[sum2] from sum2 to:@return @3: scope:[] from @begin (byte*) SCREEN2#5 ← phi( @begin/(byte*) SCREEN2#0 ) - (byte*) SCREEN#5 ← phi( @begin/(byte*) SCREEN#0 ) call main to:@4 @4: scope:[] from @3 @@ -94,11 +90,6 @@ SYMBOL TABLE SSA (label) @end (byte*) SCREEN (byte*) SCREEN#0 -(byte*) SCREEN#1 -(byte*) SCREEN#2 -(byte*) SCREEN#3 -(byte*) SCREEN#4 -(byte*) SCREEN#5 (byte*) SCREEN2 (byte*) SCREEN2#0 (byte*) SCREEN2#1 @@ -168,7 +159,6 @@ Successful SSA optimization Pass2CullEmptyBlocks Alias (byte) sum::b#0 = (byte/signed word/word/dword/signed dword~) main::$0 Alias (byte) sum::c#0 = (byte/signed word/word/dword/signed dword~) main::$1 Alias (byte) sum::return#0 = (byte) sum::return#3 -Alias (byte*) SCREEN#1 = (byte*) SCREEN#2 (byte*) SCREEN#4 Alias (byte) main::i#2 = (byte) main::i#3 (byte) main::i#4 Alias (byte*) SCREEN2#1 = (byte*) SCREEN2#2 (byte*) SCREEN2#3 Alias (byte) sum2::b#0 = (byte/signed word/word/dword/signed dword~) main::$3 @@ -176,15 +166,11 @@ Alias (byte) sum2::c#0 = (byte/signed word/word/dword/signed dword~) main::$4 Alias (byte) sum2::return#0 = (byte) sum2::return#3 Alias (byte) sum::return#1 = (byte~) sum::$1 (byte) sum::return#4 (byte) sum::return#2 Alias (byte) sum2::return#1 = (byte~) sum2::$1 (byte) sum2::return#4 (byte) sum2::return#2 -Alias (byte*) SCREEN#0 = (byte*) SCREEN#5 Alias (byte*) SCREEN2#0 = (byte*) SCREEN2#5 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) SCREEN#1 Self Phi Eliminated (byte*) SCREEN2#1 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) SCREEN#3 (byte*) SCREEN#0 Redundant Phi (byte*) SCREEN2#4 (byte*) SCREEN2#0 -Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#3 Redundant Phi (byte*) SCREEN2#1 (byte*) SCREEN2#4 Redundant Phi (byte) sum::a#1 (byte) sum::a#0 Redundant Phi (byte) sum::b#1 (byte) sum::b#0 diff --git a/src/test/ref/zpptr.log b/src/test/ref/zpptr.log index 6cafee542..6da8c2444 100644 --- a/src/test/ref/zpptr.log +++ b/src/test/ref/zpptr.log @@ -1,3 +1,4 @@ +Identified constant variable (byte*) main::zpptr CONTROL FLOW GRAPH SSA @begin: scope:[] from @@ -8,21 +9,18 @@ main: scope:[main] from @1 to:main::@1 main::@1: scope:[main] from main main::@5 (byte) main::j#6 ← phi( main/(byte) main::j#0 main::@5/(byte) main::j#1 ) - (byte*) main::zpptr#3 ← phi( main/(byte*) main::zpptr#0 main::@5/(byte*) main::zpptr#5 ) (byte) main::i#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@2 main::@2: scope:[main] from main::@1 main::@4 (byte) main::j#4 ← phi( main::@1/(byte) main::j#6 main::@4/(byte) main::j#5 ) (byte) main::i#4 ← phi( main::@1/(byte) main::i#0 main::@4/(byte) main::i#1 ) - (byte*) main::zpptr#2 ← phi( main::@1/(byte*) main::zpptr#3 main::@4/(byte*) main::zpptr#4 ) (byte) main::k#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 to:main::@3 main::@3: scope:[main] from main::@2 main::@3 (byte) main::k#2 ← phi( main::@2/(byte) main::k#0 main::@3/(byte) main::k#1 ) (byte) main::j#2 ← phi( main::@2/(byte) main::j#4 main::@3/(byte) main::j#2 ) (byte) main::i#2 ← phi( main::@2/(byte) main::i#4 main::@3/(byte) main::i#2 ) - (byte*) main::zpptr#1 ← phi( main::@2/(byte*) main::zpptr#2 main::@3/(byte*) main::zpptr#1 ) - (byte*~) main::$0 ← (byte*) main::zpptr#1 + (byte) main::i#2 + (byte*~) main::$0 ← (byte*) main::zpptr#0 + (byte) main::i#2 (byte*) main::zpptr2#0 ← (byte*~) main::$0 (word~) main::$1 ← ((word)) (byte) main::j#2 (word) main::w#0 ← (word~) main::$1 @@ -34,7 +32,6 @@ main::@3: scope:[main] from main::@2 main::@3 if((bool~) main::$3) goto main::@3 to:main::@4 main::@4: scope:[main] from main::@3 - (byte*) main::zpptr#4 ← phi( main::@3/(byte*) main::zpptr#1 ) (byte) main::j#5 ← phi( main::@3/(byte) main::j#2 ) (byte) main::i#3 ← phi( main::@3/(byte) main::i#2 ) (byte) main::i#1 ← (byte) main::i#3 + rangenext(0,$a) @@ -42,7 +39,6 @@ main::@4: scope:[main] from main::@3 if((bool~) main::$4) goto main::@2 to:main::@5 main::@5: scope:[main] from main::@4 - (byte*) main::zpptr#5 ← phi( main::@4/(byte*) main::zpptr#4 ) (byte) main::j#3 ← phi( main::@4/(byte) main::j#5 ) (byte) main::j#1 ← (byte) main::j#3 + rangenext(0,$a) (bool~) main::$5 ← (byte) main::j#1 != rangelast(0,$a) @@ -98,11 +94,6 @@ SYMBOL TABLE SSA (word) main::w#0 (byte*) main::zpptr (byte*) main::zpptr#0 -(byte*) main::zpptr#1 -(byte*) main::zpptr#2 -(byte*) main::zpptr#3 -(byte*) main::zpptr#4 -(byte*) main::zpptr#5 (byte*) main::zpptr2 (byte*) main::zpptr2#0 (byte*) main::zpptr2#1 @@ -114,13 +105,10 @@ Alias (word) main::w#0 = (word~) main::$1 Alias (byte*) main::zpptr2#1 = (byte*~) main::$2 Alias (byte) main::i#2 = (byte) main::i#3 Alias (byte) main::j#2 = (byte) main::j#5 (byte) main::j#3 -Alias (byte*) main::zpptr#1 = (byte*) main::zpptr#4 (byte*) main::zpptr#5 Successful SSA optimization Pass2AliasElimination -Self Phi Eliminated (byte*) main::zpptr#1 Self Phi Eliminated (byte) main::i#2 Self Phi Eliminated (byte) main::j#2 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::zpptr#1 (byte*) main::zpptr#2 Redundant Phi (byte) main::i#2 (byte) main::i#4 Redundant Phi (byte) main::j#2 (byte) main::j#4 Successful SSA optimization Pass2RedundantPhiElimination @@ -139,16 +127,10 @@ Resolved ranged next value main::i#1 ← ++ main::i#4 to ++ Resolved ranged comparison value if(main::i#1!=rangelast(0,$a)) goto main::@2 to (byte/signed byte/word/signed word/dword/signed dword) $b Resolved ranged next value main::j#1 ← ++ main::j#4 to ++ Resolved ranged comparison value if(main::j#1!=rangelast(0,$a)) goto main::@1 to (byte/signed byte/word/signed word/dword/signed dword) $b -Self Phi Eliminated (byte*) main::zpptr#2 Self Phi Eliminated (byte) main::j#4 Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::zpptr#2 (byte*) main::zpptr#3 Redundant Phi (byte) main::j#4 (byte) main::j#6 Successful SSA optimization Pass2RedundantPhiElimination -Self Phi Eliminated (byte*) main::zpptr#3 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte*) main::zpptr#3 (const byte*) main::zpptr#0 -Successful SSA optimization Pass2RedundantPhiElimination Inlining constant with var siblings (const byte) main::j#0 Inlining constant with var siblings (const byte) main::i#0 Inlining constant with var siblings (const byte) main::k#0