1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-01-26 15:30:28 +00:00

Fixed scope issues in ASM. Added scope to blocks.

This commit is contained in:
jespergravgaard 2017-08-12 20:16:07 +02:00
parent 15a9415d63
commit 5f27eba623
61 changed files with 4552 additions and 4505 deletions

View File

@ -59,12 +59,12 @@ public class AsmProgram {
addLine(new AsmLabel(label));
}
public void addProcBegin(String label) {
addLine(new AsmProcBegin(label));
public void addScopeBegin(String label) {
addLine(new AsmScopeBegin(label));
}
public void addProcEnd() {
addLine(new AsmProcEnd());
public void addScopeEnd() {
addLine(new AsmScopeEnd());
}
public void addInstruction(String mnemonic, AsmAddressingMode addressingMode, String parameter) {

View File

@ -1,9 +1,7 @@
package dk.camelot64.kickc.asm;
import dk.camelot64.kickc.asm.*;
import dk.camelot64.kickc.asm.parser.AsmClobber;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
@ -38,9 +36,9 @@ public class AsmProgramStaticRegisterValues {
private AsmRegisterValues updateStaticRegisterValues(AsmRegisterValues current, AsmLine line) {
if (line instanceof AsmLabel) {
current = new AsmRegisterValues();
} else if (line instanceof AsmProcBegin) {
} else if (line instanceof AsmScopeBegin) {
current = new AsmRegisterValues();
} else if (line instanceof AsmProcEnd) {
} else if (line instanceof AsmScopeEnd) {
current = new AsmRegisterValues();
} else if (line instanceof AsmInstruction) {
AsmInstruction instruction = (AsmInstruction) line;

View File

@ -1,13 +1,13 @@
package dk.camelot64.kickc.asm;
/** A procedure - representing a label and a scope beginning*/
public class AsmProcBegin implements AsmLine {
/** The beginning of a named scope (typically a procedure) */
public class AsmScopeBegin implements AsmLine {
private String label;
private int index;
public AsmProcBegin(String label) {
public AsmScopeBegin(String label) {
this.label = label;
}

View File

@ -1,11 +1,11 @@
package dk.camelot64.kickc.asm;
/** The end of a procedure (scope) */
public class AsmProcEnd implements AsmLine {
/** The end of a scope */
public class AsmScopeEnd implements AsmLine {
private int index;
public AsmProcEnd() {
public AsmScopeEnd() {
}
@Override

View File

@ -134,7 +134,7 @@ public class AsmSegment {
continue;
}
}
if(line instanceof AsmProcEnd) {
if(line instanceof AsmScopeEnd) {
printState.decIndent();
}
out.append(printState.getIndent());
@ -142,10 +142,9 @@ public class AsmSegment {
out.append(" ");
}
out.append(line.getAsm() + "\n");
if(line instanceof AsmProcBegin) {
if(line instanceof AsmScopeBegin) {
printState.incIndent();
}
}
return out.toString();
}

View File

@ -13,18 +13,27 @@ import java.util.List;
* The block only knows its own successors. To find predecessor blocks access to the entire graph is needed.*/
public class ControlFlowBlock {
/** The label representing the block. */
private LabelRef label;
/** The scope that the block is a part of. */
private ScopeRef scope;
/** The statements of the block. */
private List<Statement> statements;
/** The default successor that control flows to when exiting the block. */
private LabelRef defaultSuccessor;
/** The conditional successor of the block. If the last statement is a conditional jump this is the block that control flows to if the condition is met. */
private LabelRef conditionalSuccessor;
/** If the last statement of the block is a call this is the block containing the start of the called procedure. When the procedure returns control moves on to the default successor. */
private LabelRef callSuccessor;
public ControlFlowBlock(LabelRef label) {
public ControlFlowBlock(LabelRef label, ScopeRef scope) {
this.label = label;
this.scope = scope;
this.statements = new ArrayList<>();
this.defaultSuccessor = null;
this.conditionalSuccessor = null;
@ -33,11 +42,13 @@ public class ControlFlowBlock {
@JsonCreator
public ControlFlowBlock(
@JsonProperty("label") LabelRef label,
@JsonProperty("scope") ScopeRef scope,
@JsonProperty("statements") List<Statement> statements,
@JsonProperty("defaultSuccessor") LabelRef defaultSuccessor,
@JsonProperty("conditionalSuccessor") LabelRef conditionalSuccessor,
@JsonProperty("callSuccessor") LabelRef callSuccessor) {
this.label = label;
this.scope = scope;
this.statements = statements;
this.defaultSuccessor = defaultSuccessor;
this.conditionalSuccessor = conditionalSuccessor;
@ -48,6 +59,10 @@ public class ControlFlowBlock {
return label;
}
public ScopeRef getScope() {
return scope;
}
public void addStatement(Statement statement) {
this.statements.add(statement);
}
@ -84,7 +99,6 @@ public class ControlFlowBlock {
return statements;
}
/**
* Is the block the entry of a procedure, ie. the first block of the code of the procedure.
* @return true if this is the entry of a procedure
@ -108,6 +122,7 @@ public class ControlFlowBlock {
ControlFlowGraph graph = program.getGraph();
StringBuffer out = new StringBuffer();
out.append(label.getFullName() + ":");
out.append(" scope:["+scope.getFullName()+"] ");
out.append(" from");
if (graph != null) {
List<ControlFlowBlock> predecessors = graph.getPredecessors(this);

View File

@ -210,14 +210,13 @@ public class ControlFlowGraph {
/**
* Get all blocks stat are part of the execution of a specific scope. (mostly a procedure)
* @param scopeLabel The label of the scope to find blocks for
* @param scope The scope to find blocks for
* @return All blocks that are part of the execution of the scope
*/
public List<ControlFlowBlock> getScopeBlocks(LabelRef scopeLabel) {
public List<ControlFlowBlock> getScopeBlocks(ScopeRef scope) {
ArrayList<ControlFlowBlock> scopeBlocks = new ArrayList<>();
for (ControlFlowBlock block : getAllBlocks()) {
if(block.getLabel().getFullName().equals(scopeLabel.getFullName()) || block.getLabel().getScopeNames().equals(scopeLabel.getFullName())) {
if(block.getScope().equals(scope)) {
scopeBlocks.add(block);
}
}

View File

@ -47,7 +47,7 @@ public class ControlFlowGraphCopyVisitor extends ControlFlowGraphBaseVisitor<Obj
@Override
public ControlFlowBlock visitBlock(ControlFlowBlock origBlock) {
LabelRef label = origBlock.getLabel();
ControlFlowBlock copyBlock = new ControlFlowBlock(label);
ControlFlowBlock copyBlock = new ControlFlowBlock(label, origBlock.getScope());
this.origBlock = origBlock;
this.copyBlock = copyBlock;
// Handle statements
@ -92,7 +92,7 @@ public class ControlFlowGraphCopyVisitor extends ControlFlowGraphBaseVisitor<Obj
* @return The new block.
*/
protected ControlFlowBlock splitCurrentBlock(LabelRef label) {
ControlFlowBlock newBlock = new ControlFlowBlock(label);
ControlFlowBlock newBlock = new ControlFlowBlock(label, origBlock.getScope());
this.copyBlock.setDefaultSuccessor(newBlock.getLabel());
this.copyBlockMap.put(this.copyBlock.getLabel(), this.copyBlock);
this.copyBlock = newBlock;

View File

@ -53,11 +53,6 @@ public class Procedure extends Scope {
return new Label(getFullName(), getScope(), false);
}
@Override
public LabelRef getScopeLabelRef() {
return getLabel().getRef();
}
public SymbolType getReturnType() {
return returnType;
}

View File

@ -5,7 +5,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
/** A reference to a procedure */
public class ProcedureRef extends SymbolRef {
public class ProcedureRef extends ScopeRef {
@JsonCreator
public ProcedureRef( @JsonProperty("fullName") String fullName) {
@ -27,6 +27,6 @@ public class ProcedureRef extends SymbolRef {
*/
@JsonIgnore
public LabelRef getReturnBlock() {
return new LabelRef(getFullName()+"::@return");
return new LabelRef(getFullName()+"::"+SymbolRef.PROCEXIT_BLOCK_NAME);
}
}

View File

@ -48,11 +48,6 @@ public class ProgramScope extends Scope {
return out.toString();
}
@Override
public LabelRef getScopeLabelRef() {
return new LabelRef("");
}
@Override
public String toString(Program program) {
return "program";

View File

@ -23,7 +23,7 @@ public class RegisterUpliftProgram {
this.registerUpliftScopes = registerUpliftScopes;
}
public RegisterUpliftScope addRegisterUpliftScope(LabelRef scopeRef) {
public RegisterUpliftScope addRegisterUpliftScope(ScopeRef scopeRef) {
RegisterUpliftScope registerUpliftScope = new RegisterUpliftScope(scopeRef);
registerUpliftScopes.add(registerUpliftScope);
return registerUpliftScope;

View File

@ -8,14 +8,14 @@ import java.util.*;
public class RegisterUpliftScope {
/** The scope. */
private LabelRef scopeRef;
private ScopeRef scopeRef;
/**
* Live Range Equivalence Classes in the scope sorted by total variable register weight.
*/
private List<LiveRangeEquivalenceClass> equivalenceClasses;
public RegisterUpliftScope(LabelRef scopeRef) {
public RegisterUpliftScope(ScopeRef scopeRef) {
this.scopeRef = scopeRef;
this.equivalenceClasses = new ArrayList<>();
}
@ -24,7 +24,7 @@ public class RegisterUpliftScope {
this.equivalenceClasses = equivalenceClasses;
}
public LabelRef getScopeRef() {
public ScopeRef getScopeRef() {
return scopeRef;
}

View File

@ -69,11 +69,9 @@ public abstract class Scope implements Symbol {
return symbol.getLocalName();
}
/**
* Get the label ref representing the scope itself
* @return The label reference
*/
public abstract LabelRef getScopeLabelRef();
public ScopeRef getRef() {
return new ScopeRef(this);
}
@Override
@JsonIgnore
@ -242,6 +240,16 @@ public abstract class Scope implements Symbol {
}
}
public Scope getScope(ScopeRef scopeRef) {
Symbol symbol = getSymbol(scopeRef);
if(symbol instanceof Scope) {
return (Scope) symbol;
} else {
return null;
}
}
public Procedure getProcedure(ProcedureRef ref) {
return (Procedure) getSymbol(ref);
}

View File

@ -0,0 +1,22 @@
package dk.camelot64.kickc.icl;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
/** A reference to a scope */
public class ScopeRef extends SymbolRef {
/** The ROOT scope of the program. */
public static final ScopeRef ROOT = new ScopeRef("");
@JsonCreator
public ScopeRef(
@JsonProperty("fullName") String fullName) {
super(fullName);
}
public ScopeRef(Scope scope) {
super(scope.getFullName());
}
}

View File

@ -1,11 +1,14 @@
package dk.camelot64.kickc.icl;
import com.fasterxml.jackson.annotation.JsonIgnore;
import dk.camelot64.kickc.passes.Pass1GenerateControlFlowGraph;
/** A reference to a symbol (variable, procedure or label) */
public class SymbolRef implements Value {
public static final String BEGIN_BLOCK_NAME = "@begin";
public static final String END_BLOCK_NAME = "@end";
public static final String PROCEXIT_BLOCK_NAME = "@return";
/** The full name of the variable. Allowing lookup in the symbol table. */
private String fullName;
@ -67,14 +70,14 @@ public class SymbolRef implements Value {
@JsonIgnore
public boolean isIntermediate() {
if(
fullName.contains(Pass1GenerateControlFlowGraph.BEGIN_BLOCK_NAME) ||
fullName.contains(Pass1GenerateControlFlowGraph.END_BLOCK_NAME) ) return false;
fullName.contains(BEGIN_BLOCK_NAME) ||
fullName.contains(END_BLOCK_NAME) ) return false;
return fullName.contains("$") || fullName.contains("@");
}
@JsonIgnore
public boolean isProcExit() {
return fullName.endsWith("@return");
return fullName.endsWith(PROCEXIT_BLOCK_NAME);
}
@JsonIgnore

View File

@ -24,7 +24,7 @@ public class Pass1EliminateEmptyBlocks {
Collection<ControlFlowBlock> blocks = graph.getAllBlocks();
List<LabelRef> removeList = new ArrayList<>();
for (ControlFlowBlock block : blocks) {
if(block.getLabel().getFullName().equals(Pass1GenerateControlFlowGraph.END_BLOCK_NAME)) {
if(block.getLabel().getFullName().equals(SymbolRef.END_BLOCK_NAME)) {
continue;
}
if (block.getStatements().isEmpty()) {

View File

@ -9,22 +9,20 @@ import java.util.Stack;
/** Pass that generates a control flow graph for the program */
public class Pass1GenerateControlFlowGraph {
public static final String BEGIN_BLOCK_NAME = "@begin";
public static final String END_BLOCK_NAME = "@end";
private Scope scope;
private ProgramScope scope;
private Map<LabelRef, ControlFlowBlock> blocks;
private ControlFlowBlock firstBlock;
public Pass1GenerateControlFlowGraph(Scope scope) {
public Pass1GenerateControlFlowGraph(ProgramScope scope) {
this.scope = scope;
this.blocks = new LinkedHashMap<>();
}
public ControlFlowGraph generate(StatementSequence sequence) {
this.firstBlock = getOrCreateBlock(scope.addLabel(BEGIN_BLOCK_NAME).getRef());
this.firstBlock = getOrCreateBlock(scope.addLabel(SymbolRef.BEGIN_BLOCK_NAME).getRef(), ScopeRef.ROOT);
Stack<ControlFlowBlock> blockStack = new Stack<>();
blockStack.push(firstBlock);
sequence.addStatement(new StatementLabel(scope.addLabel(END_BLOCK_NAME).getRef()));
sequence.addStatement(new StatementLabel(scope.addLabel(SymbolRef.END_BLOCK_NAME).getRef()));
for (Statement statement : sequence.getStatements()) {
ControlFlowBlock currentBlock = blockStack.peek();
Symbol currentBlockLabel = scope.getSymbol(currentBlock.getLabel());
@ -36,22 +34,22 @@ public class Pass1GenerateControlFlowGraph {
}
if(statement instanceof StatementLabel) {
StatementLabel statementLabel = (StatementLabel) statement;
ControlFlowBlock nextBlock = getOrCreateBlock(statementLabel.getLabel());
ControlFlowBlock nextBlock = getOrCreateBlock(statementLabel.getLabel(), currentBlock.getScope());
currentBlock.setDefaultSuccessor(nextBlock.getLabel());
blockStack.pop();
blockStack.push(nextBlock);
} else if(statement instanceof StatementJump) {
StatementJump statementJump = (StatementJump) statement;
ControlFlowBlock jmpBlock = getOrCreateBlock(statementJump.getDestination());
ControlFlowBlock jmpBlock = getOrCreateBlock(statementJump.getDestination(), currentBlock.getScope());
currentBlock.setDefaultSuccessor(jmpBlock.getLabel());
ControlFlowBlock nextBlock = getOrCreateBlock(currentBlockScope.addLabelIntermediate().getRef());
ControlFlowBlock nextBlock = getOrCreateBlock(currentBlockScope.addLabelIntermediate().getRef(), currentBlock.getScope());
blockStack.pop();
blockStack.push(nextBlock);
} else if(statement instanceof StatementConditionalJump) {
currentBlock.addStatement(statement);
StatementConditionalJump statementConditionalJump = (StatementConditionalJump) statement;
ControlFlowBlock jmpBlock = getOrCreateBlock(statementConditionalJump.getDestination());
ControlFlowBlock nextBlock = getOrCreateBlock(currentBlockScope.addLabelIntermediate().getRef());
ControlFlowBlock jmpBlock = getOrCreateBlock(statementConditionalJump.getDestination(), currentBlock.getScope());
ControlFlowBlock nextBlock = getOrCreateBlock(currentBlockScope.addLabelIntermediate().getRef(), currentBlock.getScope());
currentBlock.setDefaultSuccessor(nextBlock.getLabel());
currentBlock.setConditionalSuccessor(jmpBlock.getLabel());
blockStack.pop();
@ -62,12 +60,12 @@ public class Pass1GenerateControlFlowGraph {
procedureBegin.setStrategy(StatementProcedureBegin.Strategy.PASS_BY_REGISTER);
ProcedureRef procedureRef = procedureBegin.getProcedure();
LabelRef procedureLabelRef = procedureRef.getLabelRef();
ControlFlowBlock procBlock = getOrCreateBlock(procedureLabelRef);
ControlFlowBlock procBlock = getOrCreateBlock(procedureLabelRef, procedureRef);
blockStack.push(procBlock);
} else if(statement instanceof StatementProcedureEnd) {
// Procedure strategy implemented is currently variable-based transfer of parameters/return values
currentBlock.setDefaultSuccessor(new Label("@return", scope, false).getRef());
ControlFlowBlock nextBlock = getOrCreateBlock(scope.addLabelIntermediate().getRef());
currentBlock.setDefaultSuccessor(new Label(SymbolRef.PROCEXIT_BLOCK_NAME, scope, false).getRef());
ControlFlowBlock nextBlock = getOrCreateBlock(scope.addLabelIntermediate().getRef(), ScopeRef.ROOT);
blockStack.pop();
ControlFlowBlock prevBlock = blockStack.pop();
prevBlock.setDefaultSuccessor(nextBlock.getLabel());
@ -85,10 +83,10 @@ public class Pass1GenerateControlFlowGraph {
return new ControlFlowGraph(blocks, firstBlock.getLabel());
}
private ControlFlowBlock getOrCreateBlock(LabelRef label) {
private ControlFlowBlock getOrCreateBlock(LabelRef label, ScopeRef scope) {
ControlFlowBlock block = blocks.get(label);
if(block==null) {
block = new ControlFlowBlock(label);
block = new ControlFlowBlock(label, scope);
blocks.put(block.getLabel(), block);
}
return block;

View File

@ -156,7 +156,7 @@ public class Pass1GenerateStatementSequence extends KickCBaseVisitor<Object> {
String name = ctx.NAME().getText();
Procedure procedure = getCurrentSymbols().addProcedure(name, type);
scopeStack.push(procedure);
Label procExit = procedure.addLabel("@return");
Label procExit = procedure.addLabel(SymbolRef.PROCEXIT_BLOCK_NAME);
VariableUnversioned returnVar = null;
if (!SymbolTypeBasic.VOID.equals(type)) {
returnVar = procedure.addVariable("return", type);
@ -211,7 +211,7 @@ public class Pass1GenerateStatementSequence extends KickCBaseVisitor<Object> {
sequence.addStatement(new StatementAssignment(returnVar, rValue));
PrePostModifierHandler.addPostModifiers(this, exprCtx);
}
Label returnLabel = procedure.getLabel("@return");
Label returnLabel = procedure.getLabel(SymbolRef.PROCEXIT_BLOCK_NAME);
sequence.addStatement(new StatementJump(returnLabel.getRef()));
return null;
}

View File

@ -30,7 +30,7 @@ public class Pass1ModifiedVarsAnalysis {
*/
public Set<VariableRef> getModifiedVars(Procedure procedure) {
Set<VariableRef> modified = new LinkedHashSet<>();
LabelRef procScope = procedure.getScopeLabelRef();
ScopeRef procScope = procedure.getRef();
List<ControlFlowBlock> procBlocks = program.getGraph().getScopeBlocks(procScope);
for (ControlFlowBlock block : procBlocks) {
for (Statement statement : block.getStatements()) {

View File

@ -37,7 +37,7 @@ public class Pass1ProcedureCallsReturnValue extends ControlFlowGraphCopyVisitor
getCurrentBlock().setCallSuccessor(procedure.getLabel().getRef());
if (!SymbolTypeBasic.VOID.equals(procedure.getReturnType())) {
// Find return variable final version
Label returnBlockLabel = procedure.getLabel("@return");
Label returnBlockLabel = procedure.getLabel(SymbolRef.PROCEXIT_BLOCK_NAME);
ControlFlowBlock returnBlock = program.getGraph().getBlock(returnBlockLabel.getRef());
VariableRef returnVarFinal = null;
for (Statement statement : returnBlock.getStatements()) {
@ -83,7 +83,7 @@ public class Pass1ProcedureCallsReturnValue extends ControlFlowGraphCopyVisitor
private VariableRef findReturnVersion(Procedure procedure, VariableRef assignedVar) {
String unversionedName = assignedVar.getFullNameUnversioned();
LabelRef returnBlock = new LabelRef(procedure.getScopeLabelRef().getFullName() + "::@return");
LabelRef returnBlock = new LabelRef(procedure.getRef().getFullName() + "::@return");
ControlFlowBlock block = program.getGraph().getBlock(returnBlock);
for (Statement statement : block.getStatements()) {
if (statement instanceof StatementAssignment) {

View File

@ -45,7 +45,7 @@ public class Pass2AssertBlocks extends Pass2SsaAssertion {
if (blockLabel == null) {
return;
}
if (blockLabel.getFullName().equals("@return")) {
if (blockLabel.getFullName().equals(SymbolRef.PROCEXIT_BLOCK_NAME)) {
return;
}
seenBlocks.add(blockLabel);

View File

@ -18,7 +18,7 @@ public class Pass2AssertSymbols extends Pass2SsaAssertion {
HashSet<Symbol> codeSymbols = symbolFinder.getSymbols();
// Check that all symbols found in the code is also oin the symbol tabel
for (Symbol codeSymbol : codeSymbols) {
if(codeSymbol.getFullName().equals("@return")) continue;
if(codeSymbol.getFullName().equals(SymbolRef.PROCEXIT_BLOCK_NAME)) continue;
Symbol tableSymbol = getSymbols().getSymbol(codeSymbol.getFullName());
if(tableSymbol==null) {
throw new AssertionFailed("Compile process error. Symbol found in code, but not in symbol table. "+codeSymbol.getFullName());

View File

@ -27,14 +27,21 @@ public class Pass3CodeGeneration {
public void generate() {
AsmProgram asm = new AsmProgram();
ScopeRef currentScope = ScopeRef.ROOT;
for (ControlFlowBlock block : getGraph().getAllBlocks()) {
if (!block.getScope().equals(currentScope)) {
if (!ScopeRef.ROOT.equals(currentScope)) {
asm.addScopeEnd();
}
currentScope = block.getScope();
asm.startSegment(null, block.getLabel().getFullName());
asm.addScopeBegin(block.getLabel().getFullName().replace('@', 'b').replace(':', '_'));
}
// Generate entry points (if needed)
genBlockEntryPoints(asm, block);
// Generate label
asm.startSegment(null, block.getLabel().getFullName());
if(block.isProcedureEntry(program)) {
asm.addProcBegin(block.getLabel().getFullName().replace('@', 'b').replace(':', '_'));
}else {
if (!block.isProcedureEntry(program)) {
// Generate label
asm.startSegment(null, block.getLabel().getFullName());
asm.addLabel(block.getLabel().getLocalName().replace('@', 'b').replace(':', '_'));
}
// Generate statements
@ -47,9 +54,9 @@ public class Pass3CodeGeneration {
}
asm.addInstruction("JMP", AsmAddressingMode.ABS, defaultSuccessor.getLabel().getLocalName().replace('@', 'b').replace(':', '_'));
}
if(block.isProcedureExit(program)) {
asm.addProcEnd();
}
}
if (!ScopeRef.ROOT.equals(currentScope)) {
asm.addScopeEnd();
}
program.setAsm(asm);
}
@ -59,7 +66,7 @@ public class Pass3CodeGeneration {
AsmCodegenAluState aluState = new AsmCodegenAluState();
while (statementsIt.hasNext()) {
Statement statement = statementsIt.next();
if(!(statement instanceof StatementPhiBlock)) {
if (!(statement instanceof StatementPhiBlock)) {
generateStatementAsm(asm, block, statement, aluState, true);
}
}
@ -183,7 +190,7 @@ public class Pass3CodeGeneration {
private void genBlockPhiTransition(AsmProgram asm, ControlFlowBlock fromBlock, ControlFlowBlock toBlock) {
Statement toFirstStatement = toBlock.getStatements().get(0);
asm.startSegment(toFirstStatement.getIndex(), "["+toFirstStatement.getIndex()+"]"+" phi from " + fromBlock.getLabel().getFullName()+" to "+toBlock.getLabel().getFullName());
asm.startSegment(toFirstStatement.getIndex(), "[" + toFirstStatement.getIndex() + "]" + " phi from " + fromBlock.getLabel().getFullName() + " to " + toBlock.getLabel().getFullName());
asm.addLabel((toBlock.getLabel().getLocalName() + "_from_" + fromBlock.getLabel().getLocalName()).replace('@', 'b').replace(':', '_'));
if (toBlock.hasPhiBlock()) {
StatementPhiBlock phiBlock = toBlock.getPhiBlock();
@ -217,7 +224,7 @@ public class Pass3CodeGeneration {
}
private void genAsmMove(AsmProgram asm, LValue lValue, RValue rValue, Statement statement) {
asm.startSegment(statement.getIndex(), "["+statement.getIndex() + "] phi " +lValue.toString(program) + " = " + rValue.toString(program));
asm.startSegment(statement.getIndex(), "[" + statement.getIndex() + "] phi " + lValue.toString(program) + " = " + rValue.toString(program));
if (isRegisterCopy(lValue, rValue)) {
asm.getCurrentSegment().setFragment("register_copy");
} else {

View File

@ -63,7 +63,7 @@ public class Pass3PhiLifting {
LabelRef currentBlockLabel = block.getLabel();
Scope currentScope = programScope.getSymbol(currentBlockLabel).getScope();
Label newBlockLabel = currentScope.addLabelIntermediate();
newBlock = new ControlFlowBlock(newBlockLabel.getRef());
newBlock = new ControlFlowBlock(newBlockLabel.getRef(), currentScope.getRef());
graph.addBlock(newBlock);
newBlock.setDefaultSuccessor(block.getLabel());
newBlocks.put(predecessorRef, newBlock.getLabel());

View File

@ -21,14 +21,14 @@ public class Pass3RegisterUpliftScopeAnalysis extends Pass2Base {
Collection<Scope> allScopes = getProgram().getScope().getAllScopes(true);
allScopes.add(getSymbols());
for (Scope scope : allScopes) {
LabelRef scopeLabel = scope.getScopeLabelRef();
RegisterUpliftScope registerUpliftScope = registerUpliftProgram.addRegisterUpliftScope(scopeLabel);
ScopeRef scopeRef = scope.getRef();
RegisterUpliftScope registerUpliftScope = registerUpliftProgram.addRegisterUpliftScope(scopeRef);
// Find live range equivalence classes for the scope
List<LiveRangeEquivalenceClass> equivalenceClasses = new ArrayList<>();
for (LiveRangeEquivalenceClass equivalenceClass : equivalenceClassSet.getEquivalenceClasses()) {
VariableRef variableRef = equivalenceClass.getVariables().get(0);
if (variableRef.getScopeNames().equals(scopeLabel.getFullName())) {
if (variableRef.getScopeNames().equals(scopeRef.getFullName())) {
equivalenceClasses.add(equivalenceClass);
}
}

View File

@ -58,6 +58,14 @@ public class ReferenceHelper {
);
return false;
}
} else {
writeOutputFile(fileName, extension, outputString);
System.out.println(
"Output does not match reference on line "+i+"\n"+
"Reference: <EOF>\n"+
"Output: "+outLine
);
return false;
}
}
return true;

View File

@ -1,6 +1,6 @@
@begin: from
@begin: scope:[] from
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
[0] (byte) y#2 ← phi( @3/(byte) y#4 @begin/(byte) 0 ) [ cursor#3 x#2 e#3 y#2 ]
[0] (byte) e#3 ← phi( @3/(byte) e#5 @begin/(byte) 12 ) [ cursor#3 x#2 e#3 y#2 ]
[0] (byte) x#2 ← phi( @3/(byte) x#1 @begin/(byte) 0 ) [ cursor#3 x#2 e#3 y#2 ]
@ -11,14 +11,14 @@
[4] (byte) e#1 ← (byte) e#3 + (byte) 24 [ x#1 e#1 cursor#1 y#2 ]
[5] if((byte) 39<(byte) e#1) goto @2 [ x#1 e#1 cursor#1 y#2 ]
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
[6] (byte) y#4 ← phi( @1/(byte) y#2 @2/(byte) y#1 ) [ cursor#5 x#1 e#5 y#4 ]
[6] (byte) e#5 ← phi( @1/(byte) e#1 @2/(byte) e#2 ) [ cursor#5 x#1 e#5 y#4 ]
[6] (byte*) cursor#5 ← phi( @1/(byte*) cursor#1 @2/(byte*) cursor#2 ) [ cursor#5 x#1 e#5 y#4 ]
[7] if((byte) x#1<(byte) 40) goto @1 [ cursor#5 x#1 e#5 y#4 ]
to:@end
@end: from @3
@2: from @1
@end: scope:[] from @3
@2: scope:[] from @1
[8] (byte) y#1 ← (byte) y#2 + (byte) 1 [ x#1 e#1 cursor#1 y#1 ]
[9] (byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40 [ x#1 e#1 cursor#2 y#1 ]
[10] (byte) e#2 ← (byte) e#1 - (byte) 39 [ x#1 cursor#2 e#2 y#1 ]

View File

@ -97,7 +97,7 @@ SYMBOLS
(byte) yd
INITIAL CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) STAR ← (byte) 81
(byte[1000]) SCREEN ← (word) 1024
(byte) x0 ← (byte) 0
@ -117,7 +117,7 @@ INITIAL CONTROL FLOW GRAPH
(byte*~) $5 ← (byte*~) $4 + (byte) x
(byte*) cursor ← (byte*~) $5
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
*((byte*) cursor) ← (byte) STAR
(byte~) $6 ← (byte) x + (byte) 1
(byte) x ← (byte~) $6
@ -128,7 +128,7 @@ INITIAL CONTROL FLOW GRAPH
(boolean~) $9 ← (byte) xd < (byte) e
if((boolean~) $9) goto @2
to:@4
@2: from @1 @5
@2: scope:[] from @1 @5
(byte~) $10 ← (byte) y + (byte) 1
(byte) y ← (byte~) $10
(byte*~) $11 ← (byte*) cursor + (byte) 40
@ -136,24 +136,24 @@ INITIAL CONTROL FLOW GRAPH
(byte~) $12 ← (byte) e - (byte) xd
(byte) e ← (byte~) $12
to:@3
@4: from @1
@4: scope:[] from @1
to:@3
@3: from @2 @4
@3: scope:[] from @2 @4
(byte~) $13 ← (byte) x1 + (byte) 1
(boolean~) $14 ← (byte) x < (byte~) $13
if((boolean~) $14) goto @1
to:@6
@5: from
@5: scope:[] from
to:@2
@6: from @3
@6: scope:[] from @3
to:@end
@end: from @6
@end: scope:[] from @6
Removing empty block @4
Removing empty block @5
Removing empty block @6
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) STAR ← (byte) 81
(byte[1000]) SCREEN ← (word) 1024
(byte) x0 ← (byte) 0
@ -173,7 +173,7 @@ CONTROL FLOW GRAPH
(byte*~) $5 ← (byte*~) $4 + (byte) x
(byte*) cursor ← (byte*~) $5
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
*((byte*) cursor) ← (byte) STAR
(byte~) $6 ← (byte) x + (byte) 1
(byte) x ← (byte~) $6
@ -184,7 +184,7 @@ CONTROL FLOW GRAPH
(boolean~) $9 ← (byte) xd < (byte) e
if((boolean~) $9) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte~) $10 ← (byte) y + (byte) 1
(byte) y ← (byte~) $10
(byte*~) $11 ← (byte*) cursor + (byte) 40
@ -192,17 +192,17 @@ CONTROL FLOW GRAPH
(byte~) $12 ← (byte) e - (byte) xd
(byte) e ← (byte~) $12
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte~) $13 ← (byte) x1 + (byte) 1
(boolean~) $14 ← (byte) x < (byte~) $13
if((boolean~) $14) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
PROCEDURE MODIFY VARIABLE ANALYSIS
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
@begin: from
@begin: scope:[] from
(byte) STAR ← (byte) 81
(byte[1000]) SCREEN ← (word) 1024
(byte) x0 ← (byte) 0
@ -222,7 +222,7 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
(byte*~) $5 ← (byte*~) $4 + (byte) x
(byte*) cursor ← (byte*~) $5
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
*((byte*) cursor) ← (byte) STAR
(byte~) $6 ← (byte) x + (byte) 1
(byte) x ← (byte~) $6
@ -233,7 +233,7 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
(boolean~) $9 ← (byte) xd < (byte) e
if((boolean~) $9) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte~) $10 ← (byte) y + (byte) 1
(byte) y ← (byte~) $10
(byte*~) $11 ← (byte*) cursor + (byte) 40
@ -241,18 +241,18 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
(byte~) $12 ← (byte) e - (byte) xd
(byte) e ← (byte~) $12
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte~) $13 ← (byte) x1 + (byte) 1
(boolean~) $14 ← (byte) x < (byte~) $13
if((boolean~) $14) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Completing Phi functions...
Completing Phi functions...
Completing Phi functions...
CONTROL FLOW GRAPH SSA
@begin: from
@begin: scope:[] from
(byte) STAR#0 ← (byte) 81
(byte[1000]) SCREEN#0 ← (word) 1024
(byte) x0#0 ← (byte) 0
@ -272,7 +272,7 @@ CONTROL FLOW GRAPH SSA
(byte*~) $5 ← (byte*~) $4 + (byte) x#0
(byte*) cursor#0 ← (byte*~) $5
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) x1#2 ← phi( @3/(byte) x1#1 @begin/(byte) x1#0 )
(byte) y#3 ← phi( @3/(byte) y#4 @begin/(byte) y#0 )
(byte) xd#1 ← phi( @3/(byte) xd#3 @begin/(byte) xd#0 )
@ -291,7 +291,7 @@ CONTROL FLOW GRAPH SSA
(boolean~) $9 ← (byte) xd#1 < (byte) e#1
if((boolean~) $9) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) yd#3 ← phi( @1/(byte) yd#1 )
(byte) STAR#3 ← phi( @1/(byte) STAR#1 )
(byte) x#4 ← phi( @1/(byte) x#1 )
@ -307,7 +307,7 @@ CONTROL FLOW GRAPH SSA
(byte~) $12 ← (byte) e#4 - (byte) xd#2
(byte) e#2 ← (byte~) $12
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) y#4 ← phi( @1/(byte) y#3 @2/(byte) y#1 )
(byte) xd#3 ← phi( @1/(byte) xd#1 @2/(byte) xd#2 )
(byte) yd#2 ← phi( @1/(byte) yd#1 @2/(byte) yd#3 )
@ -320,10 +320,10 @@ CONTROL FLOW GRAPH SSA
(boolean~) $14 ← (byte) x#3 < (byte~) $13
if((boolean~) $14) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
@begin: from
@begin: scope:[] from
(byte) STAR#0 ← (byte) 81
(byte[1000]) SCREEN#0 ← (word) 1024
(byte) x0#0 ← (byte) 0
@ -343,7 +343,7 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
(byte*~) $5 ← (byte*~) $4 + (byte) x#0
(byte*) cursor#0 ← (byte*~) $5
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) x1#2 ← phi( @3/(byte) x1#1 @begin/(byte) x1#0 )
(byte) y#3 ← phi( @3/(byte) y#4 @begin/(byte) y#0 )
(byte) xd#1 ← phi( @3/(byte) xd#3 @begin/(byte) xd#0 )
@ -362,7 +362,7 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
(boolean~) $9 ← (byte) xd#1 < (byte) e#1
if((boolean~) $9) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) yd#3 ← phi( @1/(byte) yd#1 )
(byte) STAR#3 ← phi( @1/(byte) STAR#1 )
(byte) x#4 ← phi( @1/(byte) x#1 )
@ -378,7 +378,7 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
(byte~) $12 ← (byte) e#4 - (byte) xd#2
(byte) e#2 ← (byte~) $12
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) y#4 ← phi( @1/(byte) y#3 @2/(byte) y#1 )
(byte) xd#3 ← phi( @1/(byte) xd#1 @2/(byte) xd#2 )
(byte) yd#2 ← phi( @1/(byte) yd#1 @2/(byte) yd#3 )
@ -391,7 +391,7 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
(boolean~) $14 ← (byte) x#3 < (byte~) $13
if((boolean~) $14) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Constant (byte) STAR#0 (byte) 81
Constant (byte[1000]) SCREEN#0 (word) 1024
@ -401,7 +401,7 @@ Constant (byte) x1#0 (byte) 39
Constant (byte) y1#0 (byte) 24
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte~) $0 ← (byte) 39 - (byte) 0
(byte) xd#0 ← (byte~) $0
(byte~) $1 ← (byte) 24 - (byte) 0
@ -415,7 +415,7 @@ CONTROL FLOW GRAPH
(byte*~) $5 ← (byte*~) $4 + (byte) x#0
(byte*) cursor#0 ← (byte*~) $5
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) x1#2 ← phi( @3/(byte) x1#1 @begin/(byte) 39 )
(byte) y#3 ← phi( @3/(byte) y#4 @begin/(byte) y#0 )
(byte) xd#1 ← phi( @3/(byte) xd#3 @begin/(byte) xd#0 )
@ -434,7 +434,7 @@ CONTROL FLOW GRAPH
(boolean~) $9 ← (byte) xd#1 < (byte) e#1
if((boolean~) $9) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) yd#3 ← phi( @1/(byte) yd#1 )
(byte) STAR#3 ← phi( @1/(byte) STAR#1 )
(byte) x#4 ← phi( @1/(byte) x#1 )
@ -450,7 +450,7 @@ CONTROL FLOW GRAPH
(byte~) $12 ← (byte) e#4 - (byte) xd#2
(byte) e#2 ← (byte~) $12
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) y#4 ← phi( @1/(byte) y#3 @2/(byte) y#1 )
(byte) xd#3 ← phi( @1/(byte) xd#1 @2/(byte) xd#2 )
(byte) yd#2 ← phi( @1/(byte) yd#1 @2/(byte) yd#3 )
@ -463,7 +463,7 @@ CONTROL FLOW GRAPH
(boolean~) $14 ← (byte) x#3 < (byte~) $13
if((boolean~) $14) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Multiple usages for variable. Not optimizing sub-constant (byte) x1#1
Alias (byte) xd#0 = (byte~) $0
@ -483,7 +483,7 @@ Alias (byte*) cursor#2 = (byte*~) $11
Alias (byte) e#2 = (byte~) $12
Succesful SSA optimization Pass2AliasElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) xd#0 ← (byte) 39 - (byte) 0
(byte) yd#0 ← (byte) 24 - (byte) 0
(byte) x#0 ← (byte) 0
@ -493,7 +493,7 @@ CONTROL FLOW GRAPH
(byte*~) $4 ← (word) 1024 + (byte~) $3
(byte*) cursor#0 ← (byte*~) $4 + (byte) x#0
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) x1#2 ← phi( @3/(byte) x1#1 @begin/(byte) 39 )
(byte) y#2 ← phi( @3/(byte) y#4 @begin/(byte) y#0 )
(byte) xd#1 ← phi( @3/(byte) xd#3 @begin/(byte) xd#0 )
@ -509,12 +509,12 @@ CONTROL FLOW GRAPH
(boolean~) $9 ← (byte) xd#1 < (byte) e#1
if((boolean~) $9) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) y#1 ← (byte) y#2 + (byte) 1
(byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40
(byte) e#2 ← (byte) e#1 - (byte) xd#1
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) y#4 ← phi( @1/(byte) y#2 @2/(byte) y#1 )
(byte) xd#3 ← phi( @1/(byte) xd#1 @2/(byte) xd#1 )
(byte) yd#2 ← phi( @1/(byte) yd#1 @2/(byte) yd#1 )
@ -527,7 +527,7 @@ CONTROL FLOW GRAPH
(boolean~) $14 ← (byte) x#3 < (byte~) $13
if((boolean~) $14) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Redundant Phi (byte) x1#1 (byte) x1#2
Redundant Phi (byte) x#3 (byte) x#1
@ -536,7 +536,7 @@ Redundant Phi (byte) yd#2 (byte) yd#1
Redundant Phi (byte) xd#3 (byte) xd#1
Succesful SSA optimization Pass2RedundantPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) xd#0 ← (byte) 39 - (byte) 0
(byte) yd#0 ← (byte) 24 - (byte) 0
(byte) x#0 ← (byte) 0
@ -546,7 +546,7 @@ CONTROL FLOW GRAPH
(byte*~) $4 ← (word) 1024 + (byte~) $3
(byte*) cursor#0 ← (byte*~) $4 + (byte) x#0
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) x1#2 ← phi( @3/(byte) x1#2 @begin/(byte) 39 )
(byte) y#2 ← phi( @3/(byte) y#4 @begin/(byte) y#0 )
(byte) xd#1 ← phi( @3/(byte) xd#1 @begin/(byte) xd#0 )
@ -562,12 +562,12 @@ CONTROL FLOW GRAPH
(boolean~) $9 ← (byte) xd#1 < (byte) e#1
if((boolean~) $9) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) y#1 ← (byte) y#2 + (byte) 1
(byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40
(byte) e#2 ← (byte) e#1 - (byte) xd#1
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) y#4 ← phi( @1/(byte) y#2 @2/(byte) y#1 )
(byte) e#5 ← phi( @1/(byte) e#1 @2/(byte) e#2 )
(byte*) cursor#5 ← phi( @1/(byte*) cursor#1 @2/(byte*) cursor#2 )
@ -575,7 +575,7 @@ CONTROL FLOW GRAPH
(boolean~) $14 ← (byte) x#1 < (byte~) $13
if((boolean~) $14) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Self Phi Eliminated (byte) STAR#1
Self Phi Eliminated (byte) yd#1
@ -583,7 +583,7 @@ Self Phi Eliminated (byte) xd#1
Self Phi Eliminated (byte) x1#2
Succesful SSA optimization Pass2SelfPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) xd#0 ← (byte) 39 - (byte) 0
(byte) yd#0 ← (byte) 24 - (byte) 0
(byte) x#0 ← (byte) 0
@ -593,7 +593,7 @@ CONTROL FLOW GRAPH
(byte*~) $4 ← (word) 1024 + (byte~) $3
(byte*) cursor#0 ← (byte*~) $4 + (byte) x#0
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) x1#2 ← phi( @begin/(byte) 39 )
(byte) y#2 ← phi( @3/(byte) y#4 @begin/(byte) y#0 )
(byte) xd#1 ← phi( @begin/(byte) xd#0 )
@ -609,12 +609,12 @@ CONTROL FLOW GRAPH
(boolean~) $9 ← (byte) xd#1 < (byte) e#1
if((boolean~) $9) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) y#1 ← (byte) y#2 + (byte) 1
(byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40
(byte) e#2 ← (byte) e#1 - (byte) xd#1
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) y#4 ← phi( @1/(byte) y#2 @2/(byte) y#1 )
(byte) e#5 ← phi( @1/(byte) e#1 @2/(byte) e#2 )
(byte*) cursor#5 ← phi( @1/(byte*) cursor#1 @2/(byte*) cursor#2 )
@ -622,13 +622,13 @@ CONTROL FLOW GRAPH
(boolean~) $14 ← (byte) x#1 < (byte~) $13
if((boolean~) $14) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Simple Condition (boolean~) $9 if((byte) xd#1<(byte) e#1) goto @2
Simple Condition (boolean~) $14 if((byte) x#1<(byte~) $13) goto @1
Succesful SSA optimization Pass2ConditionalJumpSimplification
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) xd#0 ← (byte) 39 - (byte) 0
(byte) yd#0 ← (byte) 24 - (byte) 0
(byte) x#0 ← (byte) 0
@ -638,7 +638,7 @@ CONTROL FLOW GRAPH
(byte*~) $4 ← (word) 1024 + (byte~) $3
(byte*) cursor#0 ← (byte*~) $4 + (byte) x#0
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) x1#2 ← phi( @begin/(byte) 39 )
(byte) y#2 ← phi( @3/(byte) y#4 @begin/(byte) y#0 )
(byte) xd#1 ← phi( @begin/(byte) xd#0 )
@ -653,19 +653,19 @@ CONTROL FLOW GRAPH
(byte) e#1 ← (byte) e#3 + (byte) yd#1
if((byte) xd#1<(byte) e#1) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) y#1 ← (byte) y#2 + (byte) 1
(byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40
(byte) e#2 ← (byte) e#1 - (byte) xd#1
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) y#4 ← phi( @1/(byte) y#2 @2/(byte) y#1 )
(byte) e#5 ← phi( @1/(byte) e#1 @2/(byte) e#2 )
(byte*) cursor#5 ← phi( @1/(byte*) cursor#1 @2/(byte*) cursor#2 )
(byte~) $13 ← (byte) x1#2 + (byte) 1
if((byte) x#1<(byte~) $13) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Constant (byte) xd#0 (byte) 39
Constant (byte) yd#0 (byte) 24
@ -675,13 +675,13 @@ Constant (byte) STAR#1 (byte) 81
Constant (byte) x1#2 (byte) 39
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) e#0 ← (byte) 24 / (byte) 2
(byte~) $3 ← (byte) 0 * (byte) 40
(byte*~) $4 ← (word) 1024 + (byte~) $3
(byte*) cursor#0 ← (byte*~) $4 + (byte) 0
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) y#2 ← phi( @3/(byte) y#4 @begin/(byte) 0 )
(byte) xd#1 ← phi( @begin/(byte) 39 )
(byte) yd#1 ← phi( @begin/(byte) 24 )
@ -694,32 +694,32 @@ CONTROL FLOW GRAPH
(byte) e#1 ← (byte) e#3 + (byte) yd#1
if((byte) xd#1<(byte) e#1) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) y#1 ← (byte) y#2 + (byte) 1
(byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40
(byte) e#2 ← (byte) e#1 - (byte) xd#1
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) y#4 ← phi( @1/(byte) y#2 @2/(byte) y#1 )
(byte) e#5 ← phi( @1/(byte) e#1 @2/(byte) e#2 )
(byte*) cursor#5 ← phi( @1/(byte*) cursor#1 @2/(byte*) cursor#2 )
(byte~) $13 ← (byte) 39 + (byte) 1
if((byte) x#1<(byte~) $13) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Consolidated constant in assignment cursor#0
Multiple usages for variable. Not optimizing sub-constant (byte) y#2
Multiple usages for variable. Not optimizing sub-constant (byte*) cursor#1
Succesful SSA optimization Pass2ConstantAdditionElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) e#0 ← (byte) 24 / (byte) 2
(byte~) $3 ← (byte) 0 * (byte) 40
(byte*~) $4 ← (byte~) $3
(byte*) cursor#0 ← (byte*~) $4 + (word) 1024
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) y#2 ← phi( @3/(byte) y#4 @begin/(byte) 0 )
(byte) xd#1 ← phi( @begin/(byte) 39 )
(byte) yd#1 ← phi( @begin/(byte) 24 )
@ -732,29 +732,29 @@ CONTROL FLOW GRAPH
(byte) e#1 ← (byte) e#3 + (byte) yd#1
if((byte) xd#1<(byte) e#1) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) y#1 ← (byte) y#2 + (byte) 1
(byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40
(byte) e#2 ← (byte) e#1 - (byte) xd#1
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) y#4 ← phi( @1/(byte) y#2 @2/(byte) y#1 )
(byte) e#5 ← phi( @1/(byte) e#1 @2/(byte) e#2 )
(byte*) cursor#5 ← phi( @1/(byte*) cursor#1 @2/(byte*) cursor#2 )
(byte~) $13 ← (byte) 39 + (byte) 1
if((byte) x#1<(byte~) $13) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Alias (byte~) $3 = (byte*~) $4
Succesful SSA optimization Pass2AliasElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) e#0 ← (byte) 24 / (byte) 2
(byte~) $3 ← (byte) 0 * (byte) 40
(byte*) cursor#0 ← (byte~) $3 + (word) 1024
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) y#2 ← phi( @3/(byte) y#4 @begin/(byte) 0 )
(byte) xd#1 ← phi( @begin/(byte) 39 )
(byte) yd#1 ← phi( @begin/(byte) 24 )
@ -767,30 +767,30 @@ CONTROL FLOW GRAPH
(byte) e#1 ← (byte) e#3 + (byte) yd#1
if((byte) xd#1<(byte) e#1) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) y#1 ← (byte) y#2 + (byte) 1
(byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40
(byte) e#2 ← (byte) e#1 - (byte) xd#1
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) y#4 ← phi( @1/(byte) y#2 @2/(byte) y#1 )
(byte) e#5 ← phi( @1/(byte) e#1 @2/(byte) e#2 )
(byte*) cursor#5 ← phi( @1/(byte*) cursor#1 @2/(byte*) cursor#2 )
(byte~) $13 ← (byte) 39 + (byte) 1
if((byte) x#1<(byte~) $13) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Redundant Phi (byte) yd#1 (byte) 24
Redundant Phi (byte) xd#1 (byte) 39
Succesful SSA optimization Pass2RedundantPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) e#0 ← (byte) 24 / (byte) 2
(byte~) $3 ← (byte) 0 * (byte) 40
(byte*) cursor#0 ← (byte~) $3 + (word) 1024
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) y#2 ← phi( @3/(byte) y#4 @begin/(byte) 0 )
(byte) e#3 ← phi( @3/(byte) e#5 @begin/(byte) e#0 )
(byte) x#2 ← phi( @3/(byte) x#1 @begin/(byte) 0 )
@ -801,29 +801,29 @@ CONTROL FLOW GRAPH
(byte) e#1 ← (byte) e#3 + (byte) 24
if((byte) 39<(byte) e#1) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) y#1 ← (byte) y#2 + (byte) 1
(byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40
(byte) e#2 ← (byte) e#1 - (byte) 39
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) y#4 ← phi( @1/(byte) y#2 @2/(byte) y#1 )
(byte) e#5 ← phi( @1/(byte) e#1 @2/(byte) e#2 )
(byte*) cursor#5 ← phi( @1/(byte*) cursor#1 @2/(byte*) cursor#2 )
(byte~) $13 ← (byte) 39 + (byte) 1
if((byte) x#1<(byte~) $13) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Constant (byte) e#0 (byte) 12
Constant (byte~) $3 (byte) 0
Constant (byte~) $13 (byte) 40
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte*) cursor#0 ← (byte) 0 + (word) 1024
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) y#2 ← phi( @3/(byte) y#4 @begin/(byte) 0 )
(byte) e#3 ← phi( @3/(byte) e#5 @begin/(byte) 12 )
(byte) x#2 ← phi( @3/(byte) x#1 @begin/(byte) 0 )
@ -834,27 +834,27 @@ CONTROL FLOW GRAPH
(byte) e#1 ← (byte) e#3 + (byte) 24
if((byte) 39<(byte) e#1) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) y#1 ← (byte) y#2 + (byte) 1
(byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40
(byte) e#2 ← (byte) e#1 - (byte) 39
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) y#4 ← phi( @1/(byte) y#2 @2/(byte) y#1 )
(byte) e#5 ← phi( @1/(byte) e#1 @2/(byte) e#2 )
(byte*) cursor#5 ← phi( @1/(byte*) cursor#1 @2/(byte*) cursor#2 )
if((byte) x#1<(byte) 40) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Multiple usages for variable. Not optimizing sub-constant (byte) y#2
Multiple usages for variable. Not optimizing sub-constant (byte*) cursor#1
Constant (byte*) cursor#0 (word) 1024
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) y#2 ← phi( @3/(byte) y#4 @begin/(byte) 0 )
(byte) e#3 ← phi( @3/(byte) e#5 @begin/(byte) 12 )
(byte) x#2 ← phi( @3/(byte) x#1 @begin/(byte) 0 )
@ -865,18 +865,18 @@ CONTROL FLOW GRAPH
(byte) e#1 ← (byte) e#3 + (byte) 24
if((byte) 39<(byte) e#1) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) y#1 ← (byte) y#2 + (byte) 1
(byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40
(byte) e#2 ← (byte) e#1 - (byte) 39
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) y#4 ← phi( @1/(byte) y#2 @2/(byte) y#1 )
(byte) e#5 ← phi( @1/(byte) e#1 @2/(byte) e#2 )
(byte*) cursor#5 ← phi( @1/(byte*) cursor#1 @2/(byte*) cursor#2 )
if((byte) x#1<(byte) 40) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Multiple usages for variable. Not optimizing sub-constant (byte) y#2
Multiple usages for variable. Not optimizing sub-constant (byte*) cursor#1
@ -887,9 +887,9 @@ Added new block during phi lifting @7(between @3 and @1)
Added new block during phi lifting @8(between @1 and @3)
Block Sequence Planned @begin @1 @8 @3 @end @7 @2
CONTROL FLOW GRAPH - PHI LIFTED
@begin: from
@begin: scope:[] from
to:@1
@1: from @7 @begin
@1: scope:[] from @7 @begin
(byte) y#2 ← phi( @7/(byte~) y#5 @begin/(byte) 0 )
(byte) e#3 ← phi( @7/(byte~) e#6 @begin/(byte) 12 )
(byte) x#2 ← phi( @7/(byte~) x#5 @begin/(byte) 0 )
@ -900,25 +900,25 @@ CONTROL FLOW GRAPH - PHI LIFTED
(byte) e#1 ← (byte) e#3 + (byte) 24
if((byte) 39<(byte) e#1) goto @2
to:@8
@8: from @1
@8: scope:[] from @1
(byte*~) cursor#7 ← (byte*) cursor#1
(byte~) e#7 ← (byte) e#1
(byte~) y#6 ← (byte) y#2
to:@3
@3: from @2 @8
@3: scope:[] from @2 @8
(byte) y#4 ← phi( @8/(byte~) y#6 @2/(byte~) y#7 )
(byte) e#5 ← phi( @8/(byte~) e#7 @2/(byte~) e#8 )
(byte*) cursor#5 ← phi( @8/(byte*~) cursor#7 @2/(byte*~) cursor#8 )
if((byte) x#1<(byte) 40) goto @7
to:@end
@end: from @3
@7: from @3
@end: scope:[] from @3
@7: scope:[] from @3
(byte*~) cursor#6 ← (byte*) cursor#5
(byte~) x#5 ← (byte) x#1
(byte~) e#6 ← (byte) e#5
(byte~) y#5 ← (byte) y#4
to:@1
@2: from @1
@2: scope:[] from @1
(byte) y#1 ← (byte) y#2 + (byte) 1
(byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40
(byte) e#2 ← (byte) e#1 - (byte) 39
@ -936,9 +936,9 @@ Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
CONTROL FLOW GRAPH - LIVE RANGES
@begin: from
@begin: scope:[] from
to:@1
@1: from @7 @begin
@1: scope:[] from @7 @begin
[0] (byte) y#2 ← phi( @7/(byte~) y#5 @begin/(byte) 0 ) [ cursor#3 x#2 e#3 y#2 ]
[0] (byte) e#3 ← phi( @7/(byte~) e#6 @begin/(byte) 12 ) [ cursor#3 x#2 e#3 y#2 ]
[0] (byte) x#2 ← phi( @7/(byte~) x#5 @begin/(byte) 0 ) [ cursor#3 x#2 e#3 y#2 ]
@ -949,25 +949,25 @@ CONTROL FLOW GRAPH - LIVE RANGES
[4] (byte) e#1 ← (byte) e#3 + (byte) 24 [ e#1 cursor#1 y#2 x#1 ]
[5] if((byte) 39<(byte) e#1) goto @2 [ e#1 cursor#1 y#2 x#1 ]
to:@8
@8: from @1
@8: scope:[] from @1
[6] (byte*~) cursor#7 ← (byte*) cursor#1 [ e#1 y#2 cursor#7 x#1 ]
[7] (byte~) e#7 ← (byte) e#1 [ y#2 cursor#7 e#7 x#1 ]
[8] (byte~) y#6 ← (byte) y#2 [ cursor#7 e#7 y#6 x#1 ]
to:@3
@3: from @2 @8
@3: scope:[] from @2 @8
[9] (byte) y#4 ← phi( @8/(byte~) y#6 @2/(byte~) y#7 ) [ x#1 cursor#5 e#5 y#4 ]
[9] (byte) e#5 ← phi( @8/(byte~) e#7 @2/(byte~) e#8 ) [ x#1 cursor#5 e#5 y#4 ]
[9] (byte*) cursor#5 ← phi( @8/(byte*~) cursor#7 @2/(byte*~) cursor#8 ) [ x#1 cursor#5 e#5 y#4 ]
[10] if((byte) x#1<(byte) 40) goto @7 [ x#1 cursor#5 e#5 y#4 ]
to:@end
@end: from @3
@7: from @3
@end: scope:[] from @3
@7: scope:[] from @3
[11] (byte*~) cursor#6 ← (byte*) cursor#5 [ cursor#6 x#1 e#5 y#4 ]
[12] (byte~) x#5 ← (byte) x#1 [ cursor#6 x#5 e#5 y#4 ]
[13] (byte~) e#6 ← (byte) e#5 [ cursor#6 x#5 e#6 y#4 ]
[14] (byte~) y#5 ← (byte) y#4 [ cursor#6 x#5 e#6 y#5 ]
to:@1
@2: from @1
@2: scope:[] from @1
[15] (byte) y#1 ← (byte) y#2 + (byte) 1 [ e#1 cursor#1 x#1 y#1 ]
[16] (byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40 [ e#1 x#1 cursor#2 y#1 ]
[17] (byte) e#2 ← (byte) e#1 - (byte) 39 [ x#1 cursor#2 e#2 y#1 ]
@ -998,9 +998,9 @@ Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
CONTROL FLOW GRAPH - PHI MEM COALESCED
@begin: from
@begin: scope:[] from
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
[0] (byte) y#2 ← phi( @3/(byte) y#4 @begin/(byte) 0 ) [ cursor#3 x#2 e#3 y#2 ]
[0] (byte) e#3 ← phi( @3/(byte) e#5 @begin/(byte) 12 ) [ cursor#3 x#2 e#3 y#2 ]
[0] (byte) x#2 ← phi( @3/(byte) x#1 @begin/(byte) 0 ) [ cursor#3 x#2 e#3 y#2 ]
@ -1011,14 +1011,14 @@ CONTROL FLOW GRAPH - PHI MEM COALESCED
[4] (byte) e#1 ← (byte) e#3 + (byte) 24 [ x#1 e#1 cursor#1 y#2 ]
[5] if((byte) 39<(byte) e#1) goto @2 [ x#1 e#1 cursor#1 y#2 ]
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
[6] (byte) y#4 ← phi( @1/(byte) y#2 @2/(byte) y#1 ) [ cursor#5 x#1 e#5 y#4 ]
[6] (byte) e#5 ← phi( @1/(byte) e#1 @2/(byte) e#2 ) [ cursor#5 x#1 e#5 y#4 ]
[6] (byte*) cursor#5 ← phi( @1/(byte*) cursor#1 @2/(byte*) cursor#2 ) [ cursor#5 x#1 e#5 y#4 ]
[7] if((byte) x#1<(byte) 40) goto @1 [ cursor#5 x#1 e#5 y#4 ]
to:@end
@end: from @3
@2: from @1
@end: scope:[] from @3
@2: scope:[] from @1
[8] (byte) y#1 ← (byte) y#2 + (byte) 1 [ x#1 e#1 cursor#1 y#1 ]
[9] (byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40 [ x#1 e#1 cursor#2 y#1 ]
[10] (byte) e#2 ← (byte) e#1 - (byte) 39 [ x#1 cursor#2 e#2 y#1 ]

View File

@ -1,12 +1,12 @@
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] *((word) 4352) ← (byte) 0 [ ]
[2] *((word) 4353) ← (byte) 1 [ ]
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
[3] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) [ main::i#2 ]
[4] (byte~) main::$1 ← (word) 4352 *idx (byte) main::i#2 [ main::i#2 main::$1 ]
[5] (byte~) main::$3 ← (word) 4353 *idx (byte) main::i#2 [ main::i#2 main::$1 main::$3 ]
@ -15,6 +15,6 @@ main::@1: from main main::@1
[8] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ]
[9] if((byte) main::i#1<(byte) 15) goto main::@1 [ main::i#1 ]
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
[10] return [ ]
to:@return

View File

@ -47,16 +47,16 @@ SYMBOLS
(byte) main::i
INITIAL CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte[15]) fibs ← (word) 4352
(void~) $0 ← call main
to:@1
main: from
main: scope:[main] from
*((byte[15]) fibs + (byte) 0) ← (byte) 0
*((byte[15]) fibs + (byte) 1) ← (byte) 1
(byte) main::i ← (byte) 0
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(byte~) main::$0 ← (byte) main::i + (byte) 2
(byte~) main::$1 ← (byte[15]) fibs *idx (byte) main::i
(byte~) main::$2 ← (byte) main::i + (byte) 1
@ -67,28 +67,28 @@ main::@1: from main main::@1
(boolean~) main::$5 ← (byte) main::i < (byte) 15
if((boolean~) main::$5) goto main::@1
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
return
to:@return
@1: from @begin
@1: scope:[] from @begin
to:@end
@end: from @1
@end: scope:[] from @1
Removing empty block main::@2
Removing empty block @1
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte[15]) fibs ← (word) 4352
(void~) $0 ← call main
to:@end
main: from
main: scope:[main] from
*((byte[15]) fibs + (byte) 0) ← (byte) 0
*((byte[15]) fibs + (byte) 1) ← (byte) 1
(byte) main::i ← (byte) 0
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(byte~) main::$0 ← (byte) main::i + (byte) 2
(byte~) main::$1 ← (byte[15]) fibs *idx (byte) main::i
(byte~) main::$2 ← (byte) main::i + (byte) 1
@ -99,26 +99,26 @@ main::@1: from main main::@1
(boolean~) main::$5 ← (byte) main::i < (byte) 15
if((boolean~) main::$5) goto main::@1
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
PROCEDURE MODIFY VARIABLE ANALYSIS
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
@begin: from
@begin: scope:[] from
(byte[15]) fibs ← (word) 4352
call main param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
*((byte[15]) fibs + (byte) 0) ← (byte) 0
*((byte[15]) fibs + (byte) 1) ← (byte) 1
(byte) main::i ← (byte) 0
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(byte~) main::$0 ← (byte) main::i + (byte) 2
(byte~) main::$1 ← (byte[15]) fibs *idx (byte) main::i
(byte~) main::$2 ← (byte) main::i + (byte) 1
@ -129,26 +129,26 @@ main::@1: from main main::@1
(boolean~) main::$5 ← (byte) main::i < (byte) 15
if((boolean~) main::$5) goto main::@1
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @2
@end: scope:[] from @2
Completing Phi functions...
CONTROL FLOW GRAPH SSA
@begin: from
@begin: scope:[] from
(byte[15]) fibs#0 ← (word) 4352
call main param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[15]) fibs#1 ← phi( @begin/(byte[15]) fibs#0 )
*((byte[15]) fibs#1 + (byte) 0) ← (byte) 0
*((byte[15]) fibs#1 + (byte) 1) ← (byte) 1
(byte) main::i#0 ← (byte) 0
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(byte[15]) fibs#2 ← phi( main/(byte[15]) fibs#1 main::@1/(byte[15]) fibs#2 )
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 )
(byte~) main::$0 ← (byte) main::i#2 + (byte) 2
@ -161,25 +161,25 @@ main::@1: from main main::@1
(boolean~) main::$5 ← (byte) main::i#1 < (byte) 15
if((boolean~) main::$5) goto main::@1
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @2
@end: scope:[] from @2
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
@begin: from
@begin: scope:[] from
(byte[15]) fibs#0 ← (word) 4352
call main param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[15]) fibs#1 ← phi( @begin/(byte[15]) fibs#0 )
*((byte[15]) fibs#1 + (byte) 0) ← (byte) 0
*((byte[15]) fibs#1 + (byte) 1) ← (byte) 1
(byte) main::i#0 ← (byte) 0
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(byte[15]) fibs#2 ← phi( main/(byte[15]) fibs#1 main::@1/(byte[15]) fibs#2 )
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 )
(byte~) main::$0 ← (byte) main::i#2 + (byte) 2
@ -192,25 +192,25 @@ main::@1: from main main::@1
(boolean~) main::$5 ← (byte) main::i#1 < (byte) 15
if((boolean~) main::$5) goto main::@1
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @2
@end: scope:[] from @2
Culled Empty Block (label) @2
Succesful SSA optimization Pass2CullEmptyBlocks
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte[15]) fibs#0 ← (word) 4352
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[15]) fibs#1 ← phi( @begin/(byte[15]) fibs#0 )
*((byte[15]) fibs#1 + (byte) 0) ← (byte) 0
*((byte[15]) fibs#1 + (byte) 1) ← (byte) 1
(byte) main::i#0 ← (byte) 0
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(byte[15]) fibs#2 ← phi( main/(byte[15]) fibs#1 main::@1/(byte[15]) fibs#2 )
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 )
(byte~) main::$0 ← (byte) main::i#2 + (byte) 2
@ -223,24 +223,24 @@ main::@1: from main main::@1
(boolean~) main::$5 ← (byte) main::i#1 < (byte) 15
if((boolean~) main::$5) goto main::@1
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Constant (byte[15]) fibs#0 (word) 4352
Constant (byte) main::i#0 (byte) 0
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[15]) fibs#1 ← phi( @begin/(word) 4352 )
*((byte[15]) fibs#1 + (byte) 0) ← (byte) 0
*((byte[15]) fibs#1 + (byte) 1) ← (byte) 1
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(byte[15]) fibs#2 ← phi( main/(byte[15]) fibs#1 main::@1/(byte[15]) fibs#2 )
(byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
(byte~) main::$0 ← (byte) main::i#2 + (byte) 2
@ -253,24 +253,24 @@ main::@1: from main main::@1
(boolean~) main::$5 ← (byte) main::i#1 < (byte) 15
if((boolean~) main::$5) goto main::@1
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Multiple usages for variable. Not optimizing sub-constant (byte) main::i#2
Multiple usages for variable. Not optimizing sub-constant (byte) main::i#2
Redundant Phi (byte[15]) fibs#1 (word) 4352
Succesful SSA optimization Pass2RedundantPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
*((word) 4352 + (byte) 0) ← (byte) 0
*((word) 4352 + (byte) 1) ← (byte) 1
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(byte[15]) fibs#2 ← phi( main/(word) 4352 main::@1/(byte[15]) fibs#2 )
(byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
(byte~) main::$0 ← (byte) main::i#2 + (byte) 2
@ -283,22 +283,22 @@ main::@1: from main main::@1
(boolean~) main::$5 ← (byte) main::i#1 < (byte) 15
if((boolean~) main::$5) goto main::@1
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Self Phi Eliminated (byte[15]) fibs#2
Succesful SSA optimization Pass2SelfPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
*((word) 4352 + (byte) 0) ← (byte) 0
*((word) 4352 + (byte) 1) ← (byte) 1
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(byte[15]) fibs#2 ← phi( main/(word) 4352 )
(byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
(byte~) main::$0 ← (byte) main::i#2 + (byte) 2
@ -311,22 +311,22 @@ main::@1: from main main::@1
(boolean~) main::$5 ← (byte) main::i#1 < (byte) 15
if((boolean~) main::$5) goto main::@1
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Simple Condition (boolean~) main::$5 if((byte) main::i#1<(byte) 15) goto main::@1
Succesful SSA optimization Pass2ConditionalJumpSimplification
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
*((word) 4352 + (byte) 0) ← (byte) 0
*((word) 4352 + (byte) 1) ← (byte) 1
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(byte[15]) fibs#2 ← phi( main/(word) 4352 )
(byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
(byte~) main::$0 ← (byte) main::i#2 + (byte) 2
@ -338,22 +338,22 @@ main::@1: from main main::@1
(byte) main::i#1 ← ++ (byte) main::i#2
if((byte) main::i#1<(byte) 15) goto main::@1
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Constant (byte[15]) fibs#2 (word) 4352
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
*((word) 4352 + (byte) 0) ← (byte) 0
*((word) 4352 + (byte) 1) ← (byte) 1
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
(byte~) main::$0 ← (byte) main::i#2 + (byte) 2
(byte~) main::$1 ← (word) 4352 *idx (byte) main::i#2
@ -364,10 +364,10 @@ main::@1: from main main::@1
(byte) main::i#1 ← ++ (byte) main::i#2
if((byte) main::i#1<(byte) 15) goto main::@1
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Consolidated assigned array index constant in assignment *(4352)
Consolidated assigned array index constant in assignment *(4353)
@ -378,14 +378,14 @@ Consolidated referenced array index constant in assignment main::$3
Consolidated assigned array index constant in assignment *(4354 + main::$0)
Succesful SSA optimization Pass2ConstantAdditionElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
*((word) 4352) ← (byte) 0
*((word) 4353) ← (byte) 1
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
(byte~) main::$0 ← (byte) main::i#2
(byte~) main::$1 ← (word) 4352 *idx (byte) main::i#2
@ -396,22 +396,22 @@ main::@1: from main main::@1
(byte) main::i#1 ← ++ (byte) main::i#2
if((byte) main::i#1<(byte) 15) goto main::@1
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Alias (byte) main::i#2 = (byte~) main::$0 (byte~) main::$2
Succesful SSA optimization Pass2AliasElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
*((word) 4352) ← (byte) 0
*((word) 4353) ← (byte) 1
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
(byte~) main::$1 ← (word) 4352 *idx (byte) main::i#2
(byte~) main::$3 ← (word) 4353 *idx (byte) main::i#2
@ -420,10 +420,10 @@ main::@1: from main main::@1
(byte) main::i#1 ← ++ (byte) main::i#2
if((byte) main::i#1<(byte) 15) goto main::@1
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Multiple usages for variable. Not optimizing sub-constant (byte) main::i#2
Multiple usages for variable. Not optimizing sub-constant (byte) main::i#2
@ -432,15 +432,15 @@ Block Sequence Planned @begin @end main main::@1 main::@return
Added new block during phi lifting main::@3(between main::@1 and main::@1)
Block Sequence Planned @begin @end main main::@1 main::@return main::@3
CONTROL FLOW GRAPH - PHI LIFTED
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
*((word) 4352) ← (byte) 0
*((word) 4353) ← (byte) 1
to:main::@1
main::@1: from main main::@3
main::@1: scope:[main] from main main::@3
(byte) main::i#2 ← phi( main/(byte) 0 main::@3/(byte~) main::i#3 )
(byte~) main::$1 ← (word) 4352 *idx (byte) main::i#2
(byte~) main::$3 ← (word) 4353 *idx (byte) main::i#2
@ -449,25 +449,25 @@ main::@1: from main main::@3
(byte) main::i#1 ← ++ (byte) main::i#2
if((byte) main::i#1<(byte) 15) goto main::@3
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
main::@3: from main::@1
main::@3: scope:[main] from main::@1
(byte~) main::i#3 ← (byte) main::i#1
to:main::@1
Propagating live ranges...
Propagating live ranges...
CONTROL FLOW GRAPH - LIVE RANGES
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] *((word) 4352) ← (byte) 0 [ ]
[2] *((word) 4353) ← (byte) 1 [ ]
to:main::@1
main::@1: from main main::@3
main::@1: scope:[main] from main main::@3
[3] (byte) main::i#2 ← phi( main/(byte) 0 main::@3/(byte~) main::i#3 ) [ main::i#2 ]
[4] (byte~) main::$1 ← (word) 4352 *idx (byte) main::i#2 [ main::i#2 main::$1 ]
[5] (byte~) main::$3 ← (word) 4353 *idx (byte) main::i#2 [ main::i#2 main::$1 main::$3 ]
@ -476,10 +476,10 @@ main::@1: from main main::@3
[8] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ]
[9] if((byte) main::i#1<(byte) 15) goto main::@3 [ main::i#1 ]
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
[10] return [ ]
to:@return
main::@3: from main::@1
main::@3: scope:[main] from main::@1
[11] (byte~) main::i#3 ← (byte) main::i#1 [ main::i#3 ]
to:main::@1
@ -491,15 +491,15 @@ Block Sequence Planned @begin @end main main::@1 main::@return
Propagating live ranges...
Propagating live ranges...
CONTROL FLOW GRAPH - PHI MEM COALESCED
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] *((word) 4352) ← (byte) 0 [ ]
[2] *((word) 4353) ← (byte) 1 [ ]
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
[3] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 ) [ main::i#2 ]
[4] (byte~) main::$1 ← (word) 4352 *idx (byte) main::i#2 [ main::i#2 main::$1 ]
[5] (byte~) main::$3 ← (word) 4353 *idx (byte) main::i#2 [ main::i#2 main::$1 main::$3 ]
@ -508,7 +508,7 @@ main::@1: from main main::@1
[8] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ]
[9] if((byte) main::i#1<(byte) 15) goto main::@1 [ main::i#1 ]
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
[10] return [ ]
to:@return

View File

@ -1,43 +1,43 @@
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] call prepare param-assignment [ ]
to:main::@3
main::@3: from main main::@11 main::@3 main::@6
main::@3: scope:[main] from main main::@11 main::@3 main::@6
[2] (byte) main::c#2 ← phi( main/(byte) 25 main::@11/(byte) 25 main::@6/(byte) main::c#1 ) [ main::c#2 ]
[3] (byte~) main::$1 ← * (word) 53266 [ main::$1 main::c#2 ]
[4] if((byte~) main::$1!=(byte) 254) goto main::@3 [ main::c#2 ]
to:main::@4
main::@4: from main::@3 main::@4
main::@4: scope:[main] from main::@3 main::@4
[5] (byte~) main::$3 ← * (word) 53266 [ main::$3 main::c#2 ]
[6] if((byte~) main::$3!=(byte) 255) goto main::@4 [ main::c#2 ]
to:main::@6
main::@6: from main::@4
main::@6: scope:[main] from main::@4
[7] (byte) main::c#1 ← -- (byte) main::c#2 [ main::c#1 ]
[8] if((byte) main::c#1!=(byte) 0) goto main::@3 [ main::c#1 ]
to:main::@7
main::@7: from main::@6
main::@7: scope:[main] from main::@6
[9] call flip param-assignment [ ]
to:main::@10
main::@10: from main::@7
main::@10: scope:[main] from main::@7
[10] call plot param-assignment [ ]
to:main::@11
main::@11: from main::@10
main::@11: scope:[main] from main::@10
[11] if(true) goto main::@3 [ ]
to:main::@return
main::@return: from main::@11
main::@return: scope:[main] from main::@11
[12] return [ ]
to:@return
plot: from main::@10
plot: scope:[plot] from main::@10
to:plot::@1
plot::@1: from plot plot::@3
plot::@1: scope:[plot] from plot plot::@3
[13] (byte) plot::y#2 ← phi( plot/(byte) 16 plot::@3/(byte) plot::y#1 ) [ plot::i#3 plot::line#2 plot::y#2 ]
[13] (byte*) plot::line#2 ← phi( plot/(word) 1236 plot::@3/(byte*) plot::line#1 ) [ plot::i#3 plot::line#2 plot::y#2 ]
[13] (byte) plot::i#3 ← phi( plot/(byte) 0 plot::@3/(byte) plot::i#1 ) [ plot::i#3 plot::line#2 plot::y#2 ]
to:plot::@2
plot::@2: from plot::@1 plot::@2
plot::@2: scope:[plot] from plot::@1 plot::@2
[14] (byte) plot::x#2 ← phi( plot::@1/(byte) 0 plot::@2/(byte) plot::x#1 ) [ plot::i#2 plot::line#2 plot::x#2 plot::y#2 ]
[14] (byte) plot::i#2 ← phi( plot::@1/(byte) plot::i#3 plot::@2/(byte) plot::i#1 ) [ plot::i#2 plot::line#2 plot::x#2 plot::y#2 ]
[15] (byte~) plot::$3 ← (word) 4096 *idx (byte) plot::i#2 [ plot::i#2 plot::line#2 plot::x#2 plot::$3 plot::y#2 ]
@ -46,22 +46,22 @@ plot::@2: from plot::@1 plot::@2
[18] (byte) plot::x#1 ← ++ (byte) plot::x#2 [ plot::i#1 plot::x#1 plot::line#2 plot::y#2 ]
[19] if((byte) plot::x#1<(byte) 16) goto plot::@2 [ plot::i#1 plot::x#1 plot::line#2 plot::y#2 ]
to:plot::@3
plot::@3: from plot::@2
plot::@3: scope:[plot] from plot::@2
[20] (byte*) plot::line#1 ← (byte*) plot::line#2 + (byte) 40 [ plot::i#1 plot::line#1 plot::y#2 ]
[21] (byte) plot::y#1 ← -- (byte) plot::y#2 [ plot::i#1 plot::line#1 plot::y#1 ]
[22] if((byte) plot::y#1!=(byte) 0) goto plot::@1 [ plot::i#1 plot::line#1 plot::y#1 ]
to:plot::@return
plot::@return: from plot::@3
plot::@return: scope:[plot] from plot::@3
[23] return [ ]
to:@return
flip: from main::@7
flip: scope:[flip] from main::@7
to:flip::@1
flip::@1: from flip flip::@4
flip::@1: scope:[flip] from flip flip::@4
[24] (byte) flip::r#2 ← phi( flip/(byte) 16 flip::@4/(byte) flip::r#1 ) [ flip::srcIdx#3 flip::dstIdx#5 flip::r#2 ]
[24] (byte) flip::dstIdx#5 ← phi( flip/(byte) 15 flip::@4/(byte) flip::dstIdx#2 ) [ flip::srcIdx#3 flip::dstIdx#5 flip::r#2 ]
[24] (byte) flip::srcIdx#3 ← phi( flip/(byte) 0 flip::@4/(byte) flip::srcIdx#1 ) [ flip::srcIdx#3 flip::dstIdx#5 flip::r#2 ]
to:flip::@2
flip::@2: from flip::@1 flip::@2
flip::@2: scope:[flip] from flip::@1 flip::@2
[25] (byte) flip::c#2 ← phi( flip::@1/(byte) 16 flip::@2/(byte) flip::c#1 ) [ flip::srcIdx#2 flip::dstIdx#3 flip::c#2 flip::r#2 ]
[25] (byte) flip::dstIdx#3 ← phi( flip::@1/(byte) flip::dstIdx#5 flip::@2/(byte) flip::dstIdx#1 ) [ flip::srcIdx#2 flip::dstIdx#3 flip::c#2 flip::r#2 ]
[25] (byte) flip::srcIdx#2 ← phi( flip::@1/(byte) flip::srcIdx#3 flip::@2/(byte) flip::srcIdx#1 ) [ flip::srcIdx#2 flip::dstIdx#3 flip::c#2 flip::r#2 ]
@ -72,29 +72,29 @@ flip::@2: from flip::@1 flip::@2
[30] (byte) flip::c#1 ← -- (byte) flip::c#2 [ flip::srcIdx#1 flip::dstIdx#1 flip::c#1 flip::r#2 ]
[31] if((byte) flip::c#1!=(byte) 0) goto flip::@2 [ flip::srcIdx#1 flip::dstIdx#1 flip::c#1 flip::r#2 ]
to:flip::@4
flip::@4: from flip::@2
flip::@4: scope:[flip] from flip::@2
[32] (byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#2 ]
[33] (byte) flip::r#1 ← -- (byte) flip::r#2 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ]
[34] if((byte) flip::r#1!=(byte) 0) goto flip::@1 [ flip::srcIdx#1 flip::dstIdx#2 flip::r#1 ]
to:flip::@3
flip::@3: from flip::@3 flip::@4
flip::@3: scope:[flip] from flip::@3 flip::@4
[35] (byte) flip::i#2 ← phi( flip::@3/(byte) flip::i#1 flip::@4/(byte) 0 ) [ flip::i#2 ]
[36] (byte~) flip::$4 ← (word) 4352 *idx (byte) flip::i#2 [ flip::i#2 flip::$4 ]
[37] *((word) 4096 + (byte) flip::i#2) ← (byte~) flip::$4 [ flip::i#2 ]
[38] (byte) flip::i#1 ← ++ (byte) flip::i#2 [ flip::i#1 ]
[39] if((byte) flip::i#1!=(byte) 0) goto flip::@3 [ flip::i#1 ]
to:flip::@return
flip::@return: from flip::@3
flip::@return: scope:[flip] from flip::@3
[40] return [ ]
to:@return
prepare: from main
prepare: scope:[prepare] from main
to:prepare::@1
prepare::@1: from prepare prepare::@1
prepare::@1: scope:[prepare] from prepare prepare::@1
[41] (byte) prepare::i#2 ← phi( prepare/(byte) 0 prepare::@1/(byte) prepare::i#1 ) [ prepare::i#2 ]
[42] *((word) 4096 + (byte) prepare::i#2) ← (byte) prepare::i#2 [ prepare::i#2 ]
[43] (byte) prepare::i#1 ← ++ (byte) prepare::i#2 [ prepare::i#1 ]
[44] if((byte) prepare::i#1!=(byte) 0) goto prepare::@1 [ prepare::i#1 ]
to:prepare::@return
prepare::@return: from prepare::@1
prepare::@return: scope:[prepare] from prepare::@1
[45] return [ ]
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,16 @@
@begin: from
@begin: scope:[] from
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
[0] (byte) s#2 ← phi( @3/(byte) s#4 @begin/(byte) 0 ) [ i#2 s#2 ]
[0] (byte) i#2 ← phi( @3/(byte) i#1 @begin/(byte) 10 ) [ i#2 s#2 ]
[1] if((byte) i#2>(byte) 5) goto @2 [ i#2 s#2 ]
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
[2] (byte) s#4 ← phi( @1/(byte) s#2 @2/(byte) s#1 ) [ s#4 i#2 ]
[3] (byte) i#1 ← -- (byte) i#2 [ i#1 s#4 ]
[4] if((byte) i#1>(byte) 0) goto @1 [ i#1 s#4 ]
to:@end
@end: from @3
@2: from @1
@end: scope:[] from @3
@2: scope:[] from @1
[5] (byte) s#1 ← (byte) s#2 + (byte) i#2 [ i#2 s#1 ]
to:@3

View File

@ -33,252 +33,252 @@ SYMBOLS
(byte) s
INITIAL CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) i ← (byte) 10
(byte) s ← (byte) 0
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(boolean~) $0 ← (byte) i > (byte) 5
if((boolean~) $0) goto @2
to:@4
@2: from @1 @5
@2: scope:[] from @1 @5
(byte~) $1 ← (byte) s + (byte) i
(byte) s ← (byte~) $1
to:@3
@4: from @1
@4: scope:[] from @1
to:@3
@3: from @2 @4
@3: scope:[] from @2 @4
(byte) i ← -- (byte) i
(boolean~) $2 ← (byte) i > (byte) 0
if((boolean~) $2) goto @1
to:@6
@5: from
@5: scope:[] from
to:@2
@6: from @3
@6: scope:[] from @3
to:@end
@end: from @6
@end: scope:[] from @6
Removing empty block @4
Removing empty block @5
Removing empty block @6
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) i ← (byte) 10
(byte) s ← (byte) 0
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(boolean~) $0 ← (byte) i > (byte) 5
if((boolean~) $0) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte~) $1 ← (byte) s + (byte) i
(byte) s ← (byte~) $1
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) i ← -- (byte) i
(boolean~) $2 ← (byte) i > (byte) 0
if((boolean~) $2) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
PROCEDURE MODIFY VARIABLE ANALYSIS
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
@begin: from
@begin: scope:[] from
(byte) i ← (byte) 10
(byte) s ← (byte) 0
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(boolean~) $0 ← (byte) i > (byte) 5
if((boolean~) $0) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte~) $1 ← (byte) s + (byte) i
(byte) s ← (byte~) $1
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) i ← -- (byte) i
(boolean~) $2 ← (byte) i > (byte) 0
if((boolean~) $2) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Completing Phi functions...
Completing Phi functions...
Completing Phi functions...
CONTROL FLOW GRAPH SSA
@begin: from
@begin: scope:[] from
(byte) i#0 ← (byte) 10
(byte) s#0 ← (byte) 0
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) s#3 ← phi( @3/(byte) s#4 @begin/(byte) s#0 )
(byte) i#2 ← phi( @3/(byte) i#1 @begin/(byte) i#0 )
(boolean~) $0 ← (byte) i#2 > (byte) 5
if((boolean~) $0) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) i#3 ← phi( @1/(byte) i#2 )
(byte) s#2 ← phi( @1/(byte) s#3 )
(byte~) $1 ← (byte) s#2 + (byte) i#3
(byte) s#1 ← (byte~) $1
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) s#4 ← phi( @1/(byte) s#3 @2/(byte) s#1 )
(byte) i#4 ← phi( @1/(byte) i#2 @2/(byte) i#3 )
(byte) i#1 ← -- (byte) i#4
(boolean~) $2 ← (byte) i#1 > (byte) 0
if((boolean~) $2) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
@begin: from
@begin: scope:[] from
(byte) i#0 ← (byte) 10
(byte) s#0 ← (byte) 0
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) s#3 ← phi( @3/(byte) s#4 @begin/(byte) s#0 )
(byte) i#2 ← phi( @3/(byte) i#1 @begin/(byte) i#0 )
(boolean~) $0 ← (byte) i#2 > (byte) 5
if((boolean~) $0) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) i#3 ← phi( @1/(byte) i#2 )
(byte) s#2 ← phi( @1/(byte) s#3 )
(byte~) $1 ← (byte) s#2 + (byte) i#3
(byte) s#1 ← (byte~) $1
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) s#4 ← phi( @1/(byte) s#3 @2/(byte) s#1 )
(byte) i#4 ← phi( @1/(byte) i#2 @2/(byte) i#3 )
(byte) i#1 ← -- (byte) i#4
(boolean~) $2 ← (byte) i#1 > (byte) 0
if((boolean~) $2) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Constant (byte) i#0 (byte) 10
Constant (byte) s#0 (byte) 0
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) s#3 ← phi( @3/(byte) s#4 @begin/(byte) 0 )
(byte) i#2 ← phi( @3/(byte) i#1 @begin/(byte) 10 )
(boolean~) $0 ← (byte) i#2 > (byte) 5
if((boolean~) $0) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) i#3 ← phi( @1/(byte) i#2 )
(byte) s#2 ← phi( @1/(byte) s#3 )
(byte~) $1 ← (byte) s#2 + (byte) i#3
(byte) s#1 ← (byte~) $1
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) s#4 ← phi( @1/(byte) s#3 @2/(byte) s#1 )
(byte) i#4 ← phi( @1/(byte) i#2 @2/(byte) i#3 )
(byte) i#1 ← -- (byte) i#4
(boolean~) $2 ← (byte) i#1 > (byte) 0
if((boolean~) $2) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Alias (byte) s#2 = (byte) s#3
Alias (byte) i#2 = (byte) i#3
Alias (byte) s#1 = (byte~) $1
Succesful SSA optimization Pass2AliasElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) s#2 ← phi( @3/(byte) s#4 @begin/(byte) 0 )
(byte) i#2 ← phi( @3/(byte) i#1 @begin/(byte) 10 )
(boolean~) $0 ← (byte) i#2 > (byte) 5
if((boolean~) $0) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) s#1 ← (byte) s#2 + (byte) i#2
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) s#4 ← phi( @1/(byte) s#2 @2/(byte) s#1 )
(byte) i#4 ← phi( @1/(byte) i#2 @2/(byte) i#2 )
(byte) i#1 ← -- (byte) i#4
(boolean~) $2 ← (byte) i#1 > (byte) 0
if((boolean~) $2) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Redundant Phi (byte) i#4 (byte) i#2
Succesful SSA optimization Pass2RedundantPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) s#2 ← phi( @3/(byte) s#4 @begin/(byte) 0 )
(byte) i#2 ← phi( @3/(byte) i#1 @begin/(byte) 10 )
(boolean~) $0 ← (byte) i#2 > (byte) 5
if((boolean~) $0) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) s#1 ← (byte) s#2 + (byte) i#2
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) s#4 ← phi( @1/(byte) s#2 @2/(byte) s#1 )
(byte) i#1 ← -- (byte) i#2
(boolean~) $2 ← (byte) i#1 > (byte) 0
if((boolean~) $2) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Simple Condition (boolean~) $0 if((byte) i#2>(byte) 5) goto @2
Simple Condition (boolean~) $2 if((byte) i#1>(byte) 0) goto @1
Succesful SSA optimization Pass2ConditionalJumpSimplification
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) s#2 ← phi( @3/(byte) s#4 @begin/(byte) 0 )
(byte) i#2 ← phi( @3/(byte) i#1 @begin/(byte) 10 )
if((byte) i#2>(byte) 5) goto @2
to:@3
@2: from @1
@2: scope:[] from @1
(byte) s#1 ← (byte) s#2 + (byte) i#2
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
(byte) s#4 ← phi( @1/(byte) s#2 @2/(byte) s#1 )
(byte) i#1 ← -- (byte) i#2
if((byte) i#1>(byte) 0) goto @1
to:@end
@end: from @3
@end: scope:[] from @3
Block Sequence Planned @begin @1 @3 @end @2
Added new block during phi lifting @7(between @3 and @1)
Added new block during phi lifting @8(between @1 and @3)
Block Sequence Planned @begin @1 @8 @3 @end @7 @2
CONTROL FLOW GRAPH - PHI LIFTED
@begin: from
@begin: scope:[] from
to:@1
@1: from @7 @begin
@1: scope:[] from @7 @begin
(byte) s#2 ← phi( @7/(byte~) s#5 @begin/(byte) 0 )
(byte) i#2 ← phi( @7/(byte~) i#5 @begin/(byte) 10 )
if((byte) i#2>(byte) 5) goto @2
to:@8
@8: from @1
@8: scope:[] from @1
(byte~) s#6 ← (byte) s#2
to:@3
@3: from @2 @8
@3: scope:[] from @2 @8
(byte) s#4 ← phi( @8/(byte~) s#6 @2/(byte~) s#7 )
(byte) i#1 ← -- (byte) i#2
if((byte) i#1>(byte) 0) goto @7
to:@end
@end: from @3
@7: from @3
@end: scope:[] from @3
@7: scope:[] from @3
(byte~) i#5 ← (byte) i#1
(byte~) s#5 ← (byte) s#4
to:@1
@2: from @1
@2: scope:[] from @1
(byte) s#1 ← (byte) s#2 + (byte) i#2
(byte~) s#7 ← (byte) s#1
to:@3
@ -288,27 +288,27 @@ Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
CONTROL FLOW GRAPH - LIVE RANGES
@begin: from
@begin: scope:[] from
to:@1
@1: from @7 @begin
@1: scope:[] from @7 @begin
[0] (byte) s#2 ← phi( @7/(byte~) s#5 @begin/(byte) 0 ) [ i#2 s#2 ]
[0] (byte) i#2 ← phi( @7/(byte~) i#5 @begin/(byte) 10 ) [ i#2 s#2 ]
[1] if((byte) i#2>(byte) 5) goto @2 [ i#2 s#2 ]
to:@8
@8: from @1
@8: scope:[] from @1
[2] (byte~) s#6 ← (byte) s#2 [ i#2 s#6 ]
to:@3
@3: from @2 @8
@3: scope:[] from @2 @8
[3] (byte) s#4 ← phi( @8/(byte~) s#6 @2/(byte~) s#7 ) [ i#2 s#4 ]
[4] (byte) i#1 ← -- (byte) i#2 [ i#1 s#4 ]
[5] if((byte) i#1>(byte) 0) goto @7 [ i#1 s#4 ]
to:@end
@end: from @3
@7: from @3
@end: scope:[] from @3
@7: scope:[] from @3
[6] (byte~) i#5 ← (byte) i#1 [ i#5 s#4 ]
[7] (byte~) s#5 ← (byte) s#4 [ i#5 s#5 ]
to:@1
@2: from @1
@2: scope:[] from @1
[8] (byte) s#1 ← (byte) s#2 + (byte) i#2 [ i#2 s#1 ]
[9] (byte~) s#7 ← (byte) s#1 [ i#2 s#7 ]
to:@3
@ -326,20 +326,20 @@ Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
CONTROL FLOW GRAPH - PHI MEM COALESCED
@begin: from
@begin: scope:[] from
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
[0] (byte) s#2 ← phi( @3/(byte) s#4 @begin/(byte) 0 ) [ i#2 s#2 ]
[0] (byte) i#2 ← phi( @3/(byte) i#1 @begin/(byte) 10 ) [ i#2 s#2 ]
[1] if((byte) i#2>(byte) 5) goto @2 [ i#2 s#2 ]
to:@3
@3: from @1 @2
@3: scope:[] from @1 @2
[2] (byte) s#4 ← phi( @1/(byte) s#2 @2/(byte) s#1 ) [ s#4 i#2 ]
[3] (byte) i#1 ← -- (byte) i#2 [ i#1 s#4 ]
[4] if((byte) i#1>(byte) 0) goto @1 [ i#1 s#4 ]
to:@end
@end: from @3
@2: from @1
@end: scope:[] from @3
@2: scope:[] from @1
[5] (byte) s#1 ← (byte) s#2 + (byte) i#2 [ i#2 s#1 ]
to:@3

View File

@ -1,28 +1,28 @@
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@3
main::@1: scope:[main] from main main::@3
[1] (byte) main::i#2 ← phi( main/(byte) 100 main::@3/(byte) main::i#1 ) [ main::i#2 ]
[2] call nest param-assignment [ main::i#2 ]
to:main::@3
main::@3: from main::@1
main::@3: scope:[main] from main::@1
[3] (byte) main::i#1 ← -- (byte) main::i#2 [ main::i#1 ]
[4] if((byte) main::i#1>(byte) 0) goto main::@1 [ main::i#1 ]
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
[5] return [ ]
to:@return
nest: from main::@1
nest: scope:[nest] from main::@1
to:nest::@1
nest::@1: from nest nest::@1
nest::@1: scope:[nest] from nest nest::@1
[6] (byte) nest::j#2 ← phi( nest/(byte) 100 nest::@1/(byte) nest::j#1 ) [ main::i#2 nest::j#2 ]
[7] *((word) 1024) ← (byte) nest::j#2 [ main::i#2 nest::j#2 ]
[8] (byte) nest::j#1 ← -- (byte) nest::j#2 [ main::i#2 nest::j#1 ]
[9] if((byte) nest::j#1>(byte) 0) goto nest::@1 [ main::i#2 nest::j#1 ]
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
[10] return [ main::i#2 ]
to:@return

View File

@ -58,151 +58,151 @@ SYMBOLS
(byte) nest::j
INITIAL CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte*) SCREEN ← (word) 1024
(void~) $0 ← call main
to:@1
main: from
main: scope:[main] from
(byte) main::i ← (byte) 100
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(void~) main::$0 ← call nest
(byte) main::i ← -- (byte) main::i
(boolean~) main::$1 ← (byte) main::i > (byte) 0
if((boolean~) main::$1) goto main::@1
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
return
to:@return
@1: from @begin
@1: scope:[] from @begin
to:@2
nest: from
nest: scope:[nest] from
(byte) nest::j ← (byte) 100
to:nest::@1
nest::@1: from nest nest::@1
nest::@1: scope:[nest] from nest nest::@1
*((byte*) SCREEN) ← (byte) nest::j
(byte) nest::j ← -- (byte) nest::j
(boolean~) nest::$0 ← (byte) nest::j > (byte) 0
if((boolean~) nest::$0) goto nest::@1
to:nest::@2
nest::@2: from nest::@1
nest::@2: scope:[nest] from nest::@1
to:nest::@return
nest::@return: from nest::@2
nest::@return: scope:[nest] from nest::@2
return
to:@return
@2: from @1
@2: scope:[] from @1
to:@end
@end: from @2
@end: scope:[] from @2
Removing empty block main::@2
Removing empty block @1
Removing empty block nest::@2
Removing empty block @2
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte*) SCREEN ← (word) 1024
(void~) $0 ← call main
to:@end
main: from
main: scope:[main] from
(byte) main::i ← (byte) 100
to:main::@1
main::@1: from main main::@1
main::@1: scope:[main] from main main::@1
(void~) main::$0 ← call nest
(byte) main::i ← -- (byte) main::i
(boolean~) main::$1 ← (byte) main::i > (byte) 0
if((boolean~) main::$1) goto main::@1
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
nest: from
nest: scope:[nest] from
(byte) nest::j ← (byte) 100
to:nest::@1
nest::@1: from nest nest::@1
nest::@1: scope:[nest] from nest nest::@1
*((byte*) SCREEN) ← (byte) nest::j
(byte) nest::j ← -- (byte) nest::j
(boolean~) nest::$0 ← (byte) nest::j > (byte) 0
if((boolean~) nest::$0) goto nest::@1
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
PROCEDURE MODIFY VARIABLE ANALYSIS
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
@begin: from
@begin: scope:[] from
(byte*) SCREEN ← (word) 1024
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte) main::i ← (byte) 100
to:main::@1
main::@1: from main main::@3
main::@1: scope:[main] from main main::@3
call nest param-assignment
to:main::@3
main::@3: from main::@1
main::@3: scope:[main] from main::@1
(byte) main::i ← -- (byte) main::i
(boolean~) main::$1 ← (byte) main::i > (byte) 0
if((boolean~) main::$1) goto main::@1
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
nest: from main::@1
nest: scope:[nest] from main::@1
(byte) nest::j ← (byte) 100
to:nest::@1
nest::@1: from nest nest::@1
nest::@1: scope:[nest] from nest nest::@1
*((byte*) SCREEN) ← (byte) nest::j
(byte) nest::j ← -- (byte) nest::j
(boolean~) nest::$0 ← (byte) nest::j > (byte) 0
if((boolean~) nest::$0) goto nest::@1
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
return
to:@return
@end: from @3
@end: scope:[] from @3
Completing Phi functions...
Completing Phi functions...
Completing Phi functions...
Completing Phi functions...
CONTROL FLOW GRAPH SSA
@begin: from
@begin: scope:[] from
(byte*) SCREEN#0 ← (word) 1024
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte*) SCREEN#4 ← phi( @begin/(byte*) SCREEN#0 )
(byte) main::i#0 ← (byte) 100
to:main::@1
main::@1: from main main::@3
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 param-assignment
to:main::@3
main::@3: from main::@1
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
(boolean~) main::$1 ← (byte) main::i#1 > (byte) 0
if((boolean~) main::$1) goto main::@1
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
nest: from main::@1
nest: scope:[nest] from main::@1
(byte*) SCREEN#2 ← phi( main::@1/(byte*) SCREEN#3 )
(byte) nest::j#0 ← (byte) 100
to:nest::@1
nest::@1: from nest 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
@ -210,42 +210,42 @@ nest::@1: from nest nest::@1
(boolean~) nest::$0 ← (byte) nest::j#1 > (byte) 0
if((boolean~) nest::$0) goto nest::@1
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
return
to:@return
@end: from @3
@end: scope:[] from @3
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
@begin: from
@begin: scope:[] from
(byte*) SCREEN#0 ← (word) 1024
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte*) SCREEN#4 ← phi( @begin/(byte*) SCREEN#0 )
(byte) main::i#0 ← (byte) 100
to:main::@1
main::@1: from main main::@3
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 param-assignment
to:main::@3
main::@3: from main::@1
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
(boolean~) main::$1 ← (byte) main::i#1 > (byte) 0
if((boolean~) main::$1) goto main::@1
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
nest: from main::@1
nest: scope:[nest] from main::@1
(byte*) SCREEN#2 ← phi( main::@1/(byte*) SCREEN#3 )
(byte) nest::j#0 ← (byte) 100
to:nest::@1
nest::@1: from nest 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
@ -253,42 +253,42 @@ nest::@1: from nest nest::@1
(boolean~) nest::$0 ← (byte) nest::j#1 > (byte) 0
if((boolean~) nest::$0) goto nest::@1
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
return
to:@return
@end: from @3
@end: scope:[] from @3
Culled Empty Block (label) @3
Succesful SSA optimization Pass2CullEmptyBlocks
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte*) SCREEN#0 ← (word) 1024
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
(byte*) SCREEN#4 ← phi( @begin/(byte*) SCREEN#0 )
(byte) main::i#0 ← (byte) 100
to:main::@1
main::@1: from main main::@3
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 param-assignment
to:main::@3
main::@3: from main::@1
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
(boolean~) main::$1 ← (byte) main::i#1 > (byte) 0
if((boolean~) main::$1) goto main::@1
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
nest: from main::@1
nest: scope:[nest] from main::@1
(byte*) SCREEN#2 ← phi( main::@1/(byte*) SCREEN#3 )
(byte) nest::j#0 ← (byte) 100
to:nest::@1
nest::@1: from nest 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
@ -296,41 +296,41 @@ nest::@1: from nest nest::@1
(boolean~) nest::$0 ← (byte) nest::j#1 > (byte) 0
if((boolean~) nest::$0) goto nest::@1
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Constant (byte*) SCREEN#0 (word) 1024
Constant (byte) main::i#0 (byte) 100
Constant (byte) nest::j#0 (byte) 100
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
(byte*) SCREEN#4 ← phi( @begin/(word) 1024 )
to:main::@1
main::@1: from main main::@3
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) 100 main::@3/(byte) main::i#1 )
call nest param-assignment
to:main::@3
main::@3: from main::@1
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
(boolean~) main::$1 ← (byte) main::i#1 > (byte) 0
if((boolean~) main::$1) goto main::@1
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
nest: from main::@1
nest: scope:[nest] from main::@1
(byte*) SCREEN#2 ← phi( main::@1/(byte*) SCREEN#3 )
to:nest::@1
nest::@1: from nest 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) 100 nest::@1/(byte) nest::j#1 )
*((byte*) SCREEN#1) ← (byte) nest::j#2
@ -338,37 +338,37 @@ nest::@1: from nest nest::@1
(boolean~) nest::$0 ← (byte) nest::j#1 > (byte) 0
if((boolean~) nest::$0) goto nest::@1
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Alias (byte) main::i#2 = (byte) main::i#3
Alias (byte*) SCREEN#2 = (byte*) SCREEN#5 (byte*) SCREEN#3
Succesful SSA optimization Pass2AliasElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
(byte*) SCREEN#4 ← phi( @begin/(word) 1024 )
to:main::@1
main::@1: from main main::@3
main::@1: scope:[main] from main main::@3
(byte*) SCREEN#2 ← phi( main/(byte*) SCREEN#4 main::@3/(byte*) SCREEN#2 )
(byte) main::i#2 ← phi( main/(byte) 100 main::@3/(byte) main::i#1 )
call nest param-assignment
to:main::@3
main::@3: from main::@1
main::@3: scope:[main] from main::@1
(byte) main::i#1 ← -- (byte) main::i#2
(boolean~) main::$1 ← (byte) main::i#1 > (byte) 0
if((boolean~) main::$1) goto main::@1
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
nest: from main::@1
nest: scope:[nest] from main::@1
to:nest::@1
nest::@1: from nest 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) 100 nest::@1/(byte) nest::j#1 )
*((byte*) SCREEN#1) ← (byte) nest::j#2
@ -376,35 +376,35 @@ nest::@1: from nest nest::@1
(boolean~) nest::$0 ← (byte) nest::j#1 > (byte) 0
if((boolean~) nest::$0) goto nest::@1
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Redundant Phi (byte*) SCREEN#4 (word) 1024
Succesful SSA optimization Pass2RedundantPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@3
main::@1: scope:[main] from main main::@3
(byte*) SCREEN#2 ← phi( main/(word) 1024 main::@3/(byte*) SCREEN#2 )
(byte) main::i#2 ← phi( main/(byte) 100 main::@3/(byte) main::i#1 )
call nest param-assignment
to:main::@3
main::@3: from main::@1
main::@3: scope:[main] from main::@1
(byte) main::i#1 ← -- (byte) main::i#2
(boolean~) main::$1 ← (byte) main::i#1 > (byte) 0
if((boolean~) main::$1) goto main::@1
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
nest: from main::@1
nest: scope:[nest] from main::@1
to:nest::@1
nest::@1: from nest 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) 100 nest::@1/(byte) nest::j#1 )
*((byte*) SCREEN#1) ← (byte) nest::j#2
@ -412,36 +412,36 @@ nest::@1: from nest nest::@1
(boolean~) nest::$0 ← (byte) nest::j#1 > (byte) 0
if((boolean~) nest::$0) goto nest::@1
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Self Phi Eliminated (byte*) SCREEN#2
Self Phi Eliminated (byte*) SCREEN#1
Succesful SSA optimization Pass2SelfPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@3
main::@1: scope:[main] from main main::@3
(byte*) SCREEN#2 ← phi( main/(word) 1024 )
(byte) main::i#2 ← phi( main/(byte) 100 main::@3/(byte) main::i#1 )
call nest param-assignment
to:main::@3
main::@3: from main::@1
main::@3: scope:[main] from main::@1
(byte) main::i#1 ← -- (byte) main::i#2
(boolean~) main::$1 ← (byte) main::i#1 > (byte) 0
if((boolean~) main::$1) goto main::@1
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
nest: from main::@1
nest: scope:[nest] from main::@1
to:nest::@1
nest::@1: from nest nest::@1
nest::@1: scope:[nest] from nest nest::@1
(byte*) SCREEN#1 ← phi( nest/(byte*) SCREEN#2 )
(byte) nest::j#2 ← phi( nest/(byte) 100 nest::@1/(byte) nest::j#1 )
*((byte*) SCREEN#1) ← (byte) nest::j#2
@ -449,148 +449,148 @@ nest::@1: from nest nest::@1
(boolean~) nest::$0 ← (byte) nest::j#1 > (byte) 0
if((boolean~) nest::$0) goto nest::@1
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Simple Condition (boolean~) main::$1 if((byte) main::i#1>(byte) 0) goto main::@1
Simple Condition (boolean~) nest::$0 if((byte) nest::j#1>(byte) 0) goto nest::@1
Succesful SSA optimization Pass2ConditionalJumpSimplification
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@3
main::@1: scope:[main] from main main::@3
(byte*) SCREEN#2 ← phi( main/(word) 1024 )
(byte) main::i#2 ← phi( main/(byte) 100 main::@3/(byte) main::i#1 )
call nest param-assignment
to:main::@3
main::@3: from main::@1
main::@3: scope:[main] from main::@1
(byte) main::i#1 ← -- (byte) main::i#2
if((byte) main::i#1>(byte) 0) goto main::@1
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
nest: from main::@1
nest: scope:[nest] from main::@1
to:nest::@1
nest::@1: from nest nest::@1
nest::@1: scope:[nest] from nest nest::@1
(byte*) SCREEN#1 ← phi( nest/(byte*) SCREEN#2 )
(byte) nest::j#2 ← phi( nest/(byte) 100 nest::@1/(byte) nest::j#1 )
*((byte*) SCREEN#1) ← (byte) nest::j#2
(byte) nest::j#1 ← -- (byte) nest::j#2
if((byte) nest::j#1>(byte) 0) goto nest::@1
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Constant (byte*) SCREEN#2 (word) 1024
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@3
main::@1: scope:[main] from main main::@3
(byte) main::i#2 ← phi( main/(byte) 100 main::@3/(byte) main::i#1 )
call nest param-assignment
to:main::@3
main::@3: from main::@1
main::@3: scope:[main] from main::@1
(byte) main::i#1 ← -- (byte) main::i#2
if((byte) main::i#1>(byte) 0) goto main::@1
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
nest: from main::@1
nest: scope:[nest] from main::@1
to:nest::@1
nest::@1: from nest nest::@1
nest::@1: scope:[nest] from nest nest::@1
(byte*) SCREEN#1 ← phi( nest/(word) 1024 )
(byte) nest::j#2 ← phi( nest/(byte) 100 nest::@1/(byte) nest::j#1 )
*((byte*) SCREEN#1) ← (byte) nest::j#2
(byte) nest::j#1 ← -- (byte) nest::j#2
if((byte) nest::j#1>(byte) 0) goto nest::@1
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Redundant Phi (byte*) SCREEN#1 (word) 1024
Succesful SSA optimization Pass2RedundantPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@3
main::@1: scope:[main] from main main::@3
(byte) main::i#2 ← phi( main/(byte) 100 main::@3/(byte) main::i#1 )
call nest param-assignment
to:main::@3
main::@3: from main::@1
main::@3: scope:[main] from main::@1
(byte) main::i#1 ← -- (byte) main::i#2
if((byte) main::i#1>(byte) 0) goto main::@1
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
nest: from main::@1
nest: scope:[nest] from main::@1
to:nest::@1
nest::@1: from nest nest::@1
nest::@1: scope:[nest] from nest nest::@1
(byte) nest::j#2 ← phi( nest/(byte) 100 nest::@1/(byte) nest::j#1 )
*((word) 1024) ← (byte) nest::j#2
(byte) nest::j#1 ← -- (byte) nest::j#2
if((byte) nest::j#1>(byte) 0) goto nest::@1
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Block Sequence Planned @begin @end main main::@1 main::@3 main::@return nest nest::@1 nest::@return
Added new block during phi lifting main::@4(between main::@3 and main::@1)
Added new block during phi lifting nest::@3(between nest::@1 and nest::@1)
Block Sequence Planned @begin @end main main::@1 main::@3 main::@return main::@4 nest nest::@1 nest::@return nest::@3
CONTROL FLOW GRAPH - PHI LIFTED
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@4
main::@1: scope:[main] from main main::@4
(byte) main::i#2 ← phi( main/(byte) 100 main::@4/(byte~) main::i#4 )
call nest param-assignment
to:main::@3
main::@3: from main::@1
main::@3: scope:[main] from main::@1
(byte) main::i#1 ← -- (byte) main::i#2
if((byte) main::i#1>(byte) 0) goto main::@4
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
main::@4: from main::@3
main::@4: scope:[main] from main::@3
(byte~) main::i#4 ← (byte) main::i#1
to:main::@1
nest: from main::@1
nest: scope:[nest] from main::@1
to:nest::@1
nest::@1: from nest nest::@3
nest::@1: scope:[nest] from nest nest::@3
(byte) nest::j#2 ← phi( nest/(byte) 100 nest::@3/(byte~) nest::j#3 )
*((word) 1024) ← (byte) nest::j#2
(byte) nest::j#1 ← -- (byte) nest::j#2
if((byte) nest::j#1>(byte) 0) goto nest::@3
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
return
to:@return
nest::@3: from nest::@1
nest::@3: scope:[nest] from nest::@1
(byte~) nest::j#3 ← (byte) nest::j#1
to:nest::@1
@ -603,38 +603,38 @@ Propagating live ranges...
Propagated main::i#2 through call [2] call nest param-assignment
Propagating live ranges...
CONTROL FLOW GRAPH - LIVE RANGES
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@4
main::@1: scope:[main] from main main::@4
[1] (byte) main::i#2 ← phi( main/(byte) 100 main::@4/(byte~) main::i#4 ) [ main::i#2 ]
[2] call nest param-assignment [ main::i#2 ]
to:main::@3
main::@3: from main::@1
main::@3: scope:[main] from main::@1
[3] (byte) main::i#1 ← -- (byte) main::i#2 [ main::i#1 ]
[4] if((byte) main::i#1>(byte) 0) goto main::@4 [ main::i#1 ]
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
[5] return [ ]
to:@return
main::@4: from main::@3
main::@4: scope:[main] from main::@3
[6] (byte~) main::i#4 ← (byte) main::i#1 [ main::i#4 ]
to:main::@1
nest: from main::@1
nest: scope:[nest] from main::@1
to:nest::@1
nest::@1: from nest nest::@3
nest::@1: scope:[nest] from nest nest::@3
[7] (byte) nest::j#2 ← phi( nest/(byte) 100 nest::@3/(byte~) nest::j#3 ) [ main::i#2 nest::j#2 ]
[8] *((word) 1024) ← (byte) nest::j#2 [ main::i#2 nest::j#2 ]
[9] (byte) nest::j#1 ← -- (byte) nest::j#2 [ main::i#2 nest::j#1 ]
[10] if((byte) nest::j#1>(byte) 0) goto nest::@3 [ main::i#2 nest::j#1 ]
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
[11] return [ main::i#2 ]
to:@return
nest::@3: from nest::@1
nest::@3: scope:[nest] from nest::@1
[12] (byte~) nest::j#3 ← (byte) nest::j#1 [ main::i#2 nest::j#3 ]
to:nest::@1
@ -654,32 +654,32 @@ Propagating live ranges...
Propagated main::i#2 through call [2] call nest param-assignment
Propagating live ranges...
CONTROL FLOW GRAPH - PHI MEM COALESCED
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@3
main::@1: scope:[main] from main main::@3
[1] (byte) main::i#2 ← phi( main/(byte) 100 main::@3/(byte) main::i#1 ) [ main::i#2 ]
[2] call nest param-assignment [ main::i#2 ]
to:main::@3
main::@3: from main::@1
main::@3: scope:[main] from main::@1
[3] (byte) main::i#1 ← -- (byte) main::i#2 [ main::i#1 ]
[4] if((byte) main::i#1>(byte) 0) goto main::@1 [ main::i#1 ]
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
[5] return [ ]
to:@return
nest: from main::@1
nest: scope:[nest] from main::@1
to:nest::@1
nest::@1: from nest nest::@1
nest::@1: scope:[nest] from nest nest::@1
[6] (byte) nest::j#2 ← phi( nest/(byte) 100 nest::@1/(byte) nest::j#1 ) [ main::i#2 nest::j#2 ]
[7] *((word) 1024) ← (byte) nest::j#2 [ main::i#2 nest::j#2 ]
[8] (byte) nest::j#1 ← -- (byte) nest::j#2 [ main::i#2 nest::j#1 ]
[9] if((byte) nest::j#1>(byte) 0) goto nest::@1 [ main::i#2 nest::j#1 ]
to:nest::@return
nest::@return: from nest::@1
nest::@return: scope:[nest] from nest::@1
[10] return [ main::i#2 ]
to:@return

View File

@ -1,62 +1,62 @@
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@3
main::@1: scope:[main] from main main::@3
[1] (byte) main::i#2 ← phi( main/(byte) 100 main::@3/(byte) main::i#1 ) [ main::i#2 ]
to:main::@2
main::@2: from main::@1 main::@5
main::@2: scope:[main] from main::@1 main::@5
[2] (byte) main::j#2 ← phi( main::@1/(byte) 100 main::@5/(byte) main::j#1 ) [ main::j#2 main::i#2 ]
[3] call nest1 param-assignment [ main::j#2 main::i#2 ]
to:main::@5
main::@5: from main::@2
main::@5: scope:[main] from main::@2
[4] (byte) main::j#1 ← -- (byte) main::j#2 [ main::j#1 main::i#2 ]
[5] if((byte) main::j#1>(byte) 0) goto main::@2 [ main::j#1 main::i#2 ]
to:main::@3
main::@3: from main::@5
main::@3: scope:[main] from main::@5
[6] (byte) main::i#1 ← -- (byte) main::i#2 [ main::i#1 ]
[7] if((byte) main::i#1>(byte) 0) goto main::@1 [ main::i#1 ]
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
[8] return [ ]
to:@return
nest1: from main::@2
nest1: scope:[nest1] from main::@2
to:nest1::@1
nest1::@1: from nest1 nest1::@3
nest1::@1: scope:[nest1] from nest1 nest1::@3
[9] (byte) nest1::i#2 ← phi( nest1/(byte) 100 nest1::@3/(byte) nest1::i#1 ) [ main::j#2 main::i#2 nest1::i#2 ]
to:nest1::@2
nest1::@2: from nest1::@1 nest1::@5
nest1::@2: scope:[nest1] from nest1::@1 nest1::@5
[10] (byte) nest1::j#2 ← phi( nest1::@1/(byte) 100 nest1::@5/(byte) nest1::j#1 ) [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 ]
[11] call nest2 param-assignment [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 ]
to:nest1::@5
nest1::@5: from nest1::@2
nest1::@5: scope:[nest1] from nest1::@2
[12] (byte) nest1::j#1 ← -- (byte) nest1::j#2 [ main::j#2 main::i#2 nest1::j#1 nest1::i#2 ]
[13] if((byte) nest1::j#1>(byte) 0) goto nest1::@2 [ main::j#2 main::i#2 nest1::j#1 nest1::i#2 ]
to:nest1::@3
nest1::@3: from nest1::@5
nest1::@3: scope:[nest1] from nest1::@5
[14] (byte) nest1::i#1 ← -- (byte) nest1::i#2 [ main::j#2 main::i#2 nest1::i#1 ]
[15] if((byte) nest1::i#1>(byte) 0) goto nest1::@1 [ main::j#2 main::i#2 nest1::i#1 ]
to:nest1::@return
nest1::@return: from nest1::@3
nest1::@return: scope:[nest1] from nest1::@3
[16] return [ main::j#2 main::i#2 ]
to:@return
nest2: from nest1::@2
nest2: scope:[nest2] from nest1::@2
to:nest2::@1
nest2::@1: from nest2 nest2::@3
nest2::@1: scope:[nest2] from nest2 nest2::@3
[17] (byte) nest2::i#2 ← phi( nest2/(byte) 100 nest2::@3/(byte) nest2::i#1 ) [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::i#2 ]
to:nest2::@2
nest2::@2: from nest2::@1 nest2::@2
nest2::@2: scope:[nest2] from nest2::@1 nest2::@2
[18] (byte) nest2::j#2 ← phi( nest2::@1/(byte) 100 nest2::@2/(byte) nest2::j#1 ) [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#2 nest2::i#2 ]
[19] *((word) 1024) ← (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#2 nest2::i#2 ]
[20] (byte) nest2::j#1 ← -- (byte) nest2::j#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#1 nest2::i#2 ]
[21] if((byte) nest2::j#1>(byte) 0) goto nest2::@2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::j#1 nest2::i#2 ]
to:nest2::@3
nest2::@3: from nest2::@2
nest2::@3: scope:[nest2] from nest2::@2
[22] (byte) nest2::i#1 ← -- (byte) nest2::i#2 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::i#1 ]
[23] if((byte) nest2::i#1>(byte) 0) goto nest2::@1 [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 nest2::i#1 ]
to:nest2::@return
nest2::@return: from nest2::@3
nest2::@return: scope:[nest2] from nest2::@3
[24] return [ main::j#2 main::i#2 nest1::j#2 nest1::i#2 ]
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -11,17 +11,17 @@ main: {
bne b2
breturn:
rts
b2:
cpx #$32
beq !+
bcs b4
!:
b5:
dey
b1_from_b5:
jmp b1
b4:
iny
b1_from_b4:
jmp b1
}
b2:
cpx #$32
beq !+
bcs b4
!:
b5:
dey
b1_from_b5:
jmp b1
b4:
iny
b1_from_b4:
jmp b1

View File

@ -1,24 +1,24 @@
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@4 main::@5
main::@1: scope:[main] from main main::@4 main::@5
[1] (byte) main::s#3 ← phi( main/(byte) 0 main::@4/(byte) main::s#1 main::@5/(byte) main::s#2 ) [ main::i#2 main::s#3 ]
[1] (byte) main::i#2 ← phi( main/(byte) 100 main::@4/(byte) main::i#1 main::@5/(byte) main::i#1 ) [ main::i#2 main::s#3 ]
[2] (byte) main::i#1 ← -- (byte) main::i#2 [ main::i#1 main::s#3 ]
[3] if((byte) main::i#1>(byte) 0) goto main::@2 [ main::i#1 main::s#3 ]
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
[4] return [ ]
to:@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
[5] if((byte) main::i#1>(byte) 50) goto main::@4 [ main::i#1 main::s#3 ]
to:main::@5
main::@5: from main::@2
main::@5: scope:[main] from main::@2
[6] (byte) main::s#2 ← -- (byte) main::s#3 [ main::i#1 main::s#2 ]
to:main::@1
main::@4: from main::@2
main::@4: scope:[main] from main::@2
[7] (byte) main::s#1 ← ++ (byte) main::s#3 [ main::i#1 main::s#1 ]
to:main::@1

View File

@ -57,50 +57,50 @@ SYMBOLS
(byte) main::s
INITIAL CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(void~) $0 ← call main
to:@1
main: from
main: scope:[main] from
(byte) main::i ← (byte) 100
(byte) main::s ← (byte) 0
to:main::@1
main::@1: from main main::@6
main::@1: scope:[main] from main main::@6
(byte) main::i ← -- (byte) main::i
(boolean~) main::$0 ← (byte) main::i > (byte) 0
if((boolean~) main::$0) goto main::@2
to:main::@7
main::@2: from main::@1 main::@8
main::@2: scope:[main] from main::@1 main::@8
(boolean~) main::$1 ← (byte) main::i > (byte) 50
if((boolean~) main::$1) goto main::@4
to:main::@9
main::@7: from main::@1
main::@7: scope:[main] from main::@1
to:main::@3
main::@3: from main::@12 main::@7
main::@3: scope:[main] from main::@12 main::@7
to:main::@return
main::@8: from
main::@8: scope:[main] from
to:main::@2
main::@4: from main::@10 main::@2
main::@4: scope:[main] from main::@10 main::@2
(byte) main::s ← ++ (byte) main::s
to:main::@6
main::@9: from main::@2
main::@9: scope:[main] from main::@2
to:main::@5
main::@5: from main::@11 main::@9
main::@5: scope:[main] from main::@11 main::@9
(byte) main::s ← -- (byte) main::s
to:main::@6
main::@10: from
main::@10: scope:[main] from
to:main::@4
main::@6: from main::@4 main::@5
main::@6: scope:[main] from main::@4 main::@5
to:main::@1
main::@11: from
main::@11: scope:[main] from
to:main::@5
main::@12: from
main::@12: scope:[main] from
to:main::@3
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
@1: from @begin
@1: scope:[] from @begin
to:@end
@end: from @1
@end: scope:[] from @1
Removing empty block main::@7
Removing empty block main::@3
@ -112,306 +112,306 @@ Removing empty block main::@11
Removing empty block main::@12
Removing empty block @1
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(void~) $0 ← call main
to:@end
main: from
main: scope:[main] from
(byte) main::i ← (byte) 100
(byte) main::s ← (byte) 0
to:main::@1
main::@1: from main main::@4 main::@5
main::@1: scope:[main] from main main::@4 main::@5
(byte) main::i ← -- (byte) main::i
(boolean~) main::$0 ← (byte) main::i > (byte) 0
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(boolean~) main::$1 ← (byte) main::i > (byte) 50
if((boolean~) main::$1) goto main::@4
to:main::@5
main::@4: from main::@2
main::@4: scope:[main] from main::@2
(byte) main::s ← ++ (byte) main::s
to:main::@1
main::@5: from main::@2
main::@5: scope:[main] from main::@2
(byte) main::s ← -- (byte) main::s
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
PROCEDURE MODIFY VARIABLE ANALYSIS
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
@begin: from
@begin: scope:[] from
call main param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte) main::i ← (byte) 100
(byte) main::s ← (byte) 0
to:main::@1
main::@1: from main main::@4 main::@5
main::@1: scope:[main] from main main::@4 main::@5
(byte) main::i ← -- (byte) main::i
(boolean~) main::$0 ← (byte) main::i > (byte) 0
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(boolean~) main::$1 ← (byte) main::i > (byte) 50
if((boolean~) main::$1) goto main::@4
to:main::@5
main::@4: from main::@2
main::@4: scope:[main] from main::@2
(byte) main::s ← ++ (byte) main::s
to:main::@1
main::@5: from main::@2
main::@5: scope:[main] from main::@2
(byte) main::s ← -- (byte) main::s
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @2
@end: scope:[] from @2
Completing Phi functions...
Completing Phi functions...
Completing Phi functions...
CONTROL FLOW GRAPH SSA
@begin: from
@begin: scope:[] from
call main param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte) main::i#0 ← (byte) 100
(byte) main::s#0 ← (byte) 0
to:main::@1
main::@1: from main main::@4 main::@5
main::@1: scope:[main] from main main::@4 main::@5
(byte) main::s#6 ← phi( main/(byte) main::s#0 main::@4/(byte) main::s#1 main::@5/(byte) main::s#2 )
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@4/(byte) main::i#4 main::@5/(byte) main::i#5 )
(byte) main::i#1 ← -- (byte) main::i#2
(boolean~) main::$0 ← (byte) main::i#1 > (byte) 0
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) main::s#5 ← phi( main::@1/(byte) main::s#6 )
(byte) main::i#3 ← phi( main::@1/(byte) main::i#1 )
(boolean~) main::$1 ← (byte) main::i#3 > (byte) 50
if((boolean~) main::$1) goto main::@4
to:main::@5
main::@4: from main::@2
main::@4: scope:[main] from main::@2
(byte) main::i#4 ← phi( main::@2/(byte) main::i#3 )
(byte) main::s#3 ← phi( main::@2/(byte) main::s#5 )
(byte) main::s#1 ← ++ (byte) main::s#3
to:main::@1
main::@5: from main::@2
main::@5: scope:[main] from main::@2
(byte) main::i#5 ← phi( main::@2/(byte) main::i#3 )
(byte) main::s#4 ← phi( main::@2/(byte) main::s#5 )
(byte) main::s#2 ← -- (byte) main::s#4
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @2
@end: scope:[] from @2
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
@begin: from
@begin: scope:[] from
call main param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte) main::i#0 ← (byte) 100
(byte) main::s#0 ← (byte) 0
to:main::@1
main::@1: from main main::@4 main::@5
main::@1: scope:[main] from main main::@4 main::@5
(byte) main::s#6 ← phi( main/(byte) main::s#0 main::@4/(byte) main::s#1 main::@5/(byte) main::s#2 )
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@4/(byte) main::i#4 main::@5/(byte) main::i#5 )
(byte) main::i#1 ← -- (byte) main::i#2
(boolean~) main::$0 ← (byte) main::i#1 > (byte) 0
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) main::s#5 ← phi( main::@1/(byte) main::s#6 )
(byte) main::i#3 ← phi( main::@1/(byte) main::i#1 )
(boolean~) main::$1 ← (byte) main::i#3 > (byte) 50
if((boolean~) main::$1) goto main::@4
to:main::@5
main::@4: from main::@2
main::@4: scope:[main] from main::@2
(byte) main::i#4 ← phi( main::@2/(byte) main::i#3 )
(byte) main::s#3 ← phi( main::@2/(byte) main::s#5 )
(byte) main::s#1 ← ++ (byte) main::s#3
to:main::@1
main::@5: from main::@2
main::@5: scope:[main] from main::@2
(byte) main::i#5 ← phi( main::@2/(byte) main::i#3 )
(byte) main::s#4 ← phi( main::@2/(byte) main::s#5 )
(byte) main::s#2 ← -- (byte) main::s#4
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @2
@end: scope:[] from @2
Culled Empty Block (label) @2
Succesful SSA optimization Pass2CullEmptyBlocks
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
(byte) main::i#0 ← (byte) 100
(byte) main::s#0 ← (byte) 0
to:main::@1
main::@1: from main main::@4 main::@5
main::@1: scope:[main] from main main::@4 main::@5
(byte) main::s#6 ← phi( main/(byte) main::s#0 main::@4/(byte) main::s#1 main::@5/(byte) main::s#2 )
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@4/(byte) main::i#4 main::@5/(byte) main::i#5 )
(byte) main::i#1 ← -- (byte) main::i#2
(boolean~) main::$0 ← (byte) main::i#1 > (byte) 0
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) main::s#5 ← phi( main::@1/(byte) main::s#6 )
(byte) main::i#3 ← phi( main::@1/(byte) main::i#1 )
(boolean~) main::$1 ← (byte) main::i#3 > (byte) 50
if((boolean~) main::$1) goto main::@4
to:main::@5
main::@4: from main::@2
main::@4: scope:[main] from main::@2
(byte) main::i#4 ← phi( main::@2/(byte) main::i#3 )
(byte) main::s#3 ← phi( main::@2/(byte) main::s#5 )
(byte) main::s#1 ← ++ (byte) main::s#3
to:main::@1
main::@5: from main::@2
main::@5: scope:[main] from main::@2
(byte) main::i#5 ← phi( main::@2/(byte) main::i#3 )
(byte) main::s#4 ← phi( main::@2/(byte) main::s#5 )
(byte) main::s#2 ← -- (byte) main::s#4
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Constant (byte) main::i#0 (byte) 100
Constant (byte) main::s#0 (byte) 0
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@4 main::@5
main::@1: scope:[main] from main main::@4 main::@5
(byte) main::s#6 ← phi( main/(byte) 0 main::@4/(byte) main::s#1 main::@5/(byte) main::s#2 )
(byte) main::i#2 ← phi( main/(byte) 100 main::@4/(byte) main::i#4 main::@5/(byte) main::i#5 )
(byte) main::i#1 ← -- (byte) main::i#2
(boolean~) main::$0 ← (byte) main::i#1 > (byte) 0
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) main::s#5 ← phi( main::@1/(byte) main::s#6 )
(byte) main::i#3 ← phi( main::@1/(byte) main::i#1 )
(boolean~) main::$1 ← (byte) main::i#3 > (byte) 50
if((boolean~) main::$1) goto main::@4
to:main::@5
main::@4: from main::@2
main::@4: scope:[main] from main::@2
(byte) main::i#4 ← phi( main::@2/(byte) main::i#3 )
(byte) main::s#3 ← phi( main::@2/(byte) main::s#5 )
(byte) main::s#1 ← ++ (byte) main::s#3
to:main::@1
main::@5: from main::@2
main::@5: scope:[main] from main::@2
(byte) main::i#5 ← phi( main::@2/(byte) main::i#3 )
(byte) main::s#4 ← phi( main::@2/(byte) main::s#5 )
(byte) main::s#2 ← -- (byte) main::s#4
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Alias (byte) main::i#1 = (byte) main::i#3 (byte) main::i#4 (byte) main::i#5
Alias (byte) main::s#3 = (byte) main::s#5 (byte) main::s#6 (byte) main::s#4
Succesful SSA optimization Pass2AliasElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@4 main::@5
main::@1: scope:[main] from main main::@4 main::@5
(byte) main::s#3 ← phi( main/(byte) 0 main::@4/(byte) main::s#1 main::@5/(byte) main::s#2 )
(byte) main::i#2 ← phi( main/(byte) 100 main::@4/(byte) main::i#1 main::@5/(byte) main::i#1 )
(byte) main::i#1 ← -- (byte) main::i#2
(boolean~) main::$0 ← (byte) main::i#1 > (byte) 0
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(boolean~) main::$1 ← (byte) main::i#1 > (byte) 50
if((boolean~) main::$1) goto main::@4
to:main::@5
main::@4: from main::@2
main::@4: scope:[main] from main::@2
(byte) main::s#1 ← ++ (byte) main::s#3
to:main::@1
main::@5: from main::@2
main::@5: scope:[main] from main::@2
(byte) main::s#2 ← -- (byte) main::s#3
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Simple Condition (boolean~) main::$0 if((byte) main::i#1>(byte) 0) goto main::@2
Simple Condition (boolean~) main::$1 if((byte) main::i#1>(byte) 50) goto main::@4
Succesful SSA optimization Pass2ConditionalJumpSimplification
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@4 main::@5
main::@1: scope:[main] from main main::@4 main::@5
(byte) main::s#3 ← phi( main/(byte) 0 main::@4/(byte) main::s#1 main::@5/(byte) main::s#2 )
(byte) main::i#2 ← phi( main/(byte) 100 main::@4/(byte) main::i#1 main::@5/(byte) main::i#1 )
(byte) main::i#1 ← -- (byte) main::i#2
if((byte) main::i#1>(byte) 0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
if((byte) main::i#1>(byte) 50) goto main::@4
to:main::@5
main::@4: from main::@2
main::@4: scope:[main] from main::@2
(byte) main::s#1 ← ++ (byte) main::s#3
to:main::@1
main::@5: from main::@2
main::@5: scope:[main] from main::@2
(byte) main::s#2 ← -- (byte) main::s#3
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Block Sequence Planned @begin @end main main::@1 main::@return main::@2 main::@5 main::@4
Block Sequence Planned @begin @end main main::@1 main::@return main::@2 main::@5 main::@4
CONTROL FLOW GRAPH - PHI LIFTED
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@4 main::@5
main::@1: scope:[main] from main main::@4 main::@5
(byte) main::s#3 ← phi( main/(byte) 0 main::@4/(byte~) main::s#7 main::@5/(byte~) main::s#8 )
(byte) main::i#2 ← phi( main/(byte) 100 main::@4/(byte~) main::i#6 main::@5/(byte~) main::i#7 )
(byte) main::i#1 ← -- (byte) main::i#2
if((byte) main::i#1>(byte) 0) goto main::@2
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
if((byte) main::i#1>(byte) 50) goto main::@4
to:main::@5
main::@5: from main::@2
main::@5: scope:[main] from main::@2
(byte) main::s#2 ← -- (byte) main::s#3
(byte~) main::i#7 ← (byte) main::i#1
(byte~) main::s#8 ← (byte) main::s#2
to:main::@1
main::@4: from main::@2
main::@4: scope:[main] from main::@2
(byte) main::s#1 ← ++ (byte) main::s#3
(byte~) main::i#6 ← (byte) main::i#1
(byte~) main::s#7 ← (byte) main::s#1
@ -422,30 +422,30 @@ Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
CONTROL FLOW GRAPH - LIVE RANGES
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@4 main::@5
main::@1: scope:[main] from main main::@4 main::@5
[1] (byte) main::s#3 ← phi( main/(byte) 0 main::@4/(byte~) main::s#7 main::@5/(byte~) main::s#8 ) [ main::i#2 main::s#3 ]
[1] (byte) main::i#2 ← phi( main/(byte) 100 main::@4/(byte~) main::i#6 main::@5/(byte~) main::i#7 ) [ main::i#2 main::s#3 ]
[2] (byte) main::i#1 ← -- (byte) main::i#2 [ main::i#1 main::s#3 ]
[3] if((byte) main::i#1>(byte) 0) goto main::@2 [ main::i#1 main::s#3 ]
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
[4] return [ ]
to:@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
[5] if((byte) main::i#1>(byte) 50) goto main::@4 [ main::i#1 main::s#3 ]
to:main::@5
main::@5: from main::@2
main::@5: scope:[main] from main::@2
[6] (byte) main::s#2 ← -- (byte) main::s#3 [ main::i#1 main::s#2 ]
[7] (byte~) main::i#7 ← (byte) main::i#1 [ main::i#7 main::s#2 ]
[8] (byte~) main::s#8 ← (byte) main::s#2 [ main::i#7 main::s#8 ]
to:main::@1
main::@4: from main::@2
main::@4: scope:[main] from main::@2
[9] (byte) main::s#1 ← ++ (byte) main::s#3 [ main::i#1 main::s#1 ]
[10] (byte~) main::i#6 ← (byte) main::i#1 [ main::i#6 main::s#1 ]
[11] (byte~) main::s#7 ← (byte) main::s#1 [ main::i#6 main::s#7 ]
@ -463,28 +463,28 @@ Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
CONTROL FLOW GRAPH - PHI MEM COALESCED
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@4 main::@5
main::@1: scope:[main] from main main::@4 main::@5
[1] (byte) main::s#3 ← phi( main/(byte) 0 main::@4/(byte) main::s#1 main::@5/(byte) main::s#2 ) [ main::i#2 main::s#3 ]
[1] (byte) main::i#2 ← phi( main/(byte) 100 main::@4/(byte) main::i#1 main::@5/(byte) main::i#1 ) [ main::i#2 main::s#3 ]
[2] (byte) main::i#1 ← -- (byte) main::i#2 [ main::i#1 main::s#3 ]
[3] if((byte) main::i#1>(byte) 0) goto main::@2 [ main::i#1 main::s#3 ]
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
[4] return [ ]
to:@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
[5] if((byte) main::i#1>(byte) 50) goto main::@4 [ main::i#1 main::s#3 ]
to:main::@5
main::@5: from main::@2
main::@5: scope:[main] from main::@2
[6] (byte) main::s#2 ← -- (byte) main::s#3 [ main::i#1 main::s#2 ]
to:main::@1
main::@4: from main::@2
main::@4: scope:[main] from main::@2
[7] (byte) main::s#1 ← ++ (byte) main::s#3 [ main::i#1 main::s#1 ]
to:main::@1
@ -565,34 +565,34 @@ main: {
breturn:
//SEG11 [4] return [ ]
rts
//SEG12 main::@2
b2:
//SEG13 [5] if((byte) main::i#1>(byte) 50) goto main::@4 [ main::i#1 main::s#3 ] -- zpby1_gt_coby1_then_la1
lda $2
cmp #$32
beq !+
bcs b4
!:
jmp b5
//SEG14 main::@5
b5:
//SEG15 [6] (byte) main::s#2 ← -- (byte) main::s#3 [ main::i#1 main::s#2 ] -- zpby1=_dec_zpby1
dec $3
//SEG16 [1] phi from main::@5 to main::@1
b1_from_b5:
//SEG17 [1] phi (byte) main::s#3 = (byte) main::s#2 -- register_copy
//SEG18 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
//SEG19 main::@4
b4:
//SEG20 [7] (byte) main::s#1 ← ++ (byte) main::s#3 [ main::i#1 main::s#1 ] -- zpby1=_inc_zpby1
inc $3
//SEG21 [1] phi from main::@4 to main::@1
b1_from_b4:
//SEG22 [1] phi (byte) main::s#3 = (byte) main::s#1 -- register_copy
//SEG23 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
}
//SEG12 main::@2
b2:
//SEG13 [5] if((byte) main::i#1>(byte) 50) goto main::@4 [ main::i#1 main::s#3 ] -- zpby1_gt_coby1_then_la1
lda $2
cmp #$32
beq !+
bcs b4
!:
jmp b5
//SEG14 main::@5
b5:
//SEG15 [6] (byte) main::s#2 ← -- (byte) main::s#3 [ main::i#1 main::s#2 ] -- zpby1=_dec_zpby1
dec $3
//SEG16 [1] phi from main::@5 to main::@1
b1_from_b5:
//SEG17 [1] phi (byte) main::s#3 = (byte) main::s#2 -- register_copy
//SEG18 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
//SEG19 main::@4
b4:
//SEG20 [7] (byte) main::s#1 ← ++ (byte) main::s#3 [ main::i#1 main::s#1 ] -- zpby1=_inc_zpby1
inc $3
//SEG21 [1] phi from main::@4 to main::@1
b1_from_b4:
//SEG22 [1] phi (byte) main::s#3 = (byte) main::s#1 -- register_copy
//SEG23 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp byte:2 [ main::i#2 main::i#1 ] : zp byte:2 , reg byte a , reg byte x , reg byte y ,
@ -635,32 +635,32 @@ main: {
breturn:
//SEG11 [4] return [ ]
rts
//SEG12 main::@2
b2:
//SEG13 [5] if((byte) main::i#1>(byte) 50) goto main::@4 [ main::i#1 main::s#3 ] -- xby_gt_coby1_then_la1
cpx #$32
beq !+
bcs b4
!:
//SEG14 main::@5
b5:
//SEG15 [6] (byte) main::s#2 ← -- (byte) main::s#3 [ main::i#1 main::s#2 ] -- yby=_dec_yby
dey
//SEG16 [1] phi from main::@5 to main::@1
b1_from_b5:
//SEG17 [1] phi (byte) main::s#3 = (byte) main::s#2 -- register_copy
//SEG18 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
//SEG19 main::@4
b4:
//SEG20 [7] (byte) main::s#1 ← ++ (byte) main::s#3 [ main::i#1 main::s#1 ] -- yby=_inc_yby
iny
//SEG21 [1] phi from main::@4 to main::@1
b1_from_b4:
//SEG22 [1] phi (byte) main::s#3 = (byte) main::s#1 -- register_copy
//SEG23 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
}
//SEG12 main::@2
b2:
//SEG13 [5] if((byte) main::i#1>(byte) 50) goto main::@4 [ main::i#1 main::s#3 ] -- xby_gt_coby1_then_la1
cpx #$32
beq !+
bcs b4
!:
//SEG14 main::@5
b5:
//SEG15 [6] (byte) main::s#2 ← -- (byte) main::s#3 [ main::i#1 main::s#2 ] -- yby=_dec_yby
dey
//SEG16 [1] phi from main::@5 to main::@1
b1_from_b5:
//SEG17 [1] phi (byte) main::s#3 = (byte) main::s#2 -- register_copy
//SEG18 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
//SEG19 main::@4
b4:
//SEG20 [7] (byte) main::s#1 ← ++ (byte) main::s#3 [ main::i#1 main::s#1 ] -- yby=_inc_yby
iny
//SEG21 [1] phi from main::@4 to main::@1
b1_from_b4:
//SEG22 [1] phi (byte) main::s#3 = (byte) main::s#1 -- register_copy
//SEG23 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
FINAL SYMBOL TABLE
(label) @begin
@ -708,30 +708,30 @@ main: {
breturn:
//SEG11 [4] return [ ]
rts
//SEG12 main::@2
b2:
//SEG13 [5] if((byte) main::i#1>(byte) 50) goto main::@4 [ main::i#1 main::s#3 ] -- xby_gt_coby1_then_la1
cpx #$32
beq !+
bcs b4
!:
//SEG14 main::@5
b5:
//SEG15 [6] (byte) main::s#2 ← -- (byte) main::s#3 [ main::i#1 main::s#2 ] -- yby=_dec_yby
dey
//SEG16 [1] phi from main::@5 to main::@1
b1_from_b5:
//SEG17 [1] phi (byte) main::s#3 = (byte) main::s#2 -- register_copy
//SEG18 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
//SEG19 main::@4
b4:
//SEG20 [7] (byte) main::s#1 ← ++ (byte) main::s#3 [ main::i#1 main::s#1 ] -- yby=_inc_yby
iny
//SEG21 [1] phi from main::@4 to main::@1
b1_from_b4:
//SEG22 [1] phi (byte) main::s#3 = (byte) main::s#1 -- register_copy
//SEG23 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
}
//SEG12 main::@2
b2:
//SEG13 [5] if((byte) main::i#1>(byte) 50) goto main::@4 [ main::i#1 main::s#3 ] -- xby_gt_coby1_then_la1
cpx #$32
beq !+
bcs b4
!:
//SEG14 main::@5
b5:
//SEG15 [6] (byte) main::s#2 ← -- (byte) main::s#3 [ main::i#1 main::s#2 ] -- yby=_dec_yby
dey
//SEG16 [1] phi from main::@5 to main::@1
b1_from_b5:
//SEG17 [1] phi (byte) main::s#3 = (byte) main::s#2 -- register_copy
//SEG18 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
//SEG19 main::@4
b4:
//SEG20 [7] (byte) main::s#1 ← ++ (byte) main::s#3 [ main::i#1 main::s#1 ] -- yby=_inc_yby
iny
//SEG21 [1] phi from main::@4 to main::@1
b1_from_b4:
//SEG22 [1] phi (byte) main::s#3 = (byte) main::s#1 -- register_copy
//SEG23 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1

View File

@ -1,10 +1,10 @@
@begin: from
@begin: scope:[] from
to:@1
@1: from @1 @begin
@1: scope:[] from @1 @begin
[0] (byte) i#2 ← phi( @1/(byte) i#1 @begin/(byte) 5 ) [ i#2 ]
[1] (byte~) $1 ← (byte) i#2 + (byte) 4 [ i#2 $1 ]
[2] *((word) 4352 + (byte) i#2) ← (byte~) $1 [ i#2 ]
[3] (byte) i#1 ← (byte) i#2 + (byte) 1 [ i#1 ]
[4] if((byte) i#1<(byte) 10) goto @1 [ i#1 ]
to:@end
@end: from @1
@end: scope:[] from @1

View File

@ -27,11 +27,11 @@ SYMBOLS
(byte[16]) p
INITIAL CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte[16]) p ← (word) 4352
(byte) i ← (byte) 5
to:@1
@1: from @1 @begin
@1: scope:[] from @1 @begin
(byte~) $0 ← (byte) 2 + (byte) i
(byte~) $1 ← (byte~) $0 + (byte) 2
*((byte[16]) p + (byte) i) ← (byte~) $1
@ -40,17 +40,17 @@ INITIAL CONTROL FLOW GRAPH
(boolean~) $3 ← (byte) i < (byte) 10
if((boolean~) $3) goto @1
to:@2
@2: from @1
@2: scope:[] from @1
to:@end
@end: from @2
@end: scope:[] from @2
Removing empty block @2
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte[16]) p ← (word) 4352
(byte) i ← (byte) 5
to:@1
@1: from @1 @begin
@1: scope:[] from @1 @begin
(byte~) $0 ← (byte) 2 + (byte) i
(byte~) $1 ← (byte~) $0 + (byte) 2
*((byte[16]) p + (byte) i) ← (byte~) $1
@ -59,16 +59,16 @@ CONTROL FLOW GRAPH
(boolean~) $3 ← (byte) i < (byte) 10
if((boolean~) $3) goto @1
to:@end
@end: from @1
@end: scope:[] from @1
PROCEDURE MODIFY VARIABLE ANALYSIS
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
@begin: from
@begin: scope:[] from
(byte[16]) p ← (word) 4352
(byte) i ← (byte) 5
to:@1
@1: from @1 @begin
@1: scope:[] from @1 @begin
(byte~) $0 ← (byte) 2 + (byte) i
(byte~) $1 ← (byte~) $0 + (byte) 2
*((byte[16]) p + (byte) i) ← (byte~) $1
@ -77,15 +77,15 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
(boolean~) $3 ← (byte) i < (byte) 10
if((boolean~) $3) goto @1
to:@end
@end: from @1
@end: scope:[] from @1
Completing Phi functions...
CONTROL FLOW GRAPH SSA
@begin: from
@begin: scope:[] from
(byte[16]) p#0 ← (word) 4352
(byte) i#0 ← (byte) 5
to:@1
@1: from @1 @begin
@1: scope:[] from @1 @begin
(byte[16]) p#1 ← phi( @1/(byte[16]) p#1 @begin/(byte[16]) p#0 )
(byte) i#2 ← phi( @1/(byte) i#1 @begin/(byte) i#0 )
(byte~) $0 ← (byte) 2 + (byte) i#2
@ -96,14 +96,14 @@ CONTROL FLOW GRAPH SSA
(boolean~) $3 ← (byte) i#1 < (byte) 10
if((boolean~) $3) goto @1
to:@end
@end: from @1
@end: scope:[] from @1
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
@begin: from
@begin: scope:[] from
(byte[16]) p#0 ← (word) 4352
(byte) i#0 ← (byte) 5
to:@1
@1: from @1 @begin
@1: scope:[] from @1 @begin
(byte[16]) p#1 ← phi( @1/(byte[16]) p#1 @begin/(byte[16]) p#0 )
(byte) i#2 ← phi( @1/(byte) i#1 @begin/(byte) i#0 )
(byte~) $0 ← (byte) 2 + (byte) i#2
@ -114,15 +114,15 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
(boolean~) $3 ← (byte) i#1 < (byte) 10
if((boolean~) $3) goto @1
to:@end
@end: from @1
@end: scope:[] from @1
Constant (byte[16]) p#0 (word) 4352
Constant (byte) i#0 (byte) 5
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
to:@1
@1: from @1 @begin
@1: scope:[] from @1 @begin
(byte[16]) p#1 ← phi( @1/(byte[16]) p#1 @begin/(word) 4352 )
(byte) i#2 ← phi( @1/(byte) i#1 @begin/(byte) 5 )
(byte~) $0 ← (byte) 2 + (byte) i#2
@ -133,16 +133,16 @@ CONTROL FLOW GRAPH
(boolean~) $3 ← (byte) i#1 < (byte) 10
if((boolean~) $3) goto @1
to:@end
@end: from @1
@end: scope:[] from @1
Multiple usages for variable. Not optimizing sub-constant (byte) i#2
Consolidated constant in assignment $1
Multiple usages for variable. Not optimizing sub-constant (byte) i#2
Succesful SSA optimization Pass2ConstantAdditionElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
to:@1
@1: from @1 @begin
@1: scope:[] from @1 @begin
(byte[16]) p#1 ← phi( @1/(byte[16]) p#1 @begin/(word) 4352 )
(byte) i#2 ← phi( @1/(byte) i#1 @begin/(byte) 5 )
(byte~) $0 ← (byte) i#2
@ -153,15 +153,15 @@ CONTROL FLOW GRAPH
(boolean~) $3 ← (byte) i#1 < (byte) 10
if((boolean~) $3) goto @1
to:@end
@end: from @1
@end: scope:[] from @1
Alias (byte) i#2 = (byte~) $0
Alias (byte) i#1 = (byte~) $2
Succesful SSA optimization Pass2AliasElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
to:@1
@1: from @1 @begin
@1: scope:[] from @1 @begin
(byte[16]) p#1 ← phi( @1/(byte[16]) p#1 @begin/(word) 4352 )
(byte) i#2 ← phi( @1/(byte) i#1 @begin/(byte) 5 )
(byte~) $1 ← (byte) i#2 + (byte) 4
@ -170,14 +170,14 @@ CONTROL FLOW GRAPH
(boolean~) $3 ← (byte) i#1 < (byte) 10
if((boolean~) $3) goto @1
to:@end
@end: from @1
@end: scope:[] from @1
Self Phi Eliminated (byte[16]) p#1
Succesful SSA optimization Pass2SelfPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
to:@1
@1: from @1 @begin
@1: scope:[] from @1 @begin
(byte[16]) p#1 ← phi( @begin/(word) 4352 )
(byte) i#2 ← phi( @1/(byte) i#1 @begin/(byte) 5 )
(byte~) $1 ← (byte) i#2 + (byte) 4
@ -186,14 +186,14 @@ CONTROL FLOW GRAPH
(boolean~) $3 ← (byte) i#1 < (byte) 10
if((boolean~) $3) goto @1
to:@end
@end: from @1
@end: scope:[] from @1
Simple Condition (boolean~) $3 if((byte) i#1<(byte) 10) goto @1
Succesful SSA optimization Pass2ConditionalJumpSimplification
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
to:@1
@1: from @1 @begin
@1: scope:[] from @1 @begin
(byte[16]) p#1 ← phi( @begin/(word) 4352 )
(byte) i#2 ← phi( @1/(byte) i#1 @begin/(byte) 5 )
(byte~) $1 ← (byte) i#2 + (byte) 4
@ -201,21 +201,21 @@ CONTROL FLOW GRAPH
(byte) i#1 ← (byte) i#2 + (byte) 1
if((byte) i#1<(byte) 10) goto @1
to:@end
@end: from @1
@end: scope:[] from @1
Constant (byte[16]) p#1 (word) 4352
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
to:@1
@1: from @1 @begin
@1: scope:[] from @1 @begin
(byte) i#2 ← phi( @1/(byte) i#1 @begin/(byte) 5 )
(byte~) $1 ← (byte) i#2 + (byte) 4
*((word) 4352 + (byte) i#2) ← (byte~) $1
(byte) i#1 ← (byte) i#2 + (byte) 1
if((byte) i#1<(byte) 10) goto @1
to:@end
@end: from @1
@end: scope:[] from @1
Multiple usages for variable. Not optimizing sub-constant (byte) i#2
Multiple usages for variable. Not optimizing sub-constant (byte) i#2
@ -227,33 +227,33 @@ Block Sequence Planned @begin @1 @end
Added new block during phi lifting @3(between @1 and @1)
Block Sequence Planned @begin @1 @end @3
CONTROL FLOW GRAPH - PHI LIFTED
@begin: from
@begin: scope:[] from
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
(byte) i#2 ← phi( @3/(byte~) i#3 @begin/(byte) 5 )
(byte~) $1 ← (byte) i#2 + (byte) 4
*((word) 4352 + (byte) i#2) ← (byte~) $1
(byte) i#1 ← (byte) i#2 + (byte) 1
if((byte) i#1<(byte) 10) goto @3
to:@end
@end: from @1
@3: from @1
@end: scope:[] from @1
@3: scope:[] from @1
(byte~) i#3 ← (byte) i#1
to:@1
Propagating live ranges...
CONTROL FLOW GRAPH - LIVE RANGES
@begin: from
@begin: scope:[] from
to:@1
@1: from @3 @begin
@1: scope:[] from @3 @begin
[0] (byte) i#2 ← phi( @3/(byte~) i#3 @begin/(byte) 5 ) [ i#2 ]
[1] (byte~) $1 ← (byte) i#2 + (byte) 4 [ i#2 $1 ]
[2] *((word) 4352 + (byte) i#2) ← (byte~) $1 [ i#2 ]
[3] (byte) i#1 ← (byte) i#2 + (byte) 1 [ i#1 ]
[4] if((byte) i#1<(byte) 10) goto @3 [ i#1 ]
to:@end
@end: from @1
@3: from @1
@end: scope:[] from @1
@3: scope:[] from @1
[5] (byte~) i#3 ← (byte) i#1 [ i#3 ]
to:@1
@ -264,16 +264,16 @@ Culled Empty Block (label) @3
Block Sequence Planned @begin @1 @end
Propagating live ranges...
CONTROL FLOW GRAPH - PHI MEM COALESCED
@begin: from
@begin: scope:[] from
to:@1
@1: from @1 @begin
@1: scope:[] from @1 @begin
[0] (byte) i#2 ← phi( @1/(byte) i#1 @begin/(byte) 5 ) [ i#2 ]
[1] (byte~) $1 ← (byte) i#2 + (byte) 4 [ i#2 $1 ]
[2] *((word) 4352 + (byte) i#2) ← (byte~) $1 [ i#2 ]
[3] (byte) i#1 ← (byte) i#2 + (byte) 1 [ i#1 ]
[4] if((byte) i#1<(byte) 10) goto @1 [ i#1 ]
to:@end
@end: from @1
@end: scope:[] from @1
CALL GRAPH

View File

@ -1,30 +1,30 @@
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] call inccnt param-assignment [ inccnt::return#0 cnt#1 cnt2#1 ]
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
[2] (byte~) main::$0 ← (byte) inccnt::return#0 [ main::$0 cnt#1 cnt2#1 ]
[3] *((word) 1024) ← (byte~) main::$0 [ cnt#1 cnt2#1 ]
[4] (byte) cnt#3 ← ++ (byte) cnt#1 [ cnt#3 cnt2#1 ]
[5] call inccnt param-assignment [ inccnt::return#0 ]
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
[6] (byte~) main::$1 ← (byte) inccnt::return#0 [ main::$1 ]
[7] *((word) 1025) ← (byte~) main::$1 [ ]
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
[8] return [ ]
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
[9] (byte) cnt2#11 ← phi( main/(byte) 0 main::@1/(byte) cnt2#1 ) [ cnt#12 cnt2#11 ]
[9] (byte) cnt#12 ← phi( main/(byte) 0 main::@1/(byte) cnt#3 ) [ cnt#12 cnt2#11 ]
[10] (byte) cnt#1 ← ++ (byte) cnt#12 [ cnt#1 cnt2#11 ]
[11] (byte) cnt2#1 ← ++ (byte) cnt2#11 [ cnt#1 cnt2#1 ]
[12] (byte) inccnt::return#0 ← (byte) cnt#1 [ inccnt::return#0 cnt#1 cnt2#1 ]
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
[13] return [ inccnt::return#0 cnt#1 cnt2#1 ]
to:@return

View File

@ -60,69 +60,69 @@ SYMBOLS
(label) main::@return
INITIAL CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) cnt ← (byte) 0
(byte) cnt2 ← (byte) 0
(byte[256]) SCREEN ← (word) 1024
(void~) $0 ← call main
to:@1
main: from
main: scope:[main] from
(byte~) main::$0 ← call inccnt
*((byte[256]) SCREEN + (byte) 0) ← (byte~) main::$0
(byte) cnt ← ++ (byte) cnt
(byte~) main::$1 ← call inccnt
*((byte[256]) SCREEN + (byte) 1) ← (byte~) main::$1
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
return
to:@return
@1: from @begin
@1: scope:[] from @begin
to:@2
inccnt: from
inccnt: scope:[inccnt] from
(byte) cnt ← ++ (byte) cnt
(byte) cnt2 ← ++ (byte) cnt2
(byte) inccnt::return ← (byte) cnt
to:inccnt::@return
inccnt::@return: from inccnt inccnt::@1
inccnt::@return: scope:[inccnt] from inccnt inccnt::@1
(byte) inccnt::return ← (byte) inccnt::return
return (byte) inccnt::return
to:@return
inccnt::@1: from
inccnt::@1: scope:[inccnt] from
to:inccnt::@return
@2: from @1
@2: scope:[] from @1
to:@end
@end: from @2
@end: scope:[] from @2
Removing empty block @1
Removing empty block inccnt::@1
Removing empty block @2
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) cnt ← (byte) 0
(byte) cnt2 ← (byte) 0
(byte[256]) SCREEN ← (word) 1024
(void~) $0 ← call main
to:@end
main: from
main: scope:[main] from
(byte~) main::$0 ← call inccnt
*((byte[256]) SCREEN + (byte) 0) ← (byte~) main::$0
(byte) cnt ← ++ (byte) cnt
(byte~) main::$1 ← call inccnt
*((byte[256]) SCREEN + (byte) 1) ← (byte~) main::$1
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
return
to:@return
inccnt: from
inccnt: scope:[inccnt] from
(byte) cnt ← ++ (byte) cnt
(byte) cnt2 ← ++ (byte) cnt2
(byte) inccnt::return ← (byte) cnt
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
(byte) inccnt::return ← (byte) inccnt::return
return (byte) inccnt::return
to:@return
@end: from @begin
@end: scope:[] from @begin
PROCEDURE MODIFY VARIABLE ANALYSIS
main modifies cnt
@ -131,20 +131,20 @@ inccnt modifies cnt
inccnt modifies cnt2
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
@begin: from
@begin: scope:[] from
(byte) cnt ← (byte) 0
(byte) cnt2 ← (byte) 0
(byte[256]) SCREEN ← (word) 1024
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
(byte) cnt ← (byte) cnt
(byte) cnt2 ← (byte) cnt2
to:@end
main: from @begin
main: scope:[main] from @begin
(byte) inccnt::return ← call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
(byte~) main::$0 ← (byte) inccnt::return
(byte) cnt ← (byte) cnt
(byte) cnt2 ← (byte) cnt2
@ -152,52 +152,52 @@ main::@1: from main
(byte) cnt ← ++ (byte) cnt
(byte) inccnt::return ← call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte~) main::$1 ← (byte) inccnt::return
(byte) cnt ← (byte) cnt
(byte) cnt2 ← (byte) cnt2
*((byte[256]) SCREEN + (byte) 1) ← (byte~) main::$1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
(byte) cnt ← (byte) cnt
(byte) cnt2 ← (byte) cnt2
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt ← ++ (byte) cnt
(byte) cnt2 ← ++ (byte) cnt2
(byte) inccnt::return ← (byte) cnt
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
(byte) inccnt::return ← (byte) inccnt::return
(byte) cnt ← (byte) cnt
(byte) cnt2 ← (byte) cnt2
return (byte) inccnt::return
to:@return
@end: from @3
@end: scope:[] from @3
Completing Phi functions...
Completing Phi functions...
CONTROL FLOW GRAPH SSA
@begin: from
@begin: scope:[] from
(byte) cnt#0 ← (byte) 0
(byte) cnt2#0 ← (byte) 0
(byte[256]) SCREEN#0 ← (word) 1024
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
(byte) cnt2#7 ← phi( @begin/(byte) cnt2#0 )
(byte) cnt#8 ← phi( @begin/(byte) cnt#0 )
(byte) cnt#1 ← (byte) cnt#8
(byte) cnt2#1 ← (byte) cnt2#7
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[256]) SCREEN#3 ← phi( @begin/(byte[256]) SCREEN#0 )
(byte) cnt2#13 ← phi( @begin/(byte) cnt2#0 )
(byte) cnt#14 ← phi( @begin/(byte) cnt#0 )
(byte) inccnt::return#0 ← call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
(byte[256]) SCREEN#1 ← phi( main/(byte[256]) SCREEN#3 )
(byte) cnt2#8 ← phi( main/(byte) cnt2#13 )
(byte) cnt#9 ← phi( main/(byte) cnt#14 )
@ -209,7 +209,7 @@ main::@1: from main
(byte) cnt#3 ← ++ (byte) cnt#2
(byte) inccnt::return#1 ← call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte[256]) SCREEN#2 ← phi( main::@1/(byte[256]) SCREEN#1 )
(byte) cnt2#9 ← phi( main::@1/(byte) cnt2#2 )
(byte) cnt#10 ← phi( main::@1/(byte) cnt#3 )
@ -219,21 +219,21 @@ main::@2: from main::@1
(byte) cnt2#3 ← (byte) cnt2#9
*((byte[256]) SCREEN#2 + (byte) 1) ← (byte~) main::$1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
(byte) cnt2#10 ← phi( main::@2/(byte) cnt2#3 )
(byte) cnt#11 ← phi( main::@2/(byte) cnt#4 )
(byte) cnt#5 ← (byte) cnt#11
(byte) cnt2#4 ← (byte) cnt2#10
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt2#11 ← phi( main/(byte) cnt2#13 main::@1/(byte) cnt2#2 )
(byte) cnt#12 ← phi( main/(byte) cnt#14 main::@1/(byte) cnt#3 )
(byte) cnt#6 ← ++ (byte) cnt#12
(byte) cnt2#5 ← ++ (byte) cnt2#11
(byte) inccnt::return#2 ← (byte) cnt#6
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
(byte) cnt2#12 ← phi( inccnt/(byte) cnt2#5 )
(byte) cnt#13 ← phi( inccnt/(byte) cnt#6 )
(byte) inccnt::return#6 ← phi( inccnt/(byte) inccnt::return#2 )
@ -242,29 +242,29 @@ inccnt::@return: from inccnt
(byte) cnt2#6 ← (byte) cnt2#12
return (byte) inccnt::return#3
to:@return
@end: from @3
@end: scope:[] from @3
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
@begin: from
@begin: scope:[] from
(byte) cnt#0 ← (byte) 0
(byte) cnt2#0 ← (byte) 0
(byte[256]) SCREEN#0 ← (word) 1024
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
(byte) cnt2#7 ← phi( @begin/(byte) cnt2#4 )
(byte) cnt#8 ← phi( @begin/(byte) cnt#5 )
(byte) cnt#1 ← (byte) cnt#8
(byte) cnt2#1 ← (byte) cnt2#7
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[256]) SCREEN#3 ← phi( @begin/(byte[256]) SCREEN#0 )
(byte) cnt2#13 ← phi( @begin/(byte) cnt2#0 )
(byte) cnt#14 ← phi( @begin/(byte) cnt#0 )
call inccnt param-assignment
(byte) inccnt::return#0 ← (byte) inccnt::return#3
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
(byte[256]) SCREEN#1 ← phi( main/(byte[256]) SCREEN#3 )
(byte) cnt2#8 ← phi( main/(byte) cnt2#6 )
(byte) cnt#9 ← phi( main/(byte) cnt#7 )
@ -277,7 +277,7 @@ main::@1: from main
call inccnt param-assignment
(byte) inccnt::return#1 ← (byte) inccnt::return#3
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte[256]) SCREEN#2 ← phi( main::@1/(byte[256]) SCREEN#1 )
(byte) cnt2#9 ← phi( main::@1/(byte) cnt2#6 )
(byte) cnt#10 ← phi( main::@1/(byte) cnt#7 )
@ -287,21 +287,21 @@ main::@2: from main::@1
(byte) cnt2#3 ← (byte) cnt2#9
*((byte[256]) SCREEN#2 + (byte) 1) ← (byte~) main::$1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
(byte) cnt2#10 ← phi( main::@2/(byte) cnt2#3 )
(byte) cnt#11 ← phi( main::@2/(byte) cnt#4 )
(byte) cnt#5 ← (byte) cnt#11
(byte) cnt2#4 ← (byte) cnt2#10
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt2#11 ← phi( main/(byte) cnt2#13 main::@1/(byte) cnt2#2 )
(byte) cnt#12 ← phi( main/(byte) cnt#14 main::@1/(byte) cnt#3 )
(byte) cnt#6 ← ++ (byte) cnt#12
(byte) cnt2#5 ← ++ (byte) cnt2#11
(byte) inccnt::return#2 ← (byte) cnt#6
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
(byte) cnt2#12 ← phi( inccnt/(byte) cnt2#5 )
(byte) cnt#13 ← phi( inccnt/(byte) cnt#6 )
(byte) inccnt::return#6 ← phi( inccnt/(byte) inccnt::return#2 )
@ -310,30 +310,30 @@ inccnt::@return: from inccnt
(byte) cnt2#6 ← (byte) cnt2#12
return
to:@return
@end: from @3
@end: scope:[] from @3
Constant (byte) cnt#0 (byte) 0
Constant (byte) cnt2#0 (byte) 0
Constant (byte[256]) SCREEN#0 (word) 1024
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
(byte) cnt2#7 ← phi( @begin/(byte) cnt2#4 )
(byte) cnt#8 ← phi( @begin/(byte) cnt#5 )
(byte) cnt#1 ← (byte) cnt#8
(byte) cnt2#1 ← (byte) cnt2#7
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[256]) SCREEN#3 ← phi( @begin/(word) 1024 )
(byte) cnt2#13 ← phi( @begin/(byte) 0 )
(byte) cnt#14 ← phi( @begin/(byte) 0 )
call inccnt param-assignment
(byte) inccnt::return#0 ← (byte) inccnt::return#3
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
(byte[256]) SCREEN#1 ← phi( main/(byte[256]) SCREEN#3 )
(byte) cnt2#8 ← phi( main/(byte) cnt2#6 )
(byte) cnt#9 ← phi( main/(byte) cnt#7 )
@ -346,7 +346,7 @@ main::@1: from main
call inccnt param-assignment
(byte) inccnt::return#1 ← (byte) inccnt::return#3
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte[256]) SCREEN#2 ← phi( main::@1/(byte[256]) SCREEN#1 )
(byte) cnt2#9 ← phi( main::@1/(byte) cnt2#6 )
(byte) cnt#10 ← phi( main::@1/(byte) cnt#7 )
@ -356,21 +356,21 @@ main::@2: from main::@1
(byte) cnt2#3 ← (byte) cnt2#9
*((byte[256]) SCREEN#2 + (byte) 1) ← (byte~) main::$1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
(byte) cnt2#10 ← phi( main::@2/(byte) cnt2#3 )
(byte) cnt#11 ← phi( main::@2/(byte) cnt#4 )
(byte) cnt#5 ← (byte) cnt#11
(byte) cnt2#4 ← (byte) cnt2#10
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt2#11 ← phi( main/(byte) cnt2#13 main::@1/(byte) cnt2#2 )
(byte) cnt#12 ← phi( main/(byte) cnt#14 main::@1/(byte) cnt#3 )
(byte) cnt#6 ← ++ (byte) cnt#12
(byte) cnt2#5 ← ++ (byte) cnt2#11
(byte) inccnt::return#2 ← (byte) cnt#6
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
(byte) cnt2#12 ← phi( inccnt/(byte) cnt2#5 )
(byte) cnt#13 ← phi( inccnt/(byte) cnt#6 )
(byte) inccnt::return#6 ← phi( inccnt/(byte) inccnt::return#2 )
@ -379,7 +379,7 @@ inccnt::@return: from inccnt
(byte) cnt2#6 ← (byte) cnt2#12
return
to:@return
@end: from @3
@end: scope:[] from @3
Not aliassing across scopes: main::$0 inccnt::return#4
Not aliassing across scopes: main::$1 inccnt::return#5
@ -390,148 +390,148 @@ Alias (byte) inccnt::return#0 = (byte) inccnt::return#3 (byte) inccnt::return#4
Alias (byte[256]) SCREEN#1 = (byte[256]) SCREEN#3 (byte[256]) SCREEN#2
Succesful SSA optimization Pass2AliasElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[256]) SCREEN#1 ← phi( @begin/(word) 1024 )
(byte) cnt2#13 ← phi( @begin/(byte) 0 )
(byte) cnt#14 ← phi( @begin/(byte) 0 )
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
(byte~) main::$0 ← (byte) inccnt::return#0
*((byte[256]) SCREEN#1 + (byte) 0) ← (byte~) main::$0
(byte) cnt#3 ← ++ (byte) cnt#1
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte~) main::$1 ← (byte) inccnt::return#0
*((byte[256]) SCREEN#1 + (byte) 1) ← (byte~) main::$1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt2#11 ← phi( main/(byte) cnt2#13 main::@1/(byte) cnt2#1 )
(byte) cnt#12 ← phi( main/(byte) cnt#14 main::@1/(byte) cnt#3 )
(byte) cnt#1 ← ++ (byte) cnt#12
(byte) cnt2#1 ← ++ (byte) cnt2#11
(byte) inccnt::return#0 ← (byte) cnt#1
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
return
to:@return
@end: from @3
@end: scope:[] from @3
Redundant Phi (byte) cnt#14 (byte) 0
Redundant Phi (byte) cnt2#13 (byte) 0
Redundant Phi (byte[256]) SCREEN#1 (word) 1024
Succesful SSA optimization Pass2RedundantPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
(byte~) main::$0 ← (byte) inccnt::return#0
*((word) 1024 + (byte) 0) ← (byte~) main::$0
(byte) cnt#3 ← ++ (byte) cnt#1
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte~) main::$1 ← (byte) inccnt::return#0
*((word) 1024 + (byte) 1) ← (byte~) main::$1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt2#11 ← phi( main/(byte) 0 main::@1/(byte) cnt2#1 )
(byte) cnt#12 ← phi( main/(byte) 0 main::@1/(byte) cnt#3 )
(byte) cnt#1 ← ++ (byte) cnt#12
(byte) cnt2#1 ← ++ (byte) cnt2#11
(byte) inccnt::return#0 ← (byte) cnt#1
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
return
to:@return
@end: from @3
@end: scope:[] from @3
Culled Empty Block (label) @3
Succesful SSA optimization Pass2CullEmptyBlocks
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
(byte~) main::$0 ← (byte) inccnt::return#0
*((word) 1024 + (byte) 0) ← (byte~) main::$0
(byte) cnt#3 ← ++ (byte) cnt#1
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte~) main::$1 ← (byte) inccnt::return#0
*((word) 1024 + (byte) 1) ← (byte~) main::$1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt2#11 ← phi( main/(byte) 0 main::@1/(byte) cnt2#1 )
(byte) cnt#12 ← phi( main/(byte) 0 main::@1/(byte) cnt#3 )
(byte) cnt#1 ← ++ (byte) cnt#12
(byte) cnt2#1 ← ++ (byte) cnt2#11
(byte) inccnt::return#0 ← (byte) cnt#1
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Consolidated assigned array index constant in assignment *(1024)
Consolidated assigned array index constant in assignment *(1025)
Succesful SSA optimization Pass2ConstantAdditionElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
(byte~) main::$0 ← (byte) inccnt::return#0
*((word) 1024) ← (byte~) main::$0
(byte) cnt#3 ← ++ (byte) cnt#1
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte~) main::$1 ← (byte) inccnt::return#0
*((word) 1025) ← (byte~) main::$1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt2#11 ← phi( main/(byte) 0 main::@1/(byte) cnt2#1 )
(byte) cnt#12 ← phi( main/(byte) 0 main::@1/(byte) cnt#3 )
(byte) cnt#1 ← ++ (byte) cnt#12
(byte) cnt2#1 ← ++ (byte) cnt2#11
(byte) inccnt::return#0 ← (byte) cnt#1
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Not aliassing across scopes: main::$0 inccnt::return#0
Not aliassing across scopes: main::$1 inccnt::return#0
@ -542,14 +542,14 @@ Not aliassing across scopes: inccnt::return#0 cnt#1
Block Sequence Planned @begin @end main main::@1 main::@2 main::@return inccnt inccnt::@return
Block Sequence Planned @begin @end main main::@1 main::@2 main::@return inccnt inccnt::@return
CONTROL FLOW GRAPH - PHI LIFTED
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
(byte~) main::$0 ← (byte) inccnt::return#0
*((word) 1024) ← (byte~) main::$0
(byte) cnt#3 ← ++ (byte) cnt#1
@ -557,21 +557,21 @@ main::@1: from main
(byte~) cnt2#14 ← (byte) cnt2#1
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte~) main::$1 ← (byte) inccnt::return#0
*((word) 1025) ← (byte~) main::$1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt2#11 ← phi( main/(byte) 0 main::@1/(byte~) cnt2#14 )
(byte) cnt#12 ← phi( main/(byte) 0 main::@1/(byte~) cnt#15 )
(byte) cnt#1 ← ++ (byte) cnt#12
(byte) cnt2#1 ← ++ (byte) cnt2#11
(byte) inccnt::return#0 ← (byte) cnt#1
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
return
to:@return
@ -583,14 +583,14 @@ Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
CONTROL FLOW GRAPH - LIVE RANGES
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] call inccnt param-assignment [ inccnt::return#0 cnt#1 cnt2#1 ]
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
[2] (byte~) main::$0 ← (byte) inccnt::return#0 [ main::$0 cnt#1 cnt2#1 ]
[3] *((word) 1024) ← (byte~) main::$0 [ cnt#1 cnt2#1 ]
[4] (byte) cnt#3 ← ++ (byte) cnt#1 [ cnt#3 cnt2#1 ]
@ -598,21 +598,21 @@ main::@1: from main
[6] (byte~) cnt2#14 ← (byte) cnt2#1 [ cnt#15 cnt2#14 ]
[7] call inccnt param-assignment [ inccnt::return#0 ]
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
[8] (byte~) main::$1 ← (byte) inccnt::return#0 [ main::$1 ]
[9] *((word) 1025) ← (byte~) main::$1 [ ]
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
[10] return [ ]
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
[11] (byte) cnt2#11 ← phi( main/(byte) 0 main::@1/(byte~) cnt2#14 ) [ cnt#12 cnt2#11 ]
[11] (byte) cnt#12 ← phi( main/(byte) 0 main::@1/(byte~) cnt#15 ) [ cnt#12 cnt2#11 ]
[12] (byte) cnt#1 ← ++ (byte) cnt#12 [ cnt#1 cnt2#11 ]
[13] (byte) cnt2#1 ← ++ (byte) cnt2#11 [ cnt#1 cnt2#1 ]
[14] (byte) inccnt::return#0 ← (byte) cnt#1 [ inccnt::return#0 cnt#1 cnt2#1 ]
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
[15] return [ inccnt::return#0 cnt#1 cnt2#1 ]
to:@return
@ -628,34 +628,34 @@ Propagating live ranges...
Propagating live ranges...
Propagating live ranges...
CONTROL FLOW GRAPH - PHI MEM COALESCED
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] call inccnt param-assignment [ inccnt::return#0 cnt#1 cnt2#1 ]
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
[2] (byte~) main::$0 ← (byte) inccnt::return#0 [ main::$0 cnt#1 cnt2#1 ]
[3] *((word) 1024) ← (byte~) main::$0 [ cnt#1 cnt2#1 ]
[4] (byte) cnt#3 ← ++ (byte) cnt#1 [ cnt#3 cnt2#1 ]
[5] call inccnt param-assignment [ inccnt::return#0 ]
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
[6] (byte~) main::$1 ← (byte) inccnt::return#0 [ main::$1 ]
[7] *((word) 1025) ← (byte~) main::$1 [ ]
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
[8] return [ ]
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
[9] (byte) cnt2#11 ← phi( main/(byte) 0 main::@1/(byte) cnt2#1 ) [ cnt#12 cnt2#11 ]
[9] (byte) cnt#12 ← phi( main/(byte) 0 main::@1/(byte) cnt#3 ) [ cnt#12 cnt2#11 ]
[10] (byte) cnt#1 ← ++ (byte) cnt#12 [ cnt#1 cnt2#11 ]
[11] (byte) cnt2#1 ← ++ (byte) cnt2#11 [ cnt#1 cnt2#1 ]
[12] (byte) inccnt::return#0 ← (byte) cnt#1 [ inccnt::return#0 cnt#1 cnt2#1 ]
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
[13] return [ inccnt::return#0 cnt#1 cnt2#1 ]
to:@return

View File

@ -1,26 +1,26 @@
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] call inccnt param-assignment [ cnt#10 ]
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
[2] *((word) 1024) ← (byte) cnt#10 [ cnt#10 ]
[3] (byte) cnt#3 ← ++ (byte) cnt#10 [ cnt#3 ]
[4] call inccnt param-assignment [ cnt#10 ]
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
[5] (byte) cnt#1 ← ++ (byte) cnt#10 [ cnt#1 ]
[6] *((word) 1025) ← (byte) cnt#1 [ ]
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
[7] return [ ]
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
[8] (byte) cnt#13 ← phi( main/(byte) 0 main::@1/(byte) cnt#3 ) [ cnt#13 ]
[9] (byte) cnt#10 ← ++ (byte) cnt#13 [ cnt#10 ]
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
[10] return [ cnt#10 ]
to:@return

View File

@ -52,12 +52,12 @@ SYMBOLS
(label) main::@return
INITIAL CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) cnt ← (byte) 0
(byte[256]) SCREEN ← (word) 1024
(void~) $0 ← call main
to:@1
main: from
main: scope:[main] from
(void~) main::$0 ← call inccnt
*((byte[256]) SCREEN + (byte) 0) ← (byte) cnt
(byte) cnt ← ++ (byte) cnt
@ -65,30 +65,30 @@ main: from
(byte) cnt ← ++ (byte) cnt
*((byte[256]) SCREEN + (byte) 1) ← (byte) cnt
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
return
to:@return
@1: from @begin
@1: scope:[] from @begin
to:@2
inccnt: from
inccnt: scope:[inccnt] from
(byte) cnt ← ++ (byte) cnt
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
return
to:@return
@2: from @1
@2: scope:[] from @1
to:@end
@end: from @2
@end: scope:[] from @2
Removing empty block @1
Removing empty block @2
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte) cnt ← (byte) 0
(byte[256]) SCREEN ← (word) 1024
(void~) $0 ← call main
to:@end
main: from
main: scope:[main] from
(void~) main::$0 ← call inccnt
*((byte[256]) SCREEN + (byte) 0) ← (byte) cnt
(byte) cnt ← ++ (byte) cnt
@ -96,75 +96,75 @@ main: from
(byte) cnt ← ++ (byte) cnt
*((byte[256]) SCREEN + (byte) 1) ← (byte) cnt
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
return
to:@return
inccnt: from
inccnt: scope:[inccnt] from
(byte) cnt ← ++ (byte) cnt
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
return
to:@return
@end: from @begin
@end: scope:[] from @begin
PROCEDURE MODIFY VARIABLE ANALYSIS
main modifies cnt
inccnt modifies cnt
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
@begin: from
@begin: scope:[] from
(byte) cnt ← (byte) 0
(byte[256]) SCREEN ← (word) 1024
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
(byte) cnt ← (byte) cnt
to:@end
main: from @begin
main: scope:[main] from @begin
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
(byte) cnt ← (byte) cnt
*((byte[256]) SCREEN + (byte) 0) ← (byte) cnt
(byte) cnt ← ++ (byte) cnt
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) cnt ← (byte) cnt
(byte) cnt ← ++ (byte) cnt
*((byte[256]) SCREEN + (byte) 1) ← (byte) cnt
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
(byte) cnt ← (byte) cnt
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt ← ++ (byte) cnt
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
(byte) cnt ← (byte) cnt
return
to:@return
@end: from @3
@end: scope:[] from @3
Completing Phi functions...
Completing Phi functions...
CONTROL FLOW GRAPH SSA
@begin: from
@begin: scope:[] from
(byte) cnt#0 ← (byte) 0
(byte[256]) SCREEN#0 ← (word) 1024
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
(byte) cnt#9 ← phi( @begin/(byte) cnt#0 )
(byte) cnt#1 ← (byte) cnt#9
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[256]) SCREEN#3 ← phi( @begin/(byte[256]) SCREEN#0 )
(byte) cnt#15 ← phi( @begin/(byte) cnt#0 )
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
(byte[256]) SCREEN#1 ← phi( main/(byte[256]) SCREEN#3 )
(byte) cnt#10 ← phi( main/(byte) cnt#15 )
(byte) cnt#2 ← (byte) cnt#10
@ -172,45 +172,45 @@ main::@1: from main
(byte) cnt#3 ← ++ (byte) cnt#2
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte[256]) SCREEN#2 ← phi( main::@1/(byte[256]) SCREEN#1 )
(byte) cnt#11 ← phi( main::@1/(byte) cnt#3 )
(byte) cnt#4 ← (byte) cnt#11
(byte) cnt#5 ← ++ (byte) cnt#4
*((byte[256]) SCREEN#2 + (byte) 1) ← (byte) cnt#5
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
(byte) cnt#12 ← phi( main::@2/(byte) cnt#5 )
(byte) cnt#6 ← (byte) cnt#12
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt#13 ← phi( main/(byte) cnt#15 main::@1/(byte) cnt#3 )
(byte) cnt#7 ← ++ (byte) cnt#13
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
(byte) cnt#14 ← phi( inccnt/(byte) cnt#7 )
(byte) cnt#8 ← (byte) cnt#14
return
to:@return
@end: from @3
@end: scope:[] from @3
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
@begin: from
@begin: scope:[] from
(byte) cnt#0 ← (byte) 0
(byte[256]) SCREEN#0 ← (word) 1024
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
(byte) cnt#9 ← phi( @begin/(byte) cnt#6 )
(byte) cnt#1 ← (byte) cnt#9
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[256]) SCREEN#3 ← phi( @begin/(byte[256]) SCREEN#0 )
(byte) cnt#15 ← phi( @begin/(byte) cnt#0 )
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
(byte[256]) SCREEN#1 ← phi( main/(byte[256]) SCREEN#3 )
(byte) cnt#10 ← phi( main/(byte) cnt#8 )
(byte) cnt#2 ← (byte) cnt#10
@ -218,46 +218,46 @@ main::@1: from main
(byte) cnt#3 ← ++ (byte) cnt#2
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte[256]) SCREEN#2 ← phi( main::@1/(byte[256]) SCREEN#1 )
(byte) cnt#11 ← phi( main::@1/(byte) cnt#8 )
(byte) cnt#4 ← (byte) cnt#11
(byte) cnt#5 ← ++ (byte) cnt#4
*((byte[256]) SCREEN#2 + (byte) 1) ← (byte) cnt#5
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
(byte) cnt#12 ← phi( main::@2/(byte) cnt#5 )
(byte) cnt#6 ← (byte) cnt#12
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt#13 ← phi( main/(byte) cnt#15 main::@1/(byte) cnt#3 )
(byte) cnt#7 ← ++ (byte) cnt#13
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
(byte) cnt#14 ← phi( inccnt/(byte) cnt#7 )
(byte) cnt#8 ← (byte) cnt#14
return
to:@return
@end: from @3
@end: scope:[] from @3
Constant (byte) cnt#0 (byte) 0
Constant (byte[256]) SCREEN#0 (word) 1024
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
(byte) cnt#9 ← phi( @begin/(byte) cnt#6 )
(byte) cnt#1 ← (byte) cnt#9
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[256]) SCREEN#3 ← phi( @begin/(word) 1024 )
(byte) cnt#15 ← phi( @begin/(byte) 0 )
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
(byte[256]) SCREEN#1 ← phi( main/(byte[256]) SCREEN#3 )
(byte) cnt#10 ← phi( main/(byte) cnt#8 )
(byte) cnt#2 ← (byte) cnt#10
@ -265,218 +265,218 @@ main::@1: from main
(byte) cnt#3 ← ++ (byte) cnt#2
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte[256]) SCREEN#2 ← phi( main::@1/(byte[256]) SCREEN#1 )
(byte) cnt#11 ← phi( main::@1/(byte) cnt#8 )
(byte) cnt#4 ← (byte) cnt#11
(byte) cnt#5 ← ++ (byte) cnt#4
*((byte[256]) SCREEN#2 + (byte) 1) ← (byte) cnt#5
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
(byte) cnt#12 ← phi( main::@2/(byte) cnt#5 )
(byte) cnt#6 ← (byte) cnt#12
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt#13 ← phi( main/(byte) cnt#15 main::@1/(byte) cnt#3 )
(byte) cnt#7 ← ++ (byte) cnt#13
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
(byte) cnt#14 ← phi( inccnt/(byte) cnt#7 )
(byte) cnt#8 ← (byte) cnt#14
return
to:@return
@end: from @3
@end: scope:[] from @3
Alias (byte) cnt#1 = (byte) cnt#9 (byte) cnt#6 (byte) cnt#12 (byte) cnt#5
Alias (byte) cnt#10 = (byte) cnt#8 (byte) cnt#2 (byte) cnt#11 (byte) cnt#4 (byte) cnt#14 (byte) cnt#7
Alias (byte[256]) SCREEN#1 = (byte[256]) SCREEN#3 (byte[256]) SCREEN#2
Succesful SSA optimization Pass2AliasElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[256]) SCREEN#1 ← phi( @begin/(word) 1024 )
(byte) cnt#15 ← phi( @begin/(byte) 0 )
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
*((byte[256]) SCREEN#1 + (byte) 0) ← (byte) cnt#10
(byte) cnt#3 ← ++ (byte) cnt#10
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) cnt#1 ← ++ (byte) cnt#10
*((byte[256]) SCREEN#1 + (byte) 1) ← (byte) cnt#1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt#13 ← phi( main/(byte) cnt#15 main::@1/(byte) cnt#3 )
(byte) cnt#10 ← ++ (byte) cnt#13
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
return
to:@return
@end: from @3
@end: scope:[] from @3
Redundant Phi (byte) cnt#15 (byte) 0
Redundant Phi (byte[256]) SCREEN#1 (word) 1024
Succesful SSA optimization Pass2RedundantPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@3
@3: from @begin
@3: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
*((word) 1024 + (byte) 0) ← (byte) cnt#10
(byte) cnt#3 ← ++ (byte) cnt#10
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) cnt#1 ← ++ (byte) cnt#10
*((word) 1024 + (byte) 1) ← (byte) cnt#1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt#13 ← phi( main/(byte) 0 main::@1/(byte) cnt#3 )
(byte) cnt#10 ← ++ (byte) cnt#13
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
return
to:@return
@end: from @3
@end: scope:[] from @3
Culled Empty Block (label) @3
Succesful SSA optimization Pass2CullEmptyBlocks
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
*((word) 1024 + (byte) 0) ← (byte) cnt#10
(byte) cnt#3 ← ++ (byte) cnt#10
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) cnt#1 ← ++ (byte) cnt#10
*((word) 1024 + (byte) 1) ← (byte) cnt#1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt#13 ← phi( main/(byte) 0 main::@1/(byte) cnt#3 )
(byte) cnt#10 ← ++ (byte) cnt#13
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Consolidated assigned array index constant in assignment *(1024)
Consolidated assigned array index constant in assignment *(1025)
Succesful SSA optimization Pass2ConstantAdditionElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
*((word) 1024) ← (byte) cnt#10
(byte) cnt#3 ← ++ (byte) cnt#10
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) cnt#1 ← ++ (byte) cnt#10
*((word) 1025) ← (byte) cnt#1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt#13 ← phi( main/(byte) 0 main::@1/(byte) cnt#3 )
(byte) cnt#10 ← ++ (byte) cnt#13
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Block Sequence Planned @begin @end main main::@1 main::@2 main::@return inccnt inccnt::@return
Block Sequence Planned @begin @end main main::@1 main::@2 main::@return inccnt inccnt::@return
CONTROL FLOW GRAPH - PHI LIFTED
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
call inccnt param-assignment
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
*((word) 1024) ← (byte) cnt#10
(byte) cnt#3 ← ++ (byte) cnt#10
(byte~) cnt#16 ← (byte) cnt#3
call inccnt param-assignment
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) cnt#1 ← ++ (byte) cnt#10
*((word) 1025) ← (byte) cnt#1
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
return
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
(byte) cnt#13 ← phi( main/(byte) 0 main::@1/(byte~) cnt#16 )
(byte) cnt#10 ← ++ (byte) cnt#13
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
return
to:@return
Propagating live ranges...
Propagating live ranges...
CONTROL FLOW GRAPH - LIVE RANGES
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] call inccnt param-assignment [ cnt#10 ]
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
[2] *((word) 1024) ← (byte) cnt#10 [ cnt#10 ]
[3] (byte) cnt#3 ← ++ (byte) cnt#10 [ cnt#3 ]
[4] (byte~) cnt#16 ← (byte) cnt#3 [ cnt#16 ]
[5] call inccnt param-assignment [ cnt#10 ]
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
[6] (byte) cnt#1 ← ++ (byte) cnt#10 [ cnt#1 ]
[7] *((word) 1025) ← (byte) cnt#1 [ ]
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
[8] return [ ]
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
[9] (byte) cnt#13 ← phi( main/(byte) 0 main::@1/(byte~) cnt#16 ) [ cnt#13 ]
[10] (byte) cnt#10 ← ++ (byte) cnt#13 [ cnt#10 ]
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
[11] return [ cnt#10 ]
to:@return
@ -487,30 +487,30 @@ Block Sequence Planned @begin @end main main::@1 main::@2 main::@return inccnt i
Propagating live ranges...
Propagating live ranges...
CONTROL FLOW GRAPH - PHI MEM COALESCED
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] call inccnt param-assignment [ cnt#10 ]
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
[2] *((word) 1024) ← (byte) cnt#10 [ cnt#10 ]
[3] (byte) cnt#3 ← ++ (byte) cnt#10 [ cnt#3 ]
[4] call inccnt param-assignment [ cnt#10 ]
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
[5] (byte) cnt#1 ← ++ (byte) cnt#10 [ cnt#1 ]
[6] *((word) 1025) ← (byte) cnt#1 [ ]
to:main::@return
main::@return: from main::@2
main::@return: scope:[main] from main::@2
[7] return [ ]
to:@return
inccnt: from main main::@1
inccnt: scope:[inccnt] from main main::@1
[8] (byte) cnt#13 ← phi( main/(byte) 0 main::@1/(byte) cnt#3 ) [ cnt#13 ]
[9] (byte) cnt#10 ← ++ (byte) cnt#13 [ cnt#10 ]
to:inccnt::@return
inccnt::@return: from inccnt
inccnt::@return: scope:[inccnt] from inccnt
[10] return [ cnt#10 ]
to:@return

View File

@ -24,18 +24,18 @@ lvaluevar: {
bcc b2
breturn:
rts
b2:
ldy #$0
lda #$4
sta ($2),y
inc $2
bne !+
inc $2+$1
!:
inx
b1_from_b2:
jmp b1
}
b2:
ldy #$0
lda #$4
sta ($2),y
inc $2
bne !+
inc $2+$1
!:
inx
b1_from_b2:
jmp b1
rvaluevar: {
b1_from_rvaluevar:
lda #<$400
@ -48,17 +48,17 @@ rvaluevar: {
bcc b2
breturn:
rts
b2:
ldy #$0
lda ($2),y
inc $2
bne !+
inc $2+$1
!:
inx
b1_from_b2:
jmp b1
}
b2:
ldy #$0
lda ($2),y
inc $2
bne !+
inc $2+$1
!:
inx
b1_from_b2:
jmp b1
rvalue: {
lda $400
lda $401
@ -69,12 +69,12 @@ rvalue: {
bcc b2
breturn:
rts
b2:
lda $400,x
inx
b1_from_b2:
jmp b1
}
b2:
lda $400,x
inx
b1_from_b2:
jmp b1
lvalue: {
lda #$1
sta $400
@ -87,10 +87,10 @@ lvalue: {
bcc b2
breturn:
rts
b2:
lda #$3
sta $400,x
inx
b1_from_b2:
jmp b1
}
b2:
lda #$3
sta $400,x
inx
b1_from_b2:
jmp b1

View File

@ -1,79 +1,79 @@
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] call lvalue param-assignment [ ]
to:main::@1
main::@1: from main
main::@1: scope:[main] from main
[2] call rvalue param-assignment [ ]
to:main::@2
main::@2: from main::@1
main::@2: scope:[main] from main::@1
[3] call rvaluevar param-assignment [ ]
to:main::@3
main::@3: from main::@2
main::@3: scope:[main] from main::@2
[4] call lvaluevar param-assignment [ ]
to:main::@return
main::@return: from main::@3
main::@return: scope:[main] from main::@3
[5] return [ ]
to:@return
lvaluevar: from main::@3
lvaluevar: scope:[lvaluevar] from main::@3
to:lvaluevar::@1
lvaluevar::@1: from lvaluevar lvaluevar::@2
lvaluevar::@1: scope:[lvaluevar] from lvaluevar lvaluevar::@2
[6] (byte*) lvaluevar::screen#2 ← phi( lvaluevar/(word) 1024 lvaluevar::@2/(byte*) lvaluevar::screen#1 ) [ lvaluevar::i#2 lvaluevar::screen#2 ]
[6] (byte) lvaluevar::i#2 ← phi( lvaluevar/(byte) 2 lvaluevar::@2/(byte) lvaluevar::i#1 ) [ lvaluevar::i#2 lvaluevar::screen#2 ]
[7] if((byte) lvaluevar::i#2<(byte) 10) goto lvaluevar::@2 [ lvaluevar::i#2 lvaluevar::screen#2 ]
to:lvaluevar::@return
lvaluevar::@return: from lvaluevar::@1
lvaluevar::@return: scope:[lvaluevar] from lvaluevar::@1
[8] return [ ]
to:@return
lvaluevar::@2: from lvaluevar::@1
lvaluevar::@2: scope:[lvaluevar] from lvaluevar::@1
[9] *((byte*) lvaluevar::screen#2) ← (byte) 4 [ lvaluevar::i#2 lvaluevar::screen#2 ]
[10] (byte*) lvaluevar::screen#1 ← ++ (byte*) lvaluevar::screen#2 [ lvaluevar::screen#1 lvaluevar::i#2 ]
[11] (byte) lvaluevar::i#1 ← ++ (byte) lvaluevar::i#2 [ lvaluevar::i#1 lvaluevar::screen#1 ]
to:lvaluevar::@1
rvaluevar: from main::@2
rvaluevar: scope:[rvaluevar] from main::@2
to:rvaluevar::@1
rvaluevar::@1: from rvaluevar rvaluevar::@2
rvaluevar::@1: scope:[rvaluevar] from rvaluevar rvaluevar::@2
[12] (byte*) rvaluevar::screen#2 ← phi( rvaluevar/(word) 1024 rvaluevar::@2/(byte*) rvaluevar::screen#1 ) [ rvaluevar::i#2 rvaluevar::screen#2 ]
[12] (byte) rvaluevar::i#2 ← phi( rvaluevar/(byte) 2 rvaluevar::@2/(byte) rvaluevar::i#1 ) [ rvaluevar::i#2 rvaluevar::screen#2 ]
[13] if((byte) rvaluevar::i#2<(byte) 10) goto rvaluevar::@2 [ rvaluevar::i#2 rvaluevar::screen#2 ]
to:rvaluevar::@return
rvaluevar::@return: from rvaluevar::@1
rvaluevar::@return: scope:[rvaluevar] from rvaluevar::@1
[14] return [ ]
to:@return
rvaluevar::@2: from rvaluevar::@1
rvaluevar::@2: scope:[rvaluevar] from rvaluevar::@1
[15] (byte) rvaluevar::b#0 ← * (byte*) rvaluevar::screen#2 [ rvaluevar::i#2 rvaluevar::screen#2 ]
[16] (byte*) rvaluevar::screen#1 ← ++ (byte*) rvaluevar::screen#2 [ rvaluevar::screen#1 rvaluevar::i#2 ]
[17] (byte) rvaluevar::i#1 ← ++ (byte) rvaluevar::i#2 [ rvaluevar::i#1 rvaluevar::screen#1 ]
to:rvaluevar::@1
rvalue: from main::@1
rvalue: scope:[rvalue] from main::@1
[18] (byte) rvalue::b#0 ← * (word) 1024 [ ]
[19] (byte) rvalue::b#1 ← * (word) 1025 [ ]
to:rvalue::@1
rvalue::@1: from rvalue rvalue::@2
rvalue::@1: scope:[rvalue] from rvalue rvalue::@2
[20] (byte) rvalue::i#2 ← phi( rvalue/(byte) 2 rvalue::@2/(byte) rvalue::i#1 ) [ rvalue::i#2 ]
[21] if((byte) rvalue::i#2<(byte) 10) goto rvalue::@2 [ rvalue::i#2 ]
to:rvalue::@return
rvalue::@return: from rvalue::@1
rvalue::@return: scope:[rvalue] from rvalue::@1
[22] return [ ]
to:@return
rvalue::@2: from rvalue::@1
rvalue::@2: scope:[rvalue] from rvalue::@1
[23] (byte) rvalue::b#2 ← (word) 1024 *idx (byte) rvalue::i#2 [ rvalue::i#2 ]
[24] (byte) rvalue::i#1 ← ++ (byte) rvalue::i#2 [ rvalue::i#1 ]
to:rvalue::@1
lvalue: from main
lvalue: scope:[lvalue] from main
[25] *((word) 1024) ← (byte) 1 [ ]
[26] *((word) 1025) ← (byte) 2 [ ]
to:lvalue::@1
lvalue::@1: from lvalue lvalue::@2
lvalue::@1: scope:[lvalue] from lvalue lvalue::@2
[27] (byte) lvalue::i#2 ← phi( lvalue/(byte) 2 lvalue::@2/(byte) lvalue::i#1 ) [ lvalue::i#2 ]
[28] if((byte) lvalue::i#2<(byte) 10) goto lvalue::@2 [ lvalue::i#2 ]
to:lvalue::@return
lvalue::@return: from lvalue::@1
lvalue::@return: scope:[lvalue] from lvalue::@1
[29] return [ ]
to:@return
lvalue::@2: from lvalue::@1
lvalue::@2: scope:[lvalue] from lvalue::@1
[30] *((word) 1024 + (byte) lvalue::i#2) ← (byte) 3 [ lvalue::i#2 ]
[31] (byte) lvalue::i#1 ← ++ (byte) lvalue::i#2 [ lvalue::i#1 ]
to:lvalue::@1

File diff suppressed because it is too large Load Diff

View File

@ -9,9 +9,9 @@ main: {
bcc b2
breturn:
rts
b2:
lda $400,x
inx
b1_from_b2:
jmp b1
}
b2:
lda $400,x
inx
b1_from_b2:
jmp b1

View File

@ -1,17 +1,17 @@
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
[1] (byte) main::i#2 ← phi( main/(byte) 2 main::@2/(byte) main::i#1 ) [ main::i#2 ]
[2] if((byte) main::i#2<(byte) 10) goto main::@2 [ main::i#2 ]
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
[3] return [ ]
to:@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
[4] (byte) main::b#0 ← (word) 1024 *idx (byte) main::i#2 [ main::i#2 ]
[5] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ]
to:main::@1

View File

@ -51,36 +51,36 @@ SYMBOLS
(byte) main::i
INITIAL CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(void~) $0 ← call main
to:@1
main: from
main: scope:[main] from
(byte[1024]) main::SCREEN ← (word) 1024
(byte) main::i ← (byte) 2
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
(boolean~) main::$0 ← (byte) main::i < (byte) 10
if((boolean~) main::$0) goto main::@2
to:main::@4
main::@2: from main::@1 main::@5
main::@2: scope:[main] from main::@1 main::@5
(byte~) main::$1 ← (byte[1024]) main::SCREEN *idx (byte) main::i
(byte) main::b ← (byte~) main::$1
(byte) main::i ← ++ (byte) main::i
to:main::@1
main::@4: from main::@1
main::@4: scope:[main] from main::@1
to:main::@3
main::@3: from main::@4 main::@6
main::@3: scope:[main] from main::@4 main::@6
to:main::@return
main::@5: from
main::@5: scope:[main] from
to:main::@2
main::@6: from
main::@6: scope:[main] from
to:main::@3
main::@return: from main::@3
main::@return: scope:[main] from main::@3
return
to:@return
@1: from @begin
@1: scope:[] from @begin
to:@end
@end: from @1
@end: scope:[] from @1
Removing empty block main::@4
Removing empty block main::@3
@ -88,276 +88,276 @@ Removing empty block main::@5
Removing empty block main::@6
Removing empty block @1
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(void~) $0 ← call main
to:@end
main: from
main: scope:[main] from
(byte[1024]) main::SCREEN ← (word) 1024
(byte) main::i ← (byte) 2
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
(boolean~) main::$0 ← (byte) main::i < (byte) 10
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte~) main::$1 ← (byte[1024]) main::SCREEN *idx (byte) main::i
(byte) main::b ← (byte~) main::$1
(byte) main::i ← ++ (byte) main::i
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
PROCEDURE MODIFY VARIABLE ANALYSIS
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
@begin: from
@begin: scope:[] from
call main param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[1024]) main::SCREEN ← (word) 1024
(byte) main::i ← (byte) 2
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
(boolean~) main::$0 ← (byte) main::i < (byte) 10
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte~) main::$1 ← (byte[1024]) main::SCREEN *idx (byte) main::i
(byte) main::b ← (byte~) main::$1
(byte) main::i ← ++ (byte) main::i
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @2
@end: scope:[] from @2
Completing Phi functions...
Completing Phi functions...
CONTROL FLOW GRAPH SSA
@begin: from
@begin: scope:[] from
call main param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[1024]) main::SCREEN#0 ← (word) 1024
(byte) main::i#0 ← (byte) 2
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
(byte[1024]) main::SCREEN#2 ← phi( main/(byte[1024]) main::SCREEN#0 main::@2/(byte[1024]) main::SCREEN#1 )
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#1 )
(boolean~) main::$0 ← (byte) main::i#2 < (byte) 10
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) main::i#3 ← phi( main::@1/(byte) main::i#2 )
(byte[1024]) main::SCREEN#1 ← phi( main::@1/(byte[1024]) main::SCREEN#2 )
(byte~) main::$1 ← (byte[1024]) main::SCREEN#1 *idx (byte) main::i#3
(byte) main::b#0 ← (byte~) main::$1
(byte) main::i#1 ← ++ (byte) main::i#3
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @2
@end: scope:[] from @2
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
@begin: from
@begin: scope:[] from
call main param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[1024]) main::SCREEN#0 ← (word) 1024
(byte) main::i#0 ← (byte) 2
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
(byte[1024]) main::SCREEN#2 ← phi( main/(byte[1024]) main::SCREEN#0 main::@2/(byte[1024]) main::SCREEN#1 )
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#1 )
(boolean~) main::$0 ← (byte) main::i#2 < (byte) 10
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) main::i#3 ← phi( main::@1/(byte) main::i#2 )
(byte[1024]) main::SCREEN#1 ← phi( main::@1/(byte[1024]) main::SCREEN#2 )
(byte~) main::$1 ← (byte[1024]) main::SCREEN#1 *idx (byte) main::i#3
(byte) main::b#0 ← (byte~) main::$1
(byte) main::i#1 ← ++ (byte) main::i#3
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @2
@end: scope:[] from @2
Culled Empty Block (label) @2
Succesful SSA optimization Pass2CullEmptyBlocks
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
(byte[1024]) main::SCREEN#0 ← (word) 1024
(byte) main::i#0 ← (byte) 2
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
(byte[1024]) main::SCREEN#2 ← phi( main/(byte[1024]) main::SCREEN#0 main::@2/(byte[1024]) main::SCREEN#1 )
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@2/(byte) main::i#1 )
(boolean~) main::$0 ← (byte) main::i#2 < (byte) 10
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) main::i#3 ← phi( main::@1/(byte) main::i#2 )
(byte[1024]) main::SCREEN#1 ← phi( main::@1/(byte[1024]) main::SCREEN#2 )
(byte~) main::$1 ← (byte[1024]) main::SCREEN#1 *idx (byte) main::i#3
(byte) main::b#0 ← (byte~) main::$1
(byte) main::i#1 ← ++ (byte) main::i#3
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Constant (byte[1024]) main::SCREEN#0 (word) 1024
Constant (byte) main::i#0 (byte) 2
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
(byte[1024]) main::SCREEN#2 ← phi( main/(word) 1024 main::@2/(byte[1024]) main::SCREEN#1 )
(byte) main::i#2 ← phi( main/(byte) 2 main::@2/(byte) main::i#1 )
(boolean~) main::$0 ← (byte) main::i#2 < (byte) 10
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) main::i#3 ← phi( main::@1/(byte) main::i#2 )
(byte[1024]) main::SCREEN#1 ← phi( main::@1/(byte[1024]) main::SCREEN#2 )
(byte~) main::$1 ← (byte[1024]) main::SCREEN#1 *idx (byte) main::i#3
(byte) main::b#0 ← (byte~) main::$1
(byte) main::i#1 ← ++ (byte) main::i#3
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Alias (byte[1024]) main::SCREEN#1 = (byte[1024]) main::SCREEN#2
Alias (byte) main::i#2 = (byte) main::i#3
Alias (byte) main::b#0 = (byte~) main::$1
Succesful SSA optimization Pass2AliasElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
(byte[1024]) main::SCREEN#1 ← phi( main/(word) 1024 main::@2/(byte[1024]) main::SCREEN#1 )
(byte) main::i#2 ← phi( main/(byte) 2 main::@2/(byte) main::i#1 )
(boolean~) main::$0 ← (byte) main::i#2 < (byte) 10
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) main::b#0 ← (byte[1024]) main::SCREEN#1 *idx (byte) main::i#2
(byte) main::i#1 ← ++ (byte) main::i#2
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Self Phi Eliminated (byte[1024]) main::SCREEN#1
Succesful SSA optimization Pass2SelfPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
(byte[1024]) main::SCREEN#1 ← phi( main/(word) 1024 )
(byte) main::i#2 ← phi( main/(byte) 2 main::@2/(byte) main::i#1 )
(boolean~) main::$0 ← (byte) main::i#2 < (byte) 10
if((boolean~) main::$0) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) main::b#0 ← (byte[1024]) main::SCREEN#1 *idx (byte) main::i#2
(byte) main::i#1 ← ++ (byte) main::i#2
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Simple Condition (boolean~) main::$0 if((byte) main::i#2<(byte) 10) goto main::@2
Succesful SSA optimization Pass2ConditionalJumpSimplification
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
(byte[1024]) main::SCREEN#1 ← phi( main/(word) 1024 )
(byte) main::i#2 ← phi( main/(byte) 2 main::@2/(byte) main::i#1 )
if((byte) main::i#2<(byte) 10) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) main::b#0 ← (byte[1024]) main::SCREEN#1 *idx (byte) main::i#2
(byte) main::i#1 ← ++ (byte) main::i#2
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Constant (byte[1024]) main::SCREEN#1 (word) 1024
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
(byte) main::i#2 ← phi( main/(byte) 2 main::@2/(byte) main::i#1 )
if((byte) main::i#2<(byte) 10) goto main::@2
to:main::@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) main::b#0 ← (word) 1024 *idx (byte) main::i#2
(byte) main::i#1 ← ++ (byte) main::i#2
to:main::@1
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Multiple usages for variable. Not optimizing sub-constant (byte) main::i#2
Multiple usages for variable. Not optimizing sub-constant (byte) main::i#2
Block Sequence Planned @begin @end main main::@1 main::@return main::@2
Block Sequence Planned @begin @end main main::@1 main::@return main::@2
CONTROL FLOW GRAPH - PHI LIFTED
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
(byte) main::i#2 ← phi( main/(byte) 2 main::@2/(byte~) main::i#4 )
if((byte) main::i#2<(byte) 10) goto main::@2
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
(byte) main::b#0 ← (word) 1024 *idx (byte) main::i#2
(byte) main::i#1 ← ++ (byte) main::i#2
(byte~) main::i#4 ← (byte) main::i#1
@ -366,20 +366,20 @@ main::@2: from main::@1
Adding empty live range for unused variable main::b#0
Propagating live ranges...
CONTROL FLOW GRAPH - LIVE RANGES
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
[1] (byte) main::i#2 ← phi( main/(byte) 2 main::@2/(byte~) main::i#4 ) [ main::i#2 ]
[2] if((byte) main::i#2<(byte) 10) goto main::@2 [ main::i#2 ]
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
[3] return [ ]
to:@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
[4] (byte) main::b#0 ← (word) 1024 *idx (byte) main::i#2 [ main::i#2 ]
[5] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ]
[6] (byte~) main::i#4 ← (byte) main::i#1 [ main::i#4 ]
@ -392,20 +392,20 @@ Block Sequence Planned @begin @end main main::@1 main::@return main::@2
Adding empty live range for unused variable main::b#0
Propagating live ranges...
CONTROL FLOW GRAPH - PHI MEM COALESCED
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
to:main::@1
main::@1: from main main::@2
main::@1: scope:[main] from main main::@2
[1] (byte) main::i#2 ← phi( main/(byte) 2 main::@2/(byte) main::i#1 ) [ main::i#2 ]
[2] if((byte) main::i#2<(byte) 10) goto main::@2 [ main::i#2 ]
to:main::@return
main::@return: from main::@1
main::@return: scope:[main] from main::@1
[3] return [ ]
to:@return
main::@2: from main::@1
main::@2: scope:[main] from main::@1
[4] (byte) main::b#0 ← (word) 1024 *idx (byte) main::i#2 [ main::i#2 ]
[5] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ]
to:main::@1
@ -477,19 +477,19 @@ main: {
breturn:
//SEG9 [3] return [ ]
rts
//SEG10 main::@2
b2:
//SEG11 [4] (byte) main::b#0 ← (word) 1024 *idx (byte) main::i#2 [ main::i#2 ] -- zpby1=cowo1_staridx_zpby2
ldx $2
lda $400,x
sta $3
//SEG12 [5] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] -- zpby1=_inc_zpby1
inc $2
//SEG13 [1] phi from main::@2 to main::@1
b1_from_b2:
//SEG14 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
}
//SEG10 main::@2
b2:
//SEG11 [4] (byte) main::b#0 ← (word) 1024 *idx (byte) main::i#2 [ main::i#2 ] -- zpby1=cowo1_staridx_zpby2
ldx $2
lda $400,x
sta $3
//SEG12 [5] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] -- zpby1=_inc_zpby1
inc $2
//SEG13 [1] phi from main::@2 to main::@1
b1_from_b2:
//SEG14 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
REGISTER UPLIFT POTENTIAL REGISTERS
Potential registers zp byte:2 [ main::i#2 main::i#1 ] : zp byte:2 , reg byte a , reg byte x , reg byte y ,
@ -527,17 +527,17 @@ main: {
breturn:
//SEG9 [3] return [ ]
rts
//SEG10 main::@2
b2:
//SEG11 [4] (byte) main::b#0 ← (word) 1024 *idx (byte) main::i#2 [ main::i#2 ] -- aby=cowo1_staridx_xby
lda $400,x
//SEG12 [5] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] -- xby=_inc_xby
inx
//SEG13 [1] phi from main::@2 to main::@1
b1_from_b2:
//SEG14 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
}
//SEG10 main::@2
b2:
//SEG11 [4] (byte) main::b#0 ← (word) 1024 *idx (byte) main::i#2 [ main::i#2 ] -- aby=cowo1_staridx_xby
lda $400,x
//SEG12 [5] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] -- xby=_inc_xby
inx
//SEG13 [1] phi from main::@2 to main::@1
b1_from_b2:
//SEG14 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
FINAL SYMBOL TABLE
(label) @begin
@ -578,15 +578,15 @@ main: {
breturn:
//SEG9 [3] return [ ]
rts
//SEG10 main::@2
b2:
//SEG11 [4] (byte) main::b#0 ← (word) 1024 *idx (byte) main::i#2 [ main::i#2 ] -- aby=cowo1_staridx_xby
lda $400,x
//SEG12 [5] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] -- xby=_inc_xby
inx
//SEG13 [1] phi from main::@2 to main::@1
b1_from_b2:
//SEG14 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1
}
//SEG10 main::@2
b2:
//SEG11 [4] (byte) main::b#0 ← (word) 1024 *idx (byte) main::i#2 [ main::i#2 ] -- aby=cowo1_staridx_xby
lda $400,x
//SEG12 [5] (byte) main::i#1 ← ++ (byte) main::i#2 [ main::i#1 ] -- xby=_inc_xby
inx
//SEG13 [1] phi from main::@2 to main::@1
b1_from_b2:
//SEG14 [1] phi (byte) main::i#2 = (byte) main::i#1 -- register_copy
jmp b1

View File

@ -1,25 +1,25 @@
@begin: from
@begin: scope:[] from
[0] call sum param-assignment [ sum::return#0 ]
to:@2
@2: from @begin
@2: scope:[] from @begin
[1] (byte) s1#0 ← (byte) sum::return#0 [ s1#0 ]
[2] call sum param-assignment [ sum::return#0 s1#0 ]
to:@3
@3: from @2
@3: scope:[] from @2
[3] (byte) s2#0 ← (byte) sum::return#0 [ s1#0 s2#0 ]
[4] call sum param-assignment [ sum::return#0 s1#0 s2#0 ]
to:@4
@4: from @3
@4: scope:[] from @3
[5] (byte) s3#0 ← (byte) sum::return#0 [ s1#0 s2#0 s3#0 ]
[6] (byte~) $3 ← (byte) s1#0 + (byte) s2#0 [ $3 s3#0 ]
[7] (byte) s4#0 ← (byte~) $3 + (byte) s3#0 [ ]
to:@end
@end: from @4
sum: from @2 @3 @begin
@end: scope:[] from @4
sum: scope:[sum] from @2 @3 @begin
[8] (byte) sum::b#3 ← phi( @2/(byte) 4 @3/(byte) 13 @begin/(byte) 2 ) [ s1#0 s2#0 sum::a#3 sum::b#3 ]
[8] (byte) sum::a#3 ← phi( @2/(byte) 3 @3/(byte) 9 @begin/(byte) 1 ) [ s1#0 s2#0 sum::a#3 sum::b#3 ]
[9] (byte) sum::return#0 ← (byte) sum::a#3 + (byte) sum::b#3 [ sum::return#0 s1#0 s2#0 ]
to:sum::@return
sum::@return: from sum
sum::@return: scope:[sum] from sum
[10] return [ sum::return#0 s1#0 s2#0 ]
to:@return

View File

@ -43,7 +43,7 @@ SYMBOLS
(byte) sum::return
INITIAL CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte~) $0 ← call sum (byte) 1 (byte) 2
(byte) s1 ← (byte~) $0
(byte~) $1 ← call sum (byte) 3 (byte) 4
@ -54,24 +54,24 @@ INITIAL CONTROL FLOW GRAPH
(byte~) $4 ← (byte~) $3 + (byte) s3
(byte) s4 ← (byte~) $4
to:@1
sum: from
sum: scope:[sum] from
(byte~) sum::$0 ← (byte) sum::a + (byte) sum::b
(byte) sum::return ← (byte~) sum::$0
to:sum::@return
sum::@return: from sum sum::@1
sum::@return: scope:[sum] from sum sum::@1
(byte) sum::return ← (byte) sum::return
return (byte) sum::return
to:@return
sum::@1: from
sum::@1: scope:[sum] from
to:sum::@return
@1: from @begin
@1: scope:[] from @begin
to:@end
@end: from @1
@end: scope:[] from @1
Removing empty block sum::@1
Removing empty block @1
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte~) $0 ← call sum (byte) 1 (byte) 2
(byte) s1 ← (byte~) $0
(byte~) $1 ← call sum (byte) 3 (byte) 4
@ -82,64 +82,64 @@ CONTROL FLOW GRAPH
(byte~) $4 ← (byte~) $3 + (byte) s3
(byte) s4 ← (byte~) $4
to:@end
sum: from
sum: scope:[sum] from
(byte~) sum::$0 ← (byte) sum::a + (byte) sum::b
(byte) sum::return ← (byte~) sum::$0
to:sum::@return
sum::@return: from sum
sum::@return: scope:[sum] from sum
(byte) sum::return ← (byte) sum::return
return (byte) sum::return
to:@return
@end: from @begin
@end: scope:[] from @begin
PROCEDURE MODIFY VARIABLE ANALYSIS
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
@begin: from
@begin: scope:[] from
(byte) sum::a ← (byte) 1
(byte) sum::b ← (byte) 2
(byte) sum::return ← call sum param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
(byte~) $0 ← (byte) sum::return
(byte) s1 ← (byte~) $0
(byte) sum::a ← (byte) 3
(byte) sum::b ← (byte) 4
(byte) sum::return ← call sum param-assignment
to:@3
@3: from @2
@3: scope:[] from @2
(byte~) $1 ← (byte) sum::return
(byte) s2 ← (byte~) $1
(byte) sum::a ← (byte) 9
(byte) sum::b ← (byte) 13
(byte) sum::return ← call sum param-assignment
to:@4
@4: from @3
@4: scope:[] from @3
(byte~) $2 ← (byte) sum::return
(byte) s3 ← (byte~) $2
(byte~) $3 ← (byte) s1 + (byte) s2
(byte~) $4 ← (byte~) $3 + (byte) s3
(byte) s4 ← (byte~) $4
to:@end
sum: from @2 @3 @begin
sum: scope:[sum] from @2 @3 @begin
(byte~) sum::$0 ← (byte) sum::a + (byte) sum::b
(byte) sum::return ← (byte~) sum::$0
to:sum::@return
sum::@return: from sum
sum::@return: scope:[sum] from sum
(byte) sum::return ← (byte) sum::return
return (byte) sum::return
to:@return
@end: from @4
@end: scope:[] from @4
Completing Phi functions...
Completing Phi functions...
CONTROL FLOW GRAPH SSA
@begin: from
@begin: scope:[] from
(byte) sum::a#0 ← (byte) 1
(byte) sum::b#0 ← (byte) 2
(byte) sum::return#0 ← call sum param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
(byte) sum::return#5 ← phi( @begin/(byte) sum::return#0 )
(byte~) $0 ← (byte) sum::return#5
(byte) s1#0 ← (byte~) $0
@ -147,7 +147,7 @@ CONTROL FLOW GRAPH SSA
(byte) sum::b#1 ← (byte) 4
(byte) sum::return#1 ← call sum param-assignment
to:@3
@3: from @2
@3: scope:[] from @2
(byte) s1#2 ← phi( @2/(byte) s1#0 )
(byte) sum::return#6 ← phi( @2/(byte) sum::return#1 )
(byte~) $1 ← (byte) sum::return#6
@ -156,7 +156,7 @@ CONTROL FLOW GRAPH SSA
(byte) sum::b#2 ← (byte) 13
(byte) sum::return#2 ← call sum param-assignment
to:@4
@4: from @3
@4: scope:[] from @3
(byte) s2#1 ← phi( @3/(byte) s2#0 )
(byte) s1#1 ← phi( @3/(byte) s1#2 )
(byte) sum::return#7 ← phi( @3/(byte) sum::return#2 )
@ -166,27 +166,27 @@ CONTROL FLOW GRAPH SSA
(byte~) $4 ← (byte~) $3 + (byte) s3#0
(byte) s4#0 ← (byte~) $4
to:@end
sum: from @2 @3 @begin
sum: scope:[sum] from @2 @3 @begin
(byte) sum::b#3 ← phi( @2/(byte) sum::b#1 @3/(byte) sum::b#2 @begin/(byte) sum::b#0 )
(byte) sum::a#3 ← phi( @2/(byte) sum::a#1 @3/(byte) sum::a#2 @begin/(byte) sum::a#0 )
(byte~) sum::$0 ← (byte) sum::a#3 + (byte) sum::b#3
(byte) sum::return#3 ← (byte~) sum::$0
to:sum::@return
sum::@return: from sum
sum::@return: scope:[sum] from sum
(byte) sum::return#8 ← phi( sum/(byte) sum::return#3 )
(byte) sum::return#4 ← (byte) sum::return#8
return (byte) sum::return#4
to:@return
@end: from @4
@end: scope:[] from @4
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
@begin: from
@begin: scope:[] from
(byte) sum::a#0 ← (byte) 1
(byte) sum::b#0 ← (byte) 2
call sum param-assignment
(byte) sum::return#0 ← (byte) sum::return#4
to:@2
@2: from @begin
@2: scope:[] from @begin
(byte) sum::return#5 ← phi( @begin/(byte) sum::return#0 )
(byte~) $0 ← (byte) sum::return#5
(byte) s1#0 ← (byte~) $0
@ -195,7 +195,7 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
call sum param-assignment
(byte) sum::return#1 ← (byte) sum::return#4
to:@3
@3: from @2
@3: scope:[] from @2
(byte) s1#2 ← phi( @2/(byte) s1#0 )
(byte) sum::return#6 ← phi( @2/(byte) sum::return#1 )
(byte~) $1 ← (byte) sum::return#6
@ -205,7 +205,7 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
call sum param-assignment
(byte) sum::return#2 ← (byte) sum::return#4
to:@4
@4: from @3
@4: scope:[] from @3
(byte) s2#1 ← phi( @3/(byte) s2#0 )
(byte) s1#1 ← phi( @3/(byte) s1#2 )
(byte) sum::return#7 ← phi( @3/(byte) sum::return#2 )
@ -215,18 +215,18 @@ CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
(byte~) $4 ← (byte~) $3 + (byte) s3#0
(byte) s4#0 ← (byte~) $4
to:@end
sum: from @2 @3 @begin
sum: scope:[sum] from @2 @3 @begin
(byte) sum::b#3 ← phi( @2/(byte) sum::b#1 @3/(byte) sum::b#2 @begin/(byte) sum::b#0 )
(byte) sum::a#3 ← phi( @2/(byte) sum::a#1 @3/(byte) sum::a#2 @begin/(byte) sum::a#0 )
(byte~) sum::$0 ← (byte) sum::a#3 + (byte) sum::b#3
(byte) sum::return#3 ← (byte~) sum::$0
to:sum::@return
sum::@return: from sum
sum::@return: scope:[sum] from sum
(byte) sum::return#8 ← phi( sum/(byte) sum::return#3 )
(byte) sum::return#4 ← (byte) sum::return#8
return
to:@return
@end: from @4
@end: scope:[] from @4
Constant (byte) sum::a#0 (byte) 1
Constant (byte) sum::b#0 (byte) 2
@ -236,18 +236,18 @@ Constant (byte) sum::a#2 (byte) 9
Constant (byte) sum::b#2 (byte) 13
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call sum param-assignment
(byte) sum::return#0 ← (byte) sum::return#4
to:@2
@2: from @begin
@2: scope:[] from @begin
(byte) sum::return#5 ← phi( @begin/(byte) sum::return#0 )
(byte~) $0 ← (byte) sum::return#5
(byte) s1#0 ← (byte~) $0
call sum param-assignment
(byte) sum::return#1 ← (byte) sum::return#4
to:@3
@3: from @2
@3: scope:[] from @2
(byte) s1#2 ← phi( @2/(byte) s1#0 )
(byte) sum::return#6 ← phi( @2/(byte) sum::return#1 )
(byte~) $1 ← (byte) sum::return#6
@ -255,7 +255,7 @@ CONTROL FLOW GRAPH
call sum param-assignment
(byte) sum::return#2 ← (byte) sum::return#4
to:@4
@4: from @3
@4: scope:[] from @3
(byte) s2#1 ← phi( @3/(byte) s2#0 )
(byte) s1#1 ← phi( @3/(byte) s1#2 )
(byte) sum::return#7 ← phi( @3/(byte) sum::return#2 )
@ -265,18 +265,18 @@ CONTROL FLOW GRAPH
(byte~) $4 ← (byte~) $3 + (byte) s3#0
(byte) s4#0 ← (byte~) $4
to:@end
sum: from @2 @3 @begin
sum: scope:[sum] from @2 @3 @begin
(byte) sum::b#3 ← phi( @2/(byte) 4 @3/(byte) 13 @begin/(byte) 2 )
(byte) sum::a#3 ← phi( @2/(byte) 3 @3/(byte) 9 @begin/(byte) 1 )
(byte~) sum::$0 ← (byte) sum::a#3 + (byte) sum::b#3
(byte) sum::return#3 ← (byte~) sum::$0
to:sum::@return
sum::@return: from sum
sum::@return: scope:[sum] from sum
(byte) sum::return#8 ← phi( sum/(byte) sum::return#3 )
(byte) sum::return#4 ← (byte) sum::return#8
return
to:@return
@end: from @4
@end: scope:[] from @4
Not aliassing across scopes: $0 sum::return#5
Not aliassing across scopes: $1 sum::return#6
@ -288,31 +288,31 @@ Alias (byte) s3#0 = (byte~) $2
Alias (byte) s4#0 = (byte~) $4
Succesful SSA optimization Pass2AliasElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call sum param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
(byte) s1#0 ← (byte) sum::return#0
call sum param-assignment
to:@3
@3: from @2
@3: scope:[] from @2
(byte) s2#0 ← (byte) sum::return#0
call sum param-assignment
to:@4
@4: from @3
@4: scope:[] from @3
(byte) s3#0 ← (byte) sum::return#0
(byte~) $3 ← (byte) s1#0 + (byte) s2#0
(byte) s4#0 ← (byte~) $3 + (byte) s3#0
to:@end
sum: from @2 @3 @begin
sum: scope:[sum] from @2 @3 @begin
(byte) sum::b#3 ← phi( @2/(byte) 4 @3/(byte) 13 @begin/(byte) 2 )
(byte) sum::a#3 ← phi( @2/(byte) 3 @3/(byte) 9 @begin/(byte) 1 )
(byte) sum::return#0 ← (byte) sum::a#3 + (byte) sum::b#3
to:sum::@return
sum::@return: from sum
sum::@return: scope:[sum] from sum
return
to:@return
@end: from @4
@end: scope:[] from @4
Not aliassing across scopes: s1#0 sum::return#0
Not aliassing across scopes: s2#0 sum::return#0
@ -320,29 +320,29 @@ Not aliassing across scopes: s3#0 sum::return#0
Block Sequence Planned @begin @2 @3 @4 @end sum sum::@return
Block Sequence Planned @begin @2 @3 @4 @end sum sum::@return
CONTROL FLOW GRAPH - PHI LIFTED
@begin: from
@begin: scope:[] from
call sum param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
(byte) s1#0 ← (byte) sum::return#0
call sum param-assignment
to:@3
@3: from @2
@3: scope:[] from @2
(byte) s2#0 ← (byte) sum::return#0
call sum param-assignment
to:@4
@4: from @3
@4: scope:[] from @3
(byte) s3#0 ← (byte) sum::return#0
(byte~) $3 ← (byte) s1#0 + (byte) s2#0
(byte) s4#0 ← (byte~) $3 + (byte) s3#0
to:@end
@end: from @4
sum: from @2 @3 @begin
@end: scope:[] from @4
sum: scope:[sum] from @2 @3 @begin
(byte) sum::b#3 ← phi( @2/(byte) 4 @3/(byte) 13 @begin/(byte) 2 )
(byte) sum::a#3 ← phi( @2/(byte) 3 @3/(byte) 9 @begin/(byte) 1 )
(byte) sum::return#0 ← (byte) sum::a#3 + (byte) sum::b#3
to:sum::@return
sum::@return: from sum
sum::@return: scope:[sum] from sum
return
to:@return
@ -362,29 +362,29 @@ Propagated s1#0 through call [4] call sum param-assignment
Propagated s2#0 through call [4] call sum param-assignment
Propagating live ranges...
CONTROL FLOW GRAPH - LIVE RANGES
@begin: from
@begin: scope:[] from
[0] call sum param-assignment [ sum::return#0 ]
to:@2
@2: from @begin
@2: scope:[] from @begin
[1] (byte) s1#0 ← (byte) sum::return#0 [ s1#0 ]
[2] call sum param-assignment [ sum::return#0 s1#0 ]
to:@3
@3: from @2
@3: scope:[] from @2
[3] (byte) s2#0 ← (byte) sum::return#0 [ s1#0 s2#0 ]
[4] call sum param-assignment [ sum::return#0 s1#0 s2#0 ]
to:@4
@4: from @3
@4: scope:[] from @3
[5] (byte) s3#0 ← (byte) sum::return#0 [ s1#0 s2#0 s3#0 ]
[6] (byte~) $3 ← (byte) s1#0 + (byte) s2#0 [ $3 s3#0 ]
[7] (byte) s4#0 ← (byte~) $3 + (byte) s3#0 [ ]
to:@end
@end: from @4
sum: from @2 @3 @begin
@end: scope:[] from @4
sum: scope:[sum] from @2 @3 @begin
[8] (byte) sum::b#3 ← phi( @2/(byte) 4 @3/(byte) 13 @begin/(byte) 2 ) [ s1#0 s2#0 sum::a#3 sum::b#3 ]
[8] (byte) sum::a#3 ← phi( @2/(byte) 3 @3/(byte) 9 @begin/(byte) 1 ) [ s1#0 s2#0 sum::a#3 sum::b#3 ]
[9] (byte) sum::return#0 ← (byte) sum::a#3 + (byte) sum::b#3 [ sum::return#0 s1#0 s2#0 ]
to:sum::@return
sum::@return: from sum
sum::@return: scope:[sum] from sum
[10] return [ sum::return#0 s1#0 s2#0 ]
to:@return
@ -407,29 +407,29 @@ Propagated s1#0 through call [4] call sum param-assignment
Propagated s2#0 through call [4] call sum param-assignment
Propagating live ranges...
CONTROL FLOW GRAPH - PHI MEM COALESCED
@begin: from
@begin: scope:[] from
[0] call sum param-assignment [ sum::return#0 ]
to:@2
@2: from @begin
@2: scope:[] from @begin
[1] (byte) s1#0 ← (byte) sum::return#0 [ s1#0 ]
[2] call sum param-assignment [ sum::return#0 s1#0 ]
to:@3
@3: from @2
@3: scope:[] from @2
[3] (byte) s2#0 ← (byte) sum::return#0 [ s1#0 s2#0 ]
[4] call sum param-assignment [ sum::return#0 s1#0 s2#0 ]
to:@4
@4: from @3
@4: scope:[] from @3
[5] (byte) s3#0 ← (byte) sum::return#0 [ s1#0 s2#0 s3#0 ]
[6] (byte~) $3 ← (byte) s1#0 + (byte) s2#0 [ $3 s3#0 ]
[7] (byte) s4#0 ← (byte~) $3 + (byte) s3#0 [ ]
to:@end
@end: from @4
sum: from @2 @3 @begin
@end: scope:[] from @4
sum: scope:[sum] from @2 @3 @begin
[8] (byte) sum::b#3 ← phi( @2/(byte) 4 @3/(byte) 13 @begin/(byte) 2 ) [ s1#0 s2#0 sum::a#3 sum::b#3 ]
[8] (byte) sum::a#3 ← phi( @2/(byte) 3 @3/(byte) 9 @begin/(byte) 1 ) [ s1#0 s2#0 sum::a#3 sum::b#3 ]
[9] (byte) sum::return#0 ← (byte) sum::a#3 + (byte) sum::b#3 [ sum::return#0 s1#0 s2#0 ]
to:sum::@return
sum::@return: from sum
sum::@return: scope:[sum] from sum
[10] return [ sum::return#0 s1#0 s2#0 ]
to:@return

View File

@ -1,10 +1,10 @@
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] *((word) 1024) ← (byte) 1 [ ]
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
[2] return [ ]
to:@return

View File

@ -20,153 +20,153 @@ SYMBOLS
(label) main::@return
INITIAL CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte*) SCREEN ← (word) 1024
(void~) $0 ← call main
to:@1
main: from
main: scope:[main] from
*((byte*) SCREEN) ← (byte) 1
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
return
to:@return
@1: from @begin
@1: scope:[] from @begin
to:@end
@end: from @1
@end: scope:[] from @1
Removing empty block @1
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte*) SCREEN ← (word) 1024
(void~) $0 ← call main
to:@end
main: from
main: scope:[main] from
*((byte*) SCREEN) ← (byte) 1
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
return
to:@return
@end: from @begin
@end: scope:[] from @begin
PROCEDURE MODIFY VARIABLE ANALYSIS
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL
@begin: from
@begin: scope:[] from
(byte*) SCREEN ← (word) 1024
call main param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
*((byte*) SCREEN) ← (byte) 1
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
return
to:@return
@end: from @2
@end: scope:[] from @2
Completing Phi functions...
CONTROL FLOW GRAPH SSA
@begin: from
@begin: scope:[] from
(byte*) SCREEN#0 ← (word) 1024
call main param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte*) SCREEN#1 ← phi( @begin/(byte*) SCREEN#0 )
*((byte*) SCREEN#1) ← (byte) 1
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
return
to:@return
@end: from @2
@end: scope:[] from @2
CONTROL FLOW GRAPH WITH ASSIGNMENT CALL & RETURN
@begin: from
@begin: scope:[] from
(byte*) SCREEN#0 ← (word) 1024
call main param-assignment
to:@2
@2: from @begin
@2: scope:[] from @begin
to:@end
main: from @begin
main: scope:[main] from @begin
(byte*) SCREEN#1 ← phi( @begin/(byte*) SCREEN#0 )
*((byte*) SCREEN#1) ← (byte) 1
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
return
to:@return
@end: from @2
@end: scope:[] from @2
Culled Empty Block (label) @2
Succesful SSA optimization Pass2CullEmptyBlocks
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
(byte*) SCREEN#0 ← (word) 1024
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
(byte*) SCREEN#1 ← phi( @begin/(byte*) SCREEN#0 )
*((byte*) SCREEN#1) ← (byte) 1
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Constant (byte*) SCREEN#0 (word) 1024
Succesful SSA optimization Pass2ConstantPropagation
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
(byte*) SCREEN#1 ← phi( @begin/(word) 1024 )
*((byte*) SCREEN#1) ← (byte) 1
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Redundant Phi (byte*) SCREEN#1 (word) 1024
Succesful SSA optimization Pass2RedundantPhiElimination
CONTROL FLOW GRAPH
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
main: from @begin
main: scope:[main] from @begin
*((word) 1024) ← (byte) 1
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
return
to:@return
@end: from @begin
@end: scope:[] from @begin
Block Sequence Planned @begin @end main main::@return
Block Sequence Planned @begin @end main main::@return
CONTROL FLOW GRAPH - PHI LIFTED
@begin: from
@begin: scope:[] from
call main param-assignment
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
*((word) 1024) ← (byte) 1
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
return
to:@return
Propagating live ranges...
CONTROL FLOW GRAPH - LIVE RANGES
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] *((word) 1024) ← (byte) 1 [ ]
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
[2] return [ ]
to:@return
@ -175,14 +175,14 @@ Coalesced down to 0 phi equivalence classes
Block Sequence Planned @begin @end main main::@return
Propagating live ranges...
CONTROL FLOW GRAPH - PHI MEM COALESCED
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] *((word) 1024) ← (byte) 1 [ ]
to:main::@return
main::@return: from main
main::@return: scope:[main] from main
[2] return [ ]
to:@return

View File

@ -96,40 +96,40 @@ animate: {
beq b9
breturn:
rts
b9:
lda #$19
sta $1103
lda $1003
clc
adc #$7
sta $1003
lda $1003
cmp #$28
bcs b11
jmp breturn
b11:
lda $1003
sec
sbc #$28
sta $1003
jmp breturn
b7:
lda #$0
sta $1102
jmp b8
b5:
lda #$28
sta $1001
jmp b6
b3:
lda #$0
sta $1100
jmp b4
b1:
lda #$0
sta $1000
jmp b2
}
b9:
lda #$19
sta $1103
lda $1003
clc
adc #$7
sta $1003
lda $1003
cmp #$28
bcs b11
jmp breturn
b11:
lda $1003
sec
sbc #$28
sta $1003
jmp breturn
b7:
lda #$0
sta $1102
jmp b8
b5:
lda #$28
sta $1001
jmp b6
b3:
lda #$0
sta $1100
jmp b4
b1:
lda #$0
sta $1000
jmp b2
render: {
b1_from_render:
lda #<$d800
@ -223,32 +223,32 @@ findcol: {
ldy #$0
breturn:
rts
b12:
ldy $1200,x
sta $6
b13_from_b12:
jmp b13
b9:
lda $b
sec
sbc $a
clc
adc $7
b11_from_b9:
jmp b11
b6:
lda $7
sec
sbc $9
sta $7
b8_from_b6:
jmp b8
b2:
lda $a
cmp $b
beq breturn_from_b2
jmp b3
}
b12:
ldy $1200,x
sta $6
b13_from_b12:
jmp b13
b9:
lda $b
sec
sbc $a
clc
adc $7
b11_from_b9:
jmp b11
b6:
lda $7
sec
sbc $9
sta $7
b8_from_b6:
jmp b8
b2:
lda $a
cmp $b
beq breturn_from_b2
jmp b3
initscreen: {
b1_from_initscreen:
lda #<$400

View File

@ -1,79 +1,79 @@
@begin: from
@begin: scope:[] from
[0] call main param-assignment [ ]
to:@end
@end: from @begin
main: from @begin
@end: scope:[] from @begin
main: scope:[main] from @begin
[1] call addpoint param-assignment [ ]
to:main::@3
main::@3: from main
main::@3: scope:[main] from main
[2] call addpoint param-assignment [ ]
to:main::@4
main::@4: from main::@3
main::@4: scope:[main] from main::@3
[3] call addpoint param-assignment [ ]
to:main::@5
main::@5: from main::@4
main::@5: scope:[main] from main::@4
[4] call addpoint param-assignment [ ]
to:main::@6
main::@6: from main::@5
main::@6: scope:[main] from main::@5
[5] call addpoint param-assignment [ ]
to:main::@7
main::@7: from main::@6
main::@7: scope:[main] from main::@6
[6] call addpoint param-assignment [ ]
to:main::@8
main::@8: from main::@7
main::@8: scope:[main] from main::@7
[7] call initscreen param-assignment [ ]
to:main::@1
main::@1: from main::@11 main::@8
main::@1: scope:[main] from main::@11 main::@8
[8] call render param-assignment [ ]
to:main::@10
main::@10: from main::@1
main::@10: scope:[main] from main::@1
[9] call animate param-assignment [ ]
to:main::@11
main::@11: from main::@10
main::@11: scope:[main] from main::@10
[10] if(true) goto main::@1 [ ]
to:main::@return
main::@return: from main::@11
main::@return: scope:[main] from main::@11
[11] return [ ]
to:@return
animate: from main::@10
animate: scope:[animate] from main::@10
[12] (byte~) animate::$0 ← * (word) 4096 [ animate::$0 ]
[13] (byte~) animate::$1 ← (byte~) animate::$0 + (byte) 1 [ animate::$1 ]
[14] *((word) 4096) ← (byte~) animate::$1 [ ]
[15] (byte~) animate::$2 ← * (word) 4096 [ animate::$2 ]
[16] if((byte~) animate::$2==(byte) 40) goto animate::@1 [ ]
to:animate::@2
animate::@2: from animate animate::@1
animate::@2: scope:[animate] from animate animate::@1
[17] (byte~) animate::$4 ← * (word) 4352 [ animate::$4 ]
[18] (byte~) animate::$5 ← (byte~) animate::$4 + (byte) 1 [ animate::$5 ]
[19] *((word) 4352) ← (byte~) animate::$5 [ ]
[20] (byte~) animate::$6 ← * (word) 4352 [ animate::$6 ]
[21] if((byte~) animate::$6==(byte) 25) goto animate::@3 [ ]
to:animate::@4
animate::@4: from animate::@2 animate::@3
animate::@4: scope:[animate] from animate::@2 animate::@3
[22] (byte~) animate::$8 ← * (word) 4097 [ animate::$8 ]
[23] (byte~) animate::$9 ← (byte~) animate::$8 - (byte) 1 [ animate::$9 ]
[24] *((word) 4097) ← (byte~) animate::$9 [ ]
[25] (byte~) animate::$10 ← * (word) 4097 [ animate::$10 ]
[26] if((byte~) animate::$10==(byte) 255) goto animate::@5 [ ]
to:animate::@6
animate::@6: from animate::@4 animate::@5
animate::@6: scope:[animate] from animate::@4 animate::@5
[27] (byte~) animate::$12 ← * (word) 4354 [ animate::$12 ]
[28] (byte~) animate::$13 ← (byte~) animate::$12 + (byte) 1 [ animate::$13 ]
[29] *((word) 4354) ← (byte~) animate::$13 [ ]
[30] (byte~) animate::$14 ← * (word) 4354 [ animate::$14 ]
[31] if((byte~) animate::$14==(byte) 25) goto animate::@7 [ ]
to:animate::@8
animate::@8: from animate::@6 animate::@7
animate::@8: scope:[animate] from animate::@6 animate::@7
[32] (byte~) animate::$16 ← * (word) 4355 [ animate::$16 ]
[33] (byte~) animate::$17 ← (byte~) animate::$16 - (byte) 1 [ animate::$17 ]
[34] *((word) 4355) ← (byte~) animate::$17 [ ]
[35] (byte~) animate::$18 ← * (word) 4355 [ animate::$18 ]
[36] if((byte~) animate::$18==(byte) 255) goto animate::@9 [ ]
to:animate::@return
animate::@return: from animate::@11 animate::@8 animate::@9
animate::@return: scope:[animate] from animate::@11 animate::@8 animate::@9
[37] return [ ]
to:@return
animate::@9: from animate::@8
animate::@9: scope:[animate] from animate::@8
[38] *((word) 4355) ← (byte) 25 [ ]
[39] (byte~) animate::$20 ← * (word) 4099 [ animate::$20 ]
[40] (byte~) animate::$21 ← (byte~) animate::$20 + (byte) 7 [ animate::$21 ]
@ -81,52 +81,52 @@ animate::@9: from animate::@8
[42] (byte~) animate::$22 ← * (word) 4099 [ animate::$22 ]
[43] if((byte~) animate::$22>=(byte) 40) goto animate::@11 [ ]
to:animate::@return
animate::@11: from animate::@9
animate::@11: scope:[animate] from animate::@9
[44] (byte~) animate::$24 ← * (word) 4099 [ animate::$24 ]
[45] (byte~) animate::$25 ← (byte~) animate::$24 - (byte) 40 [ animate::$25 ]
[46] *((word) 4099) ← (byte~) animate::$25 [ ]
to:animate::@return
animate::@7: from animate::@6
animate::@7: scope:[animate] from animate::@6
[47] *((word) 4354) ← (byte) 0 [ ]
to:animate::@8
animate::@5: from animate::@4
animate::@5: scope:[animate] from animate::@4
[48] *((word) 4097) ← (byte) 40 [ ]
to:animate::@6
animate::@3: from animate::@2
animate::@3: scope:[animate] from animate::@2
[49] *((word) 4352) ← (byte) 0 [ ]
to:animate::@4
animate::@1: from animate
animate::@1: scope:[animate] from animate
[50] *((word) 4096) ← (byte) 0 [ ]
to:animate::@2
render: from main::@1
render: scope:[render] from main::@1
to:render::@1
render::@1: from render render::@3
render::@1: scope:[render] from render render::@3
[51] (byte*) render::colline#2 ← phi( render/(word) 55296 render::@3/(byte*) render::colline#1 ) [ render::y#2 render::colline#2 ]
[51] (byte) render::y#2 ← phi( render/(byte) 0 render::@3/(byte) render::y#1 ) [ render::y#2 render::colline#2 ]
to:render::@2
render::@2: from render::@1 render::@5
render::@2: scope:[render] from render::@1 render::@5
[52] (byte) render::x#2 ← phi( render::@1/(byte) 0 render::@5/(byte) render::x#1 ) [ render::x#2 render::y#2 render::colline#2 ]
[53] (byte) findcol::x#0 ← (byte) render::x#2 [ render::x#2 render::y#2 render::colline#2 ]
[54] (byte) findcol::y#0 ← (byte) render::y#2 [ render::x#2 render::y#2 render::colline#2 ]
[55] call findcol param-assignment [ render::x#2 render::y#2 findcol::return#0 render::colline#2 ]
to:render::@5
render::@5: from render::@2
render::@5: scope:[render] from render::@2
[56] (byte) render::col#0 ← (byte) findcol::return#0 [ render::x#2 render::y#2 render::colline#2 render::col#0 ]
[57] *((byte*) render::colline#2 + (byte) render::x#2) ← (byte) render::col#0 [ render::x#2 render::y#2 render::colline#2 ]
[58] (byte) render::x#1 ← ++ (byte) render::x#2 [ render::x#1 render::y#2 render::colline#2 ]
[59] if((byte) render::x#1<(byte) 40) goto render::@2 [ render::x#1 render::y#2 render::colline#2 ]
to:render::@3
render::@3: from render::@5
render::@3: scope:[render] from render::@5
[60] (byte*) render::colline#1 ← (byte*) render::colline#2 + (byte) 40 [ render::colline#1 render::y#2 ]
[61] (byte) render::y#1 ← ++ (byte) render::y#2 [ render::y#1 render::colline#1 ]
[62] if((byte) render::y#1<(byte) 25) goto render::@1 [ render::y#1 render::colline#1 ]
to:render::@return
render::@return: from render::@3
render::@return: scope:[render] from render::@3
[63] return [ ]
to:@return
findcol: from render::@2
findcol: scope:[findcol] from render::@2
to:findcol::@1
findcol::@1: from findcol findcol::@13
findcol::@1: scope:[findcol] from findcol findcol::@13
[64] (byte) findcol::mincol#11 ← phi( findcol/(byte) 0 findcol::@13/(byte) findcol::mincol#2 ) [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
[64] (byte) findcol::mindiff#10 ← phi( findcol/(byte) 255 findcol::@13/(byte) findcol::mindiff#11 ) [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
[64] (byte) findcol::i#12 ← phi( findcol/(byte) 0 findcol::@13/(byte) findcol::i#1 ) [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
@ -134,60 +134,60 @@ findcol::@1: from findcol findcol::@13
[66] (byte) findcol::yp#0 ← (word) 4352 *idx (byte) findcol::i#12 [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
[67] if((byte) findcol::x#0==(byte) findcol::xp#0) goto findcol::@2 [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
to:findcol::@3
findcol::@3: from findcol::@1 findcol::@2
findcol::@3: scope:[findcol] from findcol::@1 findcol::@2
[68] if((byte) findcol::x#0<(byte) findcol::xp#0) goto findcol::@6 [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
to:findcol::@7
findcol::@7: from findcol::@3
findcol::@7: scope:[findcol] from findcol::@3
[69] (byte) findcol::diff#1 ← (byte) findcol::x#0 - (byte) findcol::xp#0 [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::diff#1 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
to:findcol::@8
findcol::@8: from findcol::@6 findcol::@7
findcol::@8: scope:[findcol] from findcol::@6 findcol::@7
[70] (byte) findcol::diff#4 ← phi( findcol::@6/(byte) findcol::diff#0 findcol::@7/(byte) findcol::diff#1 ) [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::yp#0 findcol::diff#4 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
[71] if((byte) findcol::y#0<(byte) findcol::yp#0) goto findcol::@9 [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::yp#0 findcol::diff#4 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
to:findcol::@10
findcol::@10: from findcol::@8
findcol::@10: scope:[findcol] from findcol::@8
[72] (byte~) findcol::$10 ← (byte) findcol::y#0 - (byte) findcol::yp#0 [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#4 findcol::$10 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
[73] (byte) findcol::diff#3 ← (byte) findcol::diff#4 + (byte~) findcol::$10 [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#3 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
to:findcol::@11
findcol::@11: from findcol::@10 findcol::@9
findcol::@11: scope:[findcol] from findcol::@10 findcol::@9
[74] (byte) findcol::diff#6 ← phi( findcol::@10/(byte) findcol::diff#3 findcol::@9/(byte) findcol::diff#2 ) [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#6 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
[75] if((byte) findcol::diff#6<(byte) findcol::mindiff#10) goto findcol::@12 [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#6 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
to:findcol::@13
findcol::@13: from findcol::@11 findcol::@12
findcol::@13: scope:[findcol] from findcol::@11 findcol::@12
[76] (byte) findcol::mindiff#11 ← phi( findcol::@11/(byte) findcol::mindiff#10 findcol::@12/(byte~) findcol::diff#13 ) [ render::x#2 render::y#2 render::colline#2 findcol::mindiff#11 findcol::mincol#2 findcol::i#12 findcol::x#0 findcol::y#0 numpoints#1 ]
[76] (byte) findcol::mincol#2 ← phi( findcol::@11/(byte) findcol::mincol#11 findcol::@12/(byte) findcol::mincol#1 ) [ render::x#2 render::y#2 render::colline#2 findcol::mindiff#11 findcol::mincol#2 findcol::i#12 findcol::x#0 findcol::y#0 numpoints#1 ]
[77] (byte) findcol::i#1 ← ++ (byte) findcol::i#12 [ render::x#2 render::y#2 render::colline#2 findcol::i#1 findcol::mindiff#11 findcol::mincol#2 findcol::x#0 findcol::y#0 numpoints#1 ]
[78] if((byte) findcol::i#1<(byte) numpoints#1) goto findcol::@1 [ render::x#2 render::y#2 render::colline#2 findcol::i#1 findcol::mindiff#11 findcol::mincol#2 findcol::x#0 findcol::y#0 numpoints#1 ]
to:findcol::@return
findcol::@return: from findcol::@13 findcol::@2
findcol::@return: scope:[findcol] from findcol::@13 findcol::@2
[79] (byte) findcol::return#0 ← phi( findcol::@13/(byte) findcol::mincol#2 findcol::@2/(byte) 0 ) [ render::x#2 render::y#2 findcol::return#0 render::colline#2 ]
[80] return [ render::x#2 render::y#2 findcol::return#0 render::colline#2 ]
to:@return
findcol::@12: from findcol::@11
findcol::@12: scope:[findcol] from findcol::@11
[81] (byte) findcol::mincol#1 ← (word) 4608 *idx (byte) findcol::i#12 [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#6 findcol::mincol#1 numpoints#1 ]
[82] (byte~) findcol::diff#13 ← (byte) findcol::diff#6 [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::mincol#1 findcol::diff#13 numpoints#1 ]
to:findcol::@13
findcol::@9: from findcol::@8
findcol::@9: scope:[findcol] from findcol::@8
[83] (byte~) findcol::$8 ← (byte) findcol::yp#0 - (byte) findcol::y#0 [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#4 findcol::mindiff#10 findcol::mincol#11 numpoints#1 findcol::$8 ]
[84] (byte) findcol::diff#2 ← (byte) findcol::diff#4 + (byte~) findcol::$8 [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#2 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
to:findcol::@11
findcol::@6: from findcol::@3
findcol::@6: scope:[findcol] from findcol::@3
[85] (byte) findcol::diff#0 ← (byte) findcol::xp#0 - (byte) findcol::x#0 [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::diff#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
to:findcol::@8
findcol::@2: from findcol::@1
findcol::@2: scope:[findcol] from findcol::@1
[86] if((byte) findcol::y#0==(byte) findcol::yp#0) goto findcol::@return [ render::x#2 render::y#2 render::colline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 numpoints#1 ]
to:findcol::@3
initscreen: from main::@8
initscreen: scope:[initscreen] from main::@8
to:initscreen::@1
initscreen::@1: from initscreen initscreen::@1
initscreen::@1: scope:[initscreen] from initscreen initscreen::@1
[87] (byte*) initscreen::screen#2 ← phi( initscreen/(word) 1024 initscreen::@1/(byte*) initscreen::screen#1 ) [ initscreen::screen#2 ]
[88] *((byte*) initscreen::screen#2) ← (byte) 230 [ initscreen::screen#2 ]
[89] (byte*) initscreen::screen#1 ← ++ (byte*) initscreen::screen#2 [ initscreen::screen#1 ]
[90] if((byte*) initscreen::screen#1<(word) 2024) goto initscreen::@1 [ initscreen::screen#1 ]
to:initscreen::@return
initscreen::@return: from initscreen::@1
initscreen::@return: scope:[initscreen] from initscreen::@1
[91] return [ ]
to:@return
addpoint: from main main::@3 main::@4 main::@5 main::@6 main::@7
addpoint: scope:[addpoint] from main main::@3 main::@4 main::@5 main::@6 main::@7
[92] (byte) addpoint::c#6 ← phi( main/(byte) 1 main::@3/(byte) 2 main::@4/(byte) 3 main::@5/(byte) 4 main::@6/(byte) 5 main::@7/(byte) 7 ) [ numpoints#19 addpoint::x#6 addpoint::y#6 addpoint::c#6 ]
[92] (byte) addpoint::y#6 ← phi( main/(byte) 5 main::@3/(byte) 8 main::@4/(byte) 14 main::@5/(byte) 2 main::@6/(byte) 17 main::@7/(byte) 22 ) [ numpoints#19 addpoint::x#6 addpoint::y#6 addpoint::c#6 ]
[92] (byte) numpoints#19 ← phi( main/(byte) 0 main::@3/(byte) numpoints#1 main::@4/(byte) numpoints#1 main::@5/(byte) numpoints#1 main::@6/(byte) numpoints#1 main::@7/(byte) numpoints#1 ) [ numpoints#19 addpoint::x#6 addpoint::y#6 addpoint::c#6 ]
@ -197,6 +197,6 @@ addpoint: from main main::@3 main::@4 main::@5 main::@6 main::@7
[95] *((word) 4608 + (byte) numpoints#19) ← (byte) addpoint::c#6 [ numpoints#19 ]
[96] (byte) numpoints#1 ← ++ (byte) numpoints#19 [ ]
to:addpoint::@return
addpoint::@return: from addpoint
addpoint::@return: scope:[addpoint] from addpoint
[97] return [ ]
to:@return

File diff suppressed because it is too large Load Diff