1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-04-08 14:37:40 +00:00

Working in VariableBuilder for creating variables based on type/scope, directives and configuration.

This commit is contained in:
jespergravgaard 2019-12-22 11:53:37 +01:00
parent 4c443c1034
commit 4f7485f4e5
154 changed files with 2083 additions and 1029 deletions

View File

@ -1,6 +1,7 @@
package dk.camelot64.kickc.model;
import dk.camelot64.kickc.model.iterator.ProgramValue;
import dk.camelot64.kickc.model.operators.Operators;
import dk.camelot64.kickc.model.statements.StatementSource;
import dk.camelot64.kickc.model.symbols.StructDefinition;
import dk.camelot64.kickc.model.symbols.Variable;
@ -57,6 +58,20 @@ public class ConstantValueLists {
}
// Add a cast to the value list itself
programValue.set(new CastValue(declaredType, valueList));
} else if(declaredType.equals(SymbolType.WORD) && valueList.getList().size()==2){
// An inline word { byte, byte}
for(int i = 0; i < valueList.getList().size(); i++) {
exprModified |= addValueCasts(SymbolType.BYTE, false, new ProgramValue.ProgramValueListElement(valueList, i), program, source);
}
// Add a cast to the value list itself
programValue.set(new CastValue(declaredType, valueList));
} else if(declaredType.equals(SymbolType.DWORD) && valueList.getList().size()==2){
// An inline dword { byte, byte}
for(int i = 0; i < valueList.getList().size(); i++) {
exprModified |= addValueCasts(SymbolType.WORD, false, new ProgramValue.ProgramValueListElement(valueList, i), program, source);
}
// Add a cast to the value list itself
programValue.set(new CastValue(declaredType, valueList));
} else {
// TODO: Handle word/dword initializers
throw new InternalError("Type not handled! " + declaredType);
@ -153,6 +168,18 @@ public class ConstantValueLists {
memberValues.put(memberDef.getRef(), memberValue);
}
return new ConstantStructValue(declaredStructType, memberValues);
} else if(declaredType.equals(SymbolType.WORD) && constantValues.size()==2){
// An inline word
for(ConstantValue constantValue : constantValues)
if(!SymbolTypeConversion.assignmentTypeMatch(SymbolType.BYTE, constantValue.getType(program.getScope())))
throw new CompileError("Initializer element " + constantValue.toString(program) + " does not match needed type "+SymbolType.BYTE, source);
return new ConstantBinary(new ConstantBinary(constantValues.get(0), Operators.MULTIPLY, new ConstantInteger(0x100L, SymbolType.WORD)), Operators.PLUS, constantValues.get(1));
} else if(declaredType.equals(SymbolType.DWORD) && constantValues.size()==2){
// An inline word
for(ConstantValue constantValue : constantValues)
if(!SymbolTypeConversion.assignmentTypeMatch(SymbolType.WORD, constantValue.getType(program.getScope())))
throw new CompileError("Initializer element " + constantValue.toString(program) + " does not match needed type "+SymbolType.WORD, source);
return new ConstantBinary(new ConstantBinary(constantValues.get(0), Operators.MULTIPLY, new ConstantInteger(0x10000L, SymbolType.DWORD)), Operators.PLUS, constantValues.get(1));
} else {
throw new InternalError("Not supported " + declaredType);
}

View File

@ -19,6 +19,10 @@ public interface Directive {
class Register implements Directive {
}
/** Variable declared static. */
class Static implements Directive {
}
/** Function declared inline. */
class Inline implements Directive {
}
@ -31,6 +35,14 @@ public interface Directive {
class Export implements Directive {
}
/** Variable declared as pointer to volatile ( volatile * ) */
class ToVolatile implements Directive {
}
/** Variable declared as pointer to const ( const * ) */
class ToConst implements Directive {
}
/** Variable __ssa */
class FormSsa implements Directive {
}

View File

@ -1,12 +1,10 @@
package dk.camelot64.kickc.model;
import dk.camelot64.kickc.model.statements.StatementSource;
import dk.camelot64.kickc.model.symbols.*;
import dk.camelot64.kickc.model.types.SymbolType;
import dk.camelot64.kickc.model.types.SymbolTypePointer;
import dk.camelot64.kickc.model.types.SymbolTypeStruct;
import dk.camelot64.kickc.model.values.ScopeRef;
import dk.camelot64.kickc.model.values.VariableRef;
import java.util.List;
@ -26,39 +24,26 @@ public class VariableBuilder {
/** The type of the variable. */
private SymbolType type;
/** Tye variable is an array. */
private boolean isArray;
/** Non-null if the variable is an array. */
private ArraySpec arraySpec;
/** A compile-time constant (const keyword and no volatile keyword and initValue is a compile-time constant) */
private boolean isConstant;
/** The directives of the variable declaration. */
private List<Directive> directives;
/** Declared as global private (static keyword and global variable) */
private boolean isPrivate;
/** Declared as local permanent (static keyword and local variable) */
private boolean isPermanent;
/** Declared as volatile (volatile keyword) */
private boolean isVolatile;
/** Declared as no-modify (const keyword) */
private boolean isNoModify;
/** Declared as optimize (register keyword) */
private boolean isOptimize;
/** Declared as pointer to volatile (volatile* keyword) */
private boolean isToVolatile;
/** Declared as pointer to no-modify (const* keyword) */
private boolean isToNoModify;
public VariableBuilder(Scope scope, boolean isParameter, SymbolType type, ArraySpec arraySpec, List<Directive> directives) {
this.scope = scope;
this.isParameter = isParameter;
this.type = type;
this.arraySpec = arraySpec;
this.directives = directives;
}
/**
* Is the type is a simple integer type.
*
* @return True if the type is a simple integer type.
*/
boolean isTypeInteger() {
public boolean isTypeInteger() {
return SymbolType.isInteger(type) || SymbolType.BOOLEAN.equals(type);
}
@ -67,7 +52,7 @@ public class VariableBuilder {
*
* @return True if the type is a pointer type.
*/
boolean isTypePointer() {
public boolean isTypePointer() {
return type instanceof SymbolTypePointer;
}
@ -76,7 +61,7 @@ public class VariableBuilder {
*
* @return True if the type is a struct type.
*/
boolean isTypeStruct() {
public boolean isTypeStruct() {
return type instanceof SymbolTypeStruct;
}
@ -85,7 +70,7 @@ public class VariableBuilder {
*
* @return true if the variable is in the global scope
*/
boolean isScopeGlobal() {
public boolean isScopeGlobal() {
return ScopeRef.ROOT.equals(scope.getRef());
}
@ -94,7 +79,7 @@ public class VariableBuilder {
*
* @return true if the variable is a function parameter
*/
boolean isScopeParameter() {
public boolean isScopeParameter() {
Scope s = scope;
while(s instanceof BlockScope)
s = s.getScope();
@ -106,7 +91,7 @@ public class VariableBuilder {
*
* @return true if the variable is in a function scope
*/
boolean isScopeLocal() {
public boolean isScopeLocal() {
Scope s = scope;
while(s instanceof BlockScope)
s = s.getScope();
@ -118,107 +103,191 @@ public class VariableBuilder {
*
* @return true if the variable is a struct definition member
*/
boolean isScopeMember() {
public boolean isScopeMember() {
return scope instanceof StructDefinition;
}
public VariableBuilder() {
/**
* Is the variable an array declaration
*
* @return true if the variable is an array declaration
*/
public boolean isArray() {
return arraySpec != null;
}
/**
* Find the variable kind for a declared variable (not used for intermediates or PHI-versions)
* Is the variable a compile-time constant
*
* @return true if the variable is a compile-time constant
*/
public boolean isConstant() {
if(isScopeGlobal() && hasDirective(Directive.Const.class) && !hasDirective(Directive.Volatile.class))
// Global const
return true;
else if(isScopeLocal() && hasDirective(Directive.Const.class) && hasDirective(Directive.Static.class) && !hasDirective(Directive.Volatile.class))
// Global static const
return true;
else if(isScopeLocal() && hasDirective(Directive.Const.class) && !hasDirective(Directive.Volatile.class))
// Local const
// TODO: Only allow local const variables with an init-value that is instanceof ConstantValue
return true;
else if(isArray())
// Any array
return true;
else
return false;
}
/** Declared as global private (static keyword and global variable) */
public boolean isPrivate() {
return isScopeGlobal() && hasDirective(Directive.Static.class);
}
/** Declared as local permanent (static keyword and local variable) */
public boolean isPermanent() {
return isScopeLocal() && hasDirective(Directive.Static.class);
}
/** Declared as volatile (volatile keyword) */
public boolean isVolatile() {
return hasDirective(Directive.Volatile.class);
}
/** Declared as no-modify (const keyword) */
public boolean isNoModify() {
return hasDirective(Directive.Const.class);
}
/** Declared as optimize (register keyword) */
public boolean isOptimize() {
return hasDirective(Directive.Register.class) || hasDirective(Directive.NamedRegister.class);
}
/** Declared as pointer to volatile (volatile* keyword) */
public boolean isToVolatile() {
return hasDirective(Directive.ToVolatile.class);
}
/** Declared as pointer to no-modify (const* keyword) */
public boolean isToNoModify() {
return hasDirective(Directive.ToConst.class);
}
/** Declared as export (__export keyword)
*
* @return true if declared as export
*/
public boolean isExport() {
return hasDirective(Directive.Export.class);
}
/**
* Is the variable single-static-assignment ot multi-assignment.
* Depends on the type and scope of the variable plus directives directly affecting the memory layout ( __mma, __sa, __zp, __address, __align).
* TODO: Add different handling of different types & scopes
* TODO: Handle intermediate variables
* TODO: Add support for memory configuration controlling the assignment-type
*
* @return true if the variable is single-static-assignment
*/
public boolean isSingleStaticAssignment() {
if(hasDirective(Directive.FormMa.class))
return false;
else if(!isConstant())
return true;
else
return false;
}
/**
* Get the resulting kind of a variable.
*
* @param type The type of the variable
* @param scope The scope
* @param isParameter true if the variable is a procedure parameter
* @param sourceDirectives The directives in the source code
* @param source The source line (for exceptions)
* @return The variable kind
*/
public Variable.Kind getKind(SymbolType type, Scope scope, boolean isParameter, boolean isArray, List<Directive> sourceDirectives, StatementSource source) {
// Look for const without volatile
if(hasDirective(Directive.Const.class, sourceDirectives))
if(!hasDirective(Directive.Volatile.class, sourceDirectives))
return Variable.Kind.CONSTANT;
// Look for array (which is implicitly const
//DirectiveType directiveType = DirectiveType.getFor(type);
if(isArray)
public Variable.Kind getKind() {
if(isConstant())
return Variable.Kind.CONSTANT;
// It is not a constant - determine PHI_MASTER vs LOAD_STORE
if(hasDirective(Directive.FormSsa.class, sourceDirectives))
else if(isSingleStaticAssignment())
return Variable.Kind.PHI_MASTER;
if(hasDirective(Directive.FormMa.class, sourceDirectives))
else
return Variable.Kind.LOAD_STORE;
if(hasDirective(Directive.Register.class, sourceDirectives))
return Variable.Kind.PHI_MASTER;
if(hasDirective(Directive.NamedRegister.class, sourceDirectives))
return Variable.Kind.PHI_MASTER;
// TODO: Add strategy for selecting LOAD_STORE for global vars
return Variable.Kind.PHI_MASTER;
}
/**
* Applies directives to a variable.
* Get the memory area to use the the variable.
* Depends on the type and scope of the variable plus directives directly affecting the memory layout ( __mma, __sa, __zp, __address, __align).
* <p>
* TODO: Add different handling of different types & scopes
* TODO: Add support for memory configuration controlling the assignment-type
*
* @param variable The variable to apply directives to
* @param sourceDirectives The directives found in the source code
* @param source The source line (for exceptions)
* @return The memory area to store the variable data in.
*/
public void applyDirectives(Variable variable, boolean isParameter, boolean isArray, List<Directive> sourceDirectives, StatementSource source) {
if(hasDirective(Directive.Const.class, sourceDirectives))
variable.setDeclaredConst(true);
if(isArray)
variable.setDeclaredConst(true);
if(hasDirective(Directive.Volatile.class, sourceDirectives))
variable.setDeclaredVolatile(true);
if(hasDirective(Directive.Export.class, sourceDirectives))
variable.setDeclaredExport(true);
if(hasDirective(Directive.Register.class, sourceDirectives)) {
variable.setMemoryArea(Variable.MemoryArea.ZEROPAGE_MEMORY);
variable.setDeclaredAsRegister(true);
public Variable.MemoryArea getMemoryArea() {
if(isConstant())
return Variable.MemoryArea.MAIN_MEMORY;
else if(!isConstant() && isOptimize())
return Variable.MemoryArea.ZEROPAGE_MEMORY;
else if(isArray())
return Variable.MemoryArea.MAIN_MEMORY;
else if(hasDirective(Directive.MemZp.class))
return Variable.MemoryArea.ZEROPAGE_MEMORY;
else if(hasDirective(Directive.MemMain.class))
return Variable.MemoryArea.MAIN_MEMORY;
Directive.Address addressDirective = findDirective(Directive.Address.class);
if(addressDirective != null)
return (addressDirective.address < 0x100) ? Variable.MemoryArea.ZEROPAGE_MEMORY : Variable.MemoryArea.MAIN_MEMORY;
else
return Variable.MemoryArea.ZEROPAGE_MEMORY;
}
/**
* Get any memory-alignment of the variables data
* @return
*/
public Integer getAlignment() {
Directive.Align alignDirective = findDirective(Directive.Align.class);
if(alignDirective != null) {
if(isArray()) {
return alignDirective.alignment;
} else {
// TODO: Add information about which variable (name) and the offending source line
throw new CompileError("Error! Cannot align variable that is not an array.");
}
}
if(isArray)
variable.setMemoryArea(Variable.MemoryArea.MAIN_MEMORY);
if(hasDirective(Directive.MemZp.class, sourceDirectives))
variable.setMemoryArea(Variable.MemoryArea.ZEROPAGE_MEMORY);
if(hasDirective(Directive.MemMain.class, sourceDirectives))
variable.setMemoryArea(Variable.MemoryArea.MAIN_MEMORY);
Directive.Address addressDirective = findDirective(Directive.Address.class, sourceDirectives);
return null;
}
/**
* Get any hard-coded register allocation.
*
* @return Hard-coded register allocation. Null if not hard-coded.
*/
public Registers.Register getRegister() {
Directive.Address addressDirective = findDirective(Directive.Address.class);
if(addressDirective != null) {
Variable.MemoryArea memoryArea = (addressDirective.address < 0x100) ? Variable.MemoryArea.ZEROPAGE_MEMORY : Variable.MemoryArea.MAIN_MEMORY;
if(Variable.MemoryArea.ZEROPAGE_MEMORY.equals(memoryArea)) {
variable.setMemoryArea(Variable.MemoryArea.ZEROPAGE_MEMORY);
Registers.Register register = new Registers.RegisterZpMem(addressDirective.address.intValue(), -1, true);
variable.setDeclaredRegister(register);
return new Registers.RegisterZpMem(addressDirective.address.intValue(), -1, true);
} else {
variable.setMemoryArea(Variable.MemoryArea.MAIN_MEMORY);
Registers.Register register = new Registers.RegisterMainMem((VariableRef) variable.getRef(), -1, addressDirective.address);
variable.setDeclaredRegister(register);
// TODO: Fix VariableRef for the hard-coded register
return new Registers.RegisterMainMem(null, -1, addressDirective.address);
}
}
Directive.NamedRegister registerDirective = findDirective(Directive.NamedRegister.class, sourceDirectives);
Directive.NamedRegister registerDirective = findDirective(Directive.NamedRegister.class);
if(registerDirective != null) {
variable.setDeclaredAsRegister(true);
Registers.Register register = Registers.getRegister(registerDirective.name);
if(register == null) {
throw new CompileError("Error! Unknown register " + registerDirective.name, source);
// TODO: Add statement source
throw new CompileError("Error! Unknown register " + registerDirective.name);
}
variable.setDeclaredRegister(register);
return register;
}
Directive.Align alignDirective = findDirective(Directive.Align.class, sourceDirectives);
if(alignDirective != null) {
if(isArray) {
variable.setDeclaredAlignment(alignDirective.alignment);
} else {
throw new CompileError("Error! Cannot align variable that is not a string or an array " + variable.toString(), source);
}
}
// TODO: Add strategy for selecting main memory for non-pointer local variables
//DirectiveScope directiveScope = DirectiveScope.getFor(lValue.getScope(), isParameter);
// No hard-coded register
return null;
}
/**
@ -229,11 +298,10 @@ public class VariableBuilder {
* @param <DirectiveClass> The class of the type to look for
* @return true if the directive if found. false otherwise.
*/
private <DirectiveClass extends Directive> boolean hasDirective(Class<DirectiveClass> directiveClass, List<Directive> directives) {
return findDirective(directiveClass, directives) != null;
private <DirectiveClass extends Directive> boolean hasDirective(Class<DirectiveClass> directiveClass) {
return findDirective(directiveClass) != null;
}
/**
* Look for a specific directive type in a list of directives
*
@ -242,7 +310,7 @@ public class VariableBuilder {
* @param <DirectiveClass> The class of the type to look for
* @return The directive if found. null if not found.
*/
private <DirectiveClass extends Directive> DirectiveClass findDirective(Class<DirectiveClass> directiveClass, List<Directive> directives) {
private <DirectiveClass extends Directive> DirectiveClass findDirective(Class<DirectiveClass> directiveClass) {
if(directives == null) return null;
for(Directive directive : directives) {
if(directiveClass.isInstance(directive)) {

View File

@ -115,6 +115,8 @@ public class SymbolTypeInference {
return SymbolType.BYTE;
} else if(rValue instanceof StructUnwoundPlaceholder) {
return ((StructUnwoundPlaceholder) rValue).getTypeStruct();
} else if(rValue instanceof ConstantStructValue) {
return ((ConstantStructValue) rValue).getStructType();
}
if(type == null) {
throw new InternalError("Cannot infer type for " + rValue.toString());

View File

@ -3,8 +3,8 @@ package dk.camelot64.kickc.passes;
import dk.camelot64.kickc.NumberParser;
import dk.camelot64.kickc.SourceLoader;
import dk.camelot64.kickc.asm.AsmClobber;
import dk.camelot64.kickc.model.*;
import dk.camelot64.kickc.model.InternalError;
import dk.camelot64.kickc.model.*;
import dk.camelot64.kickc.model.iterator.ProgramValue;
import dk.camelot64.kickc.model.operators.*;
import dk.camelot64.kickc.model.statements.*;
@ -268,7 +268,7 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
this.visitDeclTypes(ctx.declTypes());
SymbolType type = declVarType;
List<Directive> directives = declVarDirectives;
Variable param = Variable.createPhiMaster( ctx.NAME().getText(), type, getCurrentScope(), defaultMemoryArea, currentDataSegment);
Variable param = Variable.createPhiMaster(ctx.NAME().getText(), type, getCurrentScope(), defaultMemoryArea, currentDataSegment);
// Add directives
directiveContext.applyDirectives(param, true, false, directives, new StatementSource(ctx));
exitDeclTypes();
@ -567,31 +567,46 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
StatementSource statementSource = new StatementSource(ctx);
String varName = ctx.NAME().getText();
KickCParser.ExprContext initializer = ctx.expr();
ArraySpec arraySpec = null;
if(declIsArray) {
arraySpec = new ArraySpec(declArraySize);
}
if(initializer != null)
PrePostModifierHandler.addPreModifiers(this, initializer, statementSource);
RValue initValue = (initializer == null) ? null : (RValue) visit(initializer);
initValue = getInitValue(initValue, declVarType, declIsArray, declArraySize, program, statementSource);
VariableBuilder varBuilder = new VariableBuilder(getCurrentScope(), false, declVarType, arraySpec, declVarDirectives);
try {
// Find kind
Variable.Kind kind = directiveContext.getKind(declVarType, getCurrentScope(), false, declIsArray, declVarDirectives, statementSource);
if(kind.equals(Variable.Kind.CONSTANT)) {
// Create a Constant
ConstantValue initConstantValue = getConstantValue(initializer, declVarType, declVarStructMember, statementSource);
ArraySpec arraySpec = null;
if(declIsArray) {
arraySpec = new ArraySpec(declArraySize);
}
Scope scope = getCurrentScope();
Variable constVar = Variable.createConstant(varName, declVarType, scope, arraySpec, initConstantValue, currentDataSegment);
scope.add(constVar);
// Add comments to constant
constVar.setComments(ensureUnusedComments(declVarComments));
directiveContext.applyDirectives(constVar, false, declIsArray, declVarDirectives, statementSource);
assert varBuilder.getKind().equals(constVar.getKind());
assert varBuilder.isArray() == constVar.isArray();
assert varBuilder.isVolatile() == constVar.isDeclaredVolatile();
assert varBuilder.isOptimize() == constVar.isDeclaredAsRegister();
assert varBuilder.isExport() == constVar.isDeclaredExport();
assert varBuilder.isConstant() == constVar.isDeclaredConst();
assert varBuilder.getMemoryArea() == constVar.getMemoryArea();
assert Objects.equals(varBuilder.getAlignment(), constVar.getDeclaredAlignment());
assert Objects.equals(varBuilder.getRegister(), constVar.getDeclaredRegister());
} else {
// Create variable
Variable lValue;
if(kind.equals(Variable.Kind.PHI_MASTER)) {
lValue = Variable.createPhiMaster(varName, declVarType, getCurrentScope(), defaultMemoryArea, currentDataSegment);
} else if (kind.equals(Variable.Kind.LOAD_STORE)) {
} else if(kind.equals(Variable.Kind.LOAD_STORE)) {
lValue = Variable.createLoadStore(varName, declVarType, getCurrentScope(), defaultMemoryArea, currentDataSegment);
} else {
throw new InternalError("Unexpected variable kind! "+kind.name(), statementSource);
throw new InternalError("Unexpected variable kind! " + kind.name(), statementSource);
}
getCurrentScope().add(lValue);
// Add directives
@ -599,25 +614,31 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
if(declVarStructMember) {
if(initializer != null) {
throw new CompileError("Initializer not supported inside structs " + declVarType.getTypeName(), statementSource);
} else {
// Struct members have no initializers
return null;
}
} else {
RValue initValue;
if(initializer != null) {
PrePostModifierHandler.addPreModifiers(this, initializer, statementSource);
initValue = (RValue) visit(initializer);
} else {
if(initializer == null) {
initValue = createZeroValue(declVarType, statementSource);
}
Statement initStmt = new StatementAssignment(lValue.getVariableRef(), initValue, statementSource, ensureUnusedComments(declVarComments));
sequence.addStatement(initStmt);
if(initializer != null) {
PrePostModifierHandler.addPostModifiers(this, initializer, statementSource);
}
}
assert varBuilder.getKind().equals(lValue.getKind());
assert varBuilder.isArray() == lValue.isArray();
assert varBuilder.isVolatile() == lValue.isDeclaredVolatile();
assert varBuilder.isOptimize() == lValue.isDeclaredAsRegister();
assert varBuilder.isExport() == lValue.isDeclaredExport();
assert varBuilder.isConstant() == lValue.isDeclaredConst();
assert varBuilder.getMemoryArea() == lValue.getMemoryArea();
assert Objects.equals(varBuilder.getAlignment(), lValue.getDeclaredAlignment());
if(varBuilder.getRegister() instanceof Registers.RegisterMainMem) {
assert Objects.equals(varBuilder.getRegister().getType(), lValue.getDeclaredRegister().getType());
assert Objects.equals(varBuilder.getRegister().getBytes(), lValue.getDeclaredRegister().getBytes());
assert Objects.equals(((Registers.RegisterMainMem) varBuilder.getRegister()).getAddress(), ((Registers.RegisterMainMem) lValue.getDeclaredRegister()).getAddress());
} else
assert Objects.equals(varBuilder.getRegister(), lValue.getDeclaredRegister());
}
if(initializer != null)
PrePostModifierHandler.addPostModifiers(this, initializer, statementSource);
return null;
} catch(CompileError e) {
throw new CompileError(e.getMessage(), statementSource);
@ -637,38 +658,48 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
if(initializer != null && PrePostModifierHandler.hasPrePostModifiers(this, initializer, statementSource)) {
throw new CompileError("Constant value contains a pre/post-modifier.", statementSource);
}
/*
if(isStructMember) {
if(initializer != null) {
throw new CompileError("Initializer not supported inside structs " + declVarType.getTypeName(), statementSource);
} else {
// Struct members have no initializers
return null;
}
RValue initValue = null;
if(initializer != null)
initValue = (RValue) visit(initializer);
if(initValue instanceof ForwardVariableRef) {
throw new CompileError("Variable used before being defined " + initValue.toString(), statementSource);
}
*/
RValue constInitValue = getInitValue(initValue, type, declIsArray, declArraySize, program, statementSource);
if(constInitValue instanceof ConstantValue)
return (ConstantValue) constInitValue;
else
return null;
}
RValue initValue;
if(initializer == null) {
if(declIsArray) {
/**
* Get a value for initializing a variable from an expression.
* If possible the value is converted to a ConstantValue.
*
* @param initValue The parsed init expression value (may be null)
* @param type The type of the constant variable (used for creating zero values)
* @param statementSource The statement (used in exceptions.
* @return The constant init-value. Null if the value cannot be turned into a constant init-value.
*/
private static RValue getInitValue(RValue initValue, SymbolType type, boolean isArray, ConstantValue arraySize, Program program, StatementSource statementSource) {
// TODO: Handle struct members
// Create zero-initializers if null
if(initValue == null) {
if(isArray) {
// Add an zero-filled array initializer
SymbolTypePointer typePointer = (SymbolTypePointer) type;
if(declArraySize == null) {
if(arraySize == null) {
throw new CompileError("Error! Array has no declared size. ", statementSource);
}
initValue = new ConstantArrayFilled(typePointer.getElementType(), declArraySize);
initValue = new ConstantArrayFilled(typePointer.getElementType(), arraySize);
} else {
// Add an zero-value
initValue = createZeroValue(type, statementSource);
}
} else {
initValue = (RValue) visit(initializer);
}
// Convert initializer value lists to constant if possible
if((initValue instanceof ValueList)) {
ProgramValue programValue = new ProgramValue.GenericValue(initValue);
ConstantValueLists.addValueCasts(type, declIsArray, programValue, program, statementSource);
ConstantValueLists.addValueCasts(type, isArray, programValue, program, statementSource);
if(programValue.get() instanceof CastValue) {
CastValue castValue = (CastValue) programValue.get();
if(castValue.getValue() instanceof ValueList) {
@ -681,17 +712,11 @@ public class Pass0GenerateStatementSequence extends KickCParserBaseVisitor<Objec
}
}
}
if(initValue instanceof ForwardVariableRef) {
throw new CompileError("Variable used before being defined " + initValue.toString(), statementSource);
// Add pointer cast to integers
if(type instanceof SymbolTypePointer && initValue instanceof ConstantValue && SymbolType.isInteger(((ConstantValue) initValue).getType(program.getScope()))) {
initValue = new ConstantCastValue(type, (ConstantValue) initValue);
}
if(!(initValue instanceof ConstantValue)) {
throw new CompileError("Constant assigned a non-constant value.", statementSource);
}
ConstantValue initConstantValue = (ConstantValue) initValue;
if(declVarType instanceof SymbolTypePointer && SymbolType.isInteger(initConstantValue.getType(program.getScope()))) {
initConstantValue = new ConstantCastValue(declVarType, initConstantValue);
}
return initConstantValue;
return initValue;
}
@Override

View File

@ -347,6 +347,8 @@ public class Pass1UnwindStructValues extends Pass1Base {
return new StructMemberUnwindingPointerDerefSimple((PointerDereferenceSimple) value, structType.getStructDefinition(getScope()), stmtIt, currentBlock, currentStmt);
} else if(value instanceof PointerDereferenceIndexed) {
return new StructMemberUnwindingPointerDerefIndexed((PointerDereferenceIndexed) value, structType.getStructDefinition(getScope()), stmtIt, currentBlock, currentStmt);
} else if(value instanceof ConstantStructValue) {
return new StructMemberUnwindingConstantValue((ConstantStructValue) value, structType.getStructDefinition(getScope()), stmtIt, currentBlock, currentStmt);
} else {
throw new InternalError("Struct unwinding not implemented for " + value.toString(getProgram()));
}
@ -450,4 +452,38 @@ public class Pass1UnwindStructValues extends Pass1Base {
}
}
/** Unwinding for a simple pointer deref to a struct. */
private class StructMemberUnwindingConstantValue implements StructUnwinding.StructMemberUnwinding {
private final ConstantStructValue constantStructValue;
private final StructDefinition structDefinition;
private final ControlFlowBlock currentBlock;
private final ListIterator<Statement> stmtIt;
private final Statement currentStmt;
StructMemberUnwindingConstantValue(ConstantStructValue constantStructValue, StructDefinition structDefinition, ListIterator<Statement> stmtIt, ControlFlowBlock currentBlock, Statement currentStmt) {
this.constantStructValue = constantStructValue;
this.structDefinition = structDefinition;
this.currentBlock = currentBlock;
this.stmtIt = stmtIt;
this.currentStmt = currentStmt;
}
@Override
public List<String> getMemberNames() {
Collection<Variable> structMemberVars = structDefinition.getAllVariables(false);
ArrayList<String> memberNames = new ArrayList<>();
for(Variable structMemberVar : structMemberVars) {
memberNames.add(structMemberVar.getLocalName());
}
return memberNames;
}
@Override
public RValue getMemberUnwinding(String memberName) {
Variable member = structDefinition.getMember(memberName);
return constantStructValue.getValue(member.getRef());
}
}
}

View File

@ -37,6 +37,11 @@ public class TestPrograms {
public TestPrograms() {
}
@Test
public void testConstantWithPrePost() throws IOException, URISyntaxException {
assertError("constant-prepost", "Constant value contains a pre/post-modifier");
}
@Test
public void testGridBobs() throws IOException, URISyntaxException {
compileAndCompare("complex/prebob/grid-bobs");
@ -2839,6 +2844,11 @@ public class TestPrograms {
compileAndCompare("inline-assignment");
}
@Test
public void testInlineDWord0() throws IOException, URISyntaxException {
compileAndCompare("inline-dword-0");
}
@Test
public void testInlineWord0() throws IOException, URISyntaxException {
compileAndCompare("inline-word-0");

View File

@ -0,0 +1,7 @@
// A constant expression with a pre/post increment should cause an error
const char i=7;
void main() {
const char j=i++;
}

View File

@ -1,10 +1,5 @@
// Tests calling into different function pointers which call a common sub-method
void main() {
do10(&hello);
do10(&world);
}
void do10(void()* fn) {
for( byte i: 0..9)
(*fn)();
@ -18,6 +13,11 @@ void world() {
print("world ");
}
void main() {
do10(&hello);
do10(&world);
}
const byte* SCREEN = $0400;
volatile byte idx = 0;

View File

@ -1,5 +1,10 @@
// Tests calling into a function pointer with local variables
void fn1() {
for(byte* screen=$400;screen<$400+1000;screen++)
(*screen)++;
}
void main() {
void()* cls = &fn1;
for(byte* cols = $d800; cols<$d800+1000;cols++) {
@ -8,9 +13,5 @@ void main() {
}
}
void fn1() {
for(byte* screen=$400;screen<$400+1000;screen++)
(*screen)++;
}

View File

@ -1,11 +1,5 @@
// Tests calling into a function pointer with local variables
void main() {
void()* f = &hello;
do10(f);
}
void do10(void()* fn) {
for( byte i: 0..9)
(*fn)();
@ -24,3 +18,9 @@ void hello() {
}
void main() {
void()* f = &hello;
do10(f);
}

View File

@ -1,14 +1,6 @@
// Tests calling into a function pointer with local variables
void main() {
void()* f = &hello;
msg = msg1;
do10(f);
msg = msg2;
do10(f);
}
void do10(void()* fn) {
for( byte i: 0..9)
(*fn)();
@ -28,4 +20,13 @@ void hello() {
} while(msg[i]);
}
void main() {
void()* f = &hello;
msg = msg1;
do10(f);
msg = msg2;
do10(f);
}

View File

@ -4,6 +4,10 @@ const byte* SCREEN = $0400;
volatile byte idx = 0;
void fn1() {
idx++;
}
void main() {
void()* f = &fn1;
(*f)();
@ -12,8 +16,4 @@ void main() {
SCREEN[idx] = 'a';
}
void fn1() {
idx++;
}

View File

@ -1,11 +1,12 @@
// Tests creating, assigning and calling pointers to non-args no-return functions
void fn1() {
const byte* BORDERCOL = $d020;
(*BORDERCOL)++;
}
void main() {
void()* f = &fn1;
(*f)();
}
void fn1() {
const byte* BORDERCOL = $d020;
(*BORDERCOL)++;
}

View File

@ -0,0 +1,7 @@
// Tests minimal inline dword
void main() {
dword w = { 0x01234, 0x5678 };
dword* screen = 0x0400;
screen[0] = w;
}

View File

@ -76,7 +76,7 @@ bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@1
(byte) bitmap_init::bits#2 ← (number) $80
to:bitmap_init::@2
bitmap_init::@4: scope:[bitmap_init] from bitmap_init::@2
(byte*) bitmap_init::yoffs#0 ← ((byte*)) (number) 0
(byte*) bitmap_init::yoffs#0 ← (byte*)(number) 0
(byte) bitmap_init::y#0 ← (byte) 0
to:bitmap_init::@5
bitmap_init::@5: scope:[bitmap_init] from bitmap_init::@4 bitmap_init::@6
@ -1253,7 +1253,6 @@ Adding number conversion cast (unumber) $400 in *((const byte*) VIC_MEMORY) ←
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) bitmap_init::bits#0 ← (unumber)(number) $80
Inlining cast (byte) bitmap_init::bits#2 ← (unumber)(number) $80
Inlining cast (byte*) bitmap_init::yoffs#0 ← (byte*)(number) 0
Inlining cast *((byte*) bitmap_clear::bitmap#2) ← (unumber)(number) 0
Inlining cast (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$0
Inlining cast (byte) next#0 ← (unumber)(number) 0

View File

@ -100,7 +100,7 @@ plots::@return: scope:[plots] from plots::@1
plot: scope:[plot] from plots::@2
(byte) plot::y#1 ← phi( plots::@2/(byte) plot::y#0 )
(byte) plot::x#1 ← phi( plots::@2/(byte) plot::x#0 )
(byte*) plot::plotter_x#0 ← ((byte*)) (number) 0
(byte*) plot::plotter_x#0 ← (byte*)(number) 0
(word) plot::plotter_y#0 ← (number) 0
(byte~) plot::$6 ← *((const byte*) plot_xhi + (byte) plot::x#1)
(byte*) plot::plotter_x#1 ← (byte*) plot::plotter_x#0 hi= (byte~) plot::$6
@ -149,7 +149,7 @@ init_plot_tables::@3: scope:[init_plot_tables] from init_plot_tables::@1
(byte) init_plot_tables::bits#2 ← (number) $80
to:init_plot_tables::@2
init_plot_tables::@4: scope:[init_plot_tables] from init_plot_tables::@2
(byte*) init_plot_tables::yoffs#0 ← ((byte*)) (number) 0
(byte*) init_plot_tables::yoffs#0 ← (byte*)(number) 0
(byte) init_plot_tables::y#0 ← (byte) 0
to:init_plot_tables::@5
init_plot_tables::@5: scope:[init_plot_tables] from init_plot_tables::@4 init_plot_tables::@6
@ -399,11 +399,9 @@ Inlining cast *((const byte*) FGCOL) ← (unumber)(number) 0
Inlining cast (word~) main::$3 ← (word)(const byte*) SCREEN
Inlining cast (byte~) main::$6 ← (byte)(unumber~) main::$5
Inlining cast (byte) plots::i#0 ← (unumber)(number) 0
Inlining cast (byte*) plot::plotter_x#0 ← (byte*)(number) 0
Inlining cast (word) plot::plotter_y#0 ← (unumber)(number) 0
Inlining cast (byte) init_plot_tables::bits#0 ← (unumber)(number) $80
Inlining cast (byte) init_plot_tables::bits#2 ← (unumber)(number) $80
Inlining cast (byte*) init_plot_tables::yoffs#0 ← (byte*)(number) 0
Inlining cast *((byte*) init_screen::b#3) ← (unumber)(number) 0
Inlining cast *((byte*) init_screen::c#3) ← (unumber)(number) $14
Successful SSA optimization Pass2InlineCast

View File

@ -6,7 +6,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(bool*) main::bscreen#0 ← ((bool*)) (number) $400
(bool*) main::bscreen#0 ← (bool*)(number) $400
*((bool*) main::bscreen#0 + (number) 0) ← true
*((bool*) main::bscreen#0 + (number) 1) ← false
(bool*~) main::$0 ← (bool*) main::bscreen#0 + (number) 2
@ -50,8 +50,6 @@ Adding number conversion cast (unumber) 0 in *((bool*) main::bscreen#0 + (number
Adding number conversion cast (unumber) 1 in *((bool*) main::bscreen#0 + (number) 1) ← false
Adding number conversion cast (unumber) 2 in (bool*~) main::$0 ← (bool*) main::bscreen#0 + (number) 2
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (bool*) main::bscreen#0 ← (bool*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (bool*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast 1

View File

@ -122,7 +122,7 @@ memset::@return: scope:[memset] from memset::@1
return
to:@return
@12: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@41
@ -1253,7 +1253,6 @@ Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word~) print_sword::$1 ← (word)(signed word) print_sword::w#7
Inlining cast (byte~) print_sbyte::$1 ← (byte)(signed byte) print_sbyte::b#4
Inlining cast (dword~) print_sdword::$1 ← (dword)(signed dword) print_sdword::dw#5

View File

@ -160,7 +160,7 @@ gfx_init_plane_charset8: scope:[gfx_init_plane_charset8] from gfx_init::@1
gfx_init_plane_charset8::@9: scope:[gfx_init_plane_charset8] from gfx_init_plane_charset8
(byte) gfx_init_plane_charset8::gfxbCpuBank#2 ← phi( gfx_init_plane_charset8/(byte) gfx_init_plane_charset8::gfxbCpuBank#0 )
(byte) gfx_init_plane_charset8::gfxbCpuBank#1 ← ++ (byte) gfx_init_plane_charset8::gfxbCpuBank#2
(byte*) gfx_init_plane_charset8::gfxa#0 ← ((byte*)) (number) $4000+(word)(const byte*) CHARSET8&(number) $3fff
(byte*) gfx_init_plane_charset8::gfxa#0 ← (byte*)(number) $4000+(word)(const byte*) CHARSET8&(number) $3fff
(byte*) gfx_init_plane_charset8::chargen#0 ← (const byte*) CHARGEN+(number) 1
*((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_CHARROM
(byte) gfx_init_plane_charset8::col#0 ← (number) 0
@ -491,7 +491,7 @@ Adding number conversion cast (unumber) $f in (number~) gfx_init_screen0::$2 ←
Adding number conversion cast (unumber) gfx_init_screen0::$2 in (number~) gfx_init_screen0::$2 ← (byte) gfx_init_screen0::cx#2 & (unumber)(number) $f
Adding number conversion cast (unumber) gfx_init_screen0::$3 in (number~) gfx_init_screen0::$3 ← (unumber~) gfx_init_screen0::$1 | (unumber~) gfx_init_screen0::$2
Adding number conversion cast (unumber) $4000 in (byte) gfx_init_plane_charset8::gfxbCpuBank#0 ← (byte)(const byte*) CHARSET8/(number) $4000
Adding number conversion cast (unumber) $3fff in (byte*) gfx_init_plane_charset8::gfxa#0 ← ((byte*)) (number) $4000+(word)(const byte*) CHARSET8&(number) $3fff
Adding number conversion cast (unumber) $3fff in (byte*) gfx_init_plane_charset8::gfxa#0 ← (byte*)(number) $4000+(word)(const byte*) CHARSET8&(number) $3fff
Adding number conversion cast (unumber) 1 in (byte*) gfx_init_plane_charset8::chargen#0 ← (const byte*) CHARGEN+(number) 1
Adding number conversion cast (unumber) 0 in (byte) gfx_init_plane_charset8::col#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gfx_init_plane_charset8::c#0 ← (number) 0
@ -503,7 +503,7 @@ Adding number conversion cast (unumber) gfx_init_plane_charset8::$5 in (number~)
Successful SSA optimization PassNAddNumberTypeConversions
Adding number conversion cast (unumber) $40 in *((const byte*) VIC_MEMORY) ← ((unumber)) (byte)(word)(const byte*) SCREEN&(unumber)(number) $3fff/(number) $40|(unumber)>(word)(const byte*) SCREEN&(unumber)(number) $3fff/(number) 4
Adding number conversion cast (unumber) 4 in *((const byte*) VIC_MEMORY) ← ((unumber)) (byte)(word)(const byte*) SCREEN&(unumber)(number) $3fff/(unumber)(number) $40|(unumber)>(word)(const byte*) SCREEN&(unumber)(number) $3fff/(number) 4
Adding number conversion cast (unumber) $4000 in (byte*) gfx_init_plane_charset8::gfxa#0 ← ((byte*)) (number) $4000+(word)(const byte*) CHARSET8&(unumber)(number) $3fff
Adding number conversion cast (unumber) $4000 in (byte*) gfx_init_plane_charset8::gfxa#0 ← (byte*)(number) $4000+(word)(const byte*) CHARSET8&(unumber)(number) $3fff
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *((const byte*) VIC_CONTROL) ← (unumber)(const byte) VIC_DEN|(const byte) VIC_ECM|(const byte) VIC_RSEL|(unumber)(number) 3
Inlining cast *((const byte*) DTV_PLANEA_START_HI) ← (unumber)(number) 0
@ -520,7 +520,6 @@ Inlining cast *((const byte*) VIC_MEMORY) ← (unumber)(byte)(word)(const byte*)
Inlining cast *((const byte*) VIC_CONTROL) ← (unumber)(const byte) VIC_DEN|(const byte) VIC_ECM|(const byte) VIC_RSEL|(unumber)(number) 3
Inlining cast *((const byte*) BORDERCOL) ← (unumber)(number) 0
Inlining cast (byte) main::rst#0 ← (unumber)(number) $42
Inlining cast (byte*) gfx_init_plane_charset8::gfxa#0 ← (byte*)(unumber)(number) $4000+(word)(const byte*) CHARSET8&(unumber)(number) $3fff
Inlining cast (byte) gfx_init_plane_charset8::col#0 ← (unumber)(number) 0
Inlining cast (byte) gfx_init_plane_charset8::c#0 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
@ -681,8 +680,6 @@ Simple Condition (bool~) gfx_init_plane_charset8::$6 [104] if((byte) gfx_init_pl
Simple Condition (bool~) gfx_init_plane_charset8::$7 [110] if((byte) gfx_init_plane_charset8::cr#1!=rangelast(0,7)) goto gfx_init_plane_charset8::@2
Simple Condition (bool~) gfx_init_plane_charset8::$8 [114] if((byte) gfx_init_plane_charset8::ch#1!=rangelast(0,$ff)) goto gfx_init_plane_charset8::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [79] (byte*) gfx_init_plane_charset8::gfxa#0 ← (byte*)(word) $4000+(word)(const byte*) CHARSET8&(word) $3fff
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::j#0 = 0
Constant (const byte) main::rst#0 = $42
Constant (const byte*) gfx_init_screen0::ch#0 = SCREEN

View File

@ -103,7 +103,7 @@ gfx_init_chunky: scope:[gfx_init_chunky] from main
gfx_init_chunky::@7: scope:[gfx_init_chunky] from gfx_init_chunky
(byte) gfx_init_chunky::gfxbCpuBank#3 ← phi( gfx_init_chunky/(byte) gfx_init_chunky::gfxbCpuBank#0 )
(byte) gfx_init_chunky::gfxbCpuBank#1 ← ++ (byte) gfx_init_chunky::gfxbCpuBank#3
(byte*) gfx_init_chunky::gfxb#0 ← ((byte*)) (number) $4000
(byte*) gfx_init_chunky::gfxb#0 ← (byte*)(number) $4000
(byte) gfx_init_chunky::y#0 ← (byte) 0
to:gfx_init_chunky::@1
gfx_init_chunky::@1: scope:[gfx_init_chunky] from gfx_init_chunky::@5 gfx_init_chunky::@7
@ -337,7 +337,6 @@ Inlining cast *((const byte*) VIC_MEMORY) ← (unumber)(byte)(word)(const byte*)
Inlining cast *((const byte*) VIC_CONTROL) ← (unumber)(const byte) VIC_DEN|(const byte) VIC_ECM|(const byte) VIC_RSEL|(unumber)(number) 3
Inlining cast *((const byte*) BORDERCOL) ← (unumber)(number) 0
Inlining cast (byte) main::rst#0 ← (unumber)(number) $42
Inlining cast (byte*) gfx_init_chunky::gfxb#0 ← (byte*)(number) $4000
Inlining cast (byte~) gfx_init_chunky::$6 ← (byte)(word~) gfx_init_chunky::$5
Inlining cast (byte*) gfx_init_chunky::gfxb#2 ← (byte*)(number) $4000
Successful SSA optimization Pass2InlineCast

View File

@ -366,7 +366,7 @@ memset::@return: scope:[memset] from memset::@1
return
to:@return
@17: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@45
@ -832,7 +832,7 @@ bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@1
(byte) bitmap_init::bits#2 ← (number) $80
to:bitmap_init::@2
bitmap_init::@4: scope:[bitmap_init] from bitmap_init::@2
(byte*) bitmap_init::yoffs#0 ← ((byte*)) (number) 0
(byte*) bitmap_init::yoffs#0 ← (byte*)(number) 0
(byte) bitmap_init::y#0 ← (byte) 0
to:bitmap_init::@5
bitmap_init::@5: scope:[bitmap_init] from bitmap_init::@4 bitmap_init::@6
@ -2555,7 +2555,7 @@ gfx_init_plane_8bppchunky: scope:[gfx_init_plane_8bppchunky] from gfx_init::@7
gfx_init_plane_8bppchunky::@7: scope:[gfx_init_plane_8bppchunky] from gfx_init_plane_8bppchunky
(byte) gfx_init_plane_8bppchunky::gfxbCpuBank#3 ← phi( gfx_init_plane_8bppchunky/(byte) gfx_init_plane_8bppchunky::gfxbCpuBank#0 )
(byte) gfx_init_plane_8bppchunky::gfxbCpuBank#1 ← ++ (byte) gfx_init_plane_8bppchunky::gfxbCpuBank#3
(byte*) gfx_init_plane_8bppchunky::gfxb#0 ← ((byte*)) (number) $4000
(byte*) gfx_init_plane_8bppchunky::gfxb#0 ← (byte*)(number) $4000
(byte) gfx_init_plane_8bppchunky::y#0 ← (byte) 0
to:gfx_init_plane_8bppchunky::@1
gfx_init_plane_8bppchunky::@1: scope:[gfx_init_plane_8bppchunky] from gfx_init_plane_8bppchunky::@5 gfx_init_plane_8bppchunky::@7
@ -2628,7 +2628,7 @@ gfx_init_plane_horisontal: scope:[gfx_init_plane_horisontal] from gfx_init::@9
gfx_init_plane_horisontal::@9: scope:[gfx_init_plane_horisontal] from gfx_init_plane_horisontal
(byte) gfx_init_plane_horisontal::gfxbCpuBank#2 ← phi( gfx_init_plane_horisontal/(byte) gfx_init_plane_horisontal::gfxbCpuBank#0 )
(byte) gfx_init_plane_horisontal::gfxbCpuBank#1 ← ++ (byte) gfx_init_plane_horisontal::gfxbCpuBank#2
(byte*) gfx_init_plane_horisontal::gfxa#0 ← ((byte*)) (number) $4000+(const dword) PLANE_HORISONTAL&(number) $3fff
(byte*) gfx_init_plane_horisontal::gfxa#0 ← (byte*)(number) $4000+(const dword) PLANE_HORISONTAL&(number) $3fff
(byte) gfx_init_plane_horisontal::ay#0 ← (byte) 0
to:gfx_init_plane_horisontal::@1
gfx_init_plane_horisontal::@1: scope:[gfx_init_plane_horisontal] from gfx_init_plane_horisontal::@7 gfx_init_plane_horisontal::@9
@ -2692,7 +2692,7 @@ gfx_init_plane_horisontal2: scope:[gfx_init_plane_horisontal2] from gfx_init::@
gfx_init_plane_horisontal2::@5: scope:[gfx_init_plane_horisontal2] from gfx_init_plane_horisontal2
(byte) gfx_init_plane_horisontal2::gfxbCpuBank#2 ← phi( gfx_init_plane_horisontal2/(byte) gfx_init_plane_horisontal2::gfxbCpuBank#0 )
(byte) gfx_init_plane_horisontal2::gfxbCpuBank#1 ← ++ (byte) gfx_init_plane_horisontal2::gfxbCpuBank#2
(byte*) gfx_init_plane_horisontal2::gfxa#0 ← ((byte*)) (number) $4000+(const dword) PLANE_HORISONTAL2&(number) $3fff
(byte*) gfx_init_plane_horisontal2::gfxa#0 ← (byte*)(number) $4000+(const dword) PLANE_HORISONTAL2&(number) $3fff
(byte) gfx_init_plane_horisontal2::ay#0 ← (byte) 0
to:gfx_init_plane_horisontal2::@1
gfx_init_plane_horisontal2::@1: scope:[gfx_init_plane_horisontal2] from gfx_init_plane_horisontal2::@3 gfx_init_plane_horisontal2::@5
@ -2739,7 +2739,7 @@ gfx_init_plane_vertical: scope:[gfx_init_plane_vertical] from gfx_init::@10
gfx_init_plane_vertical::@5: scope:[gfx_init_plane_vertical] from gfx_init_plane_vertical
(byte) gfx_init_plane_vertical::gfxbCpuBank#2 ← phi( gfx_init_plane_vertical/(byte) gfx_init_plane_vertical::gfxbCpuBank#0 )
(byte) gfx_init_plane_vertical::gfxbCpuBank#1 ← ++ (byte) gfx_init_plane_vertical::gfxbCpuBank#2
(byte*) gfx_init_plane_vertical::gfxb#0 ← ((byte*)) (number) $4000+(const dword) PLANE_VERTICAL&(number) $3fff
(byte*) gfx_init_plane_vertical::gfxb#0 ← (byte*)(number) $4000+(const dword) PLANE_VERTICAL&(number) $3fff
(byte) gfx_init_plane_vertical::by#0 ← (byte) 0
to:gfx_init_plane_vertical::@1
gfx_init_plane_vertical::@1: scope:[gfx_init_plane_vertical] from gfx_init_plane_vertical::@3 gfx_init_plane_vertical::@5
@ -2783,7 +2783,7 @@ gfx_init_plane_charset8: scope:[gfx_init_plane_charset8] from gfx_init::@8
gfx_init_plane_charset8::@9: scope:[gfx_init_plane_charset8] from gfx_init_plane_charset8
(byte) gfx_init_plane_charset8::gfxbCpuBank#2 ← phi( gfx_init_plane_charset8/(byte) gfx_init_plane_charset8::gfxbCpuBank#0 )
(byte) gfx_init_plane_charset8::gfxbCpuBank#1 ← ++ (byte) gfx_init_plane_charset8::gfxbCpuBank#2
(byte*) gfx_init_plane_charset8::gfxa#0 ← ((byte*)) (number) $4000+(const dword) PLANE_CHARSET8&(number) $3fff
(byte*) gfx_init_plane_charset8::gfxa#0 ← (byte*)(number) $4000+(const dword) PLANE_CHARSET8&(number) $3fff
(byte*) gfx_init_plane_charset8::chargen#0 ← (const byte*) CHARGEN
*((const byte*) PROCPORT) ← (const byte) PROCPORT_RAM_CHARROM
(byte) gfx_init_plane_charset8::col#0 ← (number) 0
@ -6552,23 +6552,23 @@ Adding number conversion cast (unumber) gfx_init_vic_bitmap::$4 in (number~) gfx
Adding number conversion cast (unumber) $4000 in (byte) gfx_init_plane_8bppchunky::gfxbCpuBank#0 ← (byte)(const dword) PLANE_8BPP_CHUNKY/(number) $4000
Adding number conversion cast (unumber) $8000 in (bool~) gfx_init_plane_8bppchunky::$2 ← (byte*) gfx_init_plane_8bppchunky::gfxb#3 == (number) $8000
Adding number conversion cast (unumber) $4000 in (byte) gfx_init_plane_horisontal::gfxbCpuBank#0 ← (byte)(const dword) PLANE_HORISONTAL/(number) $4000
Adding number conversion cast (unumber) $3fff in (byte*) gfx_init_plane_horisontal::gfxa#0 ← ((byte*)) (number) $4000+(const dword) PLANE_HORISONTAL&(number) $3fff
Adding number conversion cast (unumber) $3fff in (byte*) gfx_init_plane_horisontal::gfxa#0 ← (byte*)(number) $4000+(const dword) PLANE_HORISONTAL&(number) $3fff
Adding number conversion cast (unumber) 4 in (number~) gfx_init_plane_horisontal::$2 ← (byte) gfx_init_plane_horisontal::ay#2 & (number) 4
Adding number conversion cast (unumber) gfx_init_plane_horisontal::$2 in (number~) gfx_init_plane_horisontal::$2 ← (byte) gfx_init_plane_horisontal::ay#2 & (unumber)(number) 4
Adding number conversion cast (unumber) 0 in (bool~) gfx_init_plane_horisontal::$3 ← (unumber~) gfx_init_plane_horisontal::$2 == (number) 0
Adding number conversion cast (unumber) 0 in *((byte*) gfx_init_plane_horisontal::gfxa#3) ← (number) 0
Adding number conversion cast (unumber) $ff in *((byte*) gfx_init_plane_horisontal::gfxa#4) ← (number) $ff
Adding number conversion cast (unumber) $4000 in (byte) gfx_init_plane_horisontal2::gfxbCpuBank#0 ← (byte)(const dword) PLANE_HORISONTAL2/(number) $4000
Adding number conversion cast (unumber) $3fff in (byte*) gfx_init_plane_horisontal2::gfxa#0 ← ((byte*)) (number) $4000+(const dword) PLANE_HORISONTAL2&(number) $3fff
Adding number conversion cast (unumber) $3fff in (byte*) gfx_init_plane_horisontal2::gfxa#0 ← (byte*)(number) $4000+(const dword) PLANE_HORISONTAL2&(number) $3fff
Adding number conversion cast (unumber) 2 in (number~) gfx_init_plane_horisontal2::$2 ← (byte) gfx_init_plane_horisontal2::ay#2 / (number) 2
Adding number conversion cast (unumber) gfx_init_plane_horisontal2::$2 in (number~) gfx_init_plane_horisontal2::$2 ← (byte) gfx_init_plane_horisontal2::ay#2 / (unumber)(number) 2
Adding number conversion cast (unumber) 3 in (number~) gfx_init_plane_horisontal2::$3 ← (unumber~) gfx_init_plane_horisontal2::$2 & (number) 3
Adding number conversion cast (unumber) gfx_init_plane_horisontal2::$3 in (number~) gfx_init_plane_horisontal2::$3 ← (unumber~) gfx_init_plane_horisontal2::$2 & (unumber)(number) 3
Adding number conversion cast (unumber) $4000 in (byte) gfx_init_plane_vertical::gfxbCpuBank#0 ← (byte)(const dword) PLANE_VERTICAL/(number) $4000
Adding number conversion cast (unumber) $3fff in (byte*) gfx_init_plane_vertical::gfxb#0 ← ((byte*)) (number) $4000+(const dword) PLANE_VERTICAL&(number) $3fff
Adding number conversion cast (unumber) $3fff in (byte*) gfx_init_plane_vertical::gfxb#0 ← (byte*)(number) $4000+(const dword) PLANE_VERTICAL&(number) $3fff
Adding number conversion cast (unumber) $f in *((byte*) gfx_init_plane_vertical::gfxb#2) ← (number) $f
Adding number conversion cast (unumber) $4000 in (byte) gfx_init_plane_charset8::gfxbCpuBank#0 ← (byte)(const dword) PLANE_CHARSET8/(number) $4000
Adding number conversion cast (unumber) $3fff in (byte*) gfx_init_plane_charset8::gfxa#0 ← ((byte*)) (number) $4000+(const dword) PLANE_CHARSET8&(number) $3fff
Adding number conversion cast (unumber) $3fff in (byte*) gfx_init_plane_charset8::gfxa#0 ← (byte*)(number) $4000+(const dword) PLANE_CHARSET8&(number) $3fff
Adding number conversion cast (unumber) 0 in (byte) gfx_init_plane_charset8::col#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) gfx_init_plane_charset8::c#0 ← (number) 0
Adding number conversion cast (unumber) $80 in (number~) gfx_init_plane_charset8::$2 ← (byte) gfx_init_plane_charset8::bits#2 & (number) $80
@ -6633,16 +6633,15 @@ Adding number conversion cast (unumber) 0 in *((const byte*) form_fields_val + (
Adding number conversion cast (unumber) 0 in (byte) form_control::return#4 ← (number) 0
Adding number conversion cast (unumber) $ff in (byte) form_control::return#5 ← (number) $ff
Successful SSA optimization PassNAddNumberTypeConversions
Adding number conversion cast (unumber) $4000 in (byte*) gfx_init_plane_horisontal::gfxa#0 ← ((byte*)) (number) $4000+(const dword) PLANE_HORISONTAL&(unumber)(number) $3fff
Adding number conversion cast (unumber) $4000 in (byte*) gfx_init_plane_horisontal2::gfxa#0 ← ((byte*)) (number) $4000+(const dword) PLANE_HORISONTAL2&(unumber)(number) $3fff
Adding number conversion cast (unumber) $4000 in (byte*) gfx_init_plane_vertical::gfxb#0 ← ((byte*)) (number) $4000+(const dword) PLANE_VERTICAL&(unumber)(number) $3fff
Adding number conversion cast (unumber) $4000 in (byte*) gfx_init_plane_charset8::gfxa#0 ← ((byte*)) (number) $4000+(const dword) PLANE_CHARSET8&(unumber)(number) $3fff
Adding number conversion cast (unumber) $4000 in (byte*) gfx_init_plane_horisontal::gfxa#0 ← (byte*)(number) $4000+(const dword) PLANE_HORISONTAL&(unumber)(number) $3fff
Adding number conversion cast (unumber) $4000 in (byte*) gfx_init_plane_horisontal2::gfxa#0 ← (byte*)(number) $4000+(const dword) PLANE_HORISONTAL2&(unumber)(number) $3fff
Adding number conversion cast (unumber) $4000 in (byte*) gfx_init_plane_vertical::gfxb#0 ← (byte*)(number) $4000+(const dword) PLANE_VERTICAL&(unumber)(number) $3fff
Adding number conversion cast (unumber) $4000 in (byte*) gfx_init_plane_charset8::gfxa#0 ← (byte*)(number) $4000+(const dword) PLANE_CHARSET8&(unumber)(number) $3fff
Adding number conversion cast (unumber) $40 in *((const byte*) VIC_MEMORY) ← (byte)(word)(const byte*) FORM_SCREEN&(unumber)(number) $3fff/(number) $40|(word)(const byte*) FORM_CHARSET&(unumber)(number) $3fff/(number) $400
Adding number conversion cast (unumber) $400 in *((const byte*) VIC_MEMORY) ← (byte)(word)(const byte*) FORM_SCREEN&(unumber)(number) $3fff/(unumber)(number) $40|(word)(const byte*) FORM_CHARSET&(unumber)(number) $3fff/(number) $400
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast *((const byte*) CIA1_PORT_A_DDR) ← (unumber)(number) $ff
Inlining cast *((const byte*) CIA1_PORT_B_DDR) ← (unumber)(number) 0
@ -6653,7 +6652,6 @@ Inlining cast (byte) keyboard_modifiers#1 ← (unumber)(number) 0
Inlining cast (byte) keyboard_event_get::return#0 ← (unumber)(number) $ff
Inlining cast (byte) bitmap_init::bits#0 ← (unumber)(number) $80
Inlining cast (byte) bitmap_init::bits#2 ← (unumber)(number) $80
Inlining cast (byte*) bitmap_init::yoffs#0 ← (byte*)(number) 0
Inlining cast *((byte*) bitmap_clear::bitmap#2) ← (unumber)(number) 0
Inlining cast (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$0
Inlining cast (byte) apply_preset::i#0 ← (unumber)(number) 0
@ -6671,16 +6669,11 @@ Inlining cast *((const byte*) PROCPORT) ← (unumber)(number) $32
Inlining cast *((const byte*) PROCPORT) ← (unumber)(number) $37
Inlining cast *((byte*) gfx_init_screen4::ch#2) ← (unumber)(number) 0
Inlining cast (byte) gfx_init_vic_bitmap::l#0 ← (unumber)(number) 0
Inlining cast (byte*) gfx_init_plane_8bppchunky::gfxb#0 ← (byte*)(number) $4000
Inlining cast (byte~) gfx_init_plane_8bppchunky::$6 ← (byte)(word~) gfx_init_plane_8bppchunky::$5
Inlining cast (byte*) gfx_init_plane_8bppchunky::gfxb#2 ← (byte*)(number) $4000
Inlining cast (byte*) gfx_init_plane_horisontal::gfxa#0 ← (byte*)(unumber)(number) $4000+(const dword) PLANE_HORISONTAL&(unumber)(number) $3fff
Inlining cast *((byte*) gfx_init_plane_horisontal::gfxa#3) ← (unumber)(number) 0
Inlining cast *((byte*) gfx_init_plane_horisontal::gfxa#4) ← (unumber)(number) $ff
Inlining cast (byte*) gfx_init_plane_horisontal2::gfxa#0 ← (byte*)(unumber)(number) $4000+(const dword) PLANE_HORISONTAL2&(unumber)(number) $3fff
Inlining cast (byte*) gfx_init_plane_vertical::gfxb#0 ← (byte*)(unumber)(number) $4000+(const dword) PLANE_VERTICAL&(unumber)(number) $3fff
Inlining cast *((byte*) gfx_init_plane_vertical::gfxb#2) ← (unumber)(number) $f
Inlining cast (byte*) gfx_init_plane_charset8::gfxa#0 ← (byte*)(unumber)(number) $4000+(const dword) PLANE_CHARSET8&(unumber)(number) $3fff
Inlining cast (byte) gfx_init_plane_charset8::col#0 ← (unumber)(number) 0
Inlining cast (byte) gfx_init_plane_charset8::c#0 ← (unumber)(number) 0
Inlining cast (byte) gfx_init_plane_fill::fill#0 ← (unumber)(number) $1b
@ -8705,10 +8698,6 @@ Simple Condition (bool~) form_control::$25 [1518] if(*((const byte*) form_fields
Successful SSA optimization Pass2ConditionalJumpSimplification
Negating conditional jump and destination [938] if((byte) gfx_mode::keyboard_event#0==(const byte) KEY_SPACE) goto gfx_mode::@return
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [1128] (byte*) gfx_init_plane_horisontal::gfxa#0 ← (byte*)(word) $4000+(const dword) PLANE_HORISONTAL&(word) $3fff
Constant right-side identified [1158] (byte*) gfx_init_plane_horisontal2::gfxa#0 ← (byte*)(word) $4000+(const dword) PLANE_HORISONTAL2&(word) $3fff
Constant right-side identified [1183] (byte*) gfx_init_plane_vertical::gfxb#0 ← (byte*)(word) $4000+(const dword) PLANE_VERTICAL&(word) $3fff
Constant right-side identified [1205] (byte*) gfx_init_plane_charset8::gfxa#0 ← (byte*)(word) $4000+(const dword) PLANE_CHARSET8&(word) $3fff
Constant right-side identified [1487] (byte) form_field_idx#7 ← (const byte) form_fields_cnt - (byte) 1
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) print_screen#0 = (byte*) 1024

View File

@ -214,7 +214,7 @@ memset::@return: scope:[memset] from memset::@1
return
to:@return
@17: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@58
@ -416,7 +416,7 @@ bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@1
(byte) bitmap_init::bits#2 ← (number) $80
to:bitmap_init::@2
bitmap_init::@4: scope:[bitmap_init] from bitmap_init::@2
(byte*) bitmap_init::yoffs#0 ← ((byte*)) (number) 0
(byte*) bitmap_init::yoffs#0 ← (byte*)(number) 0
(byte) bitmap_init::y#0 ← (byte) 0
to:bitmap_init::@5
bitmap_init::@5: scope:[bitmap_init] from bitmap_init::@4 bitmap_init::@6
@ -2955,7 +2955,7 @@ mode_8bppchunkybmm::@9: scope:[mode_8bppchunkybmm] from mode_8bppchunkybmm::@2
(byte) dtv_control#244 ← phi( mode_8bppchunkybmm::@2/(byte) dtv_control#253 )
(byte) mode_8bppchunkybmm::gfxbCpuBank#3 ← phi( mode_8bppchunkybmm::@2/(byte) mode_8bppchunkybmm::gfxbCpuBank#0 )
(byte) mode_8bppchunkybmm::gfxbCpuBank#1 ← ++ (byte) mode_8bppchunkybmm::gfxbCpuBank#3
(byte*) mode_8bppchunkybmm::gfxb#0 ← ((byte*)) (number) $4000
(byte*) mode_8bppchunkybmm::gfxb#0 ← (byte*)(number) $4000
(byte) mode_8bppchunkybmm::y#0 ← (byte) 0
to:mode_8bppchunkybmm::@3
mode_8bppchunkybmm::@3: scope:[mode_8bppchunkybmm] from mode_8bppchunkybmm::@7 mode_8bppchunkybmm::@9
@ -5744,11 +5744,9 @@ Adding number conversion cast (unumber) $400 in *((const byte*) VIC_MEMORY) ←
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast (byte) bitmap_init::bits#0 ← (unumber)(number) $80
Inlining cast (byte) bitmap_init::bits#2 ← (unumber)(number) $80
Inlining cast (byte*) bitmap_init::yoffs#0 ← (byte*)(number) 0
Inlining cast *((byte*) bitmap_clear::bitmap#2) ← (unumber)(number) 0
Inlining cast (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$0
Inlining cast *((const byte*) DTV_CONTROL) ← (unumber)(number) 0
@ -5862,7 +5860,6 @@ Inlining cast *((const byte*) DTV_PLANEB_STEP) ← (unumber)(number) 8
Inlining cast *((const byte*) DTV_PLANEB_MODULO_LO) ← (unumber)(number) 0
Inlining cast *((const byte*) DTV_PLANEB_MODULO_HI) ← (unumber)(number) 0
Inlining cast *((const byte*) BORDERCOL) ← (unumber)(number) 0
Inlining cast (byte*) mode_8bppchunkybmm::gfxb#0 ← (byte*)(number) $4000
Inlining cast (byte~) mode_8bppchunkybmm::$8 ← (byte)(word~) mode_8bppchunkybmm::$7
Inlining cast (byte*) mode_8bppchunkybmm::gfxb#2 ← (byte*)(number) $4000
Successful SSA optimization Pass2InlineCast

View File

@ -6,7 +6,7 @@ Culled Empty Block (label) line::@6
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) screen#0 ← ((byte*)) (number) $400
(byte*) screen#0 ← (byte*)(number) $400
to:@2
(void()) main()
@ -123,7 +123,6 @@ Adding number conversion cast (unumber) 2 in (byte) line::x1#0 ← (number) 2
Adding number conversion cast (unumber) 3 in (byte) line::x0#1 ← (number) 3
Adding number conversion cast (unumber) 5 in (byte) line::x1#1 ← (number) 5
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) screen#0 ← (byte*)(number) $400
Inlining cast (byte) line::x0#0 ← (unumber)(number) 1
Inlining cast (byte) line::x1#0 ← (unumber)(number) 2
Inlining cast (byte) line::x0#1 ← (unumber)(number) 3

View File

@ -6,8 +6,8 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte*) main::colors#0 ← ((byte*)) (number) $d800
(byte*) main::screen#0 ← (byte*)(number) $400
(byte*) main::colors#0 ← (byte*)(number) $d800
(byte) main::color#0 ← (number) 1
(byte) main::row#0 ← (byte) 0
to:main::@1
@ -112,8 +112,6 @@ Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (byte
Adding number conversion cast (unumber) $28 in (byte*~) main::$3 ← (byte*) main::screen#3 + (number) $28
Adding number conversion cast (unumber) $28 in (byte*~) main::$4 ← (byte*) main::colors#3 + (number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Inlining cast (byte*) main::colors#0 ← (byte*)(number) $d800
Inlining cast (byte) main::color#0 ← (unumber)(number) 1
Inlining cast *((byte*) main::screen#2 + (byte) main::column#2) ← (unumber)(number) $a0
Successful SSA optimization Pass2InlineCast

View File

@ -12,7 +12,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte*) main::screen#0 ← (byte*)(number) $400
(byte*~) main::$0 ← (byte*) main::screen#0 + (number) $3e8
(byte*) main::sc#0 ← (byte*) main::screen#0
to:main::@1
@ -231,7 +231,6 @@ Adding number conversion cast (unumber) 5 in (bool~) main::$13 ← (byte) main::
Adding number conversion cast (unumber) $b in *((byte*) main::screen#8 + (number) $b) ← (byte) '+'
Adding number conversion cast (unumber) $e in *((byte*) main::screen#9 + (number) $e) ← (byte) '+'
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Inlining cast (byte) main::i#0 ← (unumber)(number) 0
Inlining cast (byte) main::i1#0 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast

View File

@ -18,14 +18,14 @@ Fixing pointer array-indexing *((const struct ProcessingSprite*) PROCESSING + (b
Fixing pointer array-indexing *((const struct ProcessingSprite*) PROCESSING + (byte) startProcessing::spriteIdx)
Fixing pointer array-indexing *((const word*) VXSIN + (byte) processChars::xchar)
Fixing pointer array-indexing *((const word*) VYSIN + (byte) processChars::ychar)
Created struct value member variable (byte) main::center_x
Created struct value member variable (byte) main::center_y
Created struct value member variable (byte) main::center_dist
Converted struct value to member variables (struct ProcessingChar) main::center
Created struct value member variable (byte~) main::$5_x
Created struct value member variable (byte~) main::$5_y
Created struct value member variable (byte~) main::$5_dist
Converted struct value to member variables (struct ProcessingChar~) main::$5
Created struct value member variable (byte) main::center_x
Created struct value member variable (byte) main::center_y
Created struct value member variable (byte) main::center_dist
Converted struct value to member variables (struct ProcessingChar) main::center
Created struct value member variable (byte) getCharToProcess::return_x
Created struct value member variable (byte) getCharToProcess::return_y
Created struct value member variable (byte) getCharToProcess::return_dist
@ -53,9 +53,9 @@ Adding struct value member variable copy (byte) main::center_x ← (byte~) main:
Adding struct value member variable copy (byte) main::center_y ← (byte~) main::$5_y
Adding struct value member variable copy (byte) main::center_dist ← (byte~) main::$5_dist
Converted procedure struct value parameter to member unwinding in call (void~) main::$8 ← call startProcessing (byte) main::center_x (byte) main::center_y (byte) main::center_dist
Adding struct value list initializer (byte) getCharToProcess::closest_x ← (number) 0
Adding struct value list initializer (byte) getCharToProcess::closest_y ← (number) 0
Adding struct value list initializer (byte) getCharToProcess::closest_dist ← (const byte) NOT_FOUND
Adding struct value member variable copy (byte) getCharToProcess::closest_x ← (byte)(number) 0
Adding struct value member variable copy (byte) getCharToProcess::closest_y ← (byte)(number) 0
Adding struct value member variable copy (byte) getCharToProcess::closest_dist ← (const byte) NOT_FOUND
Adding struct value list initializer (byte) getCharToProcess::closest_x ← (byte) getCharToProcess::x
Adding struct value list initializer (byte) getCharToProcess::closest_y ← (byte) getCharToProcess::y
Adding struct value list initializer (byte) getCharToProcess::closest_dist ← (byte) getCharToProcess::dist
@ -581,8 +581,8 @@ main::@return: scope:[main] from main::@15
getCharToProcess: scope:[getCharToProcess] from main::@9
(byte*) SCREEN_DIST#2 ← phi( main::@9/(byte*) SCREEN_DIST#4 )
(byte*) SCREEN_COPY#2 ← phi( main::@9/(byte*) SCREEN_COPY#5 )
(byte) getCharToProcess::closest_x#0 ← (number) 0
(byte) getCharToProcess::closest_y#0 ← (number) 0
(byte) getCharToProcess::closest_x#0 ← (byte)(number) 0
(byte) getCharToProcess::closest_y#0 ← (byte)(number) 0
(byte) getCharToProcess::closest_dist#0 ← (const byte) NOT_FOUND
(byte*) getCharToProcess::screen_line#0 ← (byte*) SCREEN_COPY#2
(byte*) getCharToProcess::dist_line#0 ← (byte*) SCREEN_DIST#2
@ -2221,8 +2221,6 @@ Adding number conversion cast (unumber) 0 in *((byte*~) main::$17 + (byte~) main
Adding number conversion cast (unumber) 1 in (byte) main::i#1 ← (byte) main::i#2 + rangenext(0,NUM_PROCESSING-1)
Adding number conversion cast (unumber) $3e7 in *((const byte*) SCREEN+(number) $3e7) ← (byte) '.'
Adding number conversion cast (unumber) $3e7 in *((const byte*) COLS+(number) $3e7) ← ++ *((const byte*) COLS+(number) $3e7)
Adding number conversion cast (unumber) 0 in (byte) getCharToProcess::closest_x#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) getCharToProcess::closest_y#0 ← (number) 0
Adding number conversion cast (unumber) $28 in (byte*) getCharToProcess::screen_line#1 ← (byte*) getCharToProcess::screen_line#3 + (number) $28
Adding number conversion cast (unumber) $28 in (byte*) getCharToProcess::dist_line#1 ← (byte*) getCharToProcess::dist_line#3 + (number) $28
Adding number conversion cast (unumber) $28 in (number~) getCharToProcess::$9 ← (word~) getCharToProcess::$8 * (number) $28
@ -2322,8 +2320,6 @@ Inlining cast *((byte*~) main::$15 + (byte~) main::$10) ← (unumber)(number) 0
Inlining cast *((byte*~) main::$16 + (byte~) main::$10) ← (unumber)(number) 0
Inlining cast *((byte*~) main::$17 + (byte~) main::$10) ← (unumber)(number) 0
Inlining cast *((byte**~) main::$19 + (byte~) main::$10) ← (byte*)(number) 0
Inlining cast (byte) getCharToProcess::closest_x#0 ← (unumber)(number) 0
Inlining cast (byte) getCharToProcess::closest_y#0 ← (unumber)(number) 0
Inlining cast (word~) getCharToProcess::$8 ← (word)(byte) getCharToProcess::closest_y#3
Inlining cast (byte) startProcessing::freeIdx#0 ← (unumber)(number) $ff
Inlining cast (word~) startProcessing::$0 ← (word)(byte) startProcessing::center_y#1
@ -2503,8 +2499,6 @@ Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (word) $3e7
Finalized unsigned number type (word) $3e7
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) $28

View File

@ -97,7 +97,7 @@ CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@4
@4: scope:[] from @begin
(byte*) PLEX_SCREEN_PTR#0 ← ((byte*)) (number) $400+(number) $3f8
(byte*) PLEX_SCREEN_PTR#0 ← (byte*)(number) $400+(number) $3f8
(byte) plex_show_idx#0 ← (number) 0
(byte) plex_sprite_idx#0 ← (number) 0
(byte) plex_sprite_msb#0 ← (number) 1
@ -1921,7 +1921,6 @@ Adding number conversion cast (unumber) 0 in (bool~) loop::$12 ← (byte~) loop:
Adding number conversion cast (unumber) 1 in (byte) loop::i1#1 ← (byte) loop::i1#2 + rangenext(0,PLEX_COUNT-1)
Adding number conversion cast (unumber) 0 in (bool~) loop::$21 ← (number) 0 != (byte~) loop::$18
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) PLEX_SCREEN_PTR#0 ← (byte*)(number) $400+(number) $3f8
Inlining cast (byte) plex_show_idx#0 ← (unumber)(number) 0
Inlining cast (byte) plex_sprite_idx#0 ← (unumber)(number) 0
Inlining cast (byte) plex_sprite_msb#0 ← (unumber)(number) 1
@ -2445,8 +2444,6 @@ Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting && if()-condition to two if()s [39] (bool~) plexSort::$7 ← (bool~) plexSort::$5 && (bool~) plexSort::$6
Successful SSA optimization Pass2ConditionalAndOrRewriting
Negating conditional jump and destination [420] if((byte) 0!=(byte~) loop::$18) goto loop::@return
Constant right-side identified [0] (byte*) PLEX_SCREEN_PTR#0 ← (byte*)(number) $400+(number) $3f8
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) PLEX_SCREEN_PTR#0 = (byte*)$400+$3f8
Constant (const byte) plex_show_idx#0 = 0
Constant (const byte) plex_sprite_idx#0 = 0

View File

@ -68,8 +68,8 @@ show_letter: scope:[show_letter] from main::@10
[27] phi()
to:show_letter::@1
show_letter::@1: scope:[show_letter] from show_letter show_letter::@9
[28] (signed word) show_letter::current_y#4 ← phi( show_letter/(signed byte) 0 show_letter::@9/(signed word) show_letter::current_y#11 )
[28] (signed word) show_letter::current_x#4 ← phi( show_letter/(signed byte) 0 show_letter::@9/(signed word) show_letter::current_x#11 )
[28] (signed word) show_letter::current_y#4 ← phi( show_letter/(signed word) 0 show_letter::@9/(signed word) show_letter::current_y#11 )
[28] (signed word) show_letter::current_x#4 ← phi( show_letter/(signed word) 0 show_letter::@9/(signed word) show_letter::current_x#11 )
[28] (byte) show_letter::i#10 ← phi( show_letter/(byte) 0 show_letter::@9/(byte) show_letter::i#1 )
[29] (byte~) show_letter::$32 ← (byte) show_letter::i#10 << (byte) 3
[30] (byte~) show_letter::$20 ← (byte~) show_letter::$32 + (byte) show_letter::i#10

View File

@ -125,16 +125,16 @@ Converted procedure struct value parameter to member unwinding (void()) spline_1
Converted procedure struct value parameter to member unwinding (void()) spline_8seg((signed word) spline_8seg::p0_x , (signed word) spline_8seg::p0_y , (signed word) spline_8seg::p1_x , (signed word) spline_8seg::p1_y , (signed word) spline_8seg::p2_x , (signed word) spline_8seg::p2_y)
Converted procedure struct value parameter to member unwinding (void()) spline_8segB((signed word) spline_8segB::p0_x , (signed word) spline_8segB::p0_y , (signed word) spline_8segB::p1_x , (signed word) spline_8segB::p1_y , (signed word) spline_8segB::p2_x , (signed word) spline_8segB::p2_y)
Converted procedure struct value parameter to member unwinding (struct SplineVector16()) rotate((signed word) rotate::vector_x , (signed word) rotate::vector_y , (byte) rotate::angle)
Adding struct value list initializer (signed word) spline_16seg::a_x ← (number~) spline_16seg::$2
Adding struct value list initializer (signed word) spline_16seg::a_y ← (number~) spline_16seg::$5
Adding struct value list initializer (signed word) spline_16seg::b_x ← (number~) spline_16seg::$7
Adding struct value list initializer (signed word) spline_16seg::b_y ← (number~) spline_16seg::$9
Adding struct value list initializer (signed dword) spline_16seg::i_x ← (number~) spline_16seg::$15
Adding struct value list initializer (signed dword) spline_16seg::i_y ← (number~) spline_16seg::$21
Adding struct value list initializer (signed dword) spline_16seg::j_x ← (number~) spline_16seg::$24
Adding struct value list initializer (signed dword) spline_16seg::j_y ← (number~) spline_16seg::$27
Adding struct value list initializer (signed dword) spline_16seg::p_x ← (number~) spline_16seg::$29
Adding struct value list initializer (signed dword) spline_16seg::p_y ← (number~) spline_16seg::$31
Adding struct value list initializer (signed word) spline_16seg::a_x ← (signed word)(number~) spline_16seg::$2
Adding struct value list initializer (signed word) spline_16seg::a_y ← (signed word)(number~) spline_16seg::$5
Adding struct value list initializer (signed word) spline_16seg::b_x ← (signed word)(number~) spline_16seg::$7
Adding struct value list initializer (signed word) spline_16seg::b_y ← (signed word)(number~) spline_16seg::$9
Adding struct value list initializer (signed dword) spline_16seg::i_x ← (signed dword)(number~) spline_16seg::$15
Adding struct value list initializer (signed dword) spline_16seg::i_y ← (signed dword)(number~) spline_16seg::$21
Adding struct value list initializer (signed dword) spline_16seg::j_x ← (signed dword)(number~) spline_16seg::$24
Adding struct value list initializer (signed dword) spline_16seg::j_y ← (signed dword)(number~) spline_16seg::$27
Adding struct value list initializer (signed dword) spline_16seg::p_x ← (signed dword)(number~) spline_16seg::$29
Adding struct value list initializer (signed dword) spline_16seg::p_y ← (signed dword)(number~) spline_16seg::$31
Adding struct value list initializer *((signed word*~) spline_16seg::$51 + (byte~) spline_16seg::$49) ← (signed word~) spline_16seg::$40
Adding struct value list initializer *((signed word*~) spline_16seg::$52 + (byte~) spline_16seg::$49) ← (signed word~) spline_16seg::$43
Adding struct value list initializer (signed dword) spline_16seg::p_x ← (signed dword~) spline_16seg::$44
@ -143,16 +143,16 @@ Adding struct value list initializer (signed dword) spline_16seg::i_x ← (signe
Adding struct value list initializer (signed dword) spline_16seg::i_y ← (signed dword~) spline_16seg::$47
Adding struct value list initializer *((signed word*~) spline_16seg::$53 + (number~) spline_16seg::$50) ← (signed word~) spline_16seg::$34
Adding struct value list initializer *((signed word*~) spline_16seg::$54 + (number~) spline_16seg::$50) ← (signed word~) spline_16seg::$37
Adding struct value list initializer (signed word) spline_8seg::a_x ← (number~) spline_8seg::$2
Adding struct value list initializer (signed word) spline_8seg::a_y ← (number~) spline_8seg::$5
Adding struct value list initializer (signed word) spline_8seg::b_x ← (number~) spline_8seg::$7
Adding struct value list initializer (signed word) spline_8seg::b_y ← (number~) spline_8seg::$9
Adding struct value list initializer (signed dword) spline_8seg::i_x ← (number~) spline_8seg::$16
Adding struct value list initializer (signed dword) spline_8seg::i_y ← (number~) spline_8seg::$23
Adding struct value list initializer (signed dword) spline_8seg::j_x ← (number~) spline_8seg::$26
Adding struct value list initializer (signed dword) spline_8seg::j_y ← (number~) spline_8seg::$29
Adding struct value list initializer (signed dword) spline_8seg::p_x ← (number~) spline_8seg::$31
Adding struct value list initializer (signed dword) spline_8seg::p_y ← (number~) spline_8seg::$33
Adding struct value list initializer (signed word) spline_8seg::a_x ← (signed word)(number~) spline_8seg::$2
Adding struct value list initializer (signed word) spline_8seg::a_y ← (signed word)(number~) spline_8seg::$5
Adding struct value list initializer (signed word) spline_8seg::b_x ← (signed word)(number~) spline_8seg::$7
Adding struct value list initializer (signed word) spline_8seg::b_y ← (signed word)(number~) spline_8seg::$9
Adding struct value list initializer (signed dword) spline_8seg::i_x ← (signed dword)(number~) spline_8seg::$16
Adding struct value list initializer (signed dword) spline_8seg::i_y ← (signed dword)(number~) spline_8seg::$23
Adding struct value list initializer (signed dword) spline_8seg::j_x ← (signed dword)(number~) spline_8seg::$26
Adding struct value list initializer (signed dword) spline_8seg::j_y ← (signed dword)(number~) spline_8seg::$29
Adding struct value list initializer (signed dword) spline_8seg::p_x ← (signed dword)(number~) spline_8seg::$31
Adding struct value list initializer (signed dword) spline_8seg::p_y ← (signed dword)(number~) spline_8seg::$33
Adding struct value list initializer *((signed word*~) spline_8seg::$53 + (byte~) spline_8seg::$51) ← (signed word~) spline_8seg::$42
Adding struct value list initializer *((signed word*~) spline_8seg::$54 + (byte~) spline_8seg::$51) ← (signed word~) spline_8seg::$45
Adding struct value list initializer (signed dword) spline_8seg::p_x ← (signed dword~) spline_8seg::$46
@ -161,16 +161,16 @@ Adding struct value list initializer (signed dword) spline_8seg::i_x ← (signed
Adding struct value list initializer (signed dword) spline_8seg::i_y ← (signed dword~) spline_8seg::$49
Adding struct value list initializer *((signed word*~) spline_8seg::$55 + (number~) spline_8seg::$52) ← (signed word~) spline_8seg::$36
Adding struct value list initializer *((signed word*~) spline_8seg::$56 + (number~) spline_8seg::$52) ← (signed word~) spline_8seg::$39
Adding struct value list initializer (signed word) spline_8segB::a_x ← (number~) spline_8segB::$2
Adding struct value list initializer (signed word) spline_8segB::a_y ← (number~) spline_8segB::$5
Adding struct value list initializer (signed word) spline_8segB::b_x ← (number~) spline_8segB::$7
Adding struct value list initializer (signed word) spline_8segB::b_y ← (number~) spline_8segB::$9
Adding struct value list initializer (signed word) spline_8segB::i_x ← (number~) spline_8segB::$11
Adding struct value list initializer (signed word) spline_8segB::i_y ← (number~) spline_8segB::$13
Adding struct value list initializer (signed word) spline_8segB::j_x ← (number~) spline_8segB::$14
Adding struct value list initializer (signed word) spline_8segB::j_y ← (number~) spline_8segB::$15
Adding struct value list initializer (signed word) spline_8segB::p_x ← (number~) spline_8segB::$16
Adding struct value list initializer (signed word) spline_8segB::p_y ← (number~) spline_8segB::$17
Adding struct value list initializer (signed word) spline_8segB::a_x ← (signed word)(number~) spline_8segB::$2
Adding struct value list initializer (signed word) spline_8segB::a_y ← (signed word)(number~) spline_8segB::$5
Adding struct value list initializer (signed word) spline_8segB::b_x ← (signed word)(number~) spline_8segB::$7
Adding struct value list initializer (signed word) spline_8segB::b_y ← (signed word)(number~) spline_8segB::$9
Adding struct value list initializer (signed word) spline_8segB::i_x ← (signed word)(number~) spline_8segB::$11
Adding struct value list initializer (signed word) spline_8segB::i_y ← (signed word)(number~) spline_8segB::$13
Adding struct value list initializer (signed word) spline_8segB::j_x ← (signed word)(number~) spline_8segB::$14
Adding struct value list initializer (signed word) spline_8segB::j_y ← (signed word)(number~) spline_8segB::$15
Adding struct value list initializer (signed word) spline_8segB::p_x ← (signed word)(number~) spline_8segB::$16
Adding struct value list initializer (signed word) spline_8segB::p_y ← (signed word)(number~) spline_8segB::$17
Adding struct value list initializer *((signed word*~) spline_8segB::$33 + (byte~) spline_8segB::$31) ← (number~) spline_8segB::$23
Adding struct value list initializer *((signed word*~) spline_8segB::$34 + (byte~) spline_8segB::$31) ← (number~) spline_8segB::$25
Adding struct value list initializer (signed word) spline_8segB::p_x ← (signed word~) spline_8segB::$26
@ -179,8 +179,8 @@ Adding struct value list initializer (signed word) spline_8segB::i_x ← (signed
Adding struct value list initializer (signed word) spline_8segB::i_y ← (signed word~) spline_8segB::$29
Adding struct value list initializer *((signed word*~) spline_8segB::$35 + (number~) spline_8segB::$32) ← (number~) spline_8segB::$19
Adding struct value list initializer *((signed word*~) spline_8segB::$36 + (number~) spline_8segB::$32) ← (number~) spline_8segB::$21
Adding struct value list initializer (signed word) show_letter::current_x ← (number) 0
Adding struct value list initializer (signed word) show_letter::current_y ← (number) 0
Adding struct value member variable copy (signed word) show_letter::current_x ← (signed word)(number) 0
Adding struct value member variable copy (signed word) show_letter::current_y ← (signed word)(number) 0
Adding struct value list initializer (signed word) show_letter::to_x ← *((const struct Segment*) letter_c + (byte~) show_letter::$20).to.x
Adding struct value list initializer (signed word) show_letter::to_y ← *((const struct Segment*) letter_c + (byte~) show_letter::$20).to.y
Adding struct value list initializer (signed word) show_letter::to_x ← (number~) show_letter::$0
@ -209,8 +209,8 @@ Adding struct value member variable copy (signed word) bitmap_plot_spline_8seg::
Adding struct value member variable copy (signed word) bitmap_plot_spline_8seg::current_y ← *((signed word*~) bitmap_plot_spline_8seg::$11 + (number~) bitmap_plot_spline_8seg::$6)
Adding struct value member variable copy (signed word) bitmap_plot_spline_8seg::current_x ← *((signed word*~) bitmap_plot_spline_8seg::$12 + (byte~) bitmap_plot_spline_8seg::$9)
Adding struct value member variable copy (signed word) bitmap_plot_spline_8seg::current_y ← *((signed word*~) bitmap_plot_spline_8seg::$13 + (byte~) bitmap_plot_spline_8seg::$9)
Adding struct value list initializer (signed word) rotate::rotated_x ← (signed word~) rotate::$16
Adding struct value list initializer (signed word) rotate::rotated_y ← (signed word~) rotate::$19
Adding struct value list initializer (signed word) rotate::rotated_x ← (signed word)(signed word~) rotate::$16
Adding struct value list initializer (signed word) rotate::rotated_y ← (signed word)(signed word~) rotate::$19
Adding struct value member variable copy (signed word) rotate::return_x ← (signed word) rotate::rotated_x
Adding struct value member variable copy (signed word) rotate::return_y ← (signed word) rotate::rotated_y
Adding struct value member variable copy (signed word) rotate::return_x ← (signed word) rotate::return_x
@ -507,28 +507,28 @@ spline_8segB: scope:[spline_8segB] from show_letter::@3
(number~) spline_8segB::$3 ← (signed word) spline_8segB::p1_y#1 * (number) 2
(number~) spline_8segB::$4 ← (signed word) spline_8segB::p2_y#1 - (number~) spline_8segB::$3
(number~) spline_8segB::$5 ← (number~) spline_8segB::$4 + (signed word) spline_8segB::p0_y#1
(signed word) spline_8segB::a_x#0 ← (number~) spline_8segB::$2
(signed word) spline_8segB::a_y#0 ← (number~) spline_8segB::$5
(signed word) spline_8segB::a_x#0 ← (signed word)(number~) spline_8segB::$2
(signed word) spline_8segB::a_y#0 ← (signed word)(number~) spline_8segB::$5
(signed word~) spline_8segB::$6 ← (signed word) spline_8segB::p1_x#1 - (signed word) spline_8segB::p0_x#1
(number~) spline_8segB::$7 ← (signed word~) spline_8segB::$6 * (number) 2
(signed word~) spline_8segB::$8 ← (signed word) spline_8segB::p1_y#1 - (signed word) spline_8segB::p0_y#1
(number~) spline_8segB::$9 ← (signed word~) spline_8segB::$8 * (number) 2
(signed word) spline_8segB::b_x#0 ← (number~) spline_8segB::$7
(signed word) spline_8segB::b_y#0 ← (number~) spline_8segB::$9
(signed word) spline_8segB::b_x#0 ← (signed word)(number~) spline_8segB::$7
(signed word) spline_8segB::b_y#0 ← (signed word)(number~) spline_8segB::$9
(number~) spline_8segB::$10 ← (signed word) spline_8segB::b_x#0 * (number) 8
(number~) spline_8segB::$11 ← (signed word) spline_8segB::a_x#0 + (number~) spline_8segB::$10
(number~) spline_8segB::$12 ← (signed word) spline_8segB::b_y#0 * (number) 8
(number~) spline_8segB::$13 ← (signed word) spline_8segB::a_y#0 + (number~) spline_8segB::$12
(signed word) spline_8segB::i_x#0 ← (number~) spline_8segB::$11
(signed word) spline_8segB::i_y#0 ← (number~) spline_8segB::$13
(signed word) spline_8segB::i_x#0 ← (signed word)(number~) spline_8segB::$11
(signed word) spline_8segB::i_y#0 ← (signed word)(number~) spline_8segB::$13
(number~) spline_8segB::$14 ← (signed word) spline_8segB::a_x#0 * (number) 2
(number~) spline_8segB::$15 ← (signed word) spline_8segB::a_y#0 * (number) 2
(signed word) spline_8segB::j_x#0 ← (number~) spline_8segB::$14
(signed word) spline_8segB::j_y#0 ← (number~) spline_8segB::$15
(signed word) spline_8segB::j_x#0 ← (signed word)(number~) spline_8segB::$14
(signed word) spline_8segB::j_y#0 ← (signed word)(number~) spline_8segB::$15
(number~) spline_8segB::$16 ← (signed word) spline_8segB::p0_x#1 * (number) $40
(number~) spline_8segB::$17 ← (signed word) spline_8segB::p0_y#1 * (number) $40
(signed word) spline_8segB::p_x#0 ← (number~) spline_8segB::$16
(signed word) spline_8segB::p_y#0 ← (number~) spline_8segB::$17
(signed word) spline_8segB::p_x#0 ← (signed word)(number~) spline_8segB::$16
(signed word) spline_8segB::p_y#0 ← (signed word)(number~) spline_8segB::$17
(byte) spline_8segB::n#0 ← (byte) 0
to:spline_8segB::@1
spline_8segB::@1: scope:[spline_8segB] from spline_8segB spline_8segB::@1
@ -1388,8 +1388,8 @@ main::@return: scope:[main] from main::@13
(void()) show_letter((byte) show_letter::angle)
show_letter: scope:[show_letter] from main::@24
(byte) show_letter::angle#3 ← phi( main::@24/(byte) show_letter::angle#0 )
(signed word) show_letter::current_x#0 ← (number) 0
(signed word) show_letter::current_y#0 ← (number) 0
(signed word) show_letter::current_x#0 ← (signed word)(number) 0
(signed word) show_letter::current_y#0 ← (signed word)(number) 0
(byte) show_letter::i#0 ← (byte) 0
to:show_letter::@1
show_letter::@1: scope:[show_letter] from show_letter show_letter::@5
@ -1681,8 +1681,8 @@ rotate::@5: scope:[rotate] from rotate::@4
(byte~) rotate::$17 ← > (signed word) rotate::yr#1
(signed byte~) rotate::$18 ← ((signed byte)) (byte~) rotate::$17
(signed word~) rotate::$19 ← ((signed word)) (signed byte~) rotate::$18
(signed word) rotate::rotated_x#0 ← (signed word~) rotate::$16
(signed word) rotate::rotated_y#0 ← (signed word~) rotate::$19
(signed word) rotate::rotated_x#0 ← (signed word)(signed word~) rotate::$16
(signed word) rotate::rotated_y#0 ← (signed word)(signed word~) rotate::$19
(signed word) rotate::return_x#2 ← (signed word) rotate::rotated_x#0
(signed word) rotate::return_y#2 ← (signed word) rotate::rotated_y#0
(struct SplineVector16) rotate::return#0 ← struct-unwound {(signed word) rotate::return_x#2, (signed word) rotate::return_y#2}
@ -2961,8 +2961,6 @@ Adding number conversion cast (unumber) $fe in (bool~) main::$7 ← *((const byt
Adding number conversion cast (unumber) $ff in (bool~) main::$8 ← *((const byte*) RASTER) != (number) $ff
Adding number conversion cast (unumber) 9 in (byte) main::angle#1 ← (byte) main::angle#3 + (number) 9
Adding number conversion cast (unumber) $3e7 in *((const byte*) PRINT_SCREEN+(number) $3e7) ← ++ *((const byte*) PRINT_SCREEN+(number) $3e7)
Adding number conversion cast (snumber) 0 in (signed word) show_letter::current_x#0 ← (number) 0
Adding number conversion cast (snumber) 0 in (signed word) show_letter::current_y#0 ← (number) 0
Adding number conversion cast (snumber) $32 in (number~) show_letter::$0 ← (signed word) show_letter::to_x#0 - (number) $32
Adding number conversion cast (snumber) show_letter::$0 in (number~) show_letter::$0 ← (signed word) show_letter::to_x#0 - (snumber)(number) $32
Adding number conversion cast (snumber) $96 in (number~) show_letter::$1 ← (signed word) show_letter::to_y#0 - (number) $96
@ -3017,8 +3015,6 @@ Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1
Inlining cast (word~) main::toD0181_$4 ← (word)(byte*) main::toD0181_gfx#1
Inlining cast *((const byte*) D011) ← (unumber)(const byte) VIC_BMM|(const byte) VIC_DEN|(const byte) VIC_RSEL|(unumber)(number) 3
Inlining cast (byte) main::angle#0 ← (unumber)(number) 0
Inlining cast (signed word) show_letter::current_x#0 ← (snumber)(number) 0
Inlining cast (signed word) show_letter::current_y#0 ← (snumber)(number) 0
Inlining cast (word~) show_letter::$12 ← (word)(signed word) show_letter::current_x#5
Inlining cast (word~) show_letter::$13 ← (word)(signed word) show_letter::current_y#5
Inlining cast (word~) show_letter::$14 ← (word)(signed word) show_letter::segment_to_x#4
@ -3228,6 +3224,8 @@ Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast (signed word~) rotate::$16
Simplifying constant integer cast (signed word~) rotate::$19
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $40
Finalized signed number type (signed byte) 2
@ -3301,8 +3299,6 @@ Finalized unsigned number type (byte) $fe
Finalized unsigned number type (byte) $ff
Finalized unsigned number type (byte) 9
Finalized unsigned number type (word) $3e7
Finalized signed number type (signed byte) 0
Finalized signed number type (signed byte) 0
Finalized signed number type (signed byte) $32
Finalized signed number type (signed word) $96
Finalized signed number type (signed byte) $64
@ -3386,16 +3382,6 @@ Inversing boolean not [304] (bool~) mulf_init::$10 ← (byte) mulf_init::x_255#1
Inversing boolean not [332] (bool~) mulf16s::$4 ← (signed word) mulf16s::a#5 >= (signed byte) 0 from [331] (bool~) mulf16s::$3 ← (signed word) mulf16s::a#5 < (signed byte) 0
Inversing boolean not [336] (bool~) mulf16s::$6 ← (signed word) mulf16s::b#5 >= (signed byte) 0 from [335] (bool~) mulf16s::$5 ← (signed word) mulf16s::b#5 < (signed byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (signed word) spline_8segB::a_x#0 = (signed word~) spline_8segB::$2
Alias (signed word) spline_8segB::a_y#0 = (signed word~) spline_8segB::$5
Alias (signed word) spline_8segB::b_x#0 = (signed word~) spline_8segB::$7
Alias (signed word) spline_8segB::b_y#0 = (signed word~) spline_8segB::$9
Alias (signed word) spline_8segB::i_x#0 = (signed word~) spline_8segB::$11
Alias (signed word) spline_8segB::i_y#0 = (signed word~) spline_8segB::$13
Alias (signed word) spline_8segB::j_x#0 = (signed word~) spline_8segB::$14
Alias (signed word) spline_8segB::j_y#0 = (signed word~) spline_8segB::$15
Alias (signed word) spline_8segB::p_x#0 = (signed word~) spline_8segB::$16
Alias (signed word) spline_8segB::p_y#0 = (signed word~) spline_8segB::$17
Alias (signed word) spline_8segB::p_x#1 = (signed word~) spline_8segB::$26 (signed word) spline_8segB::p_x#3
Alias (signed word) spline_8segB::p_y#1 = (signed word~) spline_8segB::$27 (signed word) spline_8segB::p_y#3
Alias (signed word) spline_8segB::i_x#1 = (signed word~) spline_8segB::$28
@ -3801,10 +3787,10 @@ Simplifying expression containing zero (signed word*)show_letter::$25 in [469] (
Simplifying expression containing zero bitmap_plot_spline_8seg::$10 in [541] (signed word) bitmap_plot_spline_8seg::current_x#0 ← *((const signed word*) bitmap_plot_spline_8seg::$10 + (const byte) bitmap_plot_spline_8seg::$6)
Simplifying expression containing zero bitmap_plot_spline_8seg::$11 in [543] (signed word) bitmap_plot_spline_8seg::current_y#0 ← *((const signed word*) bitmap_plot_spline_8seg::$11 + (const byte) bitmap_plot_spline_8seg::$6)
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (void*) memset::return#2 and assignment [75] (void*) memset::return#2 ← (void*) memset::str#3
Eliminating unused variable (void*) memset::return#3 and assignment [77] (void*) memset::return#3 ← (void*) memset::str#3
Eliminating unused variable (struct SplineVector16) rotate::return#0 and assignment [344] (struct SplineVector16) rotate::return#0 ← struct-unwound {(signed word) rotate::return_x#2, (signed word) rotate::return_y#2}
Eliminating unused variable (struct SplineVector16) rotate::return#1 and assignment [345] (struct SplineVector16) rotate::return#1 ← struct-unwound {(signed word) rotate::return_x#2, (signed word) rotate::return_y#2}
Eliminating unused variable (void*) memset::return#2 and assignment [85] (void*) memset::return#2 ← (void*) memset::str#3
Eliminating unused variable (void*) memset::return#3 and assignment [87] (void*) memset::return#3 ← (void*) memset::str#3
Eliminating unused variable (struct SplineVector16) rotate::return#0 and assignment [354] (struct SplineVector16) rotate::return#0 ← struct-unwound {(signed word) rotate::return_x#2, (signed word) rotate::return_y#2}
Eliminating unused variable (struct SplineVector16) rotate::return#1 and assignment [355] (struct SplineVector16) rotate::return#1 ← struct-unwound {(signed word) rotate::return_x#2, (signed word) rotate::return_y#2}
Eliminating unused constant (const byte) bitmap_plot_spline_8seg::$6
Eliminating unused constant (const byte) OFFSET_STRUCT_SPLINEVECTOR16_X
Eliminating unused constant (const byte) OFFSET_STRUCT_SEGMENT_TYPE
@ -3824,6 +3810,16 @@ Adding number conversion cast (unumber) 9 in if((byte) bitmap_plot_spline_8seg::
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$3
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast (signed word~) spline_8segB::$2
Simplifying constant integer cast (signed word~) spline_8segB::$5
Simplifying constant integer cast (signed word~) spline_8segB::$7
Simplifying constant integer cast (signed word~) spline_8segB::$9
Simplifying constant integer cast (signed word~) spline_8segB::$11
Simplifying constant integer cast (signed word~) spline_8segB::$13
Simplifying constant integer cast (signed word~) spline_8segB::$14
Simplifying constant integer cast (signed word~) spline_8segB::$15
Simplifying constant integer cast (signed word~) spline_8segB::$16
Simplifying constant integer cast (signed word~) spline_8segB::$17
Simplifying constant integer cast 8
Simplifying constant integer cast 0
Simplifying constant integer cast 0
@ -3838,19 +3834,29 @@ Finalized unsigned number type (byte) $3d
Finalized unsigned number type (byte) $16
Finalized unsigned number type (byte) 9
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (signed word) spline_8segB::a_x#0 = (signed word~) spline_8segB::$2
Alias (signed word) spline_8segB::a_y#0 = (signed word~) spline_8segB::$5
Alias (signed word) spline_8segB::b_x#0 = (signed word~) spline_8segB::$7
Alias (signed word) spline_8segB::b_y#0 = (signed word~) spline_8segB::$9
Alias (signed word) spline_8segB::i_x#0 = (signed word~) spline_8segB::$11
Alias (signed word) spline_8segB::i_y#0 = (signed word~) spline_8segB::$13
Alias (signed word) spline_8segB::j_x#0 = (signed word~) spline_8segB::$14
Alias (signed word) spline_8segB::j_y#0 = (signed word~) spline_8segB::$15
Alias (signed word) spline_8segB::p_x#0 = (signed word~) spline_8segB::$16
Alias (signed word) spline_8segB::p_y#0 = (signed word~) spline_8segB::$17
Alias (byte~) bitmap_init::$7 = (byte~) bitmap_init::$3
Alias (byte~) bitmap_plot_spline_8seg::$8 = (byte~) bitmap_plot_spline_8seg::$7
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) bitmap_line::$4 [96] if((word) bitmap_line::dx#0==(byte) 0) goto bitmap_line::@24
Simple Condition (bool~) bitmap_line::$5 [342] if((word) bitmap_line::dy#0==(byte) 0) goto bitmap_line::@4
Simple Condition (bool~) bitmap_line::$4 [106] if((word) bitmap_line::dx#0==(byte) 0) goto bitmap_line::@24
Simple Condition (bool~) bitmap_line::$5 [352] if((word) bitmap_line::dy#0==(byte) 0) goto bitmap_line::@4
Successful SSA optimization Pass2ConditionalJumpSimplification
Negating conditional jump and destination [96] if((word) bitmap_line::dx#0!=(byte) 0) goto bitmap_line::@1
Negating conditional jump and destination [106] if((word) bitmap_line::dx#0!=(byte) 0) goto bitmap_line::@1
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [207] (byte~) main::vicSelectGfxBank1_toDd001_$1 ← > (const word) main::vicSelectGfxBank1_toDd001_$0
Constant right-side identified [211] (word~) main::toD0181_$1 ← (const word) main::toD0181_$0 & (word) $3fff
Constant right-side identified [214] (byte~) main::toD0181_$5 ← > (const word) main::toD0181_$4
Constant right-side identified [234] (signed word*~) show_letter::$29 ← (signed word*)(const struct SplineVector16*) show_letter::$24 + (const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y
Constant right-side identified [251] (signed word*~) show_letter::$31 ← (signed word*)(const struct SplineVector16*) show_letter::$26 + (const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y
Constant right-side identified [217] (byte~) main::vicSelectGfxBank1_toDd001_$1 ← > (const word) main::vicSelectGfxBank1_toDd001_$0
Constant right-side identified [221] (word~) main::toD0181_$1 ← (const word) main::toD0181_$0 & (word) $3fff
Constant right-side identified [224] (byte~) main::toD0181_$5 ← > (const word) main::toD0181_$4
Constant right-side identified [244] (signed word*~) show_letter::$29 ← (signed word*)(const struct SplineVector16*) show_letter::$24 + (const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y
Constant right-side identified [261] (signed word*~) show_letter::$31 ← (signed word*)(const struct SplineVector16*) show_letter::$26 + (const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::vicSelectGfxBank1_toDd001_$1 = >main::vicSelectGfxBank1_toDd001_$0
Constant (const word) main::toD0181_$1 = main::toD0181_$0&$3fff
@ -3971,7 +3977,7 @@ Constant inlined main::toD0181_$2 = (word)(const byte*) BITMAP_SCREEN&(word) $3f
Constant inlined main::toD0181_$1 = (word)(const byte*) BITMAP_SCREEN&(word) $3fff
Constant inlined bitmap_gfx#1 = (const byte*) BITMAP_GRAPHICS
Constant inlined main::toD0181_$0 = (word)(const byte*) BITMAP_SCREEN
Constant inlined show_letter::current_x#0 = (signed byte) 0
Constant inlined show_letter::current_x#0 = (signed word) 0
Constant inlined main::toD0181_$6 = >(word)(const byte*) BITMAP_GRAPHICS/(byte) 4
Constant inlined show_letter::$24 = (struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO
Constant inlined main::toD0181_$5 = >(word)(const byte*) BITMAP_GRAPHICS
@ -4012,7 +4018,7 @@ Constant inlined sgn_u16::return#2 = (byte) -1
Constant inlined memset::str#1 = (void*)(const byte*) BITMAP_GRAPHICS
Constant inlined memset::str#0 = (void*)(const byte*) BITMAP_SCREEN
Constant inlined mulf_init::sqr#0 = (byte) 0
Constant inlined show_letter::current_y#0 = (signed byte) 0
Constant inlined show_letter::current_y#0 = (signed word) 0
Constant inlined bitmap_clear::fgcol#0 = (const byte) WHITE
Constant inlined main::vicSelectGfxBank1_toDd001_$0 = (word)(const byte*) BITMAP_SCREEN
Constant inlined main::angle#0 = (byte) 0
@ -4399,8 +4405,8 @@ show_letter: scope:[show_letter] from main::@10
[27] phi()
to:show_letter::@1
show_letter::@1: scope:[show_letter] from show_letter show_letter::@9
[28] (signed word) show_letter::current_y#4 ← phi( show_letter/(signed byte) 0 show_letter::@9/(signed word) show_letter::current_y#11 )
[28] (signed word) show_letter::current_x#4 ← phi( show_letter/(signed byte) 0 show_letter::@9/(signed word) show_letter::current_x#11 )
[28] (signed word) show_letter::current_y#4 ← phi( show_letter/(signed word) 0 show_letter::@9/(signed word) show_letter::current_y#11 )
[28] (signed word) show_letter::current_x#4 ← phi( show_letter/(signed word) 0 show_letter::@9/(signed word) show_letter::current_x#11 )
[28] (byte) show_letter::i#10 ← phi( show_letter/(byte) 0 show_letter::@9/(byte) show_letter::i#1 )
[29] (byte~) show_letter::$32 ← (byte) show_letter::i#10 << (byte) 3
[30] (byte~) show_letter::$20 ← (byte~) show_letter::$32 + (byte) show_letter::i#10
@ -6045,12 +6051,12 @@ show_letter: {
.label __36 = $80
// [28] phi from show_letter to show_letter::@1 [phi:show_letter->show_letter::@1]
__b1_from_show_letter:
// [28] phi (signed word) show_letter::current_y#4 = (signed byte) 0 [phi:show_letter->show_letter::@1#0] -- vwsz1=vbsc1
// [28] phi (signed word) show_letter::current_y#4 = (signed word) 0 [phi:show_letter->show_letter::@1#0] -- vwsz1=vwsc1
lda #<0
sta.z current_y
lda #>0
sta.z current_y+1
// [28] phi (signed word) show_letter::current_x#4 = (signed byte) 0 [phi:show_letter->show_letter::@1#1] -- vwsz1=vbsc1
// [28] phi (signed word) show_letter::current_x#4 = (signed word) 0 [phi:show_letter->show_letter::@1#1] -- vwsz1=vwsc1
lda #<0
sta.z current_x
lda #>0
@ -9512,12 +9518,12 @@ show_letter: {
.label current_y_1 = $16
// [28] phi from show_letter to show_letter::@1 [phi:show_letter->show_letter::@1]
__b1_from_show_letter:
// [28] phi (signed word) show_letter::current_y#4 = (signed byte) 0 [phi:show_letter->show_letter::@1#0] -- vwsz1=vbsc1
// [28] phi (signed word) show_letter::current_y#4 = (signed word) 0 [phi:show_letter->show_letter::@1#0] -- vwsz1=vwsc1
lda #<0
sta.z current_y
lda #>0
sta.z current_y+1
// [28] phi (signed word) show_letter::current_x#4 = (signed byte) 0 [phi:show_letter->show_letter::@1#1] -- vwsz1=vbsc1
// [28] phi (signed word) show_letter::current_x#4 = (signed word) 0 [phi:show_letter->show_letter::@1#1] -- vwsz1=vwsc1
lda #<0
sta.z current_x
lda #>0
@ -12601,11 +12607,11 @@ show_letter: {
.label current_x_1 = $14
.label current_y_1 = $16
// [28] phi from show_letter to show_letter::@1 [phi:show_letter->show_letter::@1]
// [28] phi (signed word) show_letter::current_y#4 = (signed byte) 0 [phi:show_letter->show_letter::@1#0] -- vwsz1=vbsc1
// [28] phi (signed word) show_letter::current_y#4 = (signed word) 0 [phi:show_letter->show_letter::@1#0] -- vwsz1=vwsc1
lda #<0
sta.z current_y
sta.z current_y+1
// [28] phi (signed word) show_letter::current_x#4 = (signed byte) 0 [phi:show_letter->show_letter::@1#1] -- vwsz1=vbsc1
// [28] phi (signed word) show_letter::current_x#4 = (signed word) 0 [phi:show_letter->show_letter::@1#1] -- vwsz1=vwsc1
sta.z current_x
sta.z current_x+1
// [28] phi (byte) show_letter::i#10 = (byte) 0 [phi:show_letter->show_letter::@1#2] -- vbuz1=vbuc1

View File

@ -1407,7 +1407,7 @@ sprites_irq::@return: scope:[sprites_irq] from sprites_irq::@6
(byte) irq_raster_next#17 ← phi( @38/(byte) irq_raster_next#20 )
(byte) irq_sprite_ypos#14 ← phi( @38/(byte) irq_sprite_ypos#18 )
(byte) next_piece_idx#0 ← (number) 0
(byte*) current_piece#0 ← ((byte*)) (number) 0
(byte*) current_piece#0 ← (byte*)(number) 0
(byte) current_orientation#0 ← (number) 0
(byte) current_movedown_slow#0 ← (number) $30
(byte) current_movedown_counter#0 ← (number) 0
@ -6929,7 +6929,6 @@ Inlining cast (word~) sprites_irq::toSpritePtr2_$0 ← (word)(byte*) sprites_irq
Inlining cast (byte~) sprites_irq::toSpritePtr2_$2 ← (byte)(unumber~) sprites_irq::toSpritePtr2_$1
Inlining cast (byte) irq_cnt#2 ← (unumber)(number) 0
Inlining cast (byte) next_piece_idx#0 ← (unumber)(number) 0
Inlining cast (byte*) current_piece#0 ← (byte*)(number) 0
Inlining cast (byte) current_orientation#0 ← (unumber)(number) 0
Inlining cast (byte) current_movedown_slow#0 ← (unumber)(number) $30
Inlining cast (byte) current_movedown_counter#0 ← (unumber)(number) 0

View File

@ -112,7 +112,7 @@ memset::@return: scope:[memset] from memset::@1
return
to:@return
@12: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@41
@ -881,7 +881,6 @@ Adding number conversion cast (snumber) 2 in (signed byte) assert_sbyte::c#4 ←
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast (byte) assert_byte::c#0 ← (unumber)(number) 0
Inlining cast (byte) assert_byte::c#1 ← (unumber)(number) 2

View File

@ -369,7 +369,7 @@ atan2_16::@return: scope:[atan2_16] from atan2_16::@8
return
to:@return
@19: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@45
@ -1146,7 +1146,6 @@ Inlining cast *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#0)
Inlining cast *((byte*) init_font_hex::charset#4 + (byte) init_font_hex::idx#6) ← (unumber)(number) 0
Inlining cast *((byte*) init_font_hex::charset#4 + (byte) init_font_hex::idx#3) ← (unumber)(number) 0
Inlining cast (word) atan2_16::angle#0 ← (unumber)(number) 0
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1
Inlining cast (word~) main::toD0181_$4 ← (word)(byte*) main::toD0181_gfx#1
Inlining cast (word) main::diff_sum#0 ← (unumber)(number) 0

View File

@ -2,8 +2,8 @@ Setting inferred volatile on symbol affected by address-of (struct foo*) main::b
Created struct value member variable (byte) bar_thing1
Created struct value member variable (byte) bar_thing2
Converted struct value to member variables (struct foo) bar
Adding struct value list initializer (byte) bar_thing1 ← (byte) 'a'
Adding struct value list initializer (byte) bar_thing2 ← (byte) 'b'
Adding struct value member variable copy (byte) bar_thing1 ← (byte) 'a'
Adding struct value member variable copy (byte) bar_thing2 ← (byte) 'b'
Rewriting struct pointer member access *((struct foo*) main::barp).thing1
Rewriting struct pointer member access *((struct foo*) main::barp).thing2
Identified constant variable (struct foo*) main::barp

View File

@ -1,8 +1,8 @@
Created struct value member variable (byte) bar_thing1
Created struct value member variable (byte) bar_thing2
Converted struct value to member variables (struct foo) bar
Adding struct value list initializer (byte) bar_thing1 ← (byte) 'a'
Adding struct value list initializer (byte) bar_thing2 ← (byte) 'b'
Adding struct value member variable copy (byte) bar_thing1 ← (byte) 'a'
Adding struct value member variable copy (byte) bar_thing2 ← (byte) 'b'
Replacing struct member reference (struct foo) bar.thing1 with member unwinding reference (byte) bar_thing1
Replacing struct member reference (struct foo) bar.thing2 with member unwinding reference (byte) bar_thing2
Identified constant variable (byte) bar_thing1

View File

@ -1,8 +1,8 @@
Created struct value member variable (byte) main::button_color
Created struct value member variable (byte) main::button_size
Converted struct value to member variables (struct Button) main::button
Adding struct value list initializer (byte) main::button_color ← (const byte) RED
Adding struct value list initializer (byte) main::button_size ← (number) $18
Adding struct value member variable copy (byte) main::button_color ← (const byte) RED
Adding struct value member variable copy (byte) main::button_size ← (byte)(number) $18
Replacing struct member reference (struct Button) main::button.color with member unwinding reference (byte) main::button_color
Replacing struct member reference (struct Button) main::button.size with member unwinding reference (byte) main::button_size
Identified constant variable (byte) main::button_color
@ -41,12 +41,13 @@ SYMBOL TABLE SSA
(label) main::@return
(const byte*) main::SCREEN = (byte*)(number) $400
(const byte) main::button_color = (const byte) RED
(const byte) main::button_size = (byte) $18
(const byte) main::button_size = (byte)(number) $18
Adding number conversion cast (unumber) 0 in *((const byte*) main::SCREEN + (number) 0) ← (const byte) main::button_color
Adding number conversion cast (unumber) 1 in *((const byte*) main::SCREEN + (number) 1) ← (const byte) main::button_size
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $18
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification

View File

@ -1,8 +1,8 @@
Created struct value member variable (byte) main::button_color
Created struct value member variable (byte) main::button_size
Converted struct value to member variables (struct Button) main::button
Adding struct value list initializer (byte) main::button_color ← (const byte) RED
Adding struct value list initializer (byte) main::button_size ← (number) $18
Adding struct value member variable copy (byte) main::button_color ← (const byte) RED
Adding struct value member variable copy (byte) main::button_size ← (byte)(number) $18
Replacing struct member reference (struct Button) main::button.color with member unwinding reference (byte) main::button_color
Replacing struct member reference (struct Button) main::button.size with member unwinding reference (byte) main::button_size
Identified constant variable (byte) main::button_color
@ -41,12 +41,13 @@ SYMBOL TABLE SSA
(label) main::@return
(const byte*) main::SCREEN = (byte*)(number) $400
(const byte) main::button_color = (const byte) RED
(const byte) main::button_size = (byte) $18
(const byte) main::button_size = (byte)(number) $18
Adding number conversion cast (unumber) 0 in *((const byte*) main::SCREEN + (number) 0) ← (const byte) main::button_color
Adding number conversion cast (unumber) 1 in *((const byte*) main::SCREEN + (number) 1) ← (const byte) main::button_size
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $18
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification

View File

@ -107,7 +107,7 @@ memset::@return: scope:[memset] from memset::@1
return
to:@return
@12: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@39
@ -686,7 +686,6 @@ Adding number conversion cast (unumber) $bb in (byte) print_euclid::b#5 ← (num
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast (byte) print_euclid::a#0 ← (unumber)(number) $80
Inlining cast (byte) print_euclid::b#0 ← (unumber)(number) 2

View File

@ -273,7 +273,7 @@ memset::@return: scope:[memset] from memset::@1
return
to:@return
@16: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
to:@41
(void()) print_str_at((byte*) print_str_at::str , (byte*) print_str_at::at)
@ -2214,7 +2214,6 @@ Adding number conversion cast (unumber) 8 in *((const signed byte*) rotation_mat
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (byte~) print_sbyte_at::$1 ← (byte)(signed byte) print_sbyte_at::b#24
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast (word~) main::$1 ← (word)(const byte*) mulf_sqr1

View File

@ -121,7 +121,7 @@ memset::@return: scope:[memset] from memset::@1
return
to:@return
@16: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@44
@ -909,7 +909,6 @@ Adding number conversion cast (snumber) 2 in (signed word) mulf_init::add#1 ←
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (byte~) print_sbyte::$1 ← (byte)(signed byte) print_sbyte::b#6
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast (word~) main::$1 ← (word)(const byte*) mulf_sqr1

View File

@ -83,7 +83,7 @@ bitmap_init::@3: scope:[bitmap_init] from bitmap_init::@1
(byte) bitmap_init::bits#2 ← (number) $80
to:bitmap_init::@2
bitmap_init::@4: scope:[bitmap_init] from bitmap_init::@2
(byte*) bitmap_init::yoffs#0 ← ((byte*)) (number) 0
(byte*) bitmap_init::yoffs#0 ← (byte*)(number) 0
(byte) bitmap_init::y#0 ← (byte) 0
to:bitmap_init::@5
bitmap_init::@5: scope:[bitmap_init] from bitmap_init::@4 bitmap_init::@6
@ -1271,7 +1271,6 @@ Adding number conversion cast (unumber) $400 in *((const byte*) VIC_MEMORY) ←
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) bitmap_init::bits#0 ← (unumber)(number) $80
Inlining cast (byte) bitmap_init::bits#2 ← (unumber)(number) $80
Inlining cast (byte*) bitmap_init::yoffs#0 ← (byte*)(number) 0
Inlining cast *((byte*) bitmap_clear::bitmap#2) ← (unumber)(number) 0
Inlining cast (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$0
Inlining cast *((const byte*) BORDERCOL) ← (unumber)(number) 0

View File

@ -111,7 +111,7 @@ memset::@return: scope:[memset] from memset::@1
return
to:@return
@12: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
to:@39
(void()) print_sbyte_at((signed byte) print_sbyte_at::b , (byte*) print_sbyte_at::at)
@ -215,7 +215,7 @@ main: scope:[main] from @39
call init_screen
to:main::@7
main::@7: scope:[main] from main
(byte*) main::at_line#0 ← ((byte*)) (number) $400
(byte*) main::at_line#0 ← (byte*)(number) $400
(byte*~) main::$1 ← (byte*) main::at_line#0 + (number) 4
(byte*) main::at#0 ← (byte*~) main::$1
(byte) main::k#0 ← (byte) 0
@ -305,7 +305,7 @@ init_screen: scope:[init_screen] from main
call print_cls
to:init_screen::@5
init_screen::@5: scope:[init_screen] from init_screen
(byte*) init_screen::COLS#0 ← ((byte*)) (number) $d800
(byte*) init_screen::COLS#0 ← (byte*)(number) $d800
(byte) init_screen::l#0 ← (byte) 0
to:init_screen::@1
init_screen::@1: scope:[init_screen] from init_screen::@1 init_screen::@5
@ -618,11 +618,8 @@ Adding number conversion cast (unumber) $28 in (byte*) init_screen::COLS#1 ← (
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (byte~) print_sbyte_at::$1 ← (byte)(signed byte) print_sbyte_at::b#6
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast (byte*) main::at_line#0 ← (byte*)(number) $400
Inlining cast (byte*) init_screen::COLS#0 ← (byte*)(number) $d800
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast -$5f
Simplifying constant integer cast -$40

View File

@ -54,7 +54,7 @@ CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@12
@12: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@37
@ -225,8 +225,6 @@ SYMBOL TABLE SSA
Adding number conversion cast (unumber) 0 in (bool~) print_str::$0 ← (number) 0 != *((byte*) print_str::str#2)
Adding number conversion cast (unumber) $28 in (byte*~) print_ln::$0 ← (byte*) print_line_cursor#6 + (number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast $28

View File

@ -50,7 +50,7 @@ CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@4
@4: scope:[] from @begin
(byte*) PLEX_SCREEN_PTR#0 ← ((byte*)) (number) $400+(number) $3f8
(byte*) PLEX_SCREEN_PTR#0 ← (byte*)(number) $400+(number) $3f8
(byte) plex_show_idx#0 ← (number) 0
(byte) plex_sprite_idx#0 ← (number) 0
(byte) plex_sprite_msb#0 ← (number) 1
@ -1113,7 +1113,6 @@ Adding number conversion cast (unumber) 1 in (byte) loop::sin_idx#1 ← (byte) l
Adding number conversion cast (unumber) 0 in (bool~) loop::$6 ← (byte~) loop::$5 != (number) 0
Adding number conversion cast (unumber) 1 in (byte) loop::ss#1 ← (byte) loop::ss#2 + rangenext(0,PLEX_COUNT-1)
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) PLEX_SCREEN_PTR#0 ← (byte*)(number) $400+(number) $3f8
Inlining cast (byte) plex_show_idx#0 ← (unumber)(number) 0
Inlining cast (byte) plex_sprite_idx#0 ← (unumber)(number) 0
Inlining cast (byte) plex_sprite_msb#0 ← (unumber)(number) 1
@ -1436,7 +1435,6 @@ Simple Condition (bool~) loop::$11 [212] if((byte) loop::ss#1!=rangelast(0,PLEX_
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting && if()-condition to two if()s [39] (bool~) plexSort::$7 ← (bool~) plexSort::$5 && (bool~) plexSort::$6
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant right-side identified [0] (byte*) PLEX_SCREEN_PTR#0 ← (byte*)(number) $400+(number) $3f8
Constant right-side identified [137] (byte*~) init::$1 ← (const byte*) SPRITE / (byte) $40
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) PLEX_SCREEN_PTR#0 = (byte*)$400+$3f8

View File

@ -137,7 +137,7 @@ memset::@return: scope:[memset] from memset::@1
return
to:@return
@16: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@43
@ -1315,7 +1315,6 @@ Adding number conversion cast (unumber) makecharset::$11 in (number~) makecharse
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast *((const word*) SID_VOICE3_FREQ) ← (unumber)(number) $ffff
Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1

View File

@ -139,7 +139,7 @@ memset::@return: scope:[memset] from memset::@1
return
to:@return
@16: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@43
@ -1414,7 +1414,6 @@ Adding number conversion cast (unumber) makecharset::$11 in (number~) makecharse
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast *((const word*) SID_VOICE3_FREQ) ← (unumber)(number) $ffff
Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1

View File

@ -111,7 +111,7 @@ memset::@return: scope:[memset] from memset::@1
return
to:@return
@12: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@41
@ -1448,7 +1448,6 @@ Adding number conversion cast (snumber) $200 in (signed word) mulf8s127::c#3 ←
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word~) print_sword::$1 ← (word)(signed word) print_sword::w#4
Inlining cast (byte~) print_sbyte::$1 ← (byte)(signed byte) print_sbyte::b#5
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8

View File

@ -8,7 +8,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @2
(byte*) main::z#0 ← ((byte*)) (number) $450
(byte*) main::z#0 ← (byte*)(number) $450
*((byte*) main::z#0 + (number) 2) ← (number) $f0
*((byte*) main::z#0 + (number) 3) ← (number) $f
(byte) main::x#0 ← (number) $aa
@ -115,7 +115,6 @@ Adding number conversion cast (unumber) $55 in (byte) main::x#1 ← (number) $55
Adding number conversion cast (unumber) 1 in *((const byte*) main::screen + (number) 1) ← (byte) main::a2#0
Adding number conversion cast (unumber) 2 in (byte~) fct::$0 ← (byte) fct::x#2 & *((byte*) fct::z#2 + (number) 2)
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::z#0 ← (byte*)(number) $450
Inlining cast *((byte*) main::z#0 + (unumber)(number) 2) ← (unumber)(number) $f0
Inlining cast *((byte*) main::z#0 + (unumber)(number) 3) ← (unumber)(number) $f
Inlining cast (byte) main::x#0 ← (unumber)(number) $aa

View File

@ -1,8 +1,6 @@
Resolved forward reference hello to (void()) hello()
Resolved forward reference world to (void()) world()
Warning! Adding boolean cast to non-boolean condition *((byte*) print::msg + (byte) print::i)
Culled Empty Block (label) @1
Culled Empty Block (label) do10::@2
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @3
Culled Empty Block (label) print::@2
@ -11,21 +9,6 @@ CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@4
(void()) main()
main: scope:[main] from @5
(void()*) do10::fn#0 ← &(void()) hello()
call do10
to:main::@1
main::@1: scope:[main] from main
(void()*) do10::fn#1 ← &(void()) world()
call do10
to:main::@2
main::@2: scope:[main] from main::@1
to:main::@return
main::@return: scope:[main] from main::@2
return
to:@return
(void()) do10((void()*) do10::fn)
do10: scope:[do10] from main main::@1
(void()*) do10::fn#3 ← phi( main/(void()*) do10::fn#0 main::@1/(void()*) do10::fn#1 )
@ -74,6 +57,21 @@ world::@return: scope:[world] from world::@1
(byte) idx#3 ← (byte) idx#10
return
to:@return
(void()) main()
main: scope:[main] from @5
(void()*) do10::fn#0 ← &(void()) hello()
call do10
to:main::@1
main::@1: scope:[main] from main
(void()*) do10::fn#1 ← &(void()) world()
call do10
to:main::@2
main::@2: scope:[main] from main::@1
to:main::@return
main::@return: scope:[main] from main::@2
return
to:@return
@4: scope:[] from @begin
(byte) idx#4 ← (number) 0
to:@5
@ -201,27 +199,27 @@ Identical Phi Values (byte*) print::msg#2 (byte*) print::msg#3
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values (byte) idx#15 (byte) idx#16
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) do10::$1 [11] if((byte) do10::i#1!=rangelast(0,9)) goto do10::@1
Simple Condition (bool~) do10::$1 [6] if((byte) do10::i#1!=rangelast(0,9)) goto do10::@1
Simple Condition (bool~) print::$0 [37] if((byte) 0!=*((byte*) print::msg#3 + (byte) print::i#1)) goto print::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const void()*) do10::fn#0 = &hello
Constant (const void()*) do10::fn#1 = &world
Constant (const byte) do10::i#0 = 0
Constant (const byte*) print::msg#0 = hello::msg
Constant (const byte*) print::msg#1 = world::msg
Constant (const void()*) do10::fn#0 = &hello
Constant (const void()*) do10::fn#1 = &world
Constant (const byte) print::i#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [9] do10::i#1 ← ++ do10::i#2 to ++
Resolved ranged comparison value [11] if(do10::i#1!=rangelast(0,9)) goto do10::@1 to (number) $a
Resolved ranged next value [4] do10::i#1 ← ++ do10::i#2 to ++
Resolved ranged comparison value [6] if(do10::i#1!=rangelast(0,9)) goto do10::@1 to (number) $a
Adding number conversion cast (unumber) $a in if((byte) do10::i#1!=(number) $a) goto do10::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $a
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $a
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining constant with var siblings (const byte) do10::i#0
Inlining constant with var siblings (const void()*) do10::fn#0
Inlining constant with var siblings (const void()*) do10::fn#1
Inlining constant with var siblings (const byte) do10::i#0
Inlining constant with var siblings (const byte*) print::msg#0
Inlining constant with var siblings (const byte*) print::msg#1
Inlining constant with var siblings (const byte) print::i#0
@ -590,16 +588,16 @@ REGISTER UPLIFT SCOPES
Uplift Scope [print] 27.5: zp[1]:7 [ print::i#2 print::i#1 ] 3.67: zp[2]:5 [ print::msg#3 ]
Uplift Scope [do10] 27.5: zp[1]:4 [ do10::i#2 do10::i#1 ] 0: zp[2]:2 [ do10::fn#3 ]
Uplift Scope [] 26.17: zp[1]:8 [ idx#11 idx#16 idx#12 ]
Uplift Scope [main]
Uplift Scope [hello]
Uplift Scope [world]
Uplift Scope [main]
Uplifting [print] best 898 combination reg byte y [ print::i#2 print::i#1 ] zp[2]:5 [ print::msg#3 ]
Uplifting [do10] best 898 combination zp[1]:4 [ do10::i#2 do10::i#1 ] zp[2]:2 [ do10::fn#3 ]
Uplifting [] best 898 combination zp[1]:8 [ idx#11 idx#16 idx#12 ]
Uplifting [main] best 898 combination
Uplifting [hello] best 898 combination
Uplifting [world] best 898 combination
Uplifting [main] best 898 combination
Attempting to uplift remaining variables inzp[1]:4 [ do10::i#2 do10::i#1 ]
Uplifting [do10] best 898 combination zp[1]:4 [ do10::i#2 do10::i#1 ]
Attempting to uplift remaining variables inzp[1]:8 [ idx#11 idx#16 idx#12 ]

View File

@ -1,22 +1,39 @@
Resolved forward reference fn1 to (void()) fn1()
Identified constant variable (void()*) main::cls
Culled Empty Block (label) main::@4
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
Culled Empty Block (label) @1
Culled Empty Block (label) fn1::@4
Culled Empty Block (label) fn1::@3
Culled Empty Block (label) fn1::@5
Culled Empty Block (label) fn1::@6
Culled Empty Block (label) @1
Culled Empty Block (label) main::@4
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::@5
Culled Empty Block (label) main::@6
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@2
(void()) fn1()
fn1: scope:[fn1] from
(byte*) fn1::screen#0 ← (byte*)(number) $400
to:fn1::@1
fn1::@1: scope:[fn1] from fn1 fn1::@2
(byte*) fn1::screen#2 ← phi( fn1/(byte*) fn1::screen#0 fn1::@2/(byte*) fn1::screen#1 )
(bool~) fn1::$0 ← (byte*) fn1::screen#2 < (number) $400+(number) $3e8
if((bool~) fn1::$0) goto fn1::@2
to:fn1::@return
fn1::@2: scope:[fn1] from fn1::@1
(byte*) fn1::screen#3 ← phi( fn1::@1/(byte*) fn1::screen#2 )
*((byte*) fn1::screen#3) ← ++ *((byte*) fn1::screen#3)
(byte*) fn1::screen#1 ← ++ (byte*) fn1::screen#3
to:fn1::@1
fn1::@return: scope:[fn1] from fn1::@1
return
to:@return
(void()) main()
main: scope:[main] from @2
(byte*) main::cols#0 ← ((byte*)) (number) $d800
(byte*) main::cols#0 ← (byte*)(number) $d800
to:main::@1
main::@1: scope:[main] from main main::@2
(byte*) main::cols#2 ← phi( main/(byte*) main::cols#0 main::@2/(byte*) main::cols#1 )
@ -32,24 +49,6 @@ main::@2: scope:[main] from main::@1
main::@return: scope:[main] from main::@1
return
to:@return
(void()) fn1()
fn1: scope:[fn1] from
(byte*) fn1::screen#0 ← ((byte*)) (number) $400
to:fn1::@1
fn1::@1: scope:[fn1] from fn1 fn1::@2
(byte*) fn1::screen#2 ← phi( fn1/(byte*) fn1::screen#0 fn1::@2/(byte*) fn1::screen#1 )
(bool~) fn1::$0 ← (byte*) fn1::screen#2 < (number) $400+(number) $3e8
if((bool~) fn1::$0) goto fn1::@2
to:fn1::@return
fn1::@2: scope:[fn1] from fn1::@1
(byte*) fn1::screen#3 ← phi( fn1::@1/(byte*) fn1::screen#2 )
*((byte*) fn1::screen#3) ← ++ *((byte*) fn1::screen#3)
(byte*) fn1::screen#1 ← ++ (byte*) fn1::screen#3
to:fn1::@1
fn1::@return: scope:[fn1] from fn1::@1
return
to:@return
@2: scope:[] from @begin
call main
to:@3
@ -84,30 +83,27 @@ SYMBOL TABLE SSA
(byte*) main::cols#2
(byte*) main::cols#3
Adding number conversion cast (unumber) $d800+$3e8 in (bool~) main::$0 ← (byte*) main::cols#2 < (number) $d800+(number) $3e8
Adding number conversion cast (unumber) $400+$3e8 in (bool~) fn1::$0 ← (byte*) fn1::screen#2 < (number) $400+(number) $3e8
Adding number conversion cast (unumber) $d800+$3e8 in (bool~) main::$0 ← (byte*) main::cols#2 < (number) $d800+(number) $3e8
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::cols#0 ← (byte*)(number) $d800
Inlining cast (byte*) fn1::screen#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 55296
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 55296
Successful SSA optimization PassNCastSimplification
Alias (byte*) main::cols#2 = (byte*) main::cols#3
Alias (byte*) fn1::screen#2 = (byte*) fn1::screen#3
Alias (byte*) main::cols#2 = (byte*) main::cols#3
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$0 [3] if((byte*) main::cols#2<(word)(number) $d800+(number) $3e8) goto main::@2
Simple Condition (bool~) fn1::$0 [12] if((byte*) fn1::screen#2<(word)(number) $400+(number) $3e8) goto fn1::@2
Simple Condition (bool~) fn1::$0 [3] if((byte*) fn1::screen#2<(word)(number) $400+(number) $3e8) goto fn1::@2
Simple Condition (bool~) main::$0 [11] if((byte*) main::cols#2<(word)(number) $d800+(number) $3e8) goto main::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte*) main::cols#0 = (byte*) 55296
Constant (const byte*) fn1::screen#0 = (byte*) 1024
Constant (const byte*) main::cols#0 = (byte*) 55296
Successful SSA optimization Pass2ConstantIdentification
Replacing constant pointer function [5] call fn1
Replacing constant pointer function [13] call fn1
Successful SSA optimization Pass2ConstantCallPointerIdentification
Eliminating unused constant (const void()*) main::cls
Successful SSA optimization PassNEliminateUnusedVars
Inlining constant with var siblings (const byte*) main::cols#0
Inlining constant with var siblings (const byte*) fn1::screen#0
Inlining constant with var siblings (const byte*) main::cols#0
Constant inlined fn1::screen#0 = (byte*) 1024
Constant inlined main::cols#0 = (byte*) 55296
Successful SSA optimization Pass2ConstantInlining

View File

@ -1,24 +1,12 @@
Resolved forward reference hello to (void()) hello()
Warning! Adding boolean cast to non-boolean condition *((const byte*) msg + (byte) hello::i)
Identified constant variable (void()*) main::f
Culled Empty Block (label) @1
Culled Empty Block (label) do10::@2
Culled Empty Block (label) hello::@2
Culled Empty Block (label) @2
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@2
(void()) main()
main: scope:[main] from @3
(void()*) do10::fn#0 ← (const void()*) main::f
call do10
to:main::@1
main::@1: scope:[main] from main
to:main::@return
main::@return: scope:[main] from main::@1
return
to:@return
to:@1
(void()) do10((void()*) do10::fn)
do10: scope:[do10] from main
@ -36,7 +24,7 @@ do10::@1: scope:[do10] from do10 do10::@1
do10::@return: scope:[do10] from do10::@1
return
to:@return
@2: scope:[] from @begin
@1: scope:[] from @begin
(byte) idx#0 ← (number) 0
to:@3
@ -59,8 +47,19 @@ hello::@return: scope:[hello] from hello::@1
(byte) idx#2 ← (byte) idx#4
return
to:@return
@3: scope:[] from @2
(byte) idx#6 ← phi( @2/(byte) idx#0 )
(void()) main()
main: scope:[main] from @3
(void()*) do10::fn#0 ← (const void()*) main::f
call do10
to:main::@1
main::@1: scope:[main] from main
to:main::@return
main::@return: scope:[main] from main::@1
return
to:@return
@3: scope:[] from @1
(byte) idx#6 ← phi( @1/(byte) idx#0 )
call main
to:@4
@4: scope:[] from @3
@ -68,7 +67,7 @@ hello::@return: scope:[hello] from hello::@1
@end: scope:[] from @4
SYMBOL TABLE SSA
(label) @2
(label) @1
(label) @3
(label) @4
(label) @begin
@ -131,17 +130,17 @@ Identical Phi Values (void()*) do10::fn#2 (void()*) do10::fn#0
Identical Phi Values (void()*) do10::fn#1 (void()*) do10::fn#2
Identical Phi Values (byte) idx#5 (byte) idx#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) do10::$1 [9] if((byte) do10::i#1!=rangelast(0,9)) goto do10::@1
Simple Condition (bool~) hello::$0 [19] if((byte) 0!=*((const byte*) msg + (byte) hello::i#1)) goto hello::@1
Simple Condition (bool~) do10::$1 [6] if((byte) do10::i#1!=rangelast(0,9)) goto do10::@1
Simple Condition (bool~) hello::$0 [16] if((byte) 0!=*((const byte*) msg + (byte) hello::i#1)) goto hello::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const void()*) do10::fn#0 = main::f
Constant (const byte) do10::i#0 = 0
Constant (const byte) hello::i#0 = 0
Constant (const void()*) do10::fn#0 = main::f
Successful SSA optimization Pass2ConstantIdentification
Replacing constant pointer function [6] call hello
Replacing constant pointer function [3] call hello
Successful SSA optimization Pass2ConstantCallPointerIdentification
Resolved ranged next value [7] do10::i#1 ← ++ do10::i#2 to ++
Resolved ranged comparison value [9] if(do10::i#1!=rangelast(0,9)) goto do10::@1 to (number) $a
Resolved ranged next value [4] do10::i#1 ← ++ do10::i#2 to ++
Resolved ranged comparison value [6] if(do10::i#1!=rangelast(0,9)) goto do10::@1 to (number) $a
Eliminating unused constant (const void()*) do10::fn#0
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused constant (const void()*) main::f
@ -181,7 +180,6 @@ Culled Empty Block (label) @4
Culled Empty Block (label) main::@1
Culled Empty Block (label) do10::@3
Culled Empty Block (label) hello::@3
Renumbering block @2 to @1
Renumbering block @3 to @2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2

View File

@ -2,7 +2,7 @@
[0] phi()
to:@1
@1: scope:[] from @begin
[1] (byte*) msg#10 ← (byte*) 0
[1] (byte*) msg#0 ← (byte*) 0
[2] (byte) idx#0 ← (byte) 0
to:@2
@2: scope:[] from @1
@ -14,11 +14,11 @@
(void()) main()
main: scope:[main] from @2
[6] (byte*) msg#0 ← (const byte*) msg1
[6] (byte*) msg#1 ← (const byte*) msg1
[7] call do10
to:main::@1
main::@1: scope:[main] from main
[8] (byte*) msg#1 ← (const byte*) msg2
[8] (byte*) msg#2 ← (const byte*) msg2
[9] call do10
to:main::@return
main::@return: scope:[main] from main::@1
@ -46,10 +46,10 @@ hello: scope:[hello] from do10::@1
hello::@1: scope:[hello] from hello hello::@1
[18] (byte) idx#3 ← phi( hello/(byte) idx#7 hello::@1/(byte) idx#1 )
[18] (byte) hello::i#2 ← phi( hello/(byte) 0 hello::@1/(byte) hello::i#1 )
[19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#10 + (byte) hello::i#2)
[19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#0 + (byte) hello::i#2)
[20] (byte) idx#1 ← ++ (byte) idx#3
[21] (byte) hello::i#1 ← ++ (byte) hello::i#2
[22] if((byte) 0!=*((byte*) msg#10 + (byte) hello::i#1)) goto hello::@1
[22] if((byte) 0!=*((byte*) msg#0 + (byte) hello::i#1)) goto hello::@1
to:hello::@return
hello::@return: scope:[hello] from hello::@1
[23] return

View File

@ -1,37 +1,12 @@
Resolved forward reference hello to (void()) hello()
Resolved forward reference msg1 to (const byte*) msg1
Resolved forward reference msg to (byte*) msg
Resolved forward reference msg2 to (const byte*) msg2
Resolved forward reference msg to (byte*) msg
Warning! Adding boolean cast to non-boolean condition *((byte*) msg + (byte) hello::i)
Identified constant variable (void()*) main::f
Culled Empty Block (label) @1
Culled Empty Block (label) do10::@2
Culled Empty Block (label) hello::@2
Culled Empty Block (label) @2
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@2
(void()) main()
main: scope:[main] from @3
(byte*) msg#0 ← (const byte*) msg1
(void()*) do10::fn#0 ← (const void()*) main::f
call do10
to:main::@1
main::@1: scope:[main] from main
(byte*) msg#1 ← (const byte*) msg2
(void()*) do10::fn#1 ← (const void()*) main::f
call do10
to:main::@2
main::@2: scope:[main] from main::@1
(byte*) msg#8 ← phi( main::@1/(byte*) msg#1 )
to:main::@return
main::@return: scope:[main] from main::@2
(byte*) msg#5 ← phi( main::@2/(byte*) msg#8 )
(byte*) msg#2 ← (byte*) msg#5
return
to:@return
to:@1
(void()) do10((void()*) do10::fn)
do10: scope:[do10] from main main::@1
@ -49,25 +24,25 @@ do10::@1: scope:[do10] from do10 do10::@1
do10::@return: scope:[do10] from do10::@1
return
to:@return
@2: scope:[] from @begin
(byte*) msg#3 ← (byte*) 0
@1: scope:[] from @begin
(byte*) msg#0 ← (byte*) 0
(byte) idx#0 ← (number) 0
to:@3
(void()) hello()
hello: scope:[hello] from
(byte) idx#5 ← phi( @3/(byte) idx#6 )
(byte*) msg#9 ← phi( @3/(byte*) msg#10 )
(byte*) msg#8 ← phi( @3/(byte*) msg#10 )
(byte) hello::i#0 ← (number) 0
to:hello::@1
hello::@1: scope:[hello] from hello hello::@1
(byte) idx#3 ← phi( hello/(byte) idx#5 hello::@1/(byte) idx#1 )
(byte) hello::i#2 ← phi( hello/(byte) hello::i#0 hello::@1/(byte) hello::i#1 )
(byte*) msg#6 ← phi( hello/(byte*) msg#9 hello::@1/(byte*) msg#6 )
*((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#6 + (byte) hello::i#2)
(byte*) msg#5 ← phi( hello/(byte*) msg#8 hello::@1/(byte*) msg#5 )
*((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#5 + (byte) hello::i#2)
(byte) idx#1 ← ++ (byte) idx#3
(byte) hello::i#1 ← ++ (byte) hello::i#2
(bool~) hello::$0 ← (number) 0 != *((byte*) msg#6 + (byte) hello::i#1)
(bool~) hello::$0 ← (number) 0 != *((byte*) msg#5 + (byte) hello::i#1)
if((bool~) hello::$0) goto hello::@1
to:hello::@return
hello::@return: scope:[hello] from hello::@1
@ -75,19 +50,39 @@ hello::@return: scope:[hello] from hello::@1
(byte) idx#2 ← (byte) idx#4
return
to:@return
@3: scope:[] from @2
(byte) idx#6 ← phi( @2/(byte) idx#0 )
(byte*) msg#10 ← phi( @2/(byte*) msg#3 )
(void()) main()
main: scope:[main] from @3
(byte*) msg#1 ← (const byte*) msg1
(void()*) do10::fn#0 ← (const void()*) main::f
call do10
to:main::@1
main::@1: scope:[main] from main
(byte*) msg#2 ← (const byte*) msg2
(void()*) do10::fn#1 ← (const void()*) main::f
call do10
to:main::@2
main::@2: scope:[main] from main::@1
(byte*) msg#9 ← phi( main::@1/(byte*) msg#2 )
to:main::@return
main::@return: scope:[main] from main::@2
(byte*) msg#6 ← phi( main::@2/(byte*) msg#9 )
(byte*) msg#3 ← (byte*) msg#6
return
to:@return
@3: scope:[] from @1
(byte) idx#6 ← phi( @1/(byte) idx#0 )
(byte*) msg#10 ← phi( @1/(byte*) msg#0 )
call main
to:@4
@4: scope:[] from @3
(byte*) msg#7 ← phi( @3/(byte*) msg#2 )
(byte*) msg#7 ← phi( @3/(byte*) msg#3 )
(byte*) msg#4 ← (byte*) msg#7
to:@end
@end: scope:[] from @4
SYMBOL TABLE SSA
(label) @2
(label) @1
(label) @3
(label) @4
(label) @begin
@ -144,7 +139,7 @@ SYMBOL TABLE SSA
Adding number conversion cast (unumber) 0 in (byte) idx#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) hello::i#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) hello::$0 ← (number) 0 != *((byte*) msg#6 + (byte) hello::i#1)
Adding number conversion cast (unumber) 0 in (bool~) hello::$0 ← (number) 0 != *((byte*) msg#5 + (byte) hello::i#1)
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) idx#0 ← (unumber)(number) 0
Inlining cast (byte) hello::i#0 ← (unumber)(number) 0
@ -158,37 +153,37 @@ Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte*) msg#1 = (byte*) msg#8 (byte*) msg#5 (byte*) msg#2
Alias (byte) idx#1 = (byte) idx#4 (byte) idx#2
Alias (byte*) msg#10 = (byte*) msg#3
Alias (byte*) msg#2 = (byte*) msg#9 (byte*) msg#6 (byte*) msg#3
Alias (byte*) msg#0 = (byte*) msg#10
Alias (byte) idx#0 = (byte) idx#6
Alias (byte*) msg#4 = (byte*) msg#7
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (void()*) do10::fn#2 (void()*) do10::fn#3
Identical Phi Values (byte*) msg#9 (byte*) msg#10
Identical Phi Values (byte*) msg#8 (byte*) msg#0
Identical Phi Values (byte) idx#5 (byte) idx#0
Identical Phi Values (byte*) msg#6 (byte*) msg#9
Identical Phi Values (byte*) msg#4 (byte*) msg#1
Identical Phi Values (byte*) msg#5 (byte*) msg#8
Identical Phi Values (byte*) msg#4 (byte*) msg#2
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) do10::$1 [16] if((byte) do10::i#1!=rangelast(0,9)) goto do10::@1
Simple Condition (bool~) hello::$0 [27] if((byte) 0!=*((byte*) msg#10 + (byte) hello::i#1)) goto hello::@1
Simple Condition (bool~) do10::$1 [6] if((byte) do10::i#1!=rangelast(0,9)) goto do10::@1
Simple Condition (bool~) hello::$0 [17] if((byte) 0!=*((byte*) msg#0 + (byte) hello::i#1)) goto hello::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const void()*) do10::fn#0 = main::f
Constant (const void()*) do10::fn#1 = main::f
Constant (const byte) do10::i#0 = 0
Constant (const byte) hello::i#0 = 0
Constant (const void()*) do10::fn#0 = main::f
Constant (const void()*) do10::fn#1 = main::f
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [14] do10::i#1 ← ++ do10::i#2 to ++
Resolved ranged comparison value [16] if(do10::i#1!=rangelast(0,9)) goto do10::@1 to (number) $a
Resolved ranged next value [4] do10::i#1 ← ++ do10::i#2 to ++
Resolved ranged comparison value [6] if(do10::i#1!=rangelast(0,9)) goto do10::@1 to (number) $a
Adding number conversion cast (unumber) $a in if((byte) do10::i#1!=(number) $a) goto do10::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $a
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $a
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inlining constant with var siblings (const byte) do10::i#0
Inlining constant with var siblings (const void()*) do10::fn#0
Inlining constant with var siblings (const void()*) do10::fn#1
Inlining constant with var siblings (const byte) do10::i#0
Inlining constant with var siblings (const byte) hello::i#0
Constant inlined hello::i#0 = (byte) 0
Constant inlined do10::i#0 = (byte) 0
@ -197,7 +192,7 @@ Constant inlined do10::fn#0 = (const void()*) main::f
Successful SSA optimization Pass2ConstantInlining
Identical Phi Values (void()*) do10::fn#3 (const void()*) main::f
Successful SSA optimization Pass2IdenticalPhiElimination
Replacing constant pointer function [7] call hello
Replacing constant pointer function [2] call hello
Successful SSA optimization Pass2ConstantCallPointerIdentification
Eliminating unused constant (const void()*) main::f
Successful SSA optimization PassNEliminateUnusedVars
@ -224,7 +219,6 @@ Culled Empty Block (label) @4
Culled Empty Block (label) main::@2
Culled Empty Block (label) do10::@3
Culled Empty Block (label) hello::@3
Renumbering block @2 to @1
Renumbering block @3 to @2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @2
@ -236,7 +230,7 @@ FINAL CONTROL FLOW GRAPH
[0] phi()
to:@1
@1: scope:[] from @begin
[1] (byte*) msg#10 ← (byte*) 0
[1] (byte*) msg#0 ← (byte*) 0
[2] (byte) idx#0 ← (byte) 0
to:@2
@2: scope:[] from @1
@ -248,11 +242,11 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @2
[6] (byte*) msg#0 ← (const byte*) msg1
[6] (byte*) msg#1 ← (const byte*) msg1
[7] call do10
to:main::@1
main::@1: scope:[main] from main
[8] (byte*) msg#1 ← (const byte*) msg2
[8] (byte*) msg#2 ← (const byte*) msg2
[9] call do10
to:main::@return
main::@return: scope:[main] from main::@1
@ -280,10 +274,10 @@ hello: scope:[hello] from do10::@1
hello::@1: scope:[hello] from hello hello::@1
[18] (byte) idx#3 ← phi( hello/(byte) idx#7 hello::@1/(byte) idx#1 )
[18] (byte) hello::i#2 ← phi( hello/(byte) 0 hello::@1/(byte) hello::i#1 )
[19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#10 + (byte) hello::i#2)
[19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#0 + (byte) hello::i#2)
[20] (byte) idx#1 ← ++ (byte) idx#3
[21] (byte) hello::i#1 ← ++ (byte) hello::i#2
[22] if((byte) 0!=*((byte*) msg#10 + (byte) hello::i#1)) goto hello::@1
[22] if((byte) 0!=*((byte*) msg#0 + (byte) hello::i#1)) goto hello::@1
to:hello::@return
hello::@return: scope:[hello] from hello::@1
[23] return
@ -307,25 +301,25 @@ VARIABLE REGISTER WEIGHTS
(byte) idx#7 4.0
(void()) main()
(byte*) msg
(byte*) msg#0 20.0
(byte*) msg#0 10.736842105263158
(byte*) msg#1 20.0
(byte*) msg#10 10.736842105263158
(byte*) msg#2 20.0
Initial phi equivalence classes
[ do10::i#2 do10::i#1 ]
[ hello::i#2 hello::i#1 ]
[ idx#3 idx#7 idx#1 ]
Coalescing volatile variable equivalence classes [ msg#0 ] and [ msg#1 ]
Coalescing volatile variable equivalence classes [ msg#0 msg#1 ] and [ msg#10 ]
Coalescing volatile variable equivalence classes [ msg#0 msg#1 ] and [ msg#2 ]
Coalescing volatile variable equivalence classes [ idx#0 ] and [ idx#3 idx#7 idx#1 ]
Complete equivalence classes
[ do10::i#2 do10::i#1 ]
[ hello::i#2 hello::i#1 ]
[ msg#0 msg#1 msg#10 ]
[ msg#0 msg#1 msg#2 ]
[ idx#0 idx#3 idx#7 idx#1 ]
Allocated zp[1]:2 [ do10::i#2 do10::i#1 ]
Allocated zp[1]:3 [ hello::i#2 hello::i#1 ]
Allocated zp[2]:4 [ msg#0 msg#1 msg#10 ]
Allocated zp[2]:4 [ msg#0 msg#1 msg#2 ]
Allocated zp[1]:6 [ idx#0 idx#3 idx#7 idx#1 ]
INITIAL ASM
@ -345,7 +339,7 @@ __bbegin:
jmp __b1
// @1
__b1:
// [1] (byte*) msg#10 ← (byte*) 0 -- pbuz1=pbuc1
// [1] (byte*) msg#0 ← (byte*) 0 -- pbuz1=pbuc1
lda #<0
sta.z msg
lda #>0
@ -367,7 +361,7 @@ __bend_from___b2:
__bend:
// main
main: {
// [6] (byte*) msg#0 ← (const byte*) msg1 -- pbuz1=pbuc1
// [6] (byte*) msg#1 ← (const byte*) msg1 -- pbuz1=pbuc1
lda #<msg1
sta.z msg
lda #>msg1
@ -379,7 +373,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [8] (byte*) msg#1 ← (const byte*) msg2 -- pbuz1=pbuc1
// [8] (byte*) msg#2 ← (const byte*) msg2 -- pbuz1=pbuc1
lda #<msg2
sta.z msg
lda #>msg2
@ -441,7 +435,7 @@ hello: {
jmp __b1
// hello::@1
__b1:
// [19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#10 + (byte) hello::i#2) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuz3
// [19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#0 + (byte) hello::i#2) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuz3
ldx.z idx
ldy.z i
lda (msg),y
@ -450,7 +444,7 @@ hello: {
inc.z idx
// [21] (byte) hello::i#1 ← ++ (byte) hello::i#2 -- vbuz1=_inc_vbuz1
inc.z i
// [22] if((byte) 0!=*((byte*) msg#10 + (byte) hello::i#1)) goto hello::@1 -- vbuc1_neq_pbuz1_derefidx_vbuz2_then_la1
// [22] if((byte) 0!=*((byte*) msg#0 + (byte) hello::i#1)) goto hello::@1 -- vbuc1_neq_pbuz1_derefidx_vbuz2_then_la1
ldy.z i
lda (msg),y
cmp #0
@ -468,34 +462,34 @@ hello: {
.byte 0
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [1] (byte*) msg#10 ← (byte*) 0 [ msg#10 ] ( [ msg#10 ] ) always clobbers reg byte a
Statement [2] (byte) idx#0 ← (byte) 0 [ msg#10 idx#0 ] ( [ msg#10 idx#0 ] ) always clobbers reg byte a
Statement [6] (byte*) msg#0 ← (const byte*) msg1 [ msg#10 idx#0 ] ( main:4 [ msg#10 idx#0 ] ) always clobbers reg byte a
Statement [8] (byte*) msg#1 ← (const byte*) msg2 [ msg#10 idx#0 ] ( main:4 [ msg#10 idx#0 ] ) always clobbers reg byte a
Statement [19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#10 + (byte) hello::i#2) [ msg#10 idx#0 hello::i#2 idx#3 ] ( main:4::do10:7::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#2 idx#3 ] main:4::do10:9::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#2 idx#3 ] ) always clobbers reg byte a reg byte x
Statement [1] (byte*) msg#0 ← (byte*) 0 [ msg#0 ] ( [ msg#0 ] ) always clobbers reg byte a
Statement [2] (byte) idx#0 ← (byte) 0 [ msg#0 idx#0 ] ( [ msg#0 idx#0 ] ) always clobbers reg byte a
Statement [6] (byte*) msg#1 ← (const byte*) msg1 [ msg#0 idx#0 ] ( main:4 [ msg#0 idx#0 ] ) always clobbers reg byte a
Statement [8] (byte*) msg#2 ← (const byte*) msg2 [ msg#0 idx#0 ] ( main:4 [ msg#0 idx#0 ] ) always clobbers reg byte a
Statement [19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#0 + (byte) hello::i#2) [ msg#0 idx#0 hello::i#2 idx#3 ] ( main:4::do10:7::hello:13 [ do10::i#2 msg#0 idx#0 hello::i#2 idx#3 ] main:4::do10:9::hello:13 [ do10::i#2 msg#0 idx#0 hello::i#2 idx#3 ] ) always clobbers reg byte a reg byte x
Removing always clobbered register reg byte a as potential for zp[1]:2 [ do10::i#2 do10::i#1 ]
Removing always clobbered register reg byte x as potential for zp[1]:2 [ do10::i#2 do10::i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:3 [ hello::i#2 hello::i#1 ]
Removing always clobbered register reg byte x as potential for zp[1]:3 [ hello::i#2 hello::i#1 ]
Statement [22] if((byte) 0!=*((byte*) msg#10 + (byte) hello::i#1)) goto hello::@1 [ msg#10 idx#0 hello::i#1 idx#1 ] ( main:4::do10:7::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#1 idx#1 ] main:4::do10:9::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#1 idx#1 ] ) always clobbers reg byte a
Statement [1] (byte*) msg#10 ← (byte*) 0 [ msg#10 ] ( [ msg#10 ] ) always clobbers reg byte a
Statement [2] (byte) idx#0 ← (byte) 0 [ msg#10 idx#0 ] ( [ msg#10 idx#0 ] ) always clobbers reg byte a
Statement [6] (byte*) msg#0 ← (const byte*) msg1 [ msg#10 idx#0 ] ( main:4 [ msg#10 idx#0 ] ) always clobbers reg byte a
Statement [8] (byte*) msg#1 ← (const byte*) msg2 [ msg#10 idx#0 ] ( main:4 [ msg#10 idx#0 ] ) always clobbers reg byte a
Statement [19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#10 + (byte) hello::i#2) [ msg#10 idx#0 hello::i#2 idx#3 ] ( main:4::do10:7::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#2 idx#3 ] main:4::do10:9::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#2 idx#3 ] ) always clobbers reg byte a reg byte x
Statement [22] if((byte) 0!=*((byte*) msg#10 + (byte) hello::i#1)) goto hello::@1 [ msg#10 idx#0 hello::i#1 idx#1 ] ( main:4::do10:7::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#1 idx#1 ] main:4::do10:9::hello:13 [ do10::i#2 msg#10 idx#0 hello::i#1 idx#1 ] ) always clobbers reg byte a
Statement [22] if((byte) 0!=*((byte*) msg#0 + (byte) hello::i#1)) goto hello::@1 [ msg#0 idx#0 hello::i#1 idx#1 ] ( main:4::do10:7::hello:13 [ do10::i#2 msg#0 idx#0 hello::i#1 idx#1 ] main:4::do10:9::hello:13 [ do10::i#2 msg#0 idx#0 hello::i#1 idx#1 ] ) always clobbers reg byte a
Statement [1] (byte*) msg#0 ← (byte*) 0 [ msg#0 ] ( [ msg#0 ] ) always clobbers reg byte a
Statement [2] (byte) idx#0 ← (byte) 0 [ msg#0 idx#0 ] ( [ msg#0 idx#0 ] ) always clobbers reg byte a
Statement [6] (byte*) msg#1 ← (const byte*) msg1 [ msg#0 idx#0 ] ( main:4 [ msg#0 idx#0 ] ) always clobbers reg byte a
Statement [8] (byte*) msg#2 ← (const byte*) msg2 [ msg#0 idx#0 ] ( main:4 [ msg#0 idx#0 ] ) always clobbers reg byte a
Statement [19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#0 + (byte) hello::i#2) [ msg#0 idx#0 hello::i#2 idx#3 ] ( main:4::do10:7::hello:13 [ do10::i#2 msg#0 idx#0 hello::i#2 idx#3 ] main:4::do10:9::hello:13 [ do10::i#2 msg#0 idx#0 hello::i#2 idx#3 ] ) always clobbers reg byte a reg byte x
Statement [22] if((byte) 0!=*((byte*) msg#0 + (byte) hello::i#1)) goto hello::@1 [ msg#0 idx#0 hello::i#1 idx#1 ] ( main:4::do10:7::hello:13 [ do10::i#2 msg#0 idx#0 hello::i#1 idx#1 ] main:4::do10:9::hello:13 [ do10::i#2 msg#0 idx#0 hello::i#1 idx#1 ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ do10::i#2 do10::i#1 ] : zp[1]:2 , reg byte y ,
Potential registers zp[1]:3 [ hello::i#2 hello::i#1 ] : zp[1]:3 , reg byte y ,
Potential registers zp[2]:4 [ msg#0 msg#1 msg#10 ] : zp[2]:4 ,
Potential registers zp[2]:4 [ msg#0 msg#1 msg#2 ] : zp[2]:4 ,
Potential registers zp[1]:6 [ idx#0 idx#3 idx#7 idx#1 ] : zp[1]:6 ,
REGISTER UPLIFT SCOPES
Uplift Scope [] 224.06: zp[1]:6 [ idx#0 idx#3 idx#7 idx#1 ] 50.74: zp[2]:4 [ msg#0 msg#1 msg#10 ]
Uplift Scope [] 224.06: zp[1]:6 [ idx#0 idx#3 idx#7 idx#1 ] 50.74: zp[2]:4 [ msg#0 msg#1 msg#2 ]
Uplift Scope [hello] 252.5: zp[1]:3 [ hello::i#2 hello::i#1 ]
Uplift Scope [do10] 27.5: zp[1]:2 [ do10::i#2 do10::i#1 ]
Uplift Scope [main]
Uplifting [] best 5788 combination zp[1]:6 [ idx#0 idx#3 idx#7 idx#1 ] zp[2]:4 [ msg#0 msg#1 msg#10 ]
Uplifting [] best 5788 combination zp[1]:6 [ idx#0 idx#3 idx#7 idx#1 ] zp[2]:4 [ msg#0 msg#1 msg#2 ]
Uplifting [hello] best 4588 combination reg byte y [ hello::i#2 hello::i#1 ]
Uplifting [do10] best 4588 combination zp[1]:2 [ do10::i#2 do10::i#1 ]
Uplifting [main] best 4588 combination
@ -503,7 +497,7 @@ Attempting to uplift remaining variables inzp[1]:6 [ idx#0 idx#3 idx#7 idx#1 ]
Uplifting [] best 4588 combination zp[1]:6 [ idx#0 idx#3 idx#7 idx#1 ]
Attempting to uplift remaining variables inzp[1]:2 [ do10::i#2 do10::i#1 ]
Uplifting [do10] best 4588 combination zp[1]:2 [ do10::i#2 do10::i#1 ]
Allocated (was zp[2]:4) zp[2]:3 [ msg#0 msg#1 msg#10 ]
Allocated (was zp[2]:4) zp[2]:3 [ msg#0 msg#1 msg#2 ]
Allocated (was zp[1]:6) zp[1]:5 [ idx#0 idx#3 idx#7 idx#1 ]
ASSEMBLER BEFORE OPTIMIZATION
@ -522,7 +516,7 @@ __bbegin:
jmp __b1
// @1
__b1:
// [1] (byte*) msg#10 ← (byte*) 0 -- pbuz1=pbuc1
// [1] (byte*) msg#0 ← (byte*) 0 -- pbuz1=pbuc1
lda #<0
sta.z msg
lda #>0
@ -544,7 +538,7 @@ __bend_from___b2:
__bend:
// main
main: {
// [6] (byte*) msg#0 ← (const byte*) msg1 -- pbuz1=pbuc1
// [6] (byte*) msg#1 ← (const byte*) msg1 -- pbuz1=pbuc1
lda #<msg1
sta.z msg
lda #>msg1
@ -556,7 +550,7 @@ main: {
jmp __b1
// main::@1
__b1:
// [8] (byte*) msg#1 ← (const byte*) msg2 -- pbuz1=pbuc1
// [8] (byte*) msg#2 ← (const byte*) msg2 -- pbuz1=pbuc1
lda #<msg2
sta.z msg
lda #>msg2
@ -616,7 +610,7 @@ hello: {
jmp __b1
// hello::@1
__b1:
// [19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#10 + (byte) hello::i#2) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuyy
// [19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#0 + (byte) hello::i#2) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuyy
lda (msg),y
ldx.z idx
sta SCREEN,x
@ -624,7 +618,7 @@ hello: {
inc.z idx
// [21] (byte) hello::i#1 ← ++ (byte) hello::i#2 -- vbuyy=_inc_vbuyy
iny
// [22] if((byte) 0!=*((byte*) msg#10 + (byte) hello::i#1)) goto hello::@1 -- vbuc1_neq_pbuz1_derefidx_vbuyy_then_la1
// [22] if((byte) 0!=*((byte*) msg#0 + (byte) hello::i#1)) goto hello::@1 -- vbuc1_neq_pbuz1_derefidx_vbuyy_then_la1
lda (msg),y
cmp #0
bne __b1_from___b1
@ -708,15 +702,15 @@ FINAL SYMBOL TABLE
(label) main::@1
(label) main::@return
(byte*) msg
(byte*) msg#0 msg zp[2]:3 20.0
(byte*) msg#0 msg zp[2]:3 10.736842105263158
(byte*) msg#1 msg zp[2]:3 20.0
(byte*) msg#10 msg zp[2]:3 10.736842105263158
(byte*) msg#2 msg zp[2]:3 20.0
(const byte*) msg1[] = (string) "hello "
(const byte*) msg2[] = (string) "world "
zp[1]:2 [ do10::i#2 do10::i#1 ]
reg byte y [ hello::i#2 hello::i#1 ]
zp[2]:3 [ msg#0 msg#1 msg#10 ]
zp[2]:3 [ msg#0 msg#1 msg#2 ]
zp[1]:5 [ idx#0 idx#3 idx#7 idx#1 ]
@ -737,7 +731,7 @@ Score: 3558
// @1
__b1:
// msg
// [1] (byte*) msg#10 ← (byte*) 0 -- pbuz1=pbuc1
// [1] (byte*) msg#0 ← (byte*) 0 -- pbuz1=pbuc1
lda #<0
sta.z msg
sta.z msg+1
@ -754,7 +748,7 @@ __b1:
// main
main: {
// msg = msg1
// [6] (byte*) msg#0 ← (const byte*) msg1 -- pbuz1=pbuc1
// [6] (byte*) msg#1 ← (const byte*) msg1 -- pbuz1=pbuc1
lda #<msg1
sta.z msg
lda #>msg1
@ -765,7 +759,7 @@ main: {
jsr do10
// main::@1
// msg = msg2
// [8] (byte*) msg#1 ← (const byte*) msg2 -- pbuz1=pbuc1
// [8] (byte*) msg#2 ← (const byte*) msg2 -- pbuz1=pbuc1
lda #<msg2
sta.z msg
lda #>msg2
@ -818,7 +812,7 @@ hello: {
// hello::@1
__b1:
// SCREEN[idx++] = msg[i++]
// [19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#10 + (byte) hello::i#2) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuyy
// [19] *((const byte*) SCREEN + (byte) idx#3) ← *((byte*) msg#0 + (byte) hello::i#2) -- pbuc1_derefidx_vbuz1=pbuz2_derefidx_vbuyy
lda (msg),y
ldx.z idx
sta SCREEN,x
@ -828,7 +822,7 @@ hello: {
// [21] (byte) hello::i#1 ← ++ (byte) hello::i#2 -- vbuyy=_inc_vbuyy
iny
// while(msg[i])
// [22] if((byte) 0!=*((byte*) msg#10 + (byte) hello::i#1)) goto hello::@1 -- vbuc1_neq_pbuz1_derefidx_vbuyy_then_la1
// [22] if((byte) 0!=*((byte*) msg#0 + (byte) hello::i#1)) goto hello::@1 -- vbuc1_neq_pbuz1_derefidx_vbuyy_then_la1
lda (msg),y
cmp #0
bne __b1

View File

@ -25,13 +25,13 @@
(label) main::@1
(label) main::@return
(byte*) msg
(byte*) msg#0 msg zp[2]:3 20.0
(byte*) msg#0 msg zp[2]:3 10.736842105263158
(byte*) msg#1 msg zp[2]:3 20.0
(byte*) msg#10 msg zp[2]:3 10.736842105263158
(byte*) msg#2 msg zp[2]:3 20.0
(const byte*) msg1[] = (string) "hello "
(const byte*) msg2[] = (string) "world "
zp[1]:2 [ do10::i#2 do10::i#1 ]
reg byte y [ hello::i#2 hello::i#1 ]
zp[2]:3 [ msg#0 msg#1 msg#10 ]
zp[2]:3 [ msg#0 msg#1 msg#2 ]
zp[1]:5 [ idx#0 idx#3 idx#7 idx#1 ]

View File

@ -1,4 +1,3 @@
Resolved forward reference fn1 to (void()) fn1()
Identified constant variable (void()*) main::f
Culled Empty Block (label) @1
@ -7,26 +6,26 @@ CONTROL FLOW GRAPH SSA
(byte) idx#0 ← (number) 0
to:@2
(void()) main()
main: scope:[main] from @2
(void()) fn1()
fn1: scope:[fn1] from
(byte) idx#3 ← phi( @2/(byte) idx#6 )
call *((const void()*) main::f)
*((const byte*) SCREEN + (byte) idx#3) ← (byte) 'a'
call *((const void()*) main::f)
*((const byte*) SCREEN + (byte) idx#3) ← (byte) 'a'
to:main::@return
main::@return: scope:[main] from main
(byte) idx#1 ← ++ (byte) idx#3
to:fn1::@return
fn1::@return: scope:[fn1] from fn1
(byte) idx#4 ← phi( fn1/(byte) idx#1 )
(byte) idx#2 ← (byte) idx#4
return
to:@return
(void()) fn1()
fn1: scope:[fn1] from
(byte) idx#4 ← phi( @2/(byte) idx#6 )
(byte) idx#1 ← ++ (byte) idx#4
to:fn1::@return
fn1::@return: scope:[fn1] from fn1
(byte) idx#5 ← phi( fn1/(byte) idx#1 )
(byte) idx#2 ← (byte) idx#5
(void()) main()
main: scope:[main] from @2
(byte) idx#5 ← phi( @2/(byte) idx#6 )
call *((const void()*) main::f)
*((const byte*) SCREEN + (byte) idx#5) ← (byte) 'a'
call *((const void()*) main::f)
*((const byte*) SCREEN + (byte) idx#5) ← (byte) 'a'
to:main::@return
main::@return: scope:[main] from main
return
to:@return
@2: scope:[] from @begin
@ -66,14 +65,14 @@ Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte) idx#1 = (byte) idx#5 (byte) idx#2
Alias (byte) idx#1 = (byte) idx#4 (byte) idx#2
Alias (byte) idx#0 = (byte) idx#6
Successful SSA optimization Pass2AliasElimination
Identical Phi Values (byte) idx#3 (byte) idx#0
Identical Phi Values (byte) idx#4 (byte) idx#0
Identical Phi Values (byte) idx#5 (byte) idx#0
Successful SSA optimization Pass2IdenticalPhiElimination
Replacing constant pointer function [2] call fn1
Replacing constant pointer function [4] call fn1
Replacing constant pointer function [7] call fn1
Replacing constant pointer function [9] call fn1
Successful SSA optimization Pass2ConstantCallPointerIdentification
Eliminating unused constant (const void()*) main::f
Successful SSA optimization PassNEliminateUnusedVars
@ -208,12 +207,12 @@ Potential registers zp[1]:2 [ idx#0 idx#1 ] : zp[1]:2 ,
REGISTER UPLIFT SCOPES
Uplift Scope [] 21: zp[1]:2 [ idx#0 idx#1 ]
Uplift Scope [main]
Uplift Scope [fn1]
Uplift Scope [main]
Uplifting [] best 72 combination zp[1]:2 [ idx#0 idx#1 ]
Uplifting [main] best 72 combination
Uplifting [fn1] best 72 combination
Uplifting [main] best 72 combination
Attempting to uplift remaining variables inzp[1]:2 [ idx#0 idx#1 ]
Uplifting [] best 72 combination zp[1]:2 [ idx#0 idx#1 ]

View File

@ -1,4 +1,3 @@
Resolved forward reference fn1 to (void()) fn1()
Identified constant variable (void()*) main::f
Culled Empty Block (label) @1
@ -6,14 +5,6 @@ CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@2
(void()) main()
main: scope:[main] from @2
call *((const void()*) main::f)
to:main::@return
main::@return: scope:[main] from main
return
to:@return
(void()) fn1()
fn1: scope:[fn1] from
*((const byte*) fn1::BORDERCOL) ← ++ *((const byte*) fn1::BORDERCOL)
@ -21,6 +12,14 @@ fn1: scope:[fn1] from
fn1::@return: scope:[fn1] from fn1
return
to:@return
(void()) main()
main: scope:[main] from @2
call *((const void()*) main::f)
to:main::@return
main::@return: scope:[main] from main
return
to:@return
@2: scope:[] from @begin
call main
to:@3
@ -42,7 +41,7 @@ SYMBOL TABLE SSA
Simplifying constant pointer cast (byte*) 53280
Successful SSA optimization PassNCastSimplification
Replacing constant pointer function [0] call fn1
Replacing constant pointer function [2] call fn1
Successful SSA optimization Pass2ConstantCallPointerIdentification
Eliminating unused constant (const void()*) main::f
Successful SSA optimization PassNEliminateUnusedVars
@ -151,12 +150,12 @@ fn1: {
REGISTER UPLIFT POTENTIAL REGISTERS
REGISTER UPLIFT SCOPES
Uplift Scope [main]
Uplift Scope [fn1]
Uplift Scope [main]
Uplift Scope []
Uplifting [main] best 42 combination
Uplifting [fn1] best 42 combination
Uplifting [main] best 42 combination
Uplifting [] best 42 combination
ASSEMBLER BEFORE OPTIMIZATION

View File

@ -18,7 +18,7 @@ main: scope:[main] from @4
call cls
to:main::@1
main::@1: scope:[main] from main
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte*) main::screen#0 ← (byte*)(number) $400
(word) utoa16w::value#0 ← (number) 0
(byte*) utoa16w::dst#0 ← (byte*) main::screen#0
call utoa16w
@ -331,7 +331,6 @@ Adding number conversion cast (unumber) 0 in (bool~) utoa16n::$0 ← (byte) utoa
Adding number conversion cast (unumber) 0 in (bool~) utoa16n::$2 ← (byte) utoa16n::started#5 != (number) 0
Adding number conversion cast (unumber) 1 in (byte) utoa16n::started#4 ← (number) 1
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Inlining cast (word) utoa16w::value#0 ← (unumber)(number) 0
Inlining cast (word) utoa16w::value#1 ← (unumber)(number) $4d2
Inlining cast (word) utoa16w::value#2 ← (unumber)(number) $162e

View File

@ -48,7 +48,7 @@ main::@4: scope:[main] from main::@1 main::@4
if((bool~) main::$4) goto main::@4
to:main::@5
main::@5: scope:[main] from main::@4
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte*) main::screen#0 ← (byte*)(number) $400
*((const byte*) bordercol) ← (number) 1
(byte) main::time_start#0 ← *((const byte*) raster)
(word) utoa16w::value#0 ← (number) 0
@ -627,7 +627,6 @@ Adding number conversion cast (unumber) 0 in (bool~) utoa16n::$0 ← (byte) utoa
Adding number conversion cast (unumber) 0 in (bool~) utoa16n::$2 ← (byte) utoa16n::started#5 != (number) 0
Adding number conversion cast (unumber) 1 in (byte) utoa16n::started#4 ← (number) 1
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Inlining cast *((const byte*) bordercol) ← (unumber)(number) 1
Inlining cast (word) utoa16w::value#0 ← (unumber)(number) 0
Inlining cast (word) utoa16w::value#1 ← (unumber)(number) $4d2

View File

@ -104,7 +104,7 @@ memset::@return: scope:[memset] from memset::@1
return
to:@return
@12: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@37
@ -394,7 +394,6 @@ Adding number conversion cast (unumber) 1 in *((const byte*) txt + (number) 1)
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast 0

View File

@ -0,0 +1,17 @@
// Tests minimal inline dword
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
main: {
.const w = $1234*$10000+$5678
.label screen = $400
lda #<w
sta screen
lda #>w
sta screen+1
lda #<w>>$10
sta screen+2
lda #>w>>$10
sta screen+3
rts
}

View File

@ -0,0 +1,17 @@
@begin: scope:[] from
[0] phi()
to:@1
@1: scope:[] from @begin
[1] phi()
[2] call main
to:@end
@end: scope:[] from @1
[3] phi()
(void()) main()
main: scope:[main] from @1
[4] *((const dword*) main::screen) ← (const dword) main::w
to:main::@return
main::@return: scope:[main] from main
[5] return
to:@return

View File

@ -0,0 +1,261 @@
Fixing pointer array-indexing *((dword*) main::screen + (number) 0)
Identified constant variable (dword) main::w
Identified constant variable (dword*) main::screen
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@1
(void()) main()
main: scope:[main] from @1
(number~) main::$0 ← (number) 0 * (const byte) SIZEOF_DWORD
*((const dword*) main::screen + (number~) main::$0) ← (const dword) main::w
to:main::@return
main::@return: scope:[main] from main
return
to:@return
@1: scope:[] from @begin
call main
to:@2
@2: scope:[] from @1
to:@end
@end: scope:[] from @2
SYMBOL TABLE SSA
(label) @1
(label) @2
(label) @begin
(label) @end
(const byte) SIZEOF_DWORD = (byte) 4
(void()) main()
(number~) main::$0
(label) main::@return
(const dword*) main::screen = (dword*)(number) $400
(const dword) main::w = (word)(number) $1234*(dword) $10000+(word)(number) $5678
Adding number conversion cast (unumber) 0 in (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_DWORD
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) 0 * (const byte) SIZEOF_DWORD
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast $1234
Simplifying constant integer cast $5678
Simplifying constant pointer cast (dword*) 1024
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$0 ← (byte) 0 * (const byte) SIZEOF_DWORD
Constant right-side identified [0] (byte~) main::$0 ← (byte) 0 * (const byte) SIZEOF_DWORD
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$0 = 0*SIZEOF_DWORD
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_DWORD in
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero main::screen in [1] *((const dword*) main::screen + (const byte) main::$0) ← (const dword) main::w
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) main::$0
Eliminating unused constant (const byte) SIZEOF_DWORD
Successful SSA optimization PassNEliminateUnusedVars
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
Adding NOP phi() at start of @end
CALL GRAPH
Calls in [] to main:2
Created 0 initial phi equivalence classes
Coalesced down to 0 phi equivalence classes
Culled Empty Block (label) @2
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi()
to:@1
@1: scope:[] from @begin
[1] phi()
[2] call main
to:@end
@end: scope:[] from @1
[3] phi()
(void()) main()
main: scope:[main] from @1
[4] *((const dword*) main::screen) ← (const dword) main::w
to:main::@return
main::@return: scope:[main] from main
[5] return
to:@return
VARIABLE REGISTER WEIGHTS
(void()) main()
Initial phi equivalence classes
Complete equivalence classes
INITIAL ASM
Target platform is c64basic / MOS6502X
// File Comments
// Tests minimal inline dword
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
__b1_from___bbegin:
jmp __b1
// @1
__b1:
// [2] call main
jsr main
// [3] phi from @1 to @end [phi:@1->@end]
__bend_from___b1:
jmp __bend
// @end
__bend:
// main
main: {
.const w = $1234*$10000+$5678
.label screen = $400
// [4] *((const dword*) main::screen) ← (const dword) main::w -- _deref_pduc1=vduc2
lda #<w
sta screen
lda #>w
sta screen+1
lda #<w>>$10
sta screen+2
lda #>w>>$10
sta screen+3
jmp __breturn
// main::@return
__breturn:
// [5] return
rts
}
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const dword*) main::screen) ← (const dword) main::w [ ] ( main:2 [ ] ) always clobbers reg byte a
REGISTER UPLIFT SCOPES
Uplift Scope [main]
Uplift Scope []
Uplifting [main] best 45 combination
Uplifting [] best 45 combination
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
// Tests minimal inline dword
// Upstart
.pc = $801 "Basic"
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
__b1_from___bbegin:
jmp __b1
// @1
__b1:
// [2] call main
jsr main
// [3] phi from @1 to @end [phi:@1->@end]
__bend_from___b1:
jmp __bend
// @end
__bend:
// main
main: {
.const w = $1234*$10000+$5678
.label screen = $400
// [4] *((const dword*) main::screen) ← (const dword) main::w -- _deref_pduc1=vduc2
lda #<w
sta screen
lda #>w
sta screen+1
lda #<w>>$10
sta screen+2
lda #>w>>$10
sta screen+3
jmp __breturn
// main::@return
__breturn:
// [5] return
rts
}
// File Data
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp __b1
Removing instruction jmp __bend
Removing instruction jmp __breturn
Succesful ASM optimization Pass5NextJumpElimination
Replacing label __bbegin with __b1
Removing instruction __bbegin:
Removing instruction __b1_from___bbegin:
Removing instruction __bend_from___b1:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction __bend:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction __b1:
Succesful ASM optimization Pass5UnusedLabelElimination
FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@return
(const dword*) main::screen = (dword*) 1024
(const dword) main::w = (word) $1234*(dword) $10000+(word) $5678
FINAL ASSEMBLER
Score: 30
// File Comments
// Tests minimal inline dword
// Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// @begin
// [1] phi from @begin to @1 [phi:@begin->@1]
// @1
// [2] call main
// [3] phi from @1 to @end [phi:@1->@end]
// @end
// main
main: {
.const w = $1234*$10000+$5678
.label screen = $400
// screen[0] = w
// [4] *((const dword*) main::screen) ← (const dword) main::w -- _deref_pduc1=vduc2
lda #<w
sta screen
lda #>w
sta screen+1
lda #<w>>$10
sta screen+2
lda #>w>>$10
sta screen+3
// main::@return
// }
// [5] return
rts
}
// File Data

View File

@ -0,0 +1,8 @@
(label) @1
(label) @begin
(label) @end
(void()) main()
(label) main::@return
(const dword*) main::screen = (dword*) 1024
(const dword) main::w = (word) $1234*(dword) $10000+(word) $5678

View File

@ -27,7 +27,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @3
(byte*) main::sc#0 ← ((byte*)) (number) $400
(byte*) main::sc#0 ← (byte*)(number) $400
to:main::@1
main::@1: scope:[main] from main main::@2
(byte*) main::sc#2 ← phi( main/(byte*) main::sc#0 main::@2/(byte*) main::sc#1 )
@ -51,7 +51,7 @@ main::line1: scope:[main] from main::@3
(byte) main::line1_ysize#3 ← phi( main::@3/(byte) main::line1_ysize#0 )
(byte) main::line1_xpos#1 ← phi( main::@3/(byte) main::line1_xpos#0 )
(byte*) cur_line#0 ← ((byte*)) (number) $400
(word) main::line1_pos#0 ← ((word)) { (byte) main::line1_xpos#1, (number) 0 }
(word) main::line1_pos#0 ← ((word)) { (byte) main::line1_xpos#1, (byte)(number) 0 }
(byte) main::line1_i#0 ← (number) 0
to:main::line1_@1
main::line1_@1: scope:[main] from main::@8 main::line1
@ -110,7 +110,7 @@ main::line2: scope:[main] from main::@7
(byte) main::line2_ysize#3 ← phi( main::@7/(byte) main::line2_ysize#0 )
(byte) main::line2_xpos#1 ← phi( main::@7/(byte) main::line2_xpos#0 )
(byte*) cur_line#2 ← ((byte*)) (number) $400
(word) main::line2_pos#0 ← ((word)) { (byte) main::line2_xpos#1, (number) 0 }
(word) main::line2_pos#0 ← ((word)) { (byte) main::line2_xpos#1, (byte)(number) 0 }
(byte) main::line2_i#0 ← (number) 0
to:main::line2_@1
main::line2_@1: scope:[main] from main::@10 main::line2
@ -163,7 +163,7 @@ main::@return: scope:[main] from main::line2_@1
return
to:@return
@1: scope:[] from @begin
(byte*) cur_line#5 ← ((byte*)) (number) $400
(byte*) cur_line#5 ← (byte*)(number) $400
to:@3
@3: scope:[] from @1
(byte*) cur_line#16 ← phi( @1/(byte*) cur_line#5 )
@ -317,8 +317,8 @@ SYMBOL TABLE SSA
(byte*) main::sc#2
(byte*) main::sc#3
Fixing inline constructor with main::$3 ← (byte)main::line1_xpos#1 w= (byte)0
Fixing inline constructor with main::$4 ← (byte)main::line2_xpos#1 w= (byte)0
Fixing inline constructor with main::$3 ← (byte)main::line1_xpos#1 w= (byte)(byte)0
Fixing inline constructor with main::$4 ← (byte)main::line2_xpos#1 w= (byte)(byte)0
Successful SSA optimization Pass2FixInlineConstructors
Adding number conversion cast (unumber) $400+$3e8 in (bool~) main::$2 ← (byte*) main::sc#2 < (number) $400+(number) $3e8
Adding number conversion cast (unumber) 2 in (byte) main::line1_xpos#0 ← (number) 2
@ -332,7 +332,6 @@ Adding number conversion cast (unumber) $f in (byte) main::line2_ysize#0 ← (nu
Adding number conversion cast (unumber) 0 in (byte) main::line2_i#0 ← (number) 0
Adding number conversion cast (unumber) $28 in (byte*) cur_line#3 ← (byte*) cur_line#10 + (number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::sc#0 ← (byte*)(number) $400
Inlining cast (byte) main::line1_xpos#0 ← (unumber)(number) 2
Inlining cast (byte) main::line1_xadd#0 ← (unumber)(number) $40
Inlining cast (byte) main::line1_ysize#0 ← (unumber)(number) $a
@ -343,7 +342,6 @@ Inlining cast (byte) main::line2_xadd#0 ← (unumber)(number) $80
Inlining cast (byte) main::line2_ysize#0 ← (unumber)(number) $f
Inlining cast (byte*) cur_line#2 ← (byte*)(number) $400
Inlining cast (byte) main::line2_i#0 ← (unumber)(number) 0
Inlining cast (byte*) cur_line#5 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 2
@ -351,7 +349,7 @@ Simplifying constant integer cast $40
Simplifying constant integer cast $a
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast (byte) main::line1_xpos#1
Simplifying constant integer cast 0
Simplifying constant integer cast (byte)(number) 0
Simplifying constant integer cast 0
Simplifying constant integer cast $28
Simplifying constant integer cast 4
@ -359,11 +357,14 @@ Simplifying constant integer cast $80
Simplifying constant integer cast $f
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast (byte) main::line2_xpos#1
Simplifying constant integer cast 0
Simplifying constant integer cast (byte)(number) 0
Simplifying constant integer cast 0
Simplifying constant integer cast $28
Simplifying constant pointer cast (byte*) 1024
Successful SSA optimization PassNCastSimplification
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) $40
Finalized unsigned number type (byte) $a

View File

@ -8,8 +8,8 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte*) main::cols#0 ← ((byte*)) (number) $d800
(byte*) main::screen#0 ← (byte*)(number) $400
(byte*) main::cols#0 ← (byte*)(number) $d800
(byte) main::i#0 ← (byte) 0
to:main::@1
main::@1: scope:[main] from main main::@1
@ -64,8 +64,6 @@ Adding number conversion cast (unumber) $28 in (byte*) main::screen#1 ← (byte*
Adding number conversion cast (unumber) 1 in *((byte*) main::cols#2 + (byte) main::sin#0) ← (number) 1
Adding number conversion cast (unumber) $28 in (byte*) main::cols#1 ← (byte*) main::cols#2 + (number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Inlining cast (byte*) main::cols#0 ← (byte*)(number) $d800
Inlining cast *((byte*) main::cols#2 + (byte) main::sin#0) ← (unumber)(number) 1
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 4096

View File

@ -64,7 +64,7 @@ print_msg::@return: scope:[print_msg] from print_msg::@5
return
to:@return
@2: scope:[] from @begin
(byte*) screen#5 ← ((byte*)) (number) $400
(byte*) screen#5 ← (byte*)(number) $400
to:@3
(void()) print((byte*) print::msg)
@ -173,7 +173,6 @@ Adding number conversion cast (unumber) 0 in (bool~) print::$0 ← (number) 0 !=
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) print_msg::idx#0 ← (unumber)(number) 1
Inlining cast (byte) print_msg::idx#1 ← (unumber)(number) 2
Inlining cast (byte*) screen#5 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast 1
Simplifying constant integer cast 2

View File

@ -36,7 +36,7 @@ main::@return: scope:[main] from main::@3
return
to:@return
@1: scope:[] from @begin
(byte*) screen#4 ← ((byte*)) (number) $400
(byte*) screen#4 ← (byte*)(number) $400
to:@2
(void()) print((byte*) print::msg)
@ -122,8 +122,6 @@ SYMBOL TABLE SSA
Adding number conversion cast (unumber) 0 in (bool~) print::$0 ← (number) 0 != *((byte*) print::msg#4)
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) screen#4 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification

View File

@ -3,8 +3,8 @@
:BasicUpstart(main)
.pc = $80d "Program"
main: {
.label screen = $400
.const w = 2*$100+1
.label screen = $400
lda #<w
sta screen
lda #>w

View File

@ -10,7 +10,7 @@
(void()) main()
main: scope:[main] from @1
[4] *((const word*) main::screen) ← (const word) main::w#0
[4] *((const word*) main::screen) ← (const word) main::w
to:main::@return
main::@return: scope:[main] from main
[5] return

View File

@ -1,4 +1,5 @@
Fixing pointer array-indexing *((word*) main::screen + (number) 0)
Identified constant variable (word) main::w
Identified constant variable (word*) main::screen
CONTROL FLOW GRAPH SSA
@ -7,9 +8,8 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(word) main::w#0 ← ((word)) { (byte) 2, (byte) 1 }
(number~) main::$0 ← (number) 0 * (const byte) SIZEOF_WORD
*((const word*) main::screen + (number~) main::$0) ← (word) main::w#0
*((const word*) main::screen + (number~) main::$0) ← (const word) main::w
to:main::@return
main::@return: scope:[main] from main
return
@ -31,50 +31,28 @@ SYMBOL TABLE SSA
(number~) main::$0
(label) main::@return
(const word*) main::screen = (word*)(number) $400
(word) main::w
(word) main::w#0
(const word) main::w = (byte) 2*(word) $100+(byte) 1
Fixing inline constructor with main::$1 ← (byte)2 w= (byte)1
Successful SSA optimization Pass2FixInlineConstructors
Adding number conversion cast (unumber) 0 in (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) 0 * (const byte) SIZEOF_WORD
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (word*) 1024
Simplifying constant integer cast (byte) 2
Simplifying constant integer cast (byte) 1
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$0 ← (byte) 0 * (const byte) SIZEOF_WORD
Alias (word) main::w#0 = (word~) main::$1
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [0] (word) main::w#0 ← (byte) 2 w= (byte) 1
Constant right-side identified [2] (byte~) main::$0 ← (byte) 0 * (const byte) SIZEOF_WORD
Constant right-side identified [0] (byte~) main::$0 ← (byte) 0 * (const byte) SIZEOF_WORD
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$0 = 0*SIZEOF_WORD
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_WORD in
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero main::screen in [3] *((const word*) main::screen + (const byte) main::$0) ← (word) main::w#0
Simplifying expression containing zero main::screen in [1] *((const word*) main::screen + (const byte) main::$0) ← (const word) main::w
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) main::$0
Eliminating unused constant (const byte) SIZEOF_WORD
Successful SSA optimization PassNEliminateUnusedVars
Adding number conversion cast (unumber) 2*$100+1 in (word) main::w#0 ← (byte) 2*(number) $100+(byte) 1
Adding number conversion cast (unumber) 2*$100 in (word) main::w#0 ← ((unumber)) (byte) 2*(number) $100+(byte) 1
Adding number conversion cast (unumber) $100 in (word) main::w#0 ← ((unumber)) (unumber)(byte) 2*(number) $100+(byte) 1
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (word) main::w#0 ← (unumber)(unumber)(byte) 2*(unumber)(number) $100+(byte) 1
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast (unumber)(byte) 2*(unumber)(number) $100+(byte) 1
Simplifying constant integer cast (byte) 2*(unumber)(number) $100
Simplifying constant integer cast $100
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (word) $100
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant (const word) main::w#0 = 2*$100+1
Successful SSA optimization Pass2ConstantIdentification
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
@ -102,7 +80,7 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] *((const word*) main::screen) ← (const word) main::w#0
[4] *((const word*) main::screen) ← (const word) main::w
to:main::@return
main::@return: scope:[main] from main
[5] return
@ -111,7 +89,6 @@ main::@return: scope:[main] from main
VARIABLE REGISTER WEIGHTS
(void()) main()
(word) main::w
Initial phi equivalence classes
Complete equivalence classes
@ -141,9 +118,9 @@ __bend_from___b1:
__bend:
// main
main: {
.label screen = $400
.const w = 2*$100+1
// [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2
.label screen = $400
// [4] *((const word*) main::screen) ← (const word) main::w -- _deref_pwuc1=vwuc2
lda #<w
sta screen
lda #>w
@ -157,7 +134,7 @@ main: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const word*) main::screen) ← (const word) main::w#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] *((const word*) main::screen) ← (const word) main::w [ ] ( main:2 [ ] ) always clobbers reg byte a
REGISTER UPLIFT SCOPES
Uplift Scope [main]
@ -190,9 +167,9 @@ __bend_from___b1:
__bend:
// main
main: {
.label screen = $400
.const w = 2*$100+1
// [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2
.label screen = $400
// [4] *((const word*) main::screen) ← (const word) main::w -- _deref_pwuc1=vwuc2
lda #<w
sta screen
lda #>w
@ -231,8 +208,7 @@ FINAL SYMBOL TABLE
(void()) main()
(label) main::@return
(const word*) main::screen = (word*) 1024
(word) main::w
(const word) main::w#0 w = (byte) 2*(word) $100+(byte) 1
(const word) main::w = (byte) 2*(word) $100+(byte) 1
@ -254,10 +230,10 @@ Score: 18
// @end
// main
main: {
.label screen = $400
.const w = 2*$100+1
.label screen = $400
// screen[0] = w
// [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2
// [4] *((const word*) main::screen) ← (const word) main::w -- _deref_pwuc1=vwuc2
lda #<w
sta screen
lda #>w

View File

@ -4,6 +4,5 @@
(void()) main()
(label) main::@return
(const word*) main::screen = (word*) 1024
(word) main::w
(const word) main::w#0 w = (byte) 2*(word) $100+(byte) 1
(const word) main::w = (byte) 2*(word) $100+(byte) 1

View File

@ -3,8 +3,8 @@
:BasicUpstart(main)
.pc = $80d "Program"
main: {
.label screen = $400
.const w = 1*$100+2
.label screen = $400
lda #<w
sta screen
lda #>w

View File

@ -10,7 +10,7 @@
(void()) main()
main: scope:[main] from @1
[4] *((const word*) main::screen) ← (const word) main::w#0
[4] *((const word*) main::screen) ← (const word) main::w
to:main::@return
main::@return: scope:[main] from main
[5] return

View File

@ -1,4 +1,5 @@
Fixing pointer array-indexing *((word*) main::screen + (number) 0)
Identified constant variable (word) main::w
Identified constant variable (word*) main::screen
CONTROL FLOW GRAPH SSA
@ -7,9 +8,8 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(word) main::w#0 ← ((word)) { (number) 1, (number) 2 }
(number~) main::$0 ← (number) 0 * (const byte) SIZEOF_WORD
*((const word*) main::screen + (number~) main::$0) ← (word) main::w#0
*((const word*) main::screen + (number~) main::$0) ← (const word) main::w
to:main::@return
main::@return: scope:[main] from main
return
@ -31,50 +31,30 @@ SYMBOL TABLE SSA
(number~) main::$0
(label) main::@return
(const word*) main::screen = (word*)(number) $400
(word) main::w
(word) main::w#0
(const word) main::w = (byte)(number) 1*(word) $100+(byte)(number) 2
Fixing inline constructor with main::$1 ← (byte)1 w= (byte)2
Successful SSA optimization Pass2FixInlineConstructors
Adding number conversion cast (unumber) 0 in (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) 0 * (const byte) SIZEOF_WORD
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (word*) 1024
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant pointer cast (word*) 1024
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$0 ← (byte) 0 * (const byte) SIZEOF_WORD
Alias (word) main::w#0 = (word~) main::$1
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [0] (word) main::w#0 ← (byte) 1 w= (byte) 2
Constant right-side identified [2] (byte~) main::$0 ← (byte) 0 * (const byte) SIZEOF_WORD
Constant right-side identified [0] (byte~) main::$0 ← (byte) 0 * (const byte) SIZEOF_WORD
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$0 = 0*SIZEOF_WORD
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_WORD in
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero main::screen in [3] *((const word*) main::screen + (const byte) main::$0) ← (word) main::w#0
Simplifying expression containing zero main::screen in [1] *((const word*) main::screen + (const byte) main::$0) ← (const word) main::w
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) main::$0
Eliminating unused constant (const byte) SIZEOF_WORD
Successful SSA optimization PassNEliminateUnusedVars
Adding number conversion cast (unumber) 1*$100+2 in (word) main::w#0 ← (byte) 1*(number) $100+(byte) 2
Adding number conversion cast (unumber) 1*$100 in (word) main::w#0 ← ((unumber)) (byte) 1*(number) $100+(byte) 2
Adding number conversion cast (unumber) $100 in (word) main::w#0 ← ((unumber)) (unumber)(byte) 1*(number) $100+(byte) 2
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (word) main::w#0 ← (unumber)(unumber)(byte) 1*(unumber)(number) $100+(byte) 2
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast (unumber)(byte) 1*(unumber)(number) $100+(byte) 2
Simplifying constant integer cast (byte) 1*(unumber)(number) $100
Simplifying constant integer cast $100
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (word) $100
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant (const word) main::w#0 = 1*$100+2
Successful SSA optimization Pass2ConstantIdentification
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
@ -102,7 +82,7 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] *((const word*) main::screen) ← (const word) main::w#0
[4] *((const word*) main::screen) ← (const word) main::w
to:main::@return
main::@return: scope:[main] from main
[5] return
@ -111,7 +91,6 @@ main::@return: scope:[main] from main
VARIABLE REGISTER WEIGHTS
(void()) main()
(word) main::w
Initial phi equivalence classes
Complete equivalence classes
@ -141,9 +120,9 @@ __bend_from___b1:
__bend:
// main
main: {
.label screen = $400
.const w = 1*$100+2
// [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2
.label screen = $400
// [4] *((const word*) main::screen) ← (const word) main::w -- _deref_pwuc1=vwuc2
lda #<w
sta screen
lda #>w
@ -157,7 +136,7 @@ main: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const word*) main::screen) ← (const word) main::w#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] *((const word*) main::screen) ← (const word) main::w [ ] ( main:2 [ ] ) always clobbers reg byte a
REGISTER UPLIFT SCOPES
Uplift Scope [main]
@ -190,9 +169,9 @@ __bend_from___b1:
__bend:
// main
main: {
.label screen = $400
.const w = 1*$100+2
// [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2
.label screen = $400
// [4] *((const word*) main::screen) ← (const word) main::w -- _deref_pwuc1=vwuc2
lda #<w
sta screen
lda #>w
@ -231,8 +210,7 @@ FINAL SYMBOL TABLE
(void()) main()
(label) main::@return
(const word*) main::screen = (word*) 1024
(word) main::w
(const word) main::w#0 w = (byte) 1*(word) $100+(byte) 2
(const word) main::w = (byte) 1*(word) $100+(byte) 2
@ -254,10 +232,10 @@ Score: 18
// @end
// main
main: {
.label screen = $400
.const w = 1*$100+2
.label screen = $400
// screen[0] = w
// [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2
// [4] *((const word*) main::screen) ← (const word) main::w -- _deref_pwuc1=vwuc2
lda #<w
sta screen
lda #>w

View File

@ -4,6 +4,5 @@
(void()) main()
(label) main::@return
(const word*) main::screen = (word*) 1024
(word) main::w
(const word) main::w#0 w = (byte) 1*(word) $100+(byte) 2
(const word) main::w = (byte) 1*(word) $100+(byte) 2

View File

@ -3,8 +3,8 @@
:BasicUpstart(main)
.pc = $80d "Program"
main: {
.label screen = $400
.const w = 1*$100+2
.label screen = $400
lda #<w
sta screen
lda #>w

View File

@ -10,7 +10,7 @@
(void()) main()
main: scope:[main] from @1
[4] *((const word*) main::screen) ← (const word) main::w#0
[4] *((const word*) main::screen) ← (const word) main::w
to:main::@return
main::@return: scope:[main] from main
[5] return

View File

@ -1,4 +1,5 @@
Fixing pointer array-indexing *((word*) main::screen + (number) 0)
Identified constant variable (word) main::w
Identified constant variable (word*) main::screen
CONTROL FLOW GRAPH SSA
@ -7,9 +8,8 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(word) main::w#0 ← ((word)) { (number) 1, (byte) 2 }
(number~) main::$0 ← (number) 0 * (const byte) SIZEOF_WORD
*((const word*) main::screen + (number~) main::$0) ← (word) main::w#0
*((const word*) main::screen + (number~) main::$0) ← (const word) main::w
to:main::@return
main::@return: scope:[main] from main
return
@ -31,50 +31,29 @@ SYMBOL TABLE SSA
(number~) main::$0
(label) main::@return
(const word*) main::screen = (word*)(number) $400
(word) main::w
(word) main::w#0
(const word) main::w = (byte)(number) 1*(word) $100+(byte) 2
Fixing inline constructor with main::$1 ← (byte)1 w= (byte)2
Successful SSA optimization Pass2FixInlineConstructors
Adding number conversion cast (unumber) 0 in (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_WORD
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) 0 * (const byte) SIZEOF_WORD
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (word*) 1024
Simplifying constant integer cast 1
Simplifying constant integer cast (byte) 2
Simplifying constant pointer cast (word*) 1024
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) main::$0 ← (byte) 0 * (const byte) SIZEOF_WORD
Alias (word) main::w#0 = (word~) main::$1
Successful SSA optimization Pass2AliasElimination
Constant right-side identified [0] (word) main::w#0 ← (byte) 1 w= (byte) 2
Constant right-side identified [2] (byte~) main::$0 ← (byte) 0 * (const byte) SIZEOF_WORD
Constant right-side identified [0] (byte~) main::$0 ← (byte) 0 * (const byte) SIZEOF_WORD
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::$0 = 0*SIZEOF_WORD
Successful SSA optimization Pass2ConstantIdentification
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_WORD in
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero main::screen in [3] *((const word*) main::screen + (const byte) main::$0) ← (word) main::w#0
Simplifying expression containing zero main::screen in [1] *((const word*) main::screen + (const byte) main::$0) ← (const word) main::w
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) main::$0
Eliminating unused constant (const byte) SIZEOF_WORD
Successful SSA optimization PassNEliminateUnusedVars
Adding number conversion cast (unumber) 1*$100+2 in (word) main::w#0 ← (byte) 1*(number) $100+(byte) 2
Adding number conversion cast (unumber) 1*$100 in (word) main::w#0 ← ((unumber)) (byte) 1*(number) $100+(byte) 2
Adding number conversion cast (unumber) $100 in (word) main::w#0 ← ((unumber)) (unumber)(byte) 1*(number) $100+(byte) 2
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (word) main::w#0 ← (unumber)(unumber)(byte) 1*(unumber)(number) $100+(byte) 2
Successful SSA optimization Pass2InlineCast
Simplifying constant integer cast (unumber)(byte) 1*(unumber)(number) $100+(byte) 2
Simplifying constant integer cast (byte) 1*(unumber)(number) $100
Simplifying constant integer cast $100
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (word) $100
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant (const word) main::w#0 = 1*$100+2
Successful SSA optimization Pass2ConstantIdentification
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
@ -102,7 +81,7 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] *((const word*) main::screen) ← (const word) main::w#0
[4] *((const word*) main::screen) ← (const word) main::w
to:main::@return
main::@return: scope:[main] from main
[5] return
@ -111,7 +90,6 @@ main::@return: scope:[main] from main
VARIABLE REGISTER WEIGHTS
(void()) main()
(word) main::w
Initial phi equivalence classes
Complete equivalence classes
@ -141,9 +119,9 @@ __bend_from___b1:
__bend:
// main
main: {
.label screen = $400
.const w = 1*$100+2
// [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2
.label screen = $400
// [4] *((const word*) main::screen) ← (const word) main::w -- _deref_pwuc1=vwuc2
lda #<w
sta screen
lda #>w
@ -157,7 +135,7 @@ main: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const word*) main::screen) ← (const word) main::w#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [4] *((const word*) main::screen) ← (const word) main::w [ ] ( main:2 [ ] ) always clobbers reg byte a
REGISTER UPLIFT SCOPES
Uplift Scope [main]
@ -190,9 +168,9 @@ __bend_from___b1:
__bend:
// main
main: {
.label screen = $400
.const w = 1*$100+2
// [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2
.label screen = $400
// [4] *((const word*) main::screen) ← (const word) main::w -- _deref_pwuc1=vwuc2
lda #<w
sta screen
lda #>w
@ -231,8 +209,7 @@ FINAL SYMBOL TABLE
(void()) main()
(label) main::@return
(const word*) main::screen = (word*) 1024
(word) main::w
(const word) main::w#0 w = (byte) 1*(word) $100+(byte) 2
(const word) main::w = (byte) 1*(word) $100+(byte) 2
@ -254,10 +231,10 @@ Score: 18
// @end
// main
main: {
.label screen = $400
.const w = 1*$100+2
.label screen = $400
// screen[0] = w
// [4] *((const word*) main::screen) ← (const word) main::w#0 -- _deref_pwuc1=vwuc2
// [4] *((const word*) main::screen) ← (const word) main::w -- _deref_pwuc1=vwuc2
lda #<w
sta screen
lda #>w

View File

@ -4,6 +4,5 @@
(void()) main()
(label) main::@return
(const word*) main::screen = (word*) 1024
(word) main::w
(const word) main::w#0 w = (byte) 1*(word) $100+(byte) 2
(const word) main::w = (byte) 1*(word) $100+(byte) 2

View File

@ -9,7 +9,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte*) main::screen#0 ← (byte*)(number) $400
(word) main::i#0 ← (word) 0
to:main::@1
main::@1: scope:[main] from main main::@1
@ -55,8 +55,6 @@ SYMBOL TABLE SSA
(byte*) main::screen#1
(byte*) main::screen#2
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Successful SSA optimization PassNCastSimplification
Simple Condition (bool~) main::$1 [9] if((word) main::i#1!=rangelast(0,$3e7)) goto main::@1

View File

@ -206,7 +206,7 @@ memset::@return: scope:[memset] from memset::@1
to:@return
@20: scope:[] from @2
(word) rem16u#27 ← phi( @2/(word) rem16u#0 )
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@46
@ -659,7 +659,7 @@ lin16u_gen::@8: scope:[lin16u_gen] from lin16u_gen::@7
(word) rem16u#8 ← (word) rem16u#17
(word) lin16u_gen::stepf#0 ← (word~) lin16u_gen::$4
(dword) lin16u_gen::step#0 ← ((dword)) { (word) lin16u_gen::stepi#1, (word) lin16u_gen::stepf#0 }
(dword) lin16u_gen::val#0 ← ((dword)) { (word) lin16u_gen::min#4, (number) 0 }
(dword) lin16u_gen::val#0 ← ((dword)) { (word) lin16u_gen::min#4, (word)(number) 0 }
(word) lin16u_gen::i#0 ← (number) 0
to:lin16u_gen::@1
lin16u_gen::@1: scope:[lin16u_gen] from lin16u_gen::@2 lin16u_gen::@8
@ -1237,7 +1237,7 @@ SYMBOL TABLE SSA
(word) rem16u#9
Fixing inline constructor with lin16u_gen::$8 ← (word)lin16u_gen::stepi#1 dw= (word)lin16u_gen::stepf#0
Fixing inline constructor with lin16u_gen::$9 ← (word)lin16u_gen::min#4 dw= (word)0
Fixing inline constructor with lin16u_gen::$9 ← (word)lin16u_gen::min#4 dw= (word)(word)0
Successful SSA optimization Pass2FixInlineConstructors
Adding number conversion cast (unumber) 0 in (word) rem16u#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (word) divr16u::quotient#0 ← (number) 0
@ -1285,7 +1285,6 @@ Inlining cast (word) rem16u#0 ← (unumber)(number) 0
Inlining cast (word) divr16u::quotient#0 ← (unumber)(number) 0
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast (word) lin16u_gen::min#0 ← (unumber)(number) $22d
Inlining cast (word) lin16u_gen::max#0 ← (unumber)(number) $7461
@ -1346,7 +1345,9 @@ Simplifying constant integer cast 0
Simplifying constant integer cast (word) lin16u_gen::stepi#1
Simplifying constant integer cast (word) lin16u_gen::stepf#0
Simplifying constant integer cast (word) lin16u_gen::min#4
Simplifying constant integer cast (word)(number) 0
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0

View File

@ -2,7 +2,7 @@ Culled Empty Block (label) malloc::@1
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) MEM#0 ← ((byte*)) (number) $400
(byte*) MEM#0 ← (byte*)(number) $400
to:@1
(byte*()) malloc()
@ -106,7 +106,6 @@ SYMBOL TABLE SSA
Adding number conversion cast (unumber) 0 in *((byte*) SCREEN_1#1) ← (number) 0
Adding number conversion cast (unumber) 0 in *((byte*) SCREEN_2#1) ← (number) 0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) MEM#0 ← (byte*)(number) $400
Inlining cast *((byte*) SCREEN_1#1) ← (unumber)(number) 0
Inlining cast *((byte*) SCREEN_2#1) ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast

View File

@ -11,7 +11,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte*) main::screen#0 ← (byte*)(number) $400
(byte) main::i#0 ← (byte) 0
to:main::@1
main::@1: scope:[main] from main main::@5
@ -85,8 +85,6 @@ SYMBOL TABLE SSA
Adding number conversion cast (unumber) 0 in (bool~) main::$0 ← *((const byte*) main::str + (byte) main::i#2) == (number) 0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification

View File

@ -15,7 +15,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte*) main::line#0 ← ((byte*)) (number) $400
(byte*) main::line#0 ← (byte*)(number) $400
to:main::@1
main::@1: scope:[main] from main main::@8
(byte*) main::line#2 ← phi( main/(byte*) main::line#0 main::@8/(byte*) main::line#1 )
@ -98,8 +98,6 @@ SYMBOL TABLE SSA
Adding number conversion cast (unumber) $400+$28*$19 in (bool~) main::$0 ← (byte*) main::line#2 < (number) $400+(number) $28*(number) $19
Adding number conversion cast (unumber) $28 in (byte*) main::line#1 ← (byte*) main::line#6 + (number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::line#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $28
Successful SSA optimization PassNCastSimplification

View File

@ -73,7 +73,7 @@ CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@12
@12: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@39
@ -676,7 +676,6 @@ Adding number conversion cast (unumber) $100 in *((const byte*) mulf_sqr2_hi+(nu
Adding number conversion cast (unumber) $1ff in *((const byte*) mulf_sqr2_hi+(number) $1ff) ← *((const byte*) mulf_sqr1_hi+(unumber)(number) $100)
Adding number conversion cast (unumber) 1 in (byte) mulf_init::dir#1 ← (number) 1
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word) mulf_init::sqr#0 ← (unumber)(number) 0
Inlining cast (byte) mulf_init::x_2#0 ← (unumber)(number) 0
Inlining cast (byte) mulf_init::c#0 ← (unumber)(number) 0

View File

@ -43,7 +43,7 @@ CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@4
@4: scope:[] from @begin
(byte*) PLEX_SCREEN_PTR#0 ← ((byte*)) (number) $400+(number) $3f8
(byte*) PLEX_SCREEN_PTR#0 ← (byte*)(number) $400+(number) $3f8
(byte) plex_show_idx#0 ← (number) 0
(byte) plex_sprite_idx#0 ← (number) 0
(byte) plex_sprite_msb#0 ← (number) 1
@ -1165,7 +1165,6 @@ Adding number conversion cast (unumber) 1 in (byte) loop::sin_idx#1 ← (byte) l
Adding number conversion cast (unumber) $7f in *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) & (number) $7f
Adding number conversion cast (unumber) 0 in *((const byte*) RASTER) ← (number) 0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) PLEX_SCREEN_PTR#0 ← (byte*)(number) $400+(number) $3f8
Inlining cast (byte) plex_show_idx#0 ← (unumber)(number) 0
Inlining cast (byte) plex_sprite_idx#0 ← (unumber)(number) 0
Inlining cast (byte) plex_sprite_msb#0 ← (unumber)(number) 1
@ -1492,7 +1491,6 @@ Rewriting && if()-condition to two if()s [39] (bool~) plexSort::$7 ← (bool~) p
Rewriting && if()-condition to two if()s [188] (bool~) plex_irq::$6 ← (bool~) plex_irq::$3 && (bool~) plex_irq::$5
Rewriting ! if()-condition to reversed if() [212] (bool~) loop::$0 ← ! (bool) framedone#12
Successful SSA optimization Pass2ConditionalAndOrRewriting
Constant right-side identified [0] (byte*) PLEX_SCREEN_PTR#0 ← (byte*)(number) $400+(number) $3f8
Constant right-side identified [139] (byte*~) init::$1 ← (const byte*) SPRITE / (byte) $40
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) PLEX_SCREEN_PTR#0 = (byte*)$400+$3f8

View File

@ -26,7 +26,7 @@ foo::@return: scope:[foo] from foo
(void()) main()
main: scope:[main] from @2
(signed word*) main::SCREEN#0 ← ((signed word*)) (number) $400
(signed word*) main::SCREEN#0 ← (signed word*)(number) $400
(signed word) main::y1#0 ← (number) $1234
(signed word) main::y2#0 ← (number) $1234
(byte) foo::x#0 ← (number) 1
@ -113,7 +113,6 @@ Adding number conversion cast (snumber) $1234 in (signed word) main::y2#0 ← (n
Adding number conversion cast (unumber) 1 in (byte) foo::x#0 ← (number) 1
Adding number conversion cast (unumber) 2 in (byte) foo::x#1 ← (number) 2
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (signed word*) main::SCREEN#0 ← (signed word*)(number) $400
Inlining cast (signed word) main::y1#0 ← (snumber)(number) $1234
Inlining cast (signed word) main::y2#0 ← (snumber)(number) $1234
Inlining cast (byte) foo::x#0 ← (unumber)(number) 1

View File

@ -1,7 +1,7 @@
Setting inferred volatile on symbol affected by address-of (struct A*) main::a ← &(struct A) aa
Created struct value member variable (byte) aa_b
Converted struct value to member variables (struct A) aa
Adding struct value list initializer (byte) aa_b ← (number) 1
Adding struct value member variable copy (byte) aa_b ← (byte)(number) 1
Rewriting struct pointer member access *((struct A*) main::a).b
Warning! Adding boolean cast to non-boolean sub-expression *((byte*~) main::$2)
Identified constant variable (struct A*) main::a
@ -9,7 +9,7 @@ Adding versioned struct unwinding for (struct A) aa#0
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte) aa_b#0 ← (number) 1
(byte) aa_b#0 ← (byte)(number) 1
(struct A) aa#0 ← struct-unwound {(byte) aa_b#0}
to:@1
@ -59,16 +59,12 @@ SYMBOL TABLE SSA
(const byte*) main::SCREEN = (byte*)(number) $400
(const struct A*) main::a = &(struct A) aa
Adding number conversion cast (unumber) 1 in (byte) aa_b#0 ← (number) 1
Adding number conversion cast (unumber) 0 in (bool~) main::$3 ← (number) 0 != *((byte*~) main::$2)
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) aa_b#0 ← (unumber)(number) 1
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inversing boolean not [4] (bool~) main::$0 ← (byte) 0 == *((byte*~) main::$2) from [3] (bool~) main::$3 ← (byte) 0 != *((byte*~) main::$2)

View File

@ -579,7 +579,7 @@ atan2_16::@return: scope:[atan2_16] from atan2_16::@8
(word*) SQUARES#46 ← phi( @16/(word*) SQUARES#0 )
(byte) NUM_SQUARES#39 ← phi( @16/(byte) NUM_SQUARES#0 )
(byte*) heap_head#31 ← phi( @16/(byte*) heap_head#36 )
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@47
@ -2921,7 +2921,6 @@ Inlining cast (word*) SQUARES#1 ← (word*)(void*~) init_squares::$1
Inlining cast (word) init_squares::sqr#0 ← (unumber)(number) 0
Inlining cast (byte~) sqrt::$2 ← (byte)(word~) sqrt::$1
Inlining cast (word) atan2_16::angle#0 ← (unumber)(number) 0
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast *((const word*) SID_VOICE3_FREQ) ← (unumber)(number) $ffff
Inlining cast (word) malloc::size#1 ← (unumber)(number) $3e8

View File

@ -7,8 +7,8 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(signed word*) main::pos_ptr#0 ← ((signed word*)) (number) $400
(byte*) main::vram_ptr#0 ← ((byte*)) (number) $428
(signed word*) main::pos_ptr#0 ← (signed word*)(number) $400
(byte*) main::vram_ptr#0 ← (byte*)(number) $428
(byte) main::i#0 ← (byte) 0
to:main::@1
main::@1: scope:[main] from main main::@1
@ -65,9 +65,6 @@ SYMBOL TABLE SSA
(byte*) main::vram_ptr#2
(byte*) main::vram_ptr#3
Inlining cast (signed word*) main::pos_ptr#0 ← (signed word*)(number) $400
Inlining cast (byte*) main::vram_ptr#0 ← (byte*)(number) $428
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (signed word*) 1024
Simplifying constant pointer cast (byte*) 1064
Simplifying constant integer cast $55aa

View File

@ -14,7 +14,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @2
(byte) textid#16 ← phi( @2/(byte) textid#15 )
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte*) main::screen#0 ← (byte*)(number) $400
(byte*) main::text#0 ← (byte*) 0
(byte) main::i#0 ← (byte) 0
to:main::@1
@ -181,7 +181,6 @@ Adding number conversion cast (unumber) 1 in (number~) nexttext::$0 ← (byte) t
Adding number conversion cast (unumber) nexttext::$0 in (number~) nexttext::$0 ← (byte) textid#8 & (unumber)(number) 1
Adding number conversion cast (unumber) 0 in (bool~) nexttext::$1 ← (unumber~) nexttext::$0 == (number) 0
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Inlining cast (byte) textid#2 ← (unumber)(number) 0
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024

View File

@ -6,7 +6,7 @@ Culled Empty Block (label) @1
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
(byte*) screen#0 ← ((byte*)) (number) $400
(byte*) screen#0 ← (byte*)(number) $400
to:@2
(void()) main()
@ -79,8 +79,6 @@ SYMBOL TABLE SSA
Adding number conversion cast (unumber) 0 in *((byte*) screen#2 + (number) 0) ← (byte) 'a'
Adding number conversion cast (unumber) 0 in *((byte*) screen#3 + (number) 0) ← (byte) 'a'
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) screen#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0

View File

@ -37,7 +37,7 @@ main::@return: scope:[main] from main::@2
return
to:@return
@1: scope:[] from @begin
(byte*) heap_head#3 ← ((byte*)) (number) $c000
(byte*) heap_head#3 ← (byte*)(number) $c000
to:@2
(void*()) malloc()
@ -113,7 +113,6 @@ Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) main::buf1#0 ← (byte*)(void*~) main::$0
Inlining cast (byte*) main::buf2#0 ← (byte*)(void*~) main::$1
Inlining cast (byte*) heap_head#3 ← (byte*)(number) $c000
Inlining cast (void*) malloc::return#2 ← (void*)(byte*) heap_head#4
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024

View File

@ -54,7 +54,7 @@ CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@12
@12: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@37
@ -275,8 +275,6 @@ SYMBOL TABLE SSA
Adding number conversion cast (unumber) 0 in (bool~) print_str::$0 ← (number) 0 != *((byte*) print_str::str#4)
Adding number conversion cast (unumber) $28 in (byte*~) print_ln::$0 ← (byte*) print_line_cursor#8 + (number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast 0
Simplifying constant integer cast $28

View File

@ -113,7 +113,7 @@ memset::@return: scope:[memset] from memset::@1
return
to:@return
@16: scope:[] from @begin
(byte*) print_screen#0 ← ((byte*)) (number) $400
(byte*) print_screen#0 ← (byte*)(number) $400
(byte*) print_line_cursor#0 ← (byte*) print_screen#0
(byte*) print_char_cursor#0 ← (byte*) print_line_cursor#0
to:@42
@ -1228,7 +1228,6 @@ Adding number conversion cast (unumber) 0 in *((const byte*) PROCPORT) ← (numb
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*~) memset::$2 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte*) print_screen#0 ← (byte*)(number) $400
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast *((const byte*) BASIC_ROM) ← (unumber)(number) $a0
Inlining cast *((const byte*) KERNAL_ROM) ← (unumber)(number) $e0

View File

@ -7,7 +7,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte*) main::screen#0 ← (byte*)(number) $400
*(*((const byte**) main::pscreen)) ← (byte) 'a'
*((const byte**) main::pscreen) ← ++ *((const byte**) main::pscreen)
*(*((const byte**) main::pscreen)) ← (byte) 'b'
@ -33,8 +33,6 @@ SYMBOL TABLE SSA
(byte*) main::screen
(byte*) main::screen#0
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Successful SSA optimization PassNCastSimplification
Adding NOP phi() at start of @begin

View File

@ -8,7 +8,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @2
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte*) main::screen#0 ← (byte*)(number) $400
(byte) sub::ch#0 ← (byte) 'a'
(byte**) sub::dst#0 ← (const byte**) main::pscreen
call sub
@ -64,8 +64,6 @@ SYMBOL TABLE SSA
(byte**) sub::dst#1
(byte**) sub::dst#2
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Successful SSA optimization PassNCastSimplification
Constant (const byte) sub::ch#0 = 'a'

View File

@ -8,7 +8,7 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @2
(byte*) main::screen#0 ← ((byte*)) (number) $400
(byte*) main::screen#0 ← (byte*)(number) $400
(byte) sub::ch#0 ← (byte) 'a'
(byte**) sub::dst#0 ← &(byte*) main::screen#0
call sub
@ -65,8 +65,6 @@ SYMBOL TABLE SSA
(byte**) sub::dst#1
(byte**) sub::dst#2
Inlining cast (byte*) main::screen#0 ← (byte*)(number) $400
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024
Successful SSA optimization PassNCastSimplification
Alias (byte*) main::screen#0 = (byte*) main::screen#1

View File

@ -90,7 +90,7 @@ rvalue::@return: scope:[rvalue] from rvalue::@3
(void()) lvaluevar()
lvaluevar: scope:[lvaluevar] from main::@3
(byte*) lvaluevar::screen#0 ← ((byte*)) (number) $400
(byte*) lvaluevar::screen#0 ← (byte*)(number) $400
(byte) lvaluevar::i#0 ← (number) 2
to:lvaluevar::@1
lvaluevar::@1: scope:[lvaluevar] from lvaluevar lvaluevar::@2
@ -112,7 +112,7 @@ lvaluevar::@return: scope:[lvaluevar] from lvaluevar::@1
(void()) rvaluevar()
rvaluevar: scope:[rvaluevar] from main::@2
(byte*) rvaluevar::screen#0 ← ((byte*)) (number) $400
(byte*) rvaluevar::screen#0 ← (byte*)(number) $400
(byte) rvaluevar::b#0 ← (byte) 0
(byte) rvaluevar::i#0 ← (number) 2
to:rvaluevar::@1
@ -243,9 +243,7 @@ Inlining cast *((const byte*) lvalue::SCREEN + (unumber)(number) 1) ← (unumber
Inlining cast (byte) lvalue::i#0 ← (unumber)(number) 2
Inlining cast *((const byte*) lvalue::SCREEN + (byte) lvalue::i#3) ← (unumber)(number) 3
Inlining cast (byte) rvalue::i#0 ← (unumber)(number) 2
Inlining cast (byte*) lvaluevar::screen#0 ← (byte*)(number) $400
Inlining cast (byte) lvaluevar::i#0 ← (unumber)(number) 2
Inlining cast (byte*) rvaluevar::screen#0 ← (byte*)(number) $400
Inlining cast (byte) rvaluevar::i#0 ← (unumber)(number) 2
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1024

View File

@ -66,7 +66,7 @@ mul8u::@return: scope:[mul8u] from mul8u::@3
(void()) main()
main: scope:[main] from @6
(word*) main::screen#0 ← ((word*)) (number) $400
(word*) main::screen#0 ← (word*)(number) $400
(byte) main::y#0 ← (byte) 0
to:main::@1
main::@1: scope:[main] from main main::@4
@ -205,7 +205,6 @@ Adding number conversion cast (unumber) $28 in (byte) mul8u::b#0 ← (number) $2
Adding number conversion cast (unumber) $28 in (byte) mul8u::b#1 ← (number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (word) mul8u::res#0 ← (unumber)(number) 0
Inlining cast (word*) main::screen#0 ← (word*)(number) $400
Inlining cast (byte) mul8u::b#0 ← (unumber)(number) $28
Inlining cast (byte) mul8u::b#1 ← (unumber)(number) $28
Successful SSA optimization Pass2InlineCast

Some files were not shown because too many files have changed in this diff Show More