1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-07-03 20:29:34 +00:00

Working on new ValueSource based unwinding. Most of the old unwinding code is now unused.

This commit is contained in:
jespergravgaard 2020-02-05 17:29:25 +01:00
parent b17d4ab8fc
commit 511020649a
30 changed files with 1225 additions and 1328 deletions

View File

@ -4,7 +4,10 @@ import dk.camelot64.kickc.model.InternalError;
import dk.camelot64.kickc.model.*;
import dk.camelot64.kickc.model.iterator.ProgramValueIterator;
import dk.camelot64.kickc.model.statements.*;
import dk.camelot64.kickc.model.symbols.*;
import dk.camelot64.kickc.model.symbols.Procedure;
import dk.camelot64.kickc.model.symbols.ProgramScope;
import dk.camelot64.kickc.model.symbols.StructDefinition;
import dk.camelot64.kickc.model.symbols.Variable;
import dk.camelot64.kickc.model.types.SymbolType;
import dk.camelot64.kickc.model.types.SymbolTypeInference;
import dk.camelot64.kickc.model.types.SymbolTypeStruct;
@ -198,6 +201,7 @@ public class Pass1UnwindStructValues extends Pass1Base {
private boolean unwindAssignment(StatementAssignment assignment, ListIterator<Statement> stmtIt, ControlFlowBlock currentBlock) {
LValue lValue = assignment.getlValue();
SymbolType lValueType = SymbolTypeInference.inferType(getScope(), lValue);
if(lValueType instanceof SymbolTypeStruct && assignment.getOperator() == null) {
// Assignment to a struct
@ -207,11 +211,13 @@ public class Pass1UnwindStructValues extends Pass1Base {
StatementSource source = assignment.getSource();
// Check if this is already a bulk assignment
if(assignment.getrValue2() instanceof MemcpyValue || assignment.getrValue2() instanceof MemsetValue)
if(rValue instanceof MemcpyValue || rValue instanceof MemsetValue)
return false;
if(rValue instanceof StructUnwoundPlaceholder)
return false;
ValueSource lValueSource = getValueSource(lValue, assignment, stmtIt, currentBlock);
ValueSource rValueSource = getValueSource(rValue, assignment, stmtIt, currentBlock);
ValueSource lValueSource = getValueSource(getProgram(), getScope(), lValue, assignment, stmtIt, currentBlock);
ValueSource rValueSource = getValueSource(getProgram(), getScope(), rValue, assignment, stmtIt, currentBlock);
List<RValue> lValueUnwoundList = new ArrayList<>();
if(copyValues(lValueSource, rValueSource, lValueUnwoundList, initialAssignment, assignment, currentBlock, stmtIt)) {
if(lValue instanceof VariableRef) {
@ -223,17 +229,9 @@ public class Pass1UnwindStructValues extends Pass1Base {
return true;
}
// Check for bulk assignable values
if(isBulkAssignable(lValue) && isBulkAssignable(rValue)) {
throw new InternalError("E!");
//RValueUnwinding lValueUnwinding = getValueUnwinding(lValue, assignment, stmtIt, currentBlock);
//RValueUnwinding rValueUnwinding = getValueUnwinding(rValue, assignment, stmtIt, currentBlock);
//unwindAssignment(lValueUnwinding, rValueUnwinding, null, stmtIt, initialAssignment, source);
//stmtIt.remove();
//return true;
}
// Check for struct unwinding
if(1==1) throw new InternalError("E!");
StructUnwinding lValueUnwinding = getStructMemberUnwinding(lValue, assignment, stmtIt, currentBlock);
if(lValueUnwinding == null)
return false;
@ -251,9 +249,12 @@ public class Pass1UnwindStructValues extends Pass1Base {
return true;
List<RValue> lValueUnwoundPlaceholder = new ArrayList<>();
for(String memberName : lValueUnwinding.getMemberNames()) {
/*
RValueUnwinding lValueMemberUnwinding = lValueUnwinding.getMemberUnwinding(memberName, getScope());
RValueUnwinding rValueMemberUnwinding = rValueUnwinding.getMemberUnwinding(memberName, getScope());
unwindAssignment(lValueMemberUnwinding, rValueMemberUnwinding, lValueUnwoundPlaceholder, stmtIt, initialAssignment, source);
*/
}
StructUnwoundPlaceholder unwoundPlaceholder = new StructUnwoundPlaceholder(lValueStructType, lValueUnwoundPlaceholder);
if(lValue instanceof VariableRef) {
@ -320,146 +321,42 @@ public class Pass1UnwindStructValues extends Pass1Base {
* @param currentBlock The current block
* @return The value source for copying. null if no value source can be created.
*/
private ValueSource getValueSource(Value value, Statement currentStmt, ListIterator<Statement> stmtIt, ControlFlowBlock currentBlock) {
if(value instanceof VariableRef) {
Variable variable = getScope().getVariable((VariableRef) value);
if(variable.getType() instanceof SymbolTypeStruct) {
return new ValueSourceVariable(variable);
public static ValueSource getValueSource(Program program, ProgramScope programScope, Value value, Statement currentStmt, ListIterator<Statement> stmtIt, ControlFlowBlock currentBlock) {
final SymbolType valueType = SymbolTypeInference.inferType(programScope, (RValue) value);
if(valueType instanceof SymbolTypeStruct && value instanceof CastValue && ((CastValue) value).getValue() instanceof ValueList) {
ValueList valueList = (ValueList) ((CastValue) value).getValue();
final StructDefinition structDefinition = ((SymbolTypeStruct) valueType).getStructDefinition(programScope);
int numMembers = structDefinition.getAllVars(false).size();
if(numMembers != valueList.getList().size()) {
throw new CompileError("Struct initialization list has wrong size. Need " + numMembers + " got " + valueList.getList().size(), currentStmt);
}
return new ValueSourceStructValueList(valueList, structDefinition);
}
while(value instanceof CastValue)
value = ((CastValue) value).getValue();
if(value instanceof VariableRef) {
Variable variable = programScope.getVariable((VariableRef) value);
return new ValueSourceVariable(variable);
}
if(value instanceof StructZero)
return new ValueSourceZero(((StructZero) value).getTypeStruct(), null);
if(value instanceof ConstantStructValue)
return new ValueSourceConstant(((ConstantStructValue) value).getType(getScope()), null, (ConstantStructValue) value);
if(value instanceof ConstantValue)
return new ValueSourceConstant(((ConstantValue) value).getType(programScope), null, (ConstantValue) value);
if(value instanceof PointerDereferenceSimple)
return new ValueSourcePointerDereferenceSimple((PointerDereferenceSimple) value, SymbolTypeInference.inferType(getScope(), (RValue) value), null);
return new ValueSourcePointerDereferenceSimple((PointerDereferenceSimple) value, valueType, null);
if(value instanceof PointerDereferenceIndexed)
return new ValueSourcePointerDereferenceIndexed((PointerDereferenceIndexed) value, SymbolTypeInference.inferType(getScope(), (RValue) value), null);
return new ValueSourcePointerDereferenceIndexed((PointerDereferenceIndexed) value, valueType, null);
if(value instanceof StructMemberRef) {
final RValue structValue = ((StructMemberRef) value).getStruct();
final ValueSource structValueSource = getValueSource(structValue, currentStmt, stmtIt, currentBlock);
final ValueSource structMemberSource = structValueSource.getMemberUnwinding(((StructMemberRef) value).getMemberName(), getProgram(), getScope(), currentStmt, currentBlock, stmtIt);
final ValueSource structValueSource = getValueSource(program, programScope, structValue, currentStmt, stmtIt, currentBlock);
final ValueSource structMemberSource = structValueSource.getMemberUnwinding(((StructMemberRef) value).getMemberName(), program, programScope, currentStmt, currentBlock, stmtIt);
return structMemberSource;
}
return null;
}
/**
* Unwind assignment from an RValue to an LValue
*
* @param lValueUnwinding The unwinding of the LValue
* @param rValueUnwinding The unwinding of the RValue
* @param lValueUnwoundList will receive the actual unwinding used for the lValue (if non-null)
* @param stmtIt Statement iterator used for adding unwound assignment statements (before the current statement)
* @param initialAssignment Is this the initial assignment
* @param source The statement source
*/
private void unwindAssignment(RValueUnwinding lValueUnwinding, RValueUnwinding rValueUnwinding, List<RValue> lValueUnwoundList, ListIterator<Statement> stmtIt, boolean initialAssignment, StatementSource source) {
if(lValueUnwinding.isBulkCopyable() && rValueUnwinding.isBulkCopyable()) {
// Use bulk unwinding for a struct member that is an array
stmtIt.previous();
if(lValueUnwinding.getArraySpec() != null)
if(rValueUnwinding.getArraySpec() == null || !lValueUnwinding.getArraySpec().equals(rValueUnwinding.getArraySpec()))
throw new RuntimeException("ArraySpec mismatch!");
LValue lValueMemberVarRef = lValueUnwinding.getBulkLValue(getScope());
RValue rValueBulkUnwinding = rValueUnwinding.getBulkRValue(getScope());
if(lValueUnwoundList != null)
lValueUnwoundList.add(lValueMemberVarRef);
Statement copyStmt = new StatementAssignment(lValueMemberVarRef, rValueBulkUnwinding, initialAssignment, source, Comment.NO_COMMENTS);
stmtIt.add(copyStmt);
stmtIt.next();
getLog().append("Adding struct value member variable copy " + copyStmt.toString(getProgram(), false));
} else {
// Unwinding a non-array struct member
stmtIt.previous();
LValue lValueMemberVarRef = (LValue) lValueUnwinding.getUnwinding(getScope());
RValue rValueMemberVarRef = rValueUnwinding.getUnwinding(getScope());
if(lValueUnwoundList != null)
lValueUnwoundList.add(lValueMemberVarRef);
Statement copyStmt = new StatementAssignment(lValueMemberVarRef, rValueMemberVarRef, initialAssignment, source, Comment.NO_COMMENTS);
stmtIt.add(copyStmt);
stmtIt.next();
getLog().append("Adding struct value member variable copy " + copyStmt.toString(getProgram(), false));
}
}
/**
* Determine whether a value can be used in a bulk assignment
*
* @param value The value
* @return true if the value is bulk assignable
*/
private boolean isBulkAssignable(RValue value) {
if(value instanceof SymbolVariableRef) {
Variable var = getScope().getVar((SymbolVariableRef) value);
if(var.isStructClassic())
// A load/store struct value
return true;
}
if(value instanceof StructZero)
// A zero-filled struct value
return true;
if(value instanceof ConstantStructValue)
// A constant struct value
return true;
if(value instanceof StructMemberRef && ((StructMemberRef) value).getStruct() instanceof PointerDereference)
// A member of a struct in memory
return true;
if(value instanceof PointerDereference) {
final SymbolType symbolType = SymbolTypeInference.inferType(getProgram().getScope(), value);
if(symbolType instanceof SymbolTypeStruct)
// A pointer to a struct
return true;
}
// TODO: Add support for arrays
// Not bulk assignable
return false;
}
/**
* Get unwinding for a value
*
* @param value The value
* @return Unwinding for the value
*/
private RValueUnwinding getValueUnwinding(RValue value, Statement currentStmt, ListIterator<Statement> stmtIt, ControlFlowBlock currentBlock) {
if(value != null) {
SymbolType valueType = SymbolTypeInference.inferType(getScope(), value);
if(valueType instanceof SymbolTypeStruct) {
if(value instanceof VariableRef) {
Variable variable = getScope().getVariable((VariableRef) value);
if(variable.isStructClassic()) {
return new RValueUnwindingStructVariable(variable);
}
}
if(value instanceof StructZero)
return new RValueUnwindingZero(valueType, null);
if(value instanceof ConstantStructValue)
return new RValueUnwindingConstant(valueType, null, (ConstantStructValue) value);
if(value instanceof PointerDereference)
return new RValueUnwindingStructPointerDeref((PointerDereference) value, (SymbolTypeStruct) valueType);
if(value instanceof StructMemberRef && ((StructMemberRef) value).getStruct() instanceof PointerDereferenceIndexed) {
final StructMemberRef structMemberRef = (StructMemberRef) value;
final PointerDereferenceIndexed structPointerDerefIdx = (PointerDereferenceIndexed) structMemberRef.getStruct();
final SymbolType structPointerType = SymbolTypeInference.inferType(getScope(), structPointerDerefIdx);
if(!(structPointerType instanceof SymbolTypeStruct))
throw new CompileError("Value is not a struct" + structPointerDerefIdx.toString(getProgram()), currentStmt);
final StructDefinition structDefinition = ((SymbolTypeStruct) structPointerType).getStructDefinition(getScope());
final String memberName = structMemberRef.getMemberName();
final Variable member = structDefinition.getMember(memberName);
final SymbolType memberType = member.getType();
final ArraySpec memberArraySpec = member.getArraySpec();
final ConstantRef memberOffsetConstant = PassNStructPointerRewriting.getMemberOffsetConstant(getScope(), structDefinition, memberName);
return new RValueUnwindingStructPointerDereferenceIndexedMember(structPointerDerefIdx, memberType, memberArraySpec, memberOffsetConstant, currentBlock, stmtIt, currentStmt);
}
}
}
return null;
}
/**
* Examine a value - and if it represents a struct get the unwinding information for the struct members
*

View File

@ -0,0 +1,67 @@
package dk.camelot64.kickc.passes.unwinding;
import dk.camelot64.kickc.model.ControlFlowBlock;
import dk.camelot64.kickc.model.InternalError;
import dk.camelot64.kickc.model.Program;
import dk.camelot64.kickc.model.statements.Statement;
import dk.camelot64.kickc.model.symbols.ArraySpec;
import dk.camelot64.kickc.model.symbols.ProgramScope;
import dk.camelot64.kickc.model.symbols.StructDefinition;
import dk.camelot64.kickc.model.types.SymbolType;
import dk.camelot64.kickc.model.values.LValue;
import dk.camelot64.kickc.model.values.RValue;
import dk.camelot64.kickc.model.values.ValueList;
import dk.camelot64.kickc.passes.Pass1UnwindStructValues;
import java.util.ListIterator;
/** A struct value list - typically an initializer <code>struct Point p = { x, y };</code>. */
public class ValueSourceStructValueList extends ValueSourceBase {
private final StructDefinition structDefinition;
private final ValueList valueList;
public ValueSourceStructValueList(ValueList valueList, StructDefinition structDefinition) {
this.valueList = valueList;
this.structDefinition = structDefinition;
}
@Override
public SymbolType getSymbolType() {
return structDefinition.getType();
}
@Override
public ArraySpec getArraySpec() {
return null;
}
@Override
protected boolean isStructClassic() {
return false;
}
@Override
public RValue getSimpleValue(ProgramScope programScope) {
throw new InternalError("Not a simple value");
}
@Override
public LValue getBulkLValue(ProgramScope scope) {
throw new InternalError("Not a bulk value");
}
@Override
public RValue getBulkRValue(ProgramScope scope) {
throw new InternalError("Not a bulk value");
}
@Override
public ValueSource getMemberUnwinding(String memberName, Program program, ProgramScope programScope, Statement currentStmt, ControlFlowBlock currentBlock, ListIterator<Statement> stmtIt) {
int memberIndex = getMemberNames(programScope).indexOf(memberName);
final RValue memberValue = valueList.getList().get(memberIndex);
final ValueSource valueSource = Pass1UnwindStructValues.getValueSource(program, programScope, memberValue, currentStmt, stmtIt, currentBlock);
return valueSource;
}
}

View File

@ -208,8 +208,8 @@ startProcessing: {
.label spritePtr = $17
// Busy-wait while finding an empty slot in the PROCESSING array
.label freeIdx = 2
.label __44 = $e
.label __45 = $c
.label __35 = $e
.label __36 = $c
ldx #$ff
__b1:
lda #0
@ -241,19 +241,19 @@ startProcessing: {
sta.z __0+1
lda.z __0
asl
sta.z __44
sta.z __35
lda.z __0+1
rol
sta.z __44+1
asl.z __44
rol.z __44+1
lda.z __45
sta.z __35+1
asl.z __35
rol.z __35+1
lda.z __36
clc
adc.z __44
sta.z __45
lda.z __45+1
adc.z __44+1
sta.z __45+1
adc.z __35
sta.z __36
lda.z __36+1
adc.z __35+1
sta.z __36+1
asl.z __1
rol.z __1+1
asl.z __1

View File

@ -90,11 +90,11 @@ startProcessing::@1: scope:[startProcessing] from startProcessing startProcessi
to:startProcessing::@2
startProcessing::@2: scope:[startProcessing] from startProcessing::@1 startProcessing::@3
[46] (byte) startProcessing::i#2 ← phi( startProcessing::@1/(byte) 0 startProcessing::@3/(byte) startProcessing::i#1 )
[47] (byte~) startProcessing::$39 ← (byte) startProcessing::i#2 << (byte) 1
[48] (byte~) startProcessing::$40 ← (byte~) startProcessing::$39 + (byte) startProcessing::i#2
[49] (byte~) startProcessing::$41 ← (byte~) startProcessing::$40 << (byte) 1
[50] (byte~) startProcessing::$42 ← (byte~) startProcessing::$41 + (byte) startProcessing::i#2
[51] (byte~) startProcessing::$27 ← (byte~) startProcessing::$42 << (byte) 1
[47] (byte~) startProcessing::$30 ← (byte) startProcessing::i#2 << (byte) 1
[48] (byte~) startProcessing::$31 ← (byte~) startProcessing::$30 + (byte) startProcessing::i#2
[49] (byte~) startProcessing::$32 ← (byte~) startProcessing::$31 << (byte) 1
[50] (byte~) startProcessing::$33 ← (byte~) startProcessing::$32 + (byte) startProcessing::i#2
[51] (byte~) startProcessing::$27 ← (byte~) startProcessing::$33 << (byte) 1
[52] if(*((byte*)(const struct ProcessingSprite*) PROCESSING+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS + (byte~) startProcessing::$27)!=(const byte) STATUS_FREE) goto startProcessing::@3
to:startProcessing::@4
startProcessing::@4: scope:[startProcessing] from startProcessing::@2 startProcessing::@9
@ -103,9 +103,9 @@ startProcessing::@4: scope:[startProcessing] from startProcessing::@2 startProc
to:startProcessing::@5
startProcessing::@5: scope:[startProcessing] from startProcessing::@4
[55] (word~) startProcessing::$0 ← (word)(byte) startProcessing::center_y#0
[56] (word~) startProcessing::$44 ← (word~) startProcessing::$0 << (byte) 2
[57] (word~) startProcessing::$45 ← (word~) startProcessing::$44 + (word~) startProcessing::$0
[58] (word~) startProcessing::$1 ← (word~) startProcessing::$45 << (byte) 3
[56] (word~) startProcessing::$35 ← (word~) startProcessing::$0 << (byte) 2
[57] (word~) startProcessing::$36 ← (word~) startProcessing::$35 + (word~) startProcessing::$0
[58] (word~) startProcessing::$1 ← (word~) startProcessing::$36 << (byte) 3
[59] (word) startProcessing::offset#0 ← (word~) startProcessing::$1 + (byte) startProcessing::center_x#0
[60] (byte*) startProcessing::colPtr#0 ← (const byte*) COLS + (word) startProcessing::offset#0
[61] (byte) startProcessing::spriteCol#0 ← *((byte*) startProcessing::colPtr#0)
@ -144,11 +144,11 @@ startProcessing::@7: scope:[startProcessing] from startProcessing::@6
[88] (byte) startProcessing::spritePtr#0 ← (byte)(const byte*) SPRITE_DATA/(byte) $40 + (byte) startProcessing::freeIdx#2
[89] (byte~) startProcessing::$20 ← (byte) startProcessing::freeIdx#2 << (byte) 3
[90] (word~) startProcessing::$21 ← (word)(byte~) startProcessing::$20
[91] (byte~) startProcessing::$47 ← (byte) startProcessing::freeIdx#2 << (byte) 1
[92] (byte~) startProcessing::$48 ← (byte~) startProcessing::$47 + (byte) startProcessing::freeIdx#2
[93] (byte~) startProcessing::$49 ← (byte~) startProcessing::$48 << (byte) 1
[94] (byte~) startProcessing::$50 ← (byte~) startProcessing::$49 + (byte) startProcessing::freeIdx#2
[95] (byte~) startProcessing::$28 ← (byte~) startProcessing::$50 << (byte) 1
[91] (byte~) startProcessing::$38 ← (byte) startProcessing::freeIdx#2 << (byte) 1
[92] (byte~) startProcessing::$39 ← (byte~) startProcessing::$38 + (byte) startProcessing::freeIdx#2
[93] (byte~) startProcessing::$40 ← (byte~) startProcessing::$39 << (byte) 1
[94] (byte~) startProcessing::$41 ← (byte~) startProcessing::$40 + (byte) startProcessing::freeIdx#2
[95] (byte~) startProcessing::$28 ← (byte~) startProcessing::$41 << (byte) 1
[96] *((word*)(const struct ProcessingSprite*) PROCESSING + (byte~) startProcessing::$28) ← (word) startProcessing::spriteX#0
[97] *((word*)(const struct ProcessingSprite*) PROCESSING+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_Y + (byte~) startProcessing::$28) ← (word) startProcessing::spriteY#0
[98] *((word*)(const struct ProcessingSprite*) PROCESSING+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_VX + (byte~) startProcessing::$28) ← (word~) startProcessing::$21

File diff suppressed because it is too large Load Diff

View File

@ -404,17 +404,17 @@ interrupt(HARDWARE_ALL)(void()) irqTop()
(word~) startProcessing::$21 zp[2]:24 0.5
(byte~) startProcessing::$27 reg byte a 2002.0
(byte~) startProcessing::$28 reg byte x 2.2222222222222228
(byte~) startProcessing::$39 reg byte a 2002.0
(byte~) startProcessing::$40 reg byte a 2002.0
(byte~) startProcessing::$41 reg byte a 2002.0
(byte~) startProcessing::$42 reg byte a 2002.0
(word~) startProcessing::$44 zp[2]:14 4.0
(word~) startProcessing::$45 zp[2]:12 4.0
(byte~) startProcessing::$47 reg byte a 4.0
(byte~) startProcessing::$48 reg byte a 4.0
(byte~) startProcessing::$49 reg byte a 4.0
(byte~) startProcessing::$30 reg byte a 2002.0
(byte~) startProcessing::$31 reg byte a 2002.0
(byte~) startProcessing::$32 reg byte a 2002.0
(byte~) startProcessing::$33 reg byte a 2002.0
(word~) startProcessing::$35 zp[2]:14 4.0
(word~) startProcessing::$36 zp[2]:12 4.0
(byte~) startProcessing::$38 reg byte a 4.0
(byte~) startProcessing::$39 reg byte a 4.0
(byte~) startProcessing::$40 reg byte a 4.0
(byte~) startProcessing::$41 reg byte a 4.0
(word~) startProcessing::$5 zp[2]:3 4.0
(byte~) startProcessing::$50 reg byte a 4.0
(word~) startProcessing::$6 zp[2]:3 4.0
(word~) startProcessing::$8 zp[2]:28 4.0
(word~) startProcessing::$9 zp[2]:28 4.0
@ -495,13 +495,13 @@ reg byte x [ getCharToProcess::return_dist#0 ]
reg byte y [ main::center_x#0 ]
zp[1]:11 [ main::center_y#0 startProcessing::center_y#0 getCharToProcess::closest_y#7 getCharToProcess::closest_y#9 getCharToProcess::return_y#1 getCharToProcess::return_y#7 ]
reg byte a [ main::center_dist#0 ]
reg byte a [ startProcessing::$39 ]
reg byte a [ startProcessing::$40 ]
reg byte a [ startProcessing::$41 ]
reg byte a [ startProcessing::$42 ]
reg byte a [ startProcessing::$30 ]
reg byte a [ startProcessing::$31 ]
reg byte a [ startProcessing::$32 ]
reg byte a [ startProcessing::$33 ]
reg byte a [ startProcessing::$27 ]
zp[2]:12 [ startProcessing::$0 startProcessing::$45 startProcessing::$1 startProcessing::offset#0 startProcessing::screenPtr#0 atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ]
zp[2]:14 [ startProcessing::$44 atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ]
zp[2]:12 [ startProcessing::$0 startProcessing::$36 startProcessing::$1 startProcessing::offset#0 startProcessing::screenPtr#0 atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ]
zp[2]:14 [ startProcessing::$35 atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ]
zp[2]:16 [ startProcessing::colPtr#0 atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 atan2_16::return#2 init_angle_screen::angle_w#0 init_angle_screen::$11 ]
zp[1]:18 [ startProcessing::spriteCol#0 init_angle_screen::x#2 init_angle_screen::x#1 getCharToProcess::closest_dist#2 getCharToProcess::closest_dist#8 getCharToProcess::closest_dist#10 getCharToProcess::closest_dist#12 ]
reg byte a [ startProcessing::ch#0 ]
@ -509,10 +509,10 @@ zp[2]:19 [ startProcessing::$11 startProcessing::$12 startProcessing::$13 startP
zp[2]:21 [ startProcessing::$15 startProcessing::$16 startProcessing::$17 startProcessing::spriteY#0 atan2_16::xd#5 atan2_16::xd#3 atan2_16::xd#10 atan2_16::xd#1 atan2_16::xd#2 ]
zp[1]:23 [ startProcessing::spritePtr#0 init_angle_screen::xb#2 init_angle_screen::xb#1 getCharToProcess::closest_x#7 getCharToProcess::closest_x#9 getCharToProcess::return_x#1 getCharToProcess::return_x#7 ]
reg byte a [ startProcessing::$20 ]
reg byte a [ startProcessing::$47 ]
reg byte a [ startProcessing::$48 ]
reg byte a [ startProcessing::$49 ]
reg byte a [ startProcessing::$50 ]
reg byte a [ startProcessing::$38 ]
reg byte a [ startProcessing::$39 ]
reg byte a [ startProcessing::$40 ]
reg byte a [ startProcessing::$41 ]
reg byte x [ startProcessing::$28 ]
zp[2]:24 [ getCharToProcess::$8 getCharToProcess::$13 getCharToProcess::$9 getCharToProcess::$10 startProcessing::$21 heap_head#5 heap_head#1 init_angle_screen::screen_bottomline#6 init_angle_screen::screen_bottomline#0 init_angle_screen::screen_bottomline#1 init_angle_screen::screen#0 ]
reg byte a [ init_angle_screen::$3 ]

View File

@ -71,8 +71,8 @@ show_letter::@1: scope:[show_letter] from show_letter show_letter::@9
[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::$24 ← (byte) show_letter::i#10 << (byte) 3
[30] (byte~) show_letter::$20 ← (byte~) show_letter::$24 + (byte) show_letter::i#10
[29] (byte~) show_letter::$23 ← (byte) show_letter::i#10 << (byte) 3
[30] (byte~) show_letter::$20 ← (byte~) show_letter::$23 + (byte) show_letter::i#10
[31] (signed word) show_letter::to_x#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) show_letter::$20)
[32] (signed word) show_letter::to_y#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) show_letter::$20)
[33] (signed word) show_letter::to_x#1 ← (signed word) show_letter::to_x#0 - (signed byte) $32
@ -89,8 +89,8 @@ show_letter::@6: scope:[show_letter] from show_letter::@1
[42] (signed word) show_letter::to_y#2 ← (signed word) rotate::return_y#0
[43] (signed word) show_letter::current_x#10 ← (signed word) show_letter::to_x#2 + (signed byte) $64
[44] (signed word) show_letter::current_y#10 ← (signed word) show_letter::to_y#2 + (signed byte) $64
[45] (byte~) show_letter::$26 ← (byte) show_letter::i#10 << (byte) 3
[46] (byte~) show_letter::$21 ← (byte~) show_letter::$26 + (byte) show_letter::i#10
[45] (byte~) show_letter::$25 ← (byte) show_letter::i#10 << (byte) 3
[46] (byte~) show_letter::$21 ← (byte~) show_letter::$25 + (byte) show_letter::i#10
[47] (signed word) show_letter::via_x#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_VIA + (byte~) show_letter::$21)
[48] (signed word) show_letter::via_y#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_VIA+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) show_letter::$21)
[49] (signed word) show_letter::via_x#1 ← (signed word) show_letter::via_x#0 - (signed byte) $32
@ -107,8 +107,8 @@ show_letter::@7: scope:[show_letter] from show_letter::@6
[58] (signed word) show_letter::via_y#2 ← (signed word) rotate::return_y#1
[59] (signed word) show_letter::segment_via_x#0 ← (signed word) show_letter::via_x#2 + (signed byte) $64
[60] (signed word) show_letter::segment_via_y#0 ← (signed word) show_letter::via_y#2 + (signed byte) $64
[61] (byte~) show_letter::$28 ← (byte) show_letter::i#10 << (byte) 3
[62] (byte~) show_letter::$22 ← (byte~) show_letter::$28 + (byte) show_letter::i#10
[61] (byte~) show_letter::$27 ← (byte) show_letter::i#10 << (byte) 3
[62] (byte~) show_letter::$22 ← (byte~) show_letter::$27 + (byte) show_letter::i#10
[63] (byte) show_letter::segment_type#0 ← *((byte*)(const struct Segment*) letter_c + (byte~) show_letter::$22)
[64] if((byte) show_letter::segment_type#0==(const byte) MOVE_TO) goto show_letter::@3
to:show_letter::@4

File diff suppressed because it is too large Load Diff

View File

@ -411,9 +411,9 @@
(byte~) show_letter::$20 reg byte x 151.5
(byte~) show_letter::$21 reg byte x 151.5
(byte~) show_letter::$22 reg byte a 202.0
(byte~) show_letter::$24 reg byte a 202.0
(byte~) show_letter::$26 reg byte a 202.0
(byte~) show_letter::$28 reg byte a 202.0
(byte~) show_letter::$23 reg byte a 202.0
(byte~) show_letter::$25 reg byte a 202.0
(byte~) show_letter::$27 reg byte a 202.0
(struct SplineVector16~) show_letter::$7
(label) show_letter::@1
(label) show_letter::@2
@ -438,10 +438,12 @@
(byte) show_letter::i
(byte) show_letter::i#1 i zp[1]:19 75.75
(byte) show_letter::i#10 i zp[1]:19 15.538461538461537
(struct SplineVector16) show_letter::segment_to
(signed word) show_letter::segment_to_x
(signed word) show_letter::segment_to_y
(byte) show_letter::segment_type
(byte) show_letter::segment_type#0 reg byte a 151.5
(struct SplineVector16) show_letter::segment_via
(signed word) show_letter::segment_via_x
(signed word) show_letter::segment_via_x#0 segment_via_x zp[2]:32 22.444444444444443
(signed word) show_letter::segment_via_y
@ -549,13 +551,13 @@ zp[1]:18 [ mulf_init::c#2 mulf_init::c#1 main::angle#2 main::angle#1 show_letter
reg byte x [ mulf_init::x_2#3 mulf_init::x_2#2 mulf_init::x_2#1 ]
reg byte x [ mulf_init::x_255#2 mulf_init::x_255#1 ]
zp[1]:19 [ mulf_init::dir#2 mulf_init::dir#4 show_letter::i#10 show_letter::i#1 ]
reg byte a [ show_letter::$24 ]
reg byte a [ show_letter::$23 ]
reg byte x [ show_letter::$20 ]
zp[2]:20 [ show_letter::current_x#10 spline_8segB::p2_x#0 mulf_init::sqr1_lo#2 mulf_init::sqr1_lo#1 ]
zp[2]:22 [ show_letter::current_y#10 spline_8segB::p2_y#0 mulf_init::sqr1_hi#2 mulf_init::sqr1_hi#1 ]
reg byte a [ show_letter::$26 ]
reg byte a [ show_letter::$25 ]
reg byte x [ show_letter::$21 ]
reg byte a [ show_letter::$28 ]
reg byte a [ show_letter::$27 ]
reg byte a [ show_letter::$22 ]
reg byte a [ show_letter::segment_type#0 ]
reg byte x [ bitmap_plot_spline_8seg::$8 ]

View File

@ -1,13 +1,12 @@
Adding value bulk copy *(&(struct Point) main::p1) ← memcpy(*(&(const struct Point) $0), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Adding value bulk copy *(&(struct Point) main::p2) ← memcpy(*(&(const struct Point) $1), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Adding struct value member variable copy *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P) ← (struct Point) main::p1
Adding struct value member variable copy *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q) ← (struct Point) main::p2
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q)
Unwinding value copy (struct Vector) main::v ← (struct Vector){ (struct Point) main::p1, (struct Point) main::p2 }
Adding value bulk copy *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P) ← memcpy(*(&(struct Point) main::p1), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Adding value bulk copy *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q) ← memcpy(*(&(struct Point) main::p2), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q)
Rewriting struct pointer member access *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P).x
Rewriting struct pointer member access *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P).y
Rewriting struct pointer member access *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q).x

View File

@ -18,8 +18,9 @@ Converted procedure call LValue to member unwinding { (byte~) main::$1_x, (byte~
Unwinding value copy (struct Point) main::point2 ← (struct Point~) main::$1
Adding value simple copy *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$1_x
Adding value simple copy *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte~) main::$1_y
Adding struct value member variable copy (byte) getPoint::p_x ← (byte) getPoint::x
Adding struct value member variable copy (byte) getPoint::p_y ← (byte) getPoint::y
Unwinding value copy (struct Point) getPoint::p ← (struct Point){ (byte) getPoint::x, (byte) getPoint::y }
Adding value simple copy (byte) getPoint::p_x ← (byte) getPoint::x
Adding value simple copy (byte) getPoint::p_y ← (byte) getPoint::y
Unwinding value copy (struct Point) getPoint::return ← (struct Point) getPoint::p
Adding value simple copy (byte) getPoint::return_x ← (byte) getPoint::p_x
Adding value simple copy (byte) getPoint::return_y ← (byte) getPoint::p_y

View File

@ -1,8 +1,9 @@
Created struct value member variable (byte) main::p_x
Created struct value member variable (byte) main::p_y
Converted struct value to member variables (struct Point) main::p
Adding struct value member variable copy (byte) main::p_x ← (byte) main::x
Adding struct value member variable copy (byte) main::p_y ← (number~) main::$0
Unwinding value copy (struct Point) main::p ← (struct Point){ (byte) main::x, (number~) main::$0 }
Adding value simple copy (byte) main::p_x ← (byte) main::x
Adding value simple copy (byte) main::p_y ← (number~) main::$0
Replacing struct member reference (struct Point) main::p.x with member unwinding reference (byte) main::p_x
Replacing struct member reference (struct Point) main::p.y with member unwinding reference (byte) main::p_y
Identified constant variable (byte) main::x

View File

@ -48,42 +48,36 @@ Adding value simple copy (byte) main::v2_p_y ← (byte) main::v1_p_y
Unwinding value copy (struct Vector) main::v2 ← (struct Vector) main::v1
Adding value simple copy (byte) main::v2_q_x ← (byte) main::v1_q_x
Adding value simple copy (byte) main::v2_q_y ← (byte) main::v1_q_y
Adding struct value member variable copy (struct Point) main::v3_p ← (struct Vector) main::v1.p
Adding struct value member variable copy (struct Point) main::v3_q ← { x: (byte) 6, y: (byte) 7 }
Adding struct value member variable copy (struct Point) main::v4_p ← (struct Point){ (struct Vector) main::v1.p.x, (struct Vector) main::v1.p.y }
Adding struct value member variable copy (struct Point) main::v4_q ← { x: (byte) 8, y: (byte) 9 }
Replacing struct member reference (struct Vector) main::v1.p with member unwinding reference (struct Point) main::v1_p
Replacing struct member reference (struct Vector) main::v1.p with member unwinding reference (struct Point) main::v1_p
Replacing struct member reference (struct Vector) main::v1.p with member unwinding reference (struct Point) main::v1_p
Replacing struct member reference (struct Vector) main::v1.p with member unwinding reference (struct Point) main::v1_p
Replacing struct member reference (struct Vector) main::v1.p with member unwinding reference (struct Point) main::v1_p
Replacing struct member reference (struct Vector) main::v1.q with member unwinding reference (struct Point) main::v1_q
Replacing struct member reference (struct Vector) main::v1.q with member unwinding reference (struct Point) main::v1_q
Replacing struct member reference (struct Vector) main::v2.p with member unwinding reference (struct Point) main::v2_p
Replacing struct member reference (struct Vector) main::v2.p with member unwinding reference (struct Point) main::v2_p
Replacing struct member reference (struct Vector) main::v2.q with member unwinding reference (struct Point) main::v2_q
Replacing struct member reference (struct Vector) main::v2.q with member unwinding reference (struct Point) main::v2_q
Replacing struct member reference (struct Vector) main::v3.p with member unwinding reference (struct Point) main::v3_p
Replacing struct member reference (struct Vector) main::v3.p with member unwinding reference (struct Point) main::v3_p
Replacing struct member reference (struct Vector) main::v3.q with member unwinding reference (struct Point) main::v3_q
Replacing struct member reference (struct Vector) main::v3.q with member unwinding reference (struct Point) main::v3_q
Replacing struct member reference (struct Vector) main::v4.p with member unwinding reference (struct Point) main::v4_p
Replacing struct member reference (struct Vector) main::v4.p with member unwinding reference (struct Point) main::v4_p
Replacing struct member reference (struct Vector) main::v4.q with member unwinding reference (struct Point) main::v4_q
Replacing struct member reference (struct Vector) main::v4.q with member unwinding reference (struct Point) main::v4_q
Unwinding value copy (struct Point) main::v3_p ← (struct Point) main::v1_p
Unwinding value copy (struct Vector) main::v3 ← (struct Vector){ (struct Vector) main::v1.p, { x: (byte) 6, y: (byte) 7 } }
Unwinding value copy (struct Vector) main::v3 ← (struct Vector){ (struct Vector) main::v1.p, { x: (byte) 6, y: (byte) 7 } }
Adding value simple copy (byte) main::v3_p_x ← (byte) main::v1_p_x
Adding value simple copy (byte) main::v3_p_y ← (byte) main::v1_p_y
Unwinding value copy (struct Point) main::v3_q ← { x: (byte) 6, y: (byte) 7 }
Unwinding value copy (struct Vector) main::v3 ← (struct Vector){ (struct Vector) main::v1.p, { x: (byte) 6, y: (byte) 7 } }
Adding value simple copy (byte) main::v3_q_x ← (byte) 6
Adding value simple copy (byte) main::v3_q_y ← (byte) 7
Adding struct value member variable copy (byte) main::v4_p_x ← (struct Point) main::v1_p.x
Adding struct value member variable copy (byte) main::v4_p_y ← (struct Point) main::v1_p.y
Unwinding value copy (struct Point) main::v4_q ← { x: (byte) 8, y: (byte) 9 }
Unwinding value copy (struct Vector) main::v4 ← (struct Vector){ (struct Point){ (struct Vector) main::v1.p.x, (struct Vector) main::v1.p.y }, { x: (byte) 8, y: (byte) 9 } }
Unwinding value copy (struct Vector) main::v4 ← (struct Vector){ (struct Point){ (struct Vector) main::v1.p.x, (struct Vector) main::v1.p.y }, { x: (byte) 8, y: (byte) 9 } }
Adding value simple copy (byte) main::v4_p_x ← (byte) main::v1_p_x
Adding value simple copy (byte) main::v4_p_y ← (byte) main::v1_p_y
Unwinding value copy (struct Vector) main::v4 ← (struct Vector){ (struct Point){ (struct Vector) main::v1.p.x, (struct Vector) main::v1.p.y }, { x: (byte) 8, y: (byte) 9 } }
Adding value simple copy (byte) main::v4_q_x ← (byte) 8
Adding value simple copy (byte) main::v4_q_y ← (byte) 9
Replacing struct member reference (struct Point) main::v1_p.x with member unwinding reference (byte) main::v1_p_x
Replacing struct member reference (struct Point) main::v1_p.y with member unwinding reference (byte) main::v1_p_y
Replacing struct member reference (struct Vector) main::v1.p with member unwinding reference (struct Point) main::v1_p
Replacing struct member reference (struct Vector) main::v1.p with member unwinding reference (struct Point) main::v1_p
Replacing struct member reference (struct Vector) main::v1.q with member unwinding reference (struct Point) main::v1_q
Replacing struct member reference (struct Vector) main::v1.q with member unwinding reference (struct Point) main::v1_q
Replacing struct member reference (struct Vector) main::v2.p with member unwinding reference (struct Point) main::v2_p
Replacing struct member reference (struct Vector) main::v2.p with member unwinding reference (struct Point) main::v2_p
Replacing struct member reference (struct Vector) main::v2.q with member unwinding reference (struct Point) main::v2_q
Replacing struct member reference (struct Vector) main::v2.q with member unwinding reference (struct Point) main::v2_q
Replacing struct member reference (struct Vector) main::v3.p with member unwinding reference (struct Point) main::v3_p
Replacing struct member reference (struct Vector) main::v3.p with member unwinding reference (struct Point) main::v3_p
Replacing struct member reference (struct Vector) main::v3.q with member unwinding reference (struct Point) main::v3_q
Replacing struct member reference (struct Vector) main::v3.q with member unwinding reference (struct Point) main::v3_q
Replacing struct member reference (struct Vector) main::v4.p with member unwinding reference (struct Point) main::v4_p
Replacing struct member reference (struct Vector) main::v4.p with member unwinding reference (struct Point) main::v4_p
Replacing struct member reference (struct Vector) main::v4.q with member unwinding reference (struct Point) main::v4_q
Replacing struct member reference (struct Vector) main::v4.q with member unwinding reference (struct Point) main::v4_q
Replacing struct member reference (struct Point) main::v1_p.x with member unwinding reference (byte) main::v1_p_x
Replacing struct member reference (struct Point) main::v1_p.y with member unwinding reference (byte) main::v1_p_y
Replacing struct member reference (struct Point) main::v1_q.x with member unwinding reference (byte) main::v1_q_x
@ -213,16 +207,20 @@ SYMBOL TABLE SSA
(byte) main::v2_q_x#0
(byte) main::v2_q_y
(byte) main::v2_q_y#0
(struct Point) main::v3_p
(byte) main::v3_p_x
(byte) main::v3_p_x#0
(byte) main::v3_p_y
(byte) main::v3_p_y#0
(struct Point) main::v3_q
(const byte) main::v3_q_x = (byte) 6
(const byte) main::v3_q_y = (byte) 7
(struct Point) main::v4_p
(byte) main::v4_p_x
(byte) main::v4_p_x#0
(byte) main::v4_p_y
(byte) main::v4_p_y#0
(struct Point) main::v4_q
(const byte) main::v4_q_x = (byte) 8
(const byte) main::v4_q_y = (byte) 9
@ -454,10 +452,14 @@ VARIABLE REGISTER WEIGHTS
(struct Point) main::v2_q
(byte) main::v2_q_x
(byte) main::v2_q_y
(struct Point) main::v3_p
(byte) main::v3_p_x
(byte) main::v3_p_y
(struct Point) main::v3_q
(struct Point) main::v4_p
(byte) main::v4_p_x
(byte) main::v4_p_y
(struct Point) main::v4_q
Initial phi equivalence classes
Complete equivalence classes
@ -713,12 +715,16 @@ FINAL SYMBOL TABLE
(struct Point) main::v2_q
(byte) main::v2_q_x
(byte) main::v2_q_y
(struct Point) main::v3_p
(byte) main::v3_p_x
(byte) main::v3_p_y
(struct Point) main::v3_q
(const byte) main::v3_q_x = (byte) 6
(const byte) main::v3_q_y = (byte) 7
(struct Point) main::v4_p
(byte) main::v4_p_x
(byte) main::v4_p_y
(struct Point) main::v4_q
(const byte) main::v4_q_x = (byte) 8
(const byte) main::v4_q_y = (byte) 9

View File

@ -21,12 +21,16 @@
(struct Point) main::v2_q
(byte) main::v2_q_x
(byte) main::v2_q_y
(struct Point) main::v3_p
(byte) main::v3_p_x
(byte) main::v3_p_y
(struct Point) main::v3_q
(const byte) main::v3_q_x = (byte) 6
(const byte) main::v3_q_y = (byte) 7
(struct Point) main::v4_p
(byte) main::v4_p_x
(byte) main::v4_p_y
(struct Point) main::v4_q
(const byte) main::v4_q_x = (byte) 8
(const byte) main::v4_q_y = (byte) 9

View File

@ -5,8 +5,8 @@
.label SCREEN = $400
.const OFFSET_STRUCT_POINT_Y = 1
.const OFFSET_STRUCT_VECTOR_Q = 2
.const SIZEOF_STRUCT_VECTOR = 4
.const SIZEOF_STRUCT_POINT = 2
.const SIZEOF_STRUCT_VECTOR = 4
main: {
.const v1_p_x = 2
.const v1_p_y = 3

View File

@ -30,41 +30,37 @@ Adding value simple copy *((byte*)(struct Point*)&(struct Vector) main::v2+(cons
Unwinding value copy (struct Vector) main::v2 ← (struct Vector) main::v1
Adding value simple copy *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) main::v1_q_x
Adding value simple copy *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte) main::v1_q_y
Adding struct value member variable copy *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P) ← (struct Vector) main::v2.p
Adding struct value member variable copy *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q) ← { x: (byte) 6, y: (byte) 7 }
Adding value bulk copy *(&(struct Vector) main::v4) ← memcpy(*(&(struct Vector) main::v3), struct Vector, (const byte) SIZEOF_STRUCT_VECTOR)
Adding struct value member variable copy (struct Point) main::v5_p ← (struct Point){ (struct Vector) main::v4.p.x, (struct Vector) main::v4.p.y }
Adding struct value member variable copy (struct Point) main::v5_q ← { x: (byte) 8, y: (byte) 9 }
Replacing struct member reference (struct Vector) main::v2.p with member unwinding reference *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v4.p with member unwinding reference *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v4.p with member unwinding reference *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v1.p with member unwinding reference (struct Point) main::v1_p
Replacing struct member reference (struct Vector) main::v1.p with member unwinding reference (struct Point) main::v1_p
Replacing struct member reference (struct Vector) main::v1.q with member unwinding reference (struct Point) main::v1_q
Replacing struct member reference (struct Vector) main::v1.q with member unwinding reference (struct Point) main::v1_q
Replacing struct member reference (struct Vector) main::v2.p with member unwinding reference *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v2.p with member unwinding reference *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v2.q with member unwinding reference *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v2.q with member unwinding reference *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v3.p with member unwinding reference *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v3.p with member unwinding reference *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v3.q with member unwinding reference *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v3.q with member unwinding reference *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v4.p with member unwinding reference *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v4.p with member unwinding reference *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v4.q with member unwinding reference *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v4.q with member unwinding reference *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v5.p with member unwinding reference (struct Point) main::v5_p
Replacing struct member reference (struct Vector) main::v5.p with member unwinding reference (struct Point) main::v5_p
Replacing struct member reference (struct Vector) main::v5.q with member unwinding reference (struct Point) main::v5_q
Replacing struct member reference (struct Vector) main::v5.q with member unwinding reference (struct Point) main::v5_q
Unwinding value copy (struct Vector) main::v3 ← (struct Vector){ (struct Vector) main::v2.p, { x: (byte) 6, y: (byte) 7 } }
Adding value bulk copy *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P) ← memcpy(*((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Adding value bulk copy *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q) ← memcpy(*(&(const struct Point) $0), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Adding struct value member variable copy (byte) main::v5_p_x ← *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P).x
Adding struct value member variable copy (byte) main::v5_p_y ← *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P).y
Unwinding value copy (struct Point) main::v5_q ← { x: (byte) 8, y: (byte) 9 }
Adding value bulk copy *(&(struct Vector) main::v4) ← memcpy(*(&(struct Vector) main::v3), struct Vector, (const byte) SIZEOF_STRUCT_VECTOR)
Unwinding value copy (struct Vector) main::v5 ← (struct Vector){ (struct Point){ (struct Vector) main::v4.p.x, (struct Vector) main::v4.p.y }, { x: (byte) 8, y: (byte) 9 } }
Unwinding value copy (struct Vector) main::v5 ← (struct Vector){ (struct Point){ (struct Vector) main::v4.p.x, (struct Vector) main::v4.p.y }, { x: (byte) 8, y: (byte) 9 } }
Adding value simple copy (byte) main::v5_p_x ← *((byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_X)
Adding value simple copy (byte) main::v5_p_y ← *((byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_Y)
Unwinding value copy (struct Vector) main::v5 ← (struct Vector){ (struct Point){ (struct Vector) main::v4.p.x, (struct Vector) main::v4.p.y }, { x: (byte) 8, y: (byte) 9 } }
Adding value simple copy (byte) main::v5_q_x ← (byte) 8
Adding value simple copy (byte) main::v5_q_y ← (byte) 9
Replacing struct member reference (struct Vector) main::v1.p with member unwinding reference (struct Point) main::v1_p
Replacing struct member reference (struct Vector) main::v1.p with member unwinding reference (struct Point) main::v1_p
Replacing struct member reference (struct Vector) main::v1.q with member unwinding reference (struct Point) main::v1_q
Replacing struct member reference (struct Vector) main::v1.q with member unwinding reference (struct Point) main::v1_q
Replacing struct member reference (struct Vector) main::v2.p with member unwinding reference *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v2.p with member unwinding reference *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v2.q with member unwinding reference *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v2.q with member unwinding reference *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v3.p with member unwinding reference *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v3.p with member unwinding reference *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v3.q with member unwinding reference *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v3.q with member unwinding reference *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v4.p with member unwinding reference *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v4.p with member unwinding reference *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P)
Replacing struct member reference (struct Vector) main::v4.q with member unwinding reference *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v4.q with member unwinding reference *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q)
Replacing struct member reference (struct Vector) main::v5.p with member unwinding reference (struct Point) main::v5_p
Replacing struct member reference (struct Vector) main::v5.p with member unwinding reference (struct Point) main::v5_p
Replacing struct member reference (struct Vector) main::v5.q with member unwinding reference (struct Point) main::v5_q
Replacing struct member reference (struct Vector) main::v5.q with member unwinding reference (struct Point) main::v5_q
Replacing struct member reference (struct Point) main::v1_p.x with member unwinding reference (byte) main::v1_p_x
Replacing struct member reference (struct Point) main::v1_p.y with member unwinding reference (byte) main::v1_p_y
Replacing struct member reference (struct Point) main::v1_q.x with member unwinding reference (byte) main::v1_q_x
@ -73,8 +69,6 @@ Replacing struct member reference (struct Point) main::v5_p.x with member unwind
Replacing struct member reference (struct Point) main::v5_p.y with member unwinding reference (byte) main::v5_p_y
Replacing struct member reference (struct Point) main::v5_q.x with member unwinding reference (byte) main::v5_q_x
Replacing struct member reference (struct Point) main::v5_q.y with member unwinding reference (byte) main::v5_q_y
Rewriting struct pointer member access *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P).x
Rewriting struct pointer member access *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P).y
Rewriting struct pointer member access *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P).x
Rewriting struct pointer member access *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P).y
Rewriting struct pointer member access *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q).x
@ -111,10 +105,8 @@ main: scope:[main] from @1
(struct Vector) main::v3 ← struct-unwound {*((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q)}
*(&(struct Vector) main::v4) ← memcpy(*(&(struct Vector) main::v3), struct Vector, (const byte) SIZEOF_STRUCT_VECTOR)
(struct Vector) main::v4 ← struct-unwound {*(&(struct Vector) main::v4)}
(byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
(byte) main::v5_p_x#0 ← *((byte*~) main::$0)
(byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
(byte) main::v5_p_y#0 ← *((byte*~) main::$1)
(byte) main::v5_p_x#0 ← *((byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_X)
(byte) main::v5_p_y#0 ← *((byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_Y)
*((const byte*) SCREEN + (byte) main::idx#0) ← (const byte) main::v1_p_x
(byte) main::idx#1 ← ++ (byte) main::idx#0
*((const byte*) SCREEN + (byte) main::idx#1) ← (const byte) main::v1_p_y
@ -123,41 +115,41 @@ main: scope:[main] from @1
(byte) main::idx#3 ← ++ (byte) main::idx#2
*((const byte*) SCREEN + (byte) main::idx#3) ← (const byte) main::v1_q_y
(byte) main::idx#4 ← ++ (byte) main::idx#3
(byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#4) ← *((byte*~) main::$2)
(byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#4) ← *((byte*~) main::$0)
(byte) main::idx#5 ← ++ (byte) main::idx#4
(byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#5) ← *((byte*~) main::$3)
(byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#5) ← *((byte*~) main::$1)
(byte) main::idx#6 ← ++ (byte) main::idx#5
(byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#6) ← *((byte*~) main::$4)
(byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#6) ← *((byte*~) main::$2)
(byte) main::idx#7 ← ++ (byte) main::idx#6
(byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#7) ← *((byte*~) main::$5)
(byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#7) ← *((byte*~) main::$3)
(byte) main::idx#8 ← ++ (byte) main::idx#7
(byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#8) ← *((byte*~) main::$6)
(byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#8) ← *((byte*~) main::$4)
(byte) main::idx#9 ← ++ (byte) main::idx#8
(byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#9) ← *((byte*~) main::$7)
(byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#9) ← *((byte*~) main::$5)
(byte) main::idx#10 ← ++ (byte) main::idx#9
(byte*~) main::$8 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#10) ← *((byte*~) main::$8)
(byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#10) ← *((byte*~) main::$6)
(byte) main::idx#11 ← ++ (byte) main::idx#10
(byte*~) main::$9 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#11) ← *((byte*~) main::$9)
(byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#11) ← *((byte*~) main::$7)
(byte) main::idx#12 ← ++ (byte) main::idx#11
(byte*~) main::$10 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#12) ← *((byte*~) main::$10)
(byte*~) main::$8 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#12) ← *((byte*~) main::$8)
(byte) main::idx#13 ← ++ (byte) main::idx#12
(byte*~) main::$11 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#13) ← *((byte*~) main::$11)
(byte*~) main::$9 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#13) ← *((byte*~) main::$9)
(byte) main::idx#14 ← ++ (byte) main::idx#13
(byte*~) main::$12 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#14) ← *((byte*~) main::$12)
(byte*~) main::$10 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#14) ← *((byte*~) main::$10)
(byte) main::idx#15 ← ++ (byte) main::idx#14
(byte*~) main::$13 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#15) ← *((byte*~) main::$13)
(byte*~) main::$11 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#15) ← *((byte*~) main::$11)
(byte) main::idx#16 ← ++ (byte) main::idx#15
*((const byte*) SCREEN + (byte) main::idx#16) ← (byte) main::v5_p_x#0
(byte) main::idx#17 ← ++ (byte) main::idx#16
@ -200,8 +192,6 @@ SYMBOL TABLE SSA
(byte*~) main::$1
(byte*~) main::$10
(byte*~) main::$11
(byte*~) main::$12
(byte*~) main::$13
(byte*~) main::$2
(byte*~) main::$3
(byte*~) main::$4
@ -242,10 +232,12 @@ SYMBOL TABLE SSA
(struct Vector) main::v2 loadstore
(struct Vector) main::v3 loadstore
(struct Vector) main::v4 loadstore
(struct Point) main::v5_p
(byte) main::v5_p_x
(byte) main::v5_p_x#0
(byte) main::v5_p_y
(byte) main::v5_p_y#0
(struct Point) main::v5_q
(const byte) main::v5_q_x = (byte) 8
(const byte) main::v5_q_y = (byte) 9
@ -254,40 +246,33 @@ Successful SSA optimization PassNCastSimplification
Removing C-classic struct-unwound assignment [5] (struct Vector) main::v2 ← struct-unwound {*((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_Y), *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y)}
Removing C-classic struct-unwound assignment [8] (struct Vector) main::v3 ← struct-unwound {*((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q)}
Removing C-classic struct-unwound assignment [10] (struct Vector) main::v4 ← struct-unwound {*(&(struct Vector) main::v4)}
Constant right-side identified [11] (byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [13] (byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [23] (byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [26] (byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [29] (byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [32] (byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [35] (byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [38] (byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [41] (byte*~) main::$8 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [44] (byte*~) main::$9 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [47] (byte*~) main::$10 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [50] (byte*~) main::$11 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [53] (byte*~) main::$12 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [56] (byte*~) main::$13 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [21] (byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [24] (byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [27] (byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [30] (byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [33] (byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [36] (byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [39] (byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [42] (byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [45] (byte*~) main::$8 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [48] (byte*~) main::$9 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [51] (byte*~) main::$10 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [54] (byte*~) main::$11 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#0 = 0
Constant (const byte*) main::$0 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$1 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$2 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$3 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$4 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$5 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$6 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$7 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$8 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$9 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$10 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$11 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$12 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$13 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$0 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$1 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$2 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$3 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$4 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$5 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$6 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$7 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$8 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$9 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$10 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$11 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P in
Simplifying expression containing zero (struct Point*)&main::v4 in
Simplifying expression containing zero (struct Point*)&main::v4 in
Simplifying expression containing zero (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_P in
Simplifying expression containing zero (struct Point*)&main::v2 in
Simplifying expression containing zero (struct Point*)&main::v2 in
@ -306,7 +291,10 @@ Simplifying expression containing zero (struct Point*)&main::v2 in [2] *((byte*)
Simplifying expression containing zero (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_Q in [3] *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_X) ← (const byte) main::v1_q_x
Simplifying expression containing zero (struct Point*)&main::v2 in [6] *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P) ← memcpy(*((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Simplifying expression containing zero (struct Point*)&main::v3 in [6] *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P) ← memcpy(*((struct Point*)&(struct Vector) main::v2), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Simplifying expression containing zero SCREEN in [15] *((const byte*) SCREEN + (const byte) main::idx#0) ← (const byte) main::v1_p_x
Simplifying expression containing zero (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P in [11] (byte) main::v5_p_x#0 ← *((byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_X)
Simplifying expression containing zero (struct Point*)&main::v4 in [11] (byte) main::v5_p_x#0 ← *((byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P)
Simplifying expression containing zero (struct Point*)&main::v4 in [12] (byte) main::v5_p_y#0 ← *((byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_Y)
Simplifying expression containing zero SCREEN in [13] *((const byte*) SCREEN + (const byte) main::idx#0) ← (const byte) main::v1_p_x
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (byte) main::idx#20 and assignment [48] (byte) main::idx#20 ← ++ (byte) main::idx#19
Eliminating unused constant (const byte) OFFSET_STRUCT_VECTOR_P
@ -416,32 +404,30 @@ Constant inlined main::idx#12 = ++++++++++++++++++++++++(byte) 0
Constant inlined main::idx#13 = ++++++++++++++++++++++++++(byte) 0
Constant inlined main::idx#14 = ++++++++++++++++++++++++++++(byte) 0
Constant inlined main::idx#15 = ++++++++++++++++++++++++++++++(byte) 0
Constant inlined main::$12 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q
Constant inlined main::$13 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$10 = (byte*)(struct Point*)&(struct Vector) main::v4
Constant inlined main::$11 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$10 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q
Constant inlined main::$11 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::idx#0 = (byte) 0
Constant inlined main::idx#1 = ++(byte) 0
Constant inlined main::idx#2 = ++++(byte) 0
Constant inlined main::$1 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$1 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::idx#3 = ++++++(byte) 0
Constant inlined main::$2 = (byte*)(struct Point*)&(struct Vector) main::v2
Constant inlined main::$2 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q
Constant inlined main::idx#4 = ++++++++(byte) 0
Constant inlined main::idx#5 = ++++++++++(byte) 0
Constant inlined main::$0 = (byte*)(struct Point*)&(struct Vector) main::v4
Constant inlined main::$0 = (byte*)(struct Point*)&(struct Vector) main::v2
Constant inlined main::idx#6 = ++++++++++++(byte) 0
Constant inlined main::$5 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$5 = (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::idx#7 = ++++++++++++++(byte) 0
Constant inlined main::$6 = (byte*)(struct Point*)&(struct Vector) main::v3
Constant inlined main::$6 = (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q
Constant inlined main::idx#8 = ++++++++++++++++(byte) 0
Constant inlined main::$3 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$3 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::idx#9 = ++++++++++++++++++(byte) 0
Constant inlined main::idx#10 = ++++++++++++++++++++(byte) 0
Constant inlined main::$4 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q
Constant inlined main::$4 = (byte*)(struct Point*)&(struct Vector) main::v3
Constant inlined main::idx#11 = ++++++++++++++++++++++(byte) 0
Constant inlined main::$9 = (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$7 = (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$8 = (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q
Constant inlined main::$9 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$7 = (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$8 = (byte*)(struct Point*)&(struct Vector) main::v4
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(SCREEN+++0)
Consolidated array index constant in *(SCREEN+++++0)
@ -576,10 +562,12 @@ VARIABLE REGISTER WEIGHTS
(struct Vector) main::v2 loadstore
(struct Vector) main::v3 loadstore
(struct Vector) main::v4 loadstore
(struct Point) main::v5_p
(byte) main::v5_p_x
(byte) main::v5_p_x#0 0.2222222222222222
(byte) main::v5_p_y
(byte) main::v5_p_y#0 0.2222222222222222
(struct Point) main::v5_q
Initial phi equivalence classes
Added variable main::v5_p_x#0 to live range equivalence class [ main::v5_p_x#0 ]
@ -611,8 +599,8 @@ Target platform is c64basic / MOS6502X
.label SCREEN = $400
.const OFFSET_STRUCT_POINT_Y = 1
.const OFFSET_STRUCT_VECTOR_Q = 2
.const SIZEOF_STRUCT_VECTOR = 4
.const SIZEOF_STRUCT_POINT = 2
.const SIZEOF_STRUCT_VECTOR = 4
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -832,8 +820,8 @@ ASSEMBLER BEFORE OPTIMIZATION
.label SCREEN = $400
.const OFFSET_STRUCT_POINT_Y = 1
.const OFFSET_STRUCT_VECTOR_Q = 2
.const SIZEOF_STRUCT_VECTOR = 4
.const SIZEOF_STRUCT_POINT = 2
.const SIZEOF_STRUCT_VECTOR = 4
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -1010,10 +998,12 @@ FINAL SYMBOL TABLE
(struct Vector) main::v2 loadstore zp[4]:2
(struct Vector) main::v3 loadstore zp[4]:6
(struct Vector) main::v4 loadstore zp[4]:10
(struct Point) main::v5_p
(byte) main::v5_p_x
(byte) main::v5_p_x#0 reg byte y 0.2222222222222222
(byte) main::v5_p_y
(byte) main::v5_p_y#0 reg byte x 0.2222222222222222
(struct Point) main::v5_q
(const byte) main::v5_q_x = (byte) 8
(const byte) main::v5_q_y = (byte) 9
@ -1037,8 +1027,8 @@ Score: 218
.label SCREEN = $400
.const OFFSET_STRUCT_POINT_Y = 1
.const OFFSET_STRUCT_VECTOR_Q = 2
.const SIZEOF_STRUCT_VECTOR = 4
.const SIZEOF_STRUCT_POINT = 2
.const SIZEOF_STRUCT_VECTOR = 4
// @begin
// [1] phi from @begin to @1 [phi:@begin->@1]
// @1

View File

@ -23,10 +23,12 @@
(struct Vector) main::v2 loadstore zp[4]:2
(struct Vector) main::v3 loadstore zp[4]:6
(struct Vector) main::v4 loadstore zp[4]:10
(struct Point) main::v5_p
(byte) main::v5_p_x
(byte) main::v5_p_x#0 reg byte y 0.2222222222222222
(byte) main::v5_p_y
(byte) main::v5_p_y#0 reg byte x 0.2222222222222222
(struct Point) main::v5_q
(const byte) main::v5_q_x = (byte) 8
(const byte) main::v5_q_y = (byte) 9

View File

@ -10,14 +10,14 @@ Converted struct value to member variables (struct Point) main::c_center
Unwinding value copy (struct Point) main::p ← { x: (byte) $a, y: (byte) $a }
Adding value simple copy (byte) main::p_x ← (byte) $a
Adding value simple copy (byte) main::p_y ← (byte) $a
Adding struct value member variable copy (struct Point) main::c_center ← (struct Point) main::p
Adding struct value member variable copy (byte) main::c_radius ← (byte) 5
Unwinding value copy (struct Circle) main::c ← (struct Circle){ (struct Point) main::p, (byte) 5 }
Unwinding value copy (struct Circle) main::c ← (struct Circle){ (struct Point) main::p, (byte) 5 }
Adding value simple copy (byte) main::c_center_x ← (byte) main::p_x
Adding value simple copy (byte) main::c_center_y ← (byte) main::p_y
Adding value simple copy (byte) main::c_radius ← (byte) 5
Replacing struct member reference (struct Circle) main::c.center with member unwinding reference (struct Point) main::c_center
Replacing struct member reference (struct Circle) main::c.center with member unwinding reference (struct Point) main::c_center
Replacing struct member reference (struct Circle) main::c.radius with member unwinding reference (byte) main::c_radius
Unwinding value copy (struct Point) main::c_center ← (struct Point) main::p
Adding value simple copy (byte) main::c_center_x ← (byte) main::p_x
Adding value simple copy (byte) main::c_center_y ← (byte) main::p_y
Replacing struct member reference (struct Point) main::c_center.x with member unwinding reference (byte) main::c_center_x
Replacing struct member reference (struct Point) main::c_center.y with member unwinding reference (byte) main::c_center_y
Identified constant variable (byte) main::p_x
@ -58,6 +58,7 @@ SYMBOL TABLE SSA
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*)(number) $400
(struct Point) main::c_center
(byte) main::c_center_x
(byte) main::c_center_x#0
(byte) main::c_center_y
@ -132,6 +133,7 @@ VARIABLE REGISTER WEIGHTS
(byte) Point::x
(byte) Point::y
(void()) main()
(struct Point) main::c_center
(byte) main::c_center_x
(byte) main::c_center_y
@ -275,6 +277,7 @@ FINAL SYMBOL TABLE
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(struct Point) main::c_center
(byte) main::c_center_x
(byte) main::c_center_y
(const byte) main::c_radius = (byte) 5

View File

@ -8,6 +8,7 @@
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(struct Point) main::c_center
(byte) main::c_center_x
(byte) main::c_center_y
(const byte) main::c_radius = (byte) 5

View File

@ -13,17 +13,17 @@ Converted struct value to member variables (struct Point) main::c_center
Unwinding value copy (struct Point) main::p ← { x: (byte) $a, y: (byte) $a }
Adding value simple copy (byte) main::p_x ← (byte) $a
Adding value simple copy (byte) main::p_y ← (byte) $a
Adding struct value member variable copy (struct Point) main::c_center ← (struct Point) main::p
Adding struct value member variable copy (byte) main::c_radius ← (byte) 5
Unwinding value copy (struct Circle) main::c ← (struct Circle){ (struct Point) main::p, (byte) 5 }
Unwinding value copy (struct Circle) main::c ← (struct Circle){ (struct Point) main::p, (byte) 5 }
Adding value simple copy (byte) main::c_center_x ← (byte) main::p_x
Adding value simple copy (byte) main::c_center_y ← (byte) main::p_y
Adding value simple copy (byte) main::c_radius ← (byte) 5
Unwinding value copy (struct Point) main::point ← (struct Circle) main::c.center
Adding value simple copy (byte) main::point_x ← (byte) main::c_center_x
Adding value simple copy (byte) main::point_y ← (byte) main::c_center_y
Replacing struct member reference (struct Point) main::point.x with member unwinding reference (byte) main::point_x
Replacing struct member reference (struct Point) main::point.y with member unwinding reference (byte) main::point_y
Replacing struct member reference (struct Circle) main::c.radius with member unwinding reference (byte) main::c_radius
Unwinding value copy (struct Point) main::c_center ← (struct Point) main::p
Adding value simple copy (byte) main::c_center_x ← (byte) main::p_x
Adding value simple copy (byte) main::c_center_y ← (byte) main::p_y
Identified constant variable (byte) main::p_x
Identified constant variable (byte) main::p_y
Identified constant variable (byte) main::c_radius
@ -64,6 +64,7 @@ SYMBOL TABLE SSA
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*)(number) $400
(struct Point) main::c_center
(byte) main::c_center_x
(byte) main::c_center_x#0
(byte) main::c_center_y
@ -145,6 +146,7 @@ VARIABLE REGISTER WEIGHTS
(byte) Point::x
(byte) Point::y
(void()) main()
(struct Point) main::c_center
(byte) main::c_center_x
(byte) main::c_center_y
(byte) main::point_x
@ -290,6 +292,7 @@ FINAL SYMBOL TABLE
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(struct Point) main::c_center
(byte) main::c_center_x
(byte) main::c_center_y
(const byte) main::c_radius = (byte) 5

View File

@ -8,6 +8,7 @@
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(struct Point) main::c_center
(byte) main::c_center_x
(byte) main::c_center_y
(const byte) main::c_radius = (byte) 5

View File

@ -10,10 +10,10 @@ main: {
.label __4 = $a
.label i = 2
.label i1 = 4
.label __7 = 8
.label __8 = 6
.label __9 = $c
.label __10 = $a
.label __5 = 8
.label __6 = 6
.label __7 = $c
.label __8 = $a
lda #<0
sta.z i
sta.z i+1
@ -28,22 +28,22 @@ main: {
lda.z __3
clc
adc #<points
sta.z __7
sta.z __5
lda.z __3+1
adc #>points
sta.z __7+1
sta.z __5+1
lda #2
ldy #0
sta (__7),y
sta (__5),y
clc
lda.z __8
lda.z __6
adc #<points+OFFSET_STRUCT_POINT_Y
sta.z __8
lda.z __8+1
sta.z __6
lda.z __6+1
adc #>points+OFFSET_STRUCT_POINT_Y
sta.z __8+1
sta.z __6+1
txa
sta (__8),y
sta (__6),y
inc.z i
bne !+
inc.z i+1
@ -67,21 +67,21 @@ main: {
lda.z __4
clc
adc #<points
sta.z __9
sta.z __7
lda.z __4+1
adc #>points
sta.z __9+1
sta.z __7+1
clc
lda.z __10
lda.z __8
adc #<SCREEN
sta.z __10
lda.z __10+1
sta.z __8
lda.z __8+1
adc #>SCREEN
sta.z __10+1
sta.z __8+1
ldy #0
!:
lda (__9),y
sta (__10),y
lda (__7),y
sta (__8),y
iny
cpy #SIZEOF_STRUCT_POINT
bne !-

View File

@ -16,19 +16,19 @@ main::@1: scope:[main] from main main::@1
[5] (word) main::i#2 ← phi( main/(word) 0 main::@1/(word) main::i#1 )
[6] (byte~) main::$0 ← (byte)(word) main::i#2
[7] (word~) main::$3 ← (word) main::i#2 << (byte) 1
[8] (byte*~) main::$7 ← (byte*)(const struct Point*) points + (word~) main::$3
[9] *((byte*~) main::$7) ← (byte) 2
[10] (byte*~) main::$8 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3
[11] *((byte*~) main::$8) ← (byte~) main::$0
[8] (byte*~) main::$5 ← (byte*)(const struct Point*) points + (word~) main::$3
[9] *((byte*~) main::$5) ← (byte) 2
[10] (byte*~) main::$6 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3
[11] *((byte*~) main::$6) ← (byte~) main::$0
[12] (word) main::i#1 ← ++ (word) main::i#2
[13] if((word) main::i#1!=(word) $1f4) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[14] (word) main::i1#2 ← phi( main::@1/(word) 0 main::@2/(word) main::i1#1 )
[15] (word~) main::$4 ← (word) main::i1#2 << (byte) 1
[16] (struct Point*~) main::$9 ← (const struct Point*) points + (word~) main::$4
[17] (struct Point*~) main::$10 ← (const struct Point*) main::SCREEN + (word~) main::$4
[18] *((struct Point*~) main::$10) ← memcpy(*((struct Point*~) main::$9), struct Point, (const byte) SIZEOF_STRUCT_POINT)
[16] (struct Point*~) main::$7 ← (const struct Point*) points + (word~) main::$4
[17] (struct Point*~) main::$8 ← (const struct Point*) main::SCREEN + (word~) main::$4
[18] *((struct Point*~) main::$8) ← memcpy(*((struct Point*~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT)
[19] (word) main::i1#1 ← ++ (word) main::i1#2
[20] if((word) main::i1#1!=(word) $1f4) goto main::@2
to:main::@return

View File

@ -2,8 +2,9 @@ Fixing pointer array-indexing *((const struct Point*) points + (word) main::i)
Fixing pointer array-indexing *((const struct Point*) points + (word) main::i1)
Fixing pointer array-indexing *((const struct Point*) main::SCREEN + (word) main::i1)
Constantified RValue *((const struct Point*) points + (word~) main::$3) ← (struct Point){ (byte) 2, (byte~) main::$0 }
Adding struct value member variable copy *((byte*~) main::$5 + (word~) main::$3) ← (byte) 2
Adding struct value member variable copy *((byte*~) main::$6 + (word~) main::$3) ← (byte~) main::$0
Unwinding value copy *((const struct Point*) points + (word~) main::$3) ← (struct Point){ (byte) 2, (byte~) main::$0 }
Adding value simple copy *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (word~) main::$3) ← (byte) 2
Adding value simple copy *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3) ← (byte~) main::$0
Adding value bulk copy *((const struct Point*) main::SCREEN + (word~) main::$4) ← memcpy(*((const struct Point*) points + (word~) main::$4), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Culled Empty Block (label) main::@4
@ -19,10 +20,8 @@ main::@1: scope:[main] from main main::@1
(word) main::i#2 ← phi( main/(word) main::i#0 main::@1/(word) main::i#1 )
(byte~) main::$0 ← ((byte)) (word) main::i#2
(word~) main::$3 ← (word) main::i#2 * (const byte) SIZEOF_STRUCT_POINT
(byte*~) main::$5 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X
*((byte*~) main::$5 + (word~) main::$3) ← (byte) 2
(byte*~) main::$6 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y
*((byte*~) main::$6 + (word~) main::$3) ← (byte~) main::$0
*((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (word~) main::$3) ← (byte) 2
*((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3) ← (byte~) main::$0
(word) main::i#1 ← (word) main::i#2 + rangenext(0,$1f3)
(bool~) main::$1 ← (word) main::i#1 != rangelast(0,$1f3)
if((bool~) main::$1) goto main::@1
@ -64,8 +63,6 @@ SYMBOL TABLE SSA
(bool~) main::$2
(word~) main::$3
(word~) main::$4
(byte*~) main::$5
(byte*~) main::$6
(label) main::@1
(label) main::@2
(label) main::@3
@ -85,27 +82,22 @@ Inlining cast (byte~) main::$0 ← (byte)(word) main::i#2
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (struct Point*) 1024
Successful SSA optimization PassNCastSimplification
Simple Condition (bool~) main::$1 [10] if((word) main::i#1!=rangelast(0,$1f3)) goto main::@1
Simple Condition (bool~) main::$2 [17] if((word) main::i1#1!=rangelast(0,$1f3)) goto main::@3
Simple Condition (bool~) main::$1 [8] if((word) main::i#1!=rangelast(0,$1f3)) goto main::@1
Simple Condition (bool~) main::$2 [15] if((word) main::i1#1!=rangelast(0,$1f3)) goto main::@3
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [4] (byte*~) main::$5 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [6] (byte*~) main::$6 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) main::i#0 = 0
Constant (const byte*) main::$5 = (byte*)points+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$6 = (byte*)points+OFFSET_STRUCT_POINT_Y
Constant (const word) main::i1#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [8] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [10] if(main::i#1!=rangelast(0,$1f3)) goto main::@1 to (number) $1f4
Resolved ranged next value [15] main::i1#1 ← ++ main::i1#2 to ++
Resolved ranged comparison value [17] if(main::i1#1!=rangelast(0,$1f3)) goto main::@3 to (number) $1f4
De-inlining pointer[w] to *(pointer+w) [5] *((const byte*) main::$5 + (word~) main::$3) ← (byte) 2
De-inlining pointer[w] to *(pointer+w) [7] *((const byte*) main::$6 + (word~) main::$3) ← (byte~) main::$0
De-inlining pointer[w] to *(pointer+w) [14] *((const struct Point*) main::SCREEN + (word~) main::$4) ← memcpy(*((const struct Point*) points + (word~) main::$4), struct Point, (const byte) SIZEOF_STRUCT_POINT)
De-inlining pointer[w] to *(pointer+w) [14] *((const struct Point*) main::SCREEN + (word~) main::$4) ← memcpy(*((struct Point*~) main::$9), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Resolved ranged next value [6] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [8] if(main::i#1!=rangelast(0,$1f3)) goto main::@1 to (number) $1f4
Resolved ranged next value [13] main::i1#1 ← ++ main::i1#2 to ++
Resolved ranged comparison value [15] if(main::i1#1!=rangelast(0,$1f3)) goto main::@3 to (number) $1f4
De-inlining pointer[w] to *(pointer+w) [4] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (word~) main::$3) ← (byte) 2
De-inlining pointer[w] to *(pointer+w) [5] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3) ← (byte~) main::$0
De-inlining pointer[w] to *(pointer+w) [12] *((const struct Point*) main::SCREEN + (word~) main::$4) ← memcpy(*((const struct Point*) points + (word~) main::$4), struct Point, (const byte) SIZEOF_STRUCT_POINT)
De-inlining pointer[w] to *(pointer+w) [12] *((const struct Point*) main::SCREEN + (word~) main::$4) ← memcpy(*((struct Point*~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Successful SSA optimization Pass2DeInlineWordDerefIdx
Simplifying expression containing zero (byte*)points in
Simplifying expression containing zero (byte*)points in (byte*~) main::$5 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (word~) main::$3
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
Successful SSA optimization PassNEliminateUnusedVars
@ -123,10 +115,8 @@ Rewriting multiplication to use shift [10] (word~) main::$4 ← (word) main::i1#
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const word) main::i#0
Inlining constant with var siblings (const word) main::i1#0
Constant inlined main::$5 = (byte*)(const struct Point*) points
Constant inlined main::i#0 = (word) 0
Constant inlined main::i1#0 = (word) 0
Constant inlined main::$6 = (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@5(between main::@1 and main::@1)
Added new block during phi lifting main::@6(between main::@3 and main::@3)
@ -172,19 +162,19 @@ main::@1: scope:[main] from main main::@1
[5] (word) main::i#2 ← phi( main/(word) 0 main::@1/(word) main::i#1 )
[6] (byte~) main::$0 ← (byte)(word) main::i#2
[7] (word~) main::$3 ← (word) main::i#2 << (byte) 1
[8] (byte*~) main::$7 ← (byte*)(const struct Point*) points + (word~) main::$3
[9] *((byte*~) main::$7) ← (byte) 2
[10] (byte*~) main::$8 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3
[11] *((byte*~) main::$8) ← (byte~) main::$0
[8] (byte*~) main::$5 ← (byte*)(const struct Point*) points + (word~) main::$3
[9] *((byte*~) main::$5) ← (byte) 2
[10] (byte*~) main::$6 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3
[11] *((byte*~) main::$6) ← (byte~) main::$0
[12] (word) main::i#1 ← ++ (word) main::i#2
[13] if((word) main::i#1!=(word) $1f4) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[14] (word) main::i1#2 ← phi( main::@1/(word) 0 main::@2/(word) main::i1#1 )
[15] (word~) main::$4 ← (word) main::i1#2 << (byte) 1
[16] (struct Point*~) main::$9 ← (const struct Point*) points + (word~) main::$4
[17] (struct Point*~) main::$10 ← (const struct Point*) main::SCREEN + (word~) main::$4
[18] *((struct Point*~) main::$10) ← memcpy(*((struct Point*~) main::$9), struct Point, (const byte) SIZEOF_STRUCT_POINT)
[16] (struct Point*~) main::$7 ← (const struct Point*) points + (word~) main::$4
[17] (struct Point*~) main::$8 ← (const struct Point*) main::SCREEN + (word~) main::$4
[18] *((struct Point*~) main::$8) ← memcpy(*((struct Point*~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT)
[19] (word) main::i1#1 ← ++ (word) main::i1#2
[20] if((word) main::i1#1!=(word) $1f4) goto main::@2
to:main::@return
@ -198,12 +188,12 @@ VARIABLE REGISTER WEIGHTS
(byte) Point::y
(void()) main()
(byte~) main::$0 4.4
(struct Point*~) main::$10 22.0
(word~) main::$3 11.0
(word~) main::$4 16.5
(byte*~) main::$7 22.0
(byte*~) main::$8 22.0
(struct Point*~) main::$9 5.5
(byte*~) main::$5 22.0
(byte*~) main::$6 22.0
(struct Point*~) main::$7 5.5
(struct Point*~) main::$8 22.0
(word) main::i
(word) main::i#1 16.5
(word) main::i#2 4.714285714285714
@ -216,30 +206,30 @@ Initial phi equivalence classes
[ main::i1#2 main::i1#1 ]
Added variable main::$0 to live range equivalence class [ main::$0 ]
Added variable main::$3 to live range equivalence class [ main::$3 ]
Added variable main::$5 to live range equivalence class [ main::$5 ]
Added variable main::$6 to live range equivalence class [ main::$6 ]
Added variable main::$4 to live range equivalence class [ main::$4 ]
Added variable main::$7 to live range equivalence class [ main::$7 ]
Added variable main::$8 to live range equivalence class [ main::$8 ]
Added variable main::$4 to live range equivalence class [ main::$4 ]
Added variable main::$9 to live range equivalence class [ main::$9 ]
Added variable main::$10 to live range equivalence class [ main::$10 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::i1#2 main::i1#1 ]
[ main::$0 ]
[ main::$3 ]
[ main::$5 ]
[ main::$6 ]
[ main::$4 ]
[ main::$7 ]
[ main::$8 ]
[ main::$4 ]
[ main::$9 ]
[ main::$10 ]
Allocated zp[2]:2 [ main::i#2 main::i#1 ]
Allocated zp[2]:4 [ main::i1#2 main::i1#1 ]
Allocated zp[1]:6 [ main::$0 ]
Allocated zp[2]:7 [ main::$3 ]
Allocated zp[2]:9 [ main::$7 ]
Allocated zp[2]:11 [ main::$8 ]
Allocated zp[2]:9 [ main::$5 ]
Allocated zp[2]:11 [ main::$6 ]
Allocated zp[2]:13 [ main::$4 ]
Allocated zp[2]:15 [ main::$9 ]
Allocated zp[2]:17 [ main::$10 ]
Allocated zp[2]:15 [ main::$7 ]
Allocated zp[2]:17 [ main::$8 ]
INITIAL ASM
Target platform is c64basic / MOS6502X
@ -276,10 +266,10 @@ main: {
.label __4 = $d
.label i = 2
.label i1 = 4
.label __7 = 9
.label __8 = $b
.label __9 = $f
.label __10 = $11
.label __5 = 9
.label __6 = $b
.label __7 = $f
.label __8 = $11
// [5] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [5] phi (word) main::i#2 = (word) 0 [phi:main->main::@1#0] -- vwuz1=vwuc1
@ -304,30 +294,30 @@ main: {
lda.z i+1
rol
sta.z __3+1
// [8] (byte*~) main::$7 ← (byte*)(const struct Point*) points + (word~) main::$3 -- pbuz1=pbuc1_plus_vwuz2
// [8] (byte*~) main::$5 ← (byte*)(const struct Point*) points + (word~) main::$3 -- pbuz1=pbuc1_plus_vwuz2
lda.z __3
clc
adc #<points
sta.z __7
sta.z __5
lda.z __3+1
adc #>points
sta.z __7+1
// [9] *((byte*~) main::$7) ← (byte) 2 -- _deref_pbuz1=vbuc1
sta.z __5+1
// [9] *((byte*~) main::$5) ← (byte) 2 -- _deref_pbuz1=vbuc1
lda #2
ldy #0
sta (__7),y
// [10] (byte*~) main::$8 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3 -- pbuz1=pbuc1_plus_vwuz2
sta (__5),y
// [10] (byte*~) main::$6 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3 -- pbuz1=pbuc1_plus_vwuz2
lda.z __3
clc
adc #<points+OFFSET_STRUCT_POINT_Y
sta.z __8
sta.z __6
lda.z __3+1
adc #>points+OFFSET_STRUCT_POINT_Y
sta.z __8+1
// [11] *((byte*~) main::$8) ← (byte~) main::$0 -- _deref_pbuz1=vbuz2
sta.z __6+1
// [11] *((byte*~) main::$6) ← (byte~) main::$0 -- _deref_pbuz1=vbuz2
lda.z __0
ldy #0
sta (__8),y
sta (__6),y
// [12] (word) main::i#1 ← ++ (word) main::i#2 -- vwuz1=_inc_vwuz1
inc.z i
bne !+
@ -361,27 +351,27 @@ main: {
lda.z i1+1
rol
sta.z __4+1
// [16] (struct Point*~) main::$9 ← (const struct Point*) points + (word~) main::$4 -- pssz1=pssc1_plus_vwuz2
// [16] (struct Point*~) main::$7 ← (const struct Point*) points + (word~) main::$4 -- pssz1=pssc1_plus_vwuz2
lda.z __4
clc
adc #<points
sta.z __9
sta.z __7
lda.z __4+1
adc #>points
sta.z __9+1
// [17] (struct Point*~) main::$10 ← (const struct Point*) main::SCREEN + (word~) main::$4 -- pssz1=pssc1_plus_vwuz2
sta.z __7+1
// [17] (struct Point*~) main::$8 ← (const struct Point*) main::SCREEN + (word~) main::$4 -- pssz1=pssc1_plus_vwuz2
lda.z __4
clc
adc #<SCREEN
sta.z __10
sta.z __8
lda.z __4+1
adc #>SCREEN
sta.z __10+1
// [18] *((struct Point*~) main::$10) ← memcpy(*((struct Point*~) main::$9), struct Point, (const byte) SIZEOF_STRUCT_POINT) -- _deref_pssz1=_deref_pssz2_memcpy_vbuc1
sta.z __8+1
// [18] *((struct Point*~) main::$8) ← memcpy(*((struct Point*~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT) -- _deref_pssz1=_deref_pssz2_memcpy_vbuc1
ldy #0
!:
lda (__9),y
sta (__10),y
lda (__7),y
sta (__8),y
iny
cpy #SIZEOF_STRUCT_POINT
bne !-
@ -410,53 +400,53 @@ REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] (byte~) main::$0 ← (byte)(word) main::i#2 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] ) always clobbers reg byte a
Statement [7] (word~) main::$3 ← (word) main::i#2 << (byte) 1 [ main::i#2 main::$0 main::$3 ] ( main:2 [ main::i#2 main::$0 main::$3 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:6 [ main::$0 ]
Statement [8] (byte*~) main::$7 ← (byte*)(const struct Point*) points + (word~) main::$3 [ main::i#2 main::$0 main::$3 main::$7 ] ( main:2 [ main::i#2 main::$0 main::$3 main::$7 ] ) always clobbers reg byte a
Statement [9] *((byte*~) main::$7) ← (byte) 2 [ main::i#2 main::$0 main::$3 ] ( main:2 [ main::i#2 main::$0 main::$3 ] ) always clobbers reg byte a reg byte y
Statement [8] (byte*~) main::$5 ← (byte*)(const struct Point*) points + (word~) main::$3 [ main::i#2 main::$0 main::$3 main::$5 ] ( main:2 [ main::i#2 main::$0 main::$3 main::$5 ] ) always clobbers reg byte a
Statement [9] *((byte*~) main::$5) ← (byte) 2 [ main::i#2 main::$0 main::$3 ] ( main:2 [ main::i#2 main::$0 main::$3 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp[1]:6 [ main::$0 ]
Statement [10] (byte*~) main::$8 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3 [ main::i#2 main::$0 main::$8 ] ( main:2 [ main::i#2 main::$0 main::$8 ] ) always clobbers reg byte a
Statement [11] *((byte*~) main::$8) ← (byte~) main::$0 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a reg byte y
Statement [10] (byte*~) main::$6 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3 [ main::i#2 main::$0 main::$6 ] ( main:2 [ main::i#2 main::$0 main::$6 ] ) always clobbers reg byte a
Statement [11] *((byte*~) main::$6) ← (byte~) main::$0 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a reg byte y
Statement [13] if((word) main::i#1!=(word) $1f4) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) always clobbers reg byte a
Statement [15] (word~) main::$4 ← (word) main::i1#2 << (byte) 1 [ main::i1#2 main::$4 ] ( main:2 [ main::i1#2 main::$4 ] ) always clobbers reg byte a
Statement [16] (struct Point*~) main::$9 ← (const struct Point*) points + (word~) main::$4 [ main::i1#2 main::$4 main::$9 ] ( main:2 [ main::i1#2 main::$4 main::$9 ] ) always clobbers reg byte a
Statement [17] (struct Point*~) main::$10 ← (const struct Point*) main::SCREEN + (word~) main::$4 [ main::i1#2 main::$9 main::$10 ] ( main:2 [ main::i1#2 main::$9 main::$10 ] ) always clobbers reg byte a
Statement [18] *((struct Point*~) main::$10) ← memcpy(*((struct Point*~) main::$9), struct Point, (const byte) SIZEOF_STRUCT_POINT) [ main::i1#2 ] ( main:2 [ main::i1#2 ] ) always clobbers reg byte a reg byte y
Statement [16] (struct Point*~) main::$7 ← (const struct Point*) points + (word~) main::$4 [ main::i1#2 main::$4 main::$7 ] ( main:2 [ main::i1#2 main::$4 main::$7 ] ) always clobbers reg byte a
Statement [17] (struct Point*~) main::$8 ← (const struct Point*) main::SCREEN + (word~) main::$4 [ main::i1#2 main::$7 main::$8 ] ( main:2 [ main::i1#2 main::$7 main::$8 ] ) always clobbers reg byte a
Statement [18] *((struct Point*~) main::$8) ← memcpy(*((struct Point*~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT) [ main::i1#2 ] ( main:2 [ main::i1#2 ] ) always clobbers reg byte a reg byte y
Statement [20] if((word) main::i1#1!=(word) $1f4) goto main::@2 [ main::i1#1 ] ( main:2 [ main::i1#1 ] ) always clobbers reg byte a
Statement [6] (byte~) main::$0 ← (byte)(word) main::i#2 [ main::i#2 main::$0 ] ( main:2 [ main::i#2 main::$0 ] ) always clobbers reg byte a
Statement [7] (word~) main::$3 ← (word) main::i#2 << (byte) 1 [ main::i#2 main::$0 main::$3 ] ( main:2 [ main::i#2 main::$0 main::$3 ] ) always clobbers reg byte a
Statement [8] (byte*~) main::$7 ← (byte*)(const struct Point*) points + (word~) main::$3 [ main::i#2 main::$0 main::$3 main::$7 ] ( main:2 [ main::i#2 main::$0 main::$3 main::$7 ] ) always clobbers reg byte a
Statement [9] *((byte*~) main::$7) ← (byte) 2 [ main::i#2 main::$0 main::$3 ] ( main:2 [ main::i#2 main::$0 main::$3 ] ) always clobbers reg byte a reg byte y
Statement [10] (byte*~) main::$8 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3 [ main::i#2 main::$0 main::$8 ] ( main:2 [ main::i#2 main::$0 main::$8 ] ) always clobbers reg byte a
Statement [11] *((byte*~) main::$8) ← (byte~) main::$0 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a reg byte y
Statement [8] (byte*~) main::$5 ← (byte*)(const struct Point*) points + (word~) main::$3 [ main::i#2 main::$0 main::$3 main::$5 ] ( main:2 [ main::i#2 main::$0 main::$3 main::$5 ] ) always clobbers reg byte a
Statement [9] *((byte*~) main::$5) ← (byte) 2 [ main::i#2 main::$0 main::$3 ] ( main:2 [ main::i#2 main::$0 main::$3 ] ) always clobbers reg byte a reg byte y
Statement [10] (byte*~) main::$6 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3 [ main::i#2 main::$0 main::$6 ] ( main:2 [ main::i#2 main::$0 main::$6 ] ) always clobbers reg byte a
Statement [11] *((byte*~) main::$6) ← (byte~) main::$0 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a reg byte y
Statement [13] if((word) main::i#1!=(word) $1f4) goto main::@1 [ main::i#1 ] ( main:2 [ main::i#1 ] ) always clobbers reg byte a
Statement [15] (word~) main::$4 ← (word) main::i1#2 << (byte) 1 [ main::i1#2 main::$4 ] ( main:2 [ main::i1#2 main::$4 ] ) always clobbers reg byte a
Statement [16] (struct Point*~) main::$9 ← (const struct Point*) points + (word~) main::$4 [ main::i1#2 main::$4 main::$9 ] ( main:2 [ main::i1#2 main::$4 main::$9 ] ) always clobbers reg byte a
Statement [17] (struct Point*~) main::$10 ← (const struct Point*) main::SCREEN + (word~) main::$4 [ main::i1#2 main::$9 main::$10 ] ( main:2 [ main::i1#2 main::$9 main::$10 ] ) always clobbers reg byte a
Statement [18] *((struct Point*~) main::$10) ← memcpy(*((struct Point*~) main::$9), struct Point, (const byte) SIZEOF_STRUCT_POINT) [ main::i1#2 ] ( main:2 [ main::i1#2 ] ) always clobbers reg byte a reg byte y
Statement [16] (struct Point*~) main::$7 ← (const struct Point*) points + (word~) main::$4 [ main::i1#2 main::$4 main::$7 ] ( main:2 [ main::i1#2 main::$4 main::$7 ] ) always clobbers reg byte a
Statement [17] (struct Point*~) main::$8 ← (const struct Point*) main::SCREEN + (word~) main::$4 [ main::i1#2 main::$7 main::$8 ] ( main:2 [ main::i1#2 main::$7 main::$8 ] ) always clobbers reg byte a
Statement [18] *((struct Point*~) main::$8) ← memcpy(*((struct Point*~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT) [ main::i1#2 ] ( main:2 [ main::i1#2 ] ) always clobbers reg byte a reg byte y
Statement [20] if((word) main::i1#1!=(word) $1f4) goto main::@2 [ main::i1#1 ] ( main:2 [ main::i1#1 ] ) always clobbers reg byte a
Potential registers zp[2]:2 [ main::i#2 main::i#1 ] : zp[2]:2 ,
Potential registers zp[2]:4 [ main::i1#2 main::i1#1 ] : zp[2]:4 ,
Potential registers zp[1]:6 [ main::$0 ] : zp[1]:6 , reg byte x ,
Potential registers zp[2]:7 [ main::$3 ] : zp[2]:7 ,
Potential registers zp[2]:9 [ main::$7 ] : zp[2]:9 ,
Potential registers zp[2]:11 [ main::$8 ] : zp[2]:11 ,
Potential registers zp[2]:9 [ main::$5 ] : zp[2]:9 ,
Potential registers zp[2]:11 [ main::$6 ] : zp[2]:11 ,
Potential registers zp[2]:13 [ main::$4 ] : zp[2]:13 ,
Potential registers zp[2]:15 [ main::$9 ] : zp[2]:15 ,
Potential registers zp[2]:17 [ main::$10 ] : zp[2]:17 ,
Potential registers zp[2]:15 [ main::$7 ] : zp[2]:15 ,
Potential registers zp[2]:17 [ main::$8 ] : zp[2]:17 ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 23.1: zp[2]:4 [ main::i1#2 main::i1#1 ] 22: zp[2]:9 [ main::$7 ] 22: zp[2]:11 [ main::$8 ] 22: zp[2]:17 [ main::$10 ] 21.21: zp[2]:2 [ main::i#2 main::i#1 ] 16.5: zp[2]:13 [ main::$4 ] 11: zp[2]:7 [ main::$3 ] 5.5: zp[2]:15 [ main::$9 ] 4.4: zp[1]:6 [ main::$0 ]
Uplift Scope [main] 23.1: zp[2]:4 [ main::i1#2 main::i1#1 ] 22: zp[2]:9 [ main::$5 ] 22: zp[2]:11 [ main::$6 ] 22: zp[2]:17 [ main::$8 ] 21.21: zp[2]:2 [ main::i#2 main::i#1 ] 16.5: zp[2]:13 [ main::$4 ] 11: zp[2]:7 [ main::$3 ] 5.5: zp[2]:15 [ main::$7 ] 4.4: zp[1]:6 [ main::$0 ]
Uplift Scope [Point]
Uplift Scope []
Uplifting [main] best 2408 combination zp[2]:4 [ main::i1#2 main::i1#1 ] zp[2]:9 [ main::$7 ] zp[2]:11 [ main::$8 ] zp[2]:17 [ main::$10 ] zp[2]:2 [ main::i#2 main::i#1 ] zp[2]:13 [ main::$4 ] zp[2]:7 [ main::$3 ] zp[2]:15 [ main::$9 ] reg byte x [ main::$0 ]
Uplifting [main] best 2408 combination zp[2]:4 [ main::i1#2 main::i1#1 ] zp[2]:9 [ main::$5 ] zp[2]:11 [ main::$6 ] zp[2]:17 [ main::$8 ] zp[2]:2 [ main::i#2 main::i#1 ] zp[2]:13 [ main::$4 ] zp[2]:7 [ main::$3 ] zp[2]:15 [ main::$7 ] reg byte x [ main::$0 ]
Uplifting [Point] best 2408 combination
Uplifting [] best 2408 combination
Coalescing zero page register [ zp[2]:7 [ main::$3 ] ] with [ zp[2]:11 [ main::$8 ] ] - score: 1
Coalescing zero page register [ zp[2]:13 [ main::$4 ] ] with [ zp[2]:17 [ main::$10 ] ] - score: 1
Allocated (was zp[2]:7) zp[2]:6 [ main::$3 main::$8 ]
Allocated (was zp[2]:9) zp[2]:8 [ main::$7 ]
Allocated (was zp[2]:13) zp[2]:10 [ main::$4 main::$10 ]
Allocated (was zp[2]:15) zp[2]:12 [ main::$9 ]
Coalescing zero page register [ zp[2]:7 [ main::$3 ] ] with [ zp[2]:11 [ main::$6 ] ] - score: 1
Coalescing zero page register [ zp[2]:13 [ main::$4 ] ] with [ zp[2]:17 [ main::$8 ] ] - score: 1
Allocated (was zp[2]:7) zp[2]:6 [ main::$3 main::$6 ]
Allocated (was zp[2]:9) zp[2]:8 [ main::$5 ]
Allocated (was zp[2]:13) zp[2]:10 [ main::$4 main::$8 ]
Allocated (was zp[2]:15) zp[2]:12 [ main::$7 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -491,10 +481,10 @@ main: {
.label __4 = $a
.label i = 2
.label i1 = 4
.label __7 = 8
.label __8 = 6
.label __9 = $c
.label __10 = $a
.label __5 = 8
.label __6 = 6
.label __7 = $c
.label __8 = $a
// [5] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [5] phi (word) main::i#2 = (word) 0 [phi:main->main::@1#0] -- vwuz1=vwuc1
@ -519,30 +509,30 @@ main: {
lda.z i+1
rol
sta.z __3+1
// [8] (byte*~) main::$7 ← (byte*)(const struct Point*) points + (word~) main::$3 -- pbuz1=pbuc1_plus_vwuz2
// [8] (byte*~) main::$5 ← (byte*)(const struct Point*) points + (word~) main::$3 -- pbuz1=pbuc1_plus_vwuz2
lda.z __3
clc
adc #<points
sta.z __7
sta.z __5
lda.z __3+1
adc #>points
sta.z __7+1
// [9] *((byte*~) main::$7) ← (byte) 2 -- _deref_pbuz1=vbuc1
sta.z __5+1
// [9] *((byte*~) main::$5) ← (byte) 2 -- _deref_pbuz1=vbuc1
lda #2
ldy #0
sta (__7),y
// [10] (byte*~) main::$8 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3 -- pbuz1=pbuc1_plus_vwuz1
sta (__5),y
// [10] (byte*~) main::$6 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3 -- pbuz1=pbuc1_plus_vwuz1
clc
lda.z __8
lda.z __6
adc #<points+OFFSET_STRUCT_POINT_Y
sta.z __8
lda.z __8+1
sta.z __6
lda.z __6+1
adc #>points+OFFSET_STRUCT_POINT_Y
sta.z __8+1
// [11] *((byte*~) main::$8) ← (byte~) main::$0 -- _deref_pbuz1=vbuxx
sta.z __6+1
// [11] *((byte*~) main::$6) ← (byte~) main::$0 -- _deref_pbuz1=vbuxx
txa
ldy #0
sta (__8),y
sta (__6),y
// [12] (word) main::i#1 ← ++ (word) main::i#2 -- vwuz1=_inc_vwuz1
inc.z i
bne !+
@ -576,27 +566,27 @@ main: {
lda.z i1+1
rol
sta.z __4+1
// [16] (struct Point*~) main::$9 ← (const struct Point*) points + (word~) main::$4 -- pssz1=pssc1_plus_vwuz2
// [16] (struct Point*~) main::$7 ← (const struct Point*) points + (word~) main::$4 -- pssz1=pssc1_plus_vwuz2
lda.z __4
clc
adc #<points
sta.z __9
sta.z __7
lda.z __4+1
adc #>points
sta.z __9+1
// [17] (struct Point*~) main::$10 ← (const struct Point*) main::SCREEN + (word~) main::$4 -- pssz1=pssc1_plus_vwuz1
sta.z __7+1
// [17] (struct Point*~) main::$8 ← (const struct Point*) main::SCREEN + (word~) main::$4 -- pssz1=pssc1_plus_vwuz1
clc
lda.z __10
lda.z __8
adc #<SCREEN
sta.z __10
lda.z __10+1
sta.z __8
lda.z __8+1
adc #>SCREEN
sta.z __10+1
// [18] *((struct Point*~) main::$10) ← memcpy(*((struct Point*~) main::$9), struct Point, (const byte) SIZEOF_STRUCT_POINT) -- _deref_pssz1=_deref_pssz2_memcpy_vbuc1
sta.z __8+1
// [18] *((struct Point*~) main::$8) ← memcpy(*((struct Point*~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT) -- _deref_pssz1=_deref_pssz2_memcpy_vbuc1
ldy #0
!:
lda (__9),y
sta (__10),y
lda (__7),y
sta (__8),y
iny
cpy #SIZEOF_STRUCT_POINT
bne !-
@ -669,12 +659,12 @@ FINAL SYMBOL TABLE
(const byte) SIZEOF_STRUCT_POINT = (byte) 2
(void()) main()
(byte~) main::$0 reg byte x 4.4
(struct Point*~) main::$10 zp[2]:10 22.0
(word~) main::$3 zp[2]:6 11.0
(word~) main::$4 zp[2]:10 16.5
(byte*~) main::$7 zp[2]:8 22.0
(byte*~) main::$8 zp[2]:6 22.0
(struct Point*~) main::$9 zp[2]:12 5.5
(byte*~) main::$5 zp[2]:8 22.0
(byte*~) main::$6 zp[2]:6 22.0
(struct Point*~) main::$7 zp[2]:12 5.5
(struct Point*~) main::$8 zp[2]:10 22.0
(label) main::@1
(label) main::@2
(label) main::@return
@ -690,10 +680,10 @@ FINAL SYMBOL TABLE
zp[2]:2 [ main::i#2 main::i#1 ]
zp[2]:4 [ main::i1#2 main::i1#1 ]
reg byte x [ main::$0 ]
zp[2]:6 [ main::$3 main::$8 ]
zp[2]:8 [ main::$7 ]
zp[2]:10 [ main::$4 main::$10 ]
zp[2]:12 [ main::$9 ]
zp[2]:6 [ main::$3 main::$6 ]
zp[2]:8 [ main::$5 ]
zp[2]:10 [ main::$4 main::$8 ]
zp[2]:12 [ main::$7 ]
FINAL ASSEMBLER
@ -722,10 +712,10 @@ main: {
.label __4 = $a
.label i = 2
.label i1 = 4
.label __7 = 8
.label __8 = 6
.label __9 = $c
.label __10 = $a
.label __5 = 8
.label __6 = 6
.label __7 = $c
.label __8 = $a
// [5] phi from main to main::@1 [phi:main->main::@1]
// [5] phi (word) main::i#2 = (word) 0 [phi:main->main::@1#0] -- vwuz1=vwuc1
lda #<0
@ -746,29 +736,29 @@ main: {
lda.z i+1
rol
sta.z __3+1
// [8] (byte*~) main::$7 ← (byte*)(const struct Point*) points + (word~) main::$3 -- pbuz1=pbuc1_plus_vwuz2
// [8] (byte*~) main::$5 ← (byte*)(const struct Point*) points + (word~) main::$3 -- pbuz1=pbuc1_plus_vwuz2
lda.z __3
clc
adc #<points
sta.z __7
sta.z __5
lda.z __3+1
adc #>points
sta.z __7+1
// [9] *((byte*~) main::$7) ← (byte) 2 -- _deref_pbuz1=vbuc1
sta.z __5+1
// [9] *((byte*~) main::$5) ← (byte) 2 -- _deref_pbuz1=vbuc1
lda #2
ldy #0
sta (__7),y
// [10] (byte*~) main::$8 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3 -- pbuz1=pbuc1_plus_vwuz1
sta (__5),y
// [10] (byte*~) main::$6 ← (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (word~) main::$3 -- pbuz1=pbuc1_plus_vwuz1
clc
lda.z __8
lda.z __6
adc #<points+OFFSET_STRUCT_POINT_Y
sta.z __8
lda.z __8+1
sta.z __6
lda.z __6+1
adc #>points+OFFSET_STRUCT_POINT_Y
sta.z __8+1
// [11] *((byte*~) main::$8) ← (byte~) main::$0 -- _deref_pbuz1=vbuxx
sta.z __6+1
// [11] *((byte*~) main::$6) ← (byte~) main::$0 -- _deref_pbuz1=vbuxx
txa
sta (__8),y
sta (__6),y
// for( word i: 0..499)
// [12] (word) main::i#1 ← ++ (word) main::i#2 -- vwuz1=_inc_vwuz1
inc.z i
@ -799,27 +789,27 @@ main: {
lda.z i1+1
rol
sta.z __4+1
// [16] (struct Point*~) main::$9 ← (const struct Point*) points + (word~) main::$4 -- pssz1=pssc1_plus_vwuz2
// [16] (struct Point*~) main::$7 ← (const struct Point*) points + (word~) main::$4 -- pssz1=pssc1_plus_vwuz2
lda.z __4
clc
adc #<points
sta.z __9
sta.z __7
lda.z __4+1
adc #>points
sta.z __9+1
// [17] (struct Point*~) main::$10 ← (const struct Point*) main::SCREEN + (word~) main::$4 -- pssz1=pssc1_plus_vwuz1
sta.z __7+1
// [17] (struct Point*~) main::$8 ← (const struct Point*) main::SCREEN + (word~) main::$4 -- pssz1=pssc1_plus_vwuz1
clc
lda.z __10
lda.z __8
adc #<SCREEN
sta.z __10
lda.z __10+1
sta.z __8
lda.z __8+1
adc #>SCREEN
sta.z __10+1
// [18] *((struct Point*~) main::$10) ← memcpy(*((struct Point*~) main::$9), struct Point, (const byte) SIZEOF_STRUCT_POINT) -- _deref_pssz1=_deref_pssz2_memcpy_vbuc1
sta.z __8+1
// [18] *((struct Point*~) main::$8) ← memcpy(*((struct Point*~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT) -- _deref_pssz1=_deref_pssz2_memcpy_vbuc1
ldy #0
!:
lda (__9),y
sta (__10),y
lda (__7),y
sta (__8),y
iny
cpy #SIZEOF_STRUCT_POINT
bne !-

View File

@ -7,12 +7,12 @@
(const byte) SIZEOF_STRUCT_POINT = (byte) 2
(void()) main()
(byte~) main::$0 reg byte x 4.4
(struct Point*~) main::$10 zp[2]:10 22.0
(word~) main::$3 zp[2]:6 11.0
(word~) main::$4 zp[2]:10 16.5
(byte*~) main::$7 zp[2]:8 22.0
(byte*~) main::$8 zp[2]:6 22.0
(struct Point*~) main::$9 zp[2]:12 5.5
(byte*~) main::$5 zp[2]:8 22.0
(byte*~) main::$6 zp[2]:6 22.0
(struct Point*~) main::$7 zp[2]:12 5.5
(struct Point*~) main::$8 zp[2]:10 22.0
(label) main::@1
(label) main::@2
(label) main::@return
@ -28,7 +28,7 @@
zp[2]:2 [ main::i#2 main::i#1 ]
zp[2]:4 [ main::i1#2 main::i1#1 ]
reg byte x [ main::$0 ]
zp[2]:6 [ main::$3 main::$8 ]
zp[2]:8 [ main::$7 ]
zp[2]:10 [ main::$4 main::$10 ]
zp[2]:12 [ main::$9 ]
zp[2]:6 [ main::$3 main::$6 ]
zp[2]:8 [ main::$5 ]
zp[2]:10 [ main::$4 main::$8 ]
zp[2]:12 [ main::$7 ]

View File

@ -15,8 +15,8 @@ main: scope:[main] from @1
main::@1: scope:[main] from main main::@1
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
[6] (signed byte~) main::$2 ← - (signed byte)(byte) main::i#2
[7] (byte~) main::$11 ← (byte) main::i#2 << (byte) 1
[8] (byte~) main::$6 ← (byte~) main::$11 + (byte) main::i#2
[7] (byte~) main::$8 ← (byte) main::i#2 << (byte) 1
[8] (byte~) main::$6 ← (byte~) main::$8 + (byte) main::i#2
[9] *((signed byte*)(const struct Point*) points + (byte~) main::$6) ← (signed byte)(byte) main::i#2
[10] *((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$6) ← (signed byte~) main::$2
[11] *((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Z + (byte~) main::$6) ← (signed byte)(byte) main::i#2
@ -25,8 +25,8 @@ main::@1: scope:[main] from main main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[14] (byte) main::i1#2 ← phi( main::@1/(byte) 0 main::@2/(byte) main::i1#1 )
[15] (byte~) main::$13 ← (byte) main::i1#2 << (byte) 1
[16] (byte~) main::$7 ← (byte~) main::$13 + (byte) main::i1#2
[15] (byte~) main::$10 ← (byte) main::i1#2 << (byte) 1
[16] (byte~) main::$7 ← (byte~) main::$10 + (byte) main::i1#2
[17] *((const struct Point*) main::SCREEN + (byte~) main::$7) ← memcpy(*((const struct Point*) points + (byte~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT)
[18] (byte) main::i1#1 ← ++ (byte) main::i1#2
[19] if((byte) main::i1#1!=(byte) 4) goto main::@2

View File

@ -2,9 +2,10 @@ Fixing pointer array-indexing *((const struct Point*) points + (byte) main::i)
Fixing pointer array-indexing *((const struct Point*) points + (byte) main::i1)
Fixing pointer array-indexing *((const struct Point*) main::SCREEN + (byte) main::i1)
Constantified RValue *((const struct Point*) points + (byte~) main::$6) ← (struct Point){ (signed byte~) main::$0, (signed byte~) main::$2, (signed byte~) main::$3 }
Adding struct value member variable copy *((signed byte*~) main::$8 + (byte~) main::$6) ← (signed byte~) main::$0
Adding struct value member variable copy *((signed byte*~) main::$9 + (byte~) main::$6) ← (signed byte~) main::$2
Adding struct value member variable copy *((signed byte*~) main::$10 + (byte~) main::$6) ← (signed byte~) main::$3
Unwinding value copy *((const struct Point*) points + (byte~) main::$6) ← (struct Point){ (signed byte~) main::$0, (signed byte~) main::$2, (signed byte~) main::$3 }
Adding value simple copy *((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (byte~) main::$6) ← (signed byte~) main::$0
Adding value simple copy *((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$6) ← (signed byte~) main::$2
Adding value simple copy *((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Z + (byte~) main::$6) ← (signed byte~) main::$3
Adding value bulk copy *((const struct Point*) main::SCREEN + (byte~) main::$7) ← memcpy(*((const struct Point*) points + (byte~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Culled Empty Block (label) main::@4
@ -23,12 +24,9 @@ main::@1: scope:[main] from main main::@1
(signed byte~) main::$2 ← - (signed byte~) main::$1
(signed byte~) main::$3 ← ((signed byte)) (byte) main::i#2
(byte~) main::$6 ← (byte) main::i#2 * (const byte) SIZEOF_STRUCT_POINT
(signed byte*~) main::$8 ← (signed byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X
*((signed byte*~) main::$8 + (byte~) main::$6) ← (signed byte~) main::$0
(signed byte*~) main::$9 ← (signed byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y
*((signed byte*~) main::$9 + (byte~) main::$6) ← (signed byte~) main::$2
(signed byte*~) main::$10 ← (signed byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Z
*((signed byte*~) main::$10 + (byte~) main::$6) ← (signed byte~) main::$3
*((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (byte~) main::$6) ← (signed byte~) main::$0
*((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$6) ← (signed byte~) main::$2
*((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Z + (byte~) main::$6) ← (signed byte~) main::$3
(byte) main::i#1 ← (byte) main::i#2 + rangenext(0,3)
(bool~) main::$4 ← (byte) main::i#1 != rangelast(0,3)
if((bool~) main::$4) goto main::@1
@ -69,15 +67,12 @@ SYMBOL TABLE SSA
(void()) main()
(signed byte~) main::$0
(signed byte~) main::$1
(signed byte*~) main::$10
(signed byte~) main::$2
(signed byte~) main::$3
(bool~) main::$4
(bool~) main::$5
(byte~) main::$6
(byte~) main::$7
(signed byte*~) main::$8
(signed byte*~) main::$9
(label) main::@1
(label) main::@2
(label) main::@3
@ -99,24 +94,17 @@ Inlining cast (signed byte~) main::$3 ← (signed byte)(byte) main::i#2
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (struct Point*) 1024
Successful SSA optimization PassNCastSimplification
Simple Condition (bool~) main::$4 [15] if((byte) main::i#1!=rangelast(0,3)) goto main::@1
Simple Condition (bool~) main::$5 [22] if((byte) main::i1#1!=rangelast(0,3)) goto main::@3
Simple Condition (bool~) main::$4 [12] if((byte) main::i#1!=rangelast(0,3)) goto main::@1
Simple Condition (bool~) main::$5 [19] if((byte) main::i1#1!=rangelast(0,3)) goto main::@3
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [7] (signed byte*~) main::$8 ← (signed byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [9] (signed byte*~) main::$9 ← (signed byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [11] (signed byte*~) main::$10 ← (signed byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Z
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::i#0 = 0
Constant (const signed byte*) main::$8 = (signed byte*)points+OFFSET_STRUCT_POINT_X
Constant (const signed byte*) main::$9 = (signed byte*)points+OFFSET_STRUCT_POINT_Y
Constant (const signed byte*) main::$10 = (signed byte*)points+OFFSET_STRUCT_POINT_Z
Constant (const byte) main::i1#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [13] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [15] if(main::i#1!=rangelast(0,3)) goto main::@1 to (number) 4
Resolved ranged next value [20] main::i1#1 ← ++ main::i1#2 to ++
Resolved ranged comparison value [22] if(main::i1#1!=rangelast(0,3)) goto main::@3 to (number) 4
Simplifying expression containing zero (signed byte*)points in
Resolved ranged next value [10] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [12] if(main::i#1!=rangelast(0,3)) goto main::@1 to (number) 4
Resolved ranged next value [17] main::i1#1 ← ++ main::i1#2 to ++
Resolved ranged comparison value [19] if(main::i1#1!=rangelast(0,3)) goto main::@3 to (number) 4
Simplifying expression containing zero (signed byte*)points in [7] *((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (byte~) main::$6) ← (signed byte~) main::$0
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
Successful SSA optimization PassNEliminateUnusedVars
@ -139,12 +127,9 @@ Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte) main::i1#0
Constant inlined main::i#0 = (byte) 0
Constant inlined main::i1#0 = (byte) 0
Constant inlined main::$9 = (signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$10 = (signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Z
Constant inlined main::$8 = (signed byte*)(const struct Point*) points
Successful SSA optimization Pass2ConstantInlining
Alias (byte~) main::$6 = (byte~) main::$12
Alias (byte~) main::$7 = (byte~) main::$14
Alias (byte~) main::$6 = (byte~) main::$9
Alias (byte~) main::$7 = (byte~) main::$11
Successful SSA optimization Pass2AliasElimination
Added new block during phi lifting main::@5(between main::@1 and main::@1)
Added new block during phi lifting main::@6(between main::@3 and main::@3)
@ -189,8 +174,8 @@ main: scope:[main] from @1
main::@1: scope:[main] from main main::@1
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
[6] (signed byte~) main::$2 ← - (signed byte)(byte) main::i#2
[7] (byte~) main::$11 ← (byte) main::i#2 << (byte) 1
[8] (byte~) main::$6 ← (byte~) main::$11 + (byte) main::i#2
[7] (byte~) main::$8 ← (byte) main::i#2 << (byte) 1
[8] (byte~) main::$6 ← (byte~) main::$8 + (byte) main::i#2
[9] *((signed byte*)(const struct Point*) points + (byte~) main::$6) ← (signed byte)(byte) main::i#2
[10] *((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$6) ← (signed byte~) main::$2
[11] *((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Z + (byte~) main::$6) ← (signed byte)(byte) main::i#2
@ -199,8 +184,8 @@ main::@1: scope:[main] from main main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[14] (byte) main::i1#2 ← phi( main::@1/(byte) 0 main::@2/(byte) main::i1#1 )
[15] (byte~) main::$13 ← (byte) main::i1#2 << (byte) 1
[16] (byte~) main::$7 ← (byte~) main::$13 + (byte) main::i1#2
[15] (byte~) main::$10 ← (byte) main::i1#2 << (byte) 1
[16] (byte~) main::$7 ← (byte~) main::$10 + (byte) main::i1#2
[17] *((const struct Point*) main::SCREEN + (byte~) main::$7) ← memcpy(*((const struct Point*) points + (byte~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT)
[18] (byte) main::i1#1 ← ++ (byte) main::i1#2
[19] if((byte) main::i1#1!=(byte) 4) goto main::@2
@ -215,11 +200,11 @@ VARIABLE REGISTER WEIGHTS
(signed byte) Point::y
(signed byte) Point::z
(void()) main()
(byte~) main::$11 22.0
(byte~) main::$13 22.0
(byte~) main::$10 22.0
(signed byte~) main::$2 5.5
(byte~) main::$6 14.666666666666666
(byte~) main::$7 22.0
(byte~) main::$8 22.0
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#2 6.285714285714286
@ -231,24 +216,24 @@ Initial phi equivalence classes
[ main::i#2 main::i#1 ]
[ main::i1#2 main::i1#1 ]
Added variable main::$2 to live range equivalence class [ main::$2 ]
Added variable main::$11 to live range equivalence class [ main::$11 ]
Added variable main::$8 to live range equivalence class [ main::$8 ]
Added variable main::$6 to live range equivalence class [ main::$6 ]
Added variable main::$13 to live range equivalence class [ main::$13 ]
Added variable main::$10 to live range equivalence class [ main::$10 ]
Added variable main::$7 to live range equivalence class [ main::$7 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::i1#2 main::i1#1 ]
[ main::$2 ]
[ main::$11 ]
[ main::$8 ]
[ main::$6 ]
[ main::$13 ]
[ main::$10 ]
[ main::$7 ]
Allocated zp[1]:2 [ main::i#2 main::i#1 ]
Allocated zp[1]:3 [ main::i1#2 main::i1#1 ]
Allocated zp[1]:4 [ main::$2 ]
Allocated zp[1]:5 [ main::$11 ]
Allocated zp[1]:5 [ main::$8 ]
Allocated zp[1]:6 [ main::$6 ]
Allocated zp[1]:7 [ main::$13 ]
Allocated zp[1]:7 [ main::$10 ]
Allocated zp[1]:8 [ main::$7 ]
INITIAL ASM
@ -287,8 +272,8 @@ main: {
.label __7 = 8
.label i = 2
.label i1 = 3
.label __11 = 5
.label __13 = 7
.label __8 = 5
.label __10 = 7
// [5] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [5] phi (byte) main::i#2 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
@ -307,12 +292,12 @@ main: {
clc
adc #1
sta.z __2
// [7] (byte~) main::$11 ← (byte) main::i#2 << (byte) 1 -- vbuz1=vbuz2_rol_1
// [7] (byte~) main::$8 ← (byte) main::i#2 << (byte) 1 -- vbuz1=vbuz2_rol_1
lda.z i
asl
sta.z __11
// [8] (byte~) main::$6 ← (byte~) main::$11 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3
lda.z __11
sta.z __8
// [8] (byte~) main::$6 ← (byte~) main::$8 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3
lda.z __8
clc
adc.z i
sta.z __6
@ -346,12 +331,12 @@ main: {
jmp __b2
// main::@2
__b2:
// [15] (byte~) main::$13 ← (byte) main::i1#2 << (byte) 1 -- vbuz1=vbuz2_rol_1
// [15] (byte~) main::$10 ← (byte) main::i1#2 << (byte) 1 -- vbuz1=vbuz2_rol_1
lda.z i1
asl
sta.z __13
// [16] (byte~) main::$7 ← (byte~) main::$13 + (byte) main::i1#2 -- vbuz1=vbuz2_plus_vbuz3
lda.z __13
sta.z __10
// [16] (byte~) main::$7 ← (byte~) main::$10 + (byte) main::i1#2 -- vbuz1=vbuz2_plus_vbuz3
lda.z __10
clc
adc.z i1
sta.z __7
@ -382,44 +367,44 @@ main: {
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] (signed byte~) main::$2 ← - (signed byte)(byte) main::i#2 [ main::i#2 main::$2 ] ( main:2 [ main::i#2 main::$2 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::i#2 main::i#1 ]
Statement [7] (byte~) main::$11 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$2 main::$11 ] ( main:2 [ main::i#2 main::$2 main::$11 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$8 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$2 main::$8 ] ( main:2 [ main::i#2 main::$2 main::$8 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:4 [ main::$2 ]
Statement [8] (byte~) main::$6 ← (byte~) main::$11 + (byte) main::i#2 [ main::i#2 main::$2 main::$6 ] ( main:2 [ main::i#2 main::$2 main::$6 ] ) always clobbers reg byte a
Statement [8] (byte~) main::$6 ← (byte~) main::$8 + (byte) main::i#2 [ main::i#2 main::$2 main::$6 ] ( main:2 [ main::i#2 main::$2 main::$6 ] ) always clobbers reg byte a
Statement [9] *((signed byte*)(const struct Point*) points + (byte~) main::$6) ← (signed byte)(byte) main::i#2 [ main::i#2 main::$2 main::$6 ] ( main:2 [ main::i#2 main::$2 main::$6 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:6 [ main::$6 ]
Statement [10] *((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$6) ← (signed byte~) main::$2 [ main::i#2 main::$6 ] ( main:2 [ main::i#2 main::$6 ] ) always clobbers reg byte a
Statement [11] *((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Z + (byte~) main::$6) ← (signed byte)(byte) main::i#2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Statement [15] (byte~) main::$13 ← (byte) main::i1#2 << (byte) 1 [ main::i1#2 main::$13 ] ( main:2 [ main::i1#2 main::$13 ] ) always clobbers reg byte a
Statement [15] (byte~) main::$10 ← (byte) main::i1#2 << (byte) 1 [ main::i1#2 main::$10 ] ( main:2 [ main::i1#2 main::$10 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::i1#2 main::i1#1 ]
Statement [16] (byte~) main::$7 ← (byte~) main::$13 + (byte) main::i1#2 [ main::i1#2 main::$7 ] ( main:2 [ main::i1#2 main::$7 ] ) always clobbers reg byte a
Statement [16] (byte~) main::$7 ← (byte~) main::$10 + (byte) main::i1#2 [ main::i1#2 main::$7 ] ( main:2 [ main::i1#2 main::$7 ] ) always clobbers reg byte a
Statement [17] *((const struct Point*) main::SCREEN + (byte~) main::$7) ← memcpy(*((const struct Point*) points + (byte~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT) [ main::i1#2 ] ( main:2 [ main::i1#2 ] ) always clobbers reg byte a reg byte x reg byte y
Removing always clobbered register reg byte x as potential for zp[1]:3 [ main::i1#2 main::i1#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:3 [ main::i1#2 main::i1#1 ]
Statement [19] if((byte) main::i1#1!=(byte) 4) goto main::@2 [ main::i1#1 ] ( main:2 [ main::i1#1 ] ) always clobbers reg byte a
Statement [6] (signed byte~) main::$2 ← - (signed byte)(byte) main::i#2 [ main::i#2 main::$2 ] ( main:2 [ main::i#2 main::$2 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$11 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$2 main::$11 ] ( main:2 [ main::i#2 main::$2 main::$11 ] ) always clobbers reg byte a
Statement [8] (byte~) main::$6 ← (byte~) main::$11 + (byte) main::i#2 [ main::i#2 main::$2 main::$6 ] ( main:2 [ main::i#2 main::$2 main::$6 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$8 ← (byte) main::i#2 << (byte) 1 [ main::i#2 main::$2 main::$8 ] ( main:2 [ main::i#2 main::$2 main::$8 ] ) always clobbers reg byte a
Statement [8] (byte~) main::$6 ← (byte~) main::$8 + (byte) main::i#2 [ main::i#2 main::$2 main::$6 ] ( main:2 [ main::i#2 main::$2 main::$6 ] ) always clobbers reg byte a
Statement [9] *((signed byte*)(const struct Point*) points + (byte~) main::$6) ← (signed byte)(byte) main::i#2 [ main::i#2 main::$2 main::$6 ] ( main:2 [ main::i#2 main::$2 main::$6 ] ) always clobbers reg byte a
Statement [10] *((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$6) ← (signed byte~) main::$2 [ main::i#2 main::$6 ] ( main:2 [ main::i#2 main::$6 ] ) always clobbers reg byte a
Statement [11] *((signed byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Z + (byte~) main::$6) ← (signed byte)(byte) main::i#2 [ main::i#2 ] ( main:2 [ main::i#2 ] ) always clobbers reg byte a
Statement [15] (byte~) main::$13 ← (byte) main::i1#2 << (byte) 1 [ main::i1#2 main::$13 ] ( main:2 [ main::i1#2 main::$13 ] ) always clobbers reg byte a
Statement [16] (byte~) main::$7 ← (byte~) main::$13 + (byte) main::i1#2 [ main::i1#2 main::$7 ] ( main:2 [ main::i1#2 main::$7 ] ) always clobbers reg byte a
Statement [15] (byte~) main::$10 ← (byte) main::i1#2 << (byte) 1 [ main::i1#2 main::$10 ] ( main:2 [ main::i1#2 main::$10 ] ) always clobbers reg byte a
Statement [16] (byte~) main::$7 ← (byte~) main::$10 + (byte) main::i1#2 [ main::i1#2 main::$7 ] ( main:2 [ main::i1#2 main::$7 ] ) always clobbers reg byte a
Statement [17] *((const struct Point*) main::SCREEN + (byte~) main::$7) ← memcpy(*((const struct Point*) points + (byte~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT) [ main::i1#2 ] ( main:2 [ main::i1#2 ] ) always clobbers reg byte a reg byte x reg byte y
Statement [19] if((byte) main::i1#1!=(byte) 4) goto main::@2 [ main::i1#1 ] ( main:2 [ main::i1#1 ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ main::i#2 main::i#1 ] : zp[1]:2 , reg byte x , reg byte y ,
Potential registers zp[1]:3 [ main::i1#2 main::i1#1 ] : zp[1]:3 ,
Potential registers zp[1]:4 [ main::$2 ] : zp[1]:4 , reg byte x , reg byte y ,
Potential registers zp[1]:5 [ main::$11 ] : zp[1]:5 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:5 [ main::$8 ] : zp[1]:5 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:6 [ main::$6 ] : zp[1]:6 , reg byte x , reg byte y ,
Potential registers zp[1]:7 [ main::$13 ] : zp[1]:7 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:7 [ main::$10 ] : zp[1]:7 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:8 [ main::$7 ] : zp[1]:8 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 27.5: zp[1]:3 [ main::i1#2 main::i1#1 ] 22.79: zp[1]:2 [ main::i#2 main::i#1 ] 22: zp[1]:5 [ main::$11 ] 22: zp[1]:7 [ main::$13 ] 22: zp[1]:8 [ main::$7 ] 14.67: zp[1]:6 [ main::$6 ] 5.5: zp[1]:4 [ main::$2 ]
Uplift Scope [main] 27.5: zp[1]:3 [ main::i1#2 main::i1#1 ] 22.79: zp[1]:2 [ main::i#2 main::i#1 ] 22: zp[1]:5 [ main::$8 ] 22: zp[1]:7 [ main::$10 ] 22: zp[1]:8 [ main::$7 ] 14.67: zp[1]:6 [ main::$6 ] 5.5: zp[1]:4 [ main::$2 ]
Uplift Scope [Point]
Uplift Scope []
Uplifting [main] best 1298 combination zp[1]:3 [ main::i1#2 main::i1#1 ] reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$11 ] reg byte a [ main::$13 ] reg byte a [ main::$7 ] zp[1]:6 [ main::$6 ] zp[1]:4 [ main::$2 ]
Uplifting [main] best 1298 combination zp[1]:3 [ main::i1#2 main::i1#1 ] reg byte x [ main::i#2 main::i#1 ] reg byte a [ main::$8 ] reg byte a [ main::$10 ] reg byte a [ main::$7 ] zp[1]:6 [ main::$6 ] zp[1]:4 [ main::$2 ]
Limited combination testing to 100 combinations of 1728 possible.
Uplifting [Point] best 1298 combination
Uplifting [] best 1298 combination
@ -481,10 +466,10 @@ main: {
clc
adc #1
sta.z __2
// [7] (byte~) main::$11 ← (byte) main::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
// [7] (byte~) main::$8 ← (byte) main::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
txa
asl
// [8] (byte~) main::$6 ← (byte~) main::$11 + (byte) main::i#2 -- vbuyy=vbuaa_plus_vbuxx
// [8] (byte~) main::$6 ← (byte~) main::$8 + (byte) main::i#2 -- vbuyy=vbuaa_plus_vbuxx
stx.z $ff
clc
adc.z $ff
@ -515,10 +500,10 @@ main: {
jmp __b2
// main::@2
__b2:
// [15] (byte~) main::$13 ← (byte) main::i1#2 << (byte) 1 -- vbuaa=vbuz1_rol_1
// [15] (byte~) main::$10 ← (byte) main::i1#2 << (byte) 1 -- vbuaa=vbuz1_rol_1
lda.z i1
asl
// [16] (byte~) main::$7 ← (byte~) main::$13 + (byte) main::i1#2 -- vbuaa=vbuaa_plus_vbuz1
// [16] (byte~) main::$7 ← (byte~) main::$10 + (byte) main::i1#2 -- vbuaa=vbuaa_plus_vbuz1
clc
adc.z i1
// [17] *((const struct Point*) main::SCREEN + (byte~) main::$7) ← memcpy(*((const struct Point*) points + (byte~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT) -- pssc1_derefidx_vbuaa=pssc2_derefidx_vbuaa_memcpy_vbuc3
@ -587,11 +572,11 @@ FINAL SYMBOL TABLE
(signed byte) Point::z
(const byte) SIZEOF_STRUCT_POINT = (byte) 3
(void()) main()
(byte~) main::$11 reg byte a 22.0
(byte~) main::$13 reg byte a 22.0
(byte~) main::$10 reg byte a 22.0
(signed byte~) main::$2 zp[1]:3 5.5
(byte~) main::$6 reg byte y 14.666666666666666
(byte~) main::$7 reg byte a 22.0
(byte~) main::$8 reg byte a 22.0
(label) main::@1
(label) main::@2
(label) main::@return
@ -607,9 +592,9 @@ FINAL SYMBOL TABLE
reg byte x [ main::i#2 main::i#1 ]
zp[1]:2 [ main::i1#2 main::i1#1 ]
zp[1]:3 [ main::$2 ]
reg byte a [ main::$11 ]
reg byte a [ main::$8 ]
reg byte y [ main::$6 ]
reg byte a [ main::$13 ]
reg byte a [ main::$10 ]
reg byte a [ main::$7 ]
@ -653,10 +638,10 @@ main: {
adc #1
sta.z __2
// points[i] = { (signed byte)i, -(signed byte)i, (signed byte)i }
// [7] (byte~) main::$11 ← (byte) main::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
// [7] (byte~) main::$8 ← (byte) main::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
txa
asl
// [8] (byte~) main::$6 ← (byte~) main::$11 + (byte) main::i#2 -- vbuyy=vbuaa_plus_vbuxx
// [8] (byte~) main::$6 ← (byte~) main::$8 + (byte) main::i#2 -- vbuyy=vbuaa_plus_vbuxx
stx.z $ff
clc
adc.z $ff
@ -685,10 +670,10 @@ main: {
// main::@2
__b2:
// SCREEN[i] = points[i]
// [15] (byte~) main::$13 ← (byte) main::i1#2 << (byte) 1 -- vbuaa=vbuz1_rol_1
// [15] (byte~) main::$10 ← (byte) main::i1#2 << (byte) 1 -- vbuaa=vbuz1_rol_1
lda.z i1
asl
// [16] (byte~) main::$7 ← (byte~) main::$13 + (byte) main::i1#2 -- vbuaa=vbuaa_plus_vbuz1
// [16] (byte~) main::$7 ← (byte~) main::$10 + (byte) main::i1#2 -- vbuaa=vbuaa_plus_vbuz1
clc
adc.z i1
// [17] *((const struct Point*) main::SCREEN + (byte~) main::$7) ← memcpy(*((const struct Point*) points + (byte~) main::$7), struct Point, (const byte) SIZEOF_STRUCT_POINT) -- pssc1_derefidx_vbuaa=pssc2_derefidx_vbuaa_memcpy_vbuc3

View File

@ -8,11 +8,11 @@
(signed byte) Point::z
(const byte) SIZEOF_STRUCT_POINT = (byte) 3
(void()) main()
(byte~) main::$11 reg byte a 22.0
(byte~) main::$13 reg byte a 22.0
(byte~) main::$10 reg byte a 22.0
(signed byte~) main::$2 zp[1]:3 5.5
(byte~) main::$6 reg byte y 14.666666666666666
(byte~) main::$7 reg byte a 22.0
(byte~) main::$8 reg byte a 22.0
(label) main::@1
(label) main::@2
(label) main::@return
@ -28,7 +28,7 @@
reg byte x [ main::i#2 main::i#1 ]
zp[1]:2 [ main::i1#2 main::i1#1 ]
zp[1]:3 [ main::$2 ]
reg byte a [ main::$11 ]
reg byte a [ main::$8 ]
reg byte y [ main::$6 ]
reg byte a [ main::$13 ]
reg byte a [ main::$10 ]
reg byte a [ main::$7 ]

View File

@ -19,8 +19,9 @@ Converted procedure call LValue to member unwinding { (byte~) main::$1_x, (byte~
Unwinding value copy *((const struct Point*) SCREEN + (byte~) main::$3) ← (struct Point~) main::$1
Adding value simple copy *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_X + (byte~) main::$3) ← (byte~) main::$1_x
Adding value simple copy *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (byte~) main::$1_y
Adding struct value member variable copy (byte) get::p_x ← (byte) get::i
Adding struct value member variable copy (byte) get::p_y ← (byte) 7
Unwinding value copy (struct Point) get::p ← (struct Point){ (byte) get::i, (byte) 7 }
Adding value simple copy (byte) get::p_x ← (byte) get::i
Adding value simple copy (byte) get::p_y ← (byte) 7
Unwinding value copy (struct Point) get::return ← (struct Point) get::p
Adding value simple copy (byte) get::return_x ← (byte) get::p_x
Adding value simple copy (byte) get::return_y ← (byte) get::p_y

View File

@ -2,8 +2,9 @@ Fixing pointer array-indexing *((const struct Point*) points + (byte) main::i)
Fixing pointer array-indexing *((const struct Point*) points + (byte) main::i1)
Fixing pointer array-indexing *((const struct Point*) main::SCREEN + (byte) main::i1)
Constantified RValue *((const struct Point*) points + (byte~) main::$2) ← (struct Point){ (byte) 2, (byte) main::i }
Adding struct value member variable copy *((byte*~) main::$4 + (byte~) main::$2) ← (byte) 2
Adding struct value member variable copy *((byte*~) main::$5 + (byte~) main::$2) ← (byte) main::i
Unwinding value copy *((const struct Point*) points + (byte~) main::$2) ← (struct Point){ (byte) 2, (byte) main::i }
Adding value simple copy *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (byte~) main::$2) ← (byte) 2
Adding value simple copy *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$2) ← (byte) main::i
Adding value bulk copy *((const struct Point*) main::SCREEN + (byte~) main::$3) ← memcpy(*((const struct Point*) points + (byte~) main::$3), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Culled Empty Block (label) main::@4
@ -18,10 +19,8 @@ main: scope:[main] from @1
main::@1: scope:[main] from main main::@1
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 )
(byte~) main::$2 ← (byte) main::i#2 * (const byte) SIZEOF_STRUCT_POINT
(byte*~) main::$4 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X
*((byte*~) main::$4 + (byte~) main::$2) ← (byte) 2
(byte*~) main::$5 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y
*((byte*~) main::$5 + (byte~) main::$2) ← (byte) main::i#2
*((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (byte~) main::$2) ← (byte) 2
*((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$2) ← (byte) main::i#2
(byte) main::i#1 ← (byte) main::i#2 + rangenext(0,1)
(bool~) main::$0 ← (byte) main::i#1 != rangelast(0,1)
if((bool~) main::$0) goto main::@1
@ -62,8 +61,6 @@ SYMBOL TABLE SSA
(bool~) main::$1
(byte~) main::$2
(byte~) main::$3
(byte*~) main::$4
(byte*~) main::$5
(label) main::@1
(label) main::@2
(label) main::@3
@ -81,22 +78,17 @@ SYMBOL TABLE SSA
Simplifying constant pointer cast (struct Point*) 1024
Successful SSA optimization PassNCastSimplification
Simple Condition (bool~) main::$0 [9] if((byte) main::i#1!=rangelast(0,1)) goto main::@1
Simple Condition (bool~) main::$1 [16] if((byte) main::i1#1!=rangelast(0,1)) goto main::@3
Simple Condition (bool~) main::$0 [7] if((byte) main::i#1!=rangelast(0,1)) goto main::@1
Simple Condition (bool~) main::$1 [14] if((byte) main::i1#1!=rangelast(0,1)) goto main::@3
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [3] (byte*~) main::$4 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [5] (byte*~) main::$5 ← (byte*)(const struct Point*) points + (const byte) OFFSET_STRUCT_POINT_Y
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::i#0 = 0
Constant (const byte*) main::$4 = (byte*)points+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$5 = (byte*)points+OFFSET_STRUCT_POINT_Y
Constant (const byte) main::i1#0 = 0
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [7] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [9] if(main::i#1!=rangelast(0,1)) goto main::@1 to (number) 2
Resolved ranged next value [14] main::i1#1 ← ++ main::i1#2 to ++
Resolved ranged comparison value [16] if(main::i1#1!=rangelast(0,1)) goto main::@3 to (number) 2
Simplifying expression containing zero (byte*)points in
Resolved ranged next value [5] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [7] if(main::i#1!=rangelast(0,1)) goto main::@1 to (number) 2
Resolved ranged next value [12] main::i1#1 ← ++ main::i1#2 to ++
Resolved ranged comparison value [14] if(main::i1#1!=rangelast(0,1)) goto main::@3 to (number) 2
Simplifying expression containing zero (byte*)points in [3] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (byte~) main::$2) ← (byte) 2
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
Successful SSA optimization PassNEliminateUnusedVars
@ -114,10 +106,8 @@ Rewriting multiplication to use shift [7] (byte~) main::$3 ← (byte) main::i1#2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte) main::i1#0
Constant inlined main::$5 = (byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::i#0 = (byte) 0
Constant inlined main::i1#0 = (byte) 0
Constant inlined main::$4 = (byte*)(const struct Point*) points
Successful SSA optimization Pass2ConstantInlining
Added new block during phi lifting main::@5(between main::@1 and main::@1)
Added new block during phi lifting main::@6(between main::@3 and main::@3)