mirror of
https://gitlab.com/camelot/kickc.git
synced 2025-04-07 06:37:31 +00:00
Added support for initializing & copying array inside struct using intrinsic memset/memcpy.
This commit is contained in:
parent
4bd3d4a6b1
commit
2cf4a3c347
src
main
fragment/mos6502-common
java/dk/camelot64/kickc
test/ref
declared-memory-var-3.logdeclared-memory-var-5.logstruct-13.logstruct-15.logstruct-16.logstruct-17.logstruct-18.logstruct-19.logstruct-20.logstruct-21.logstruct-22.logstruct-23.logstruct-24.asmstruct-24.cfgstruct-24.logstruct-26.asmstruct-26.cfgstruct-26.logstruct-26.symstruct-ptr-12.logstruct-ptr-14.log
@ -0,0 +1,5 @@
|
||||
!:
|
||||
dex
|
||||
lda {c2},x
|
||||
sta {c1},x
|
||||
bne !-
|
@ -0,0 +1,5 @@
|
||||
lda #0
|
||||
!:
|
||||
dex
|
||||
sta {c1},x
|
||||
bne !-
|
@ -367,6 +367,22 @@ public class AsmFragmentInstanceSpecFactory {
|
||||
SymbolType type = ((StackPullValue) value).getType();
|
||||
String typeShortName = Operators.getCastUnary(type).getAsmOperator().replace("_", "");
|
||||
return "_stackpull" + typeShortName + "_";
|
||||
} else if(value instanceof MemsetValue) {
|
||||
MemsetValue memsetValue = (MemsetValue) value;
|
||||
ConstantValue sizeConst = memsetValue.getSize();
|
||||
if(sizeConst.getType(program.getScope()).equals(SymbolType.NUMBER)) {
|
||||
SymbolType fixedIntegerType = SymbolTypeConversion.getSmallestUnsignedFixedIntegerType(sizeConst, program.getScope());
|
||||
sizeConst = new ConstantCastValue(fixedIntegerType, sizeConst);
|
||||
}
|
||||
return "_memset_" + bind(sizeConst);
|
||||
} else if(value instanceof MemcpyValue) {
|
||||
MemcpyValue memcpyValue = (MemcpyValue) value;
|
||||
ConstantValue sizeConst = memcpyValue.getSize();
|
||||
if(sizeConst.getType(program.getScope()).equals(SymbolType.NUMBER)) {
|
||||
SymbolType fixedIntegerType = SymbolTypeConversion.getSmallestUnsignedFixedIntegerType(sizeConst, program.getScope());
|
||||
sizeConst = new ConstantCastValue(fixedIntegerType, sizeConst);
|
||||
}
|
||||
return bind(memcpyValue.getSource()) + "_memcpy_" + "_" + bind(sizeConst);
|
||||
}
|
||||
throw new RuntimeException("Binding of value type not supported " + value.toString(program));
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
package dk.camelot64.kickc.model;
|
||||
|
||||
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.RValue;
|
||||
import dk.camelot64.kickc.model.values.SymbolVariableRef;
|
||||
@ -34,8 +36,8 @@ public class StructUnwinding {
|
||||
* @param ref The variable to add information for
|
||||
* @return The new information about the unwinding.
|
||||
*/
|
||||
public VariableUnwinding createVariableUnwinding(SymbolVariableRef ref) {
|
||||
VariableUnwinding existing = structVariables.put(ref, new VariableUnwinding());
|
||||
public VariableUnwinding createVariableUnwinding(SymbolVariableRef ref, StructDefinition structDefinition) {
|
||||
VariableUnwinding existing = structVariables.put(ref, new VariableUnwinding(structDefinition));
|
||||
if(existing != null) {
|
||||
throw new InternalError("ERROR! Struct unwinding was already created once! " + ref.toString());
|
||||
}
|
||||
@ -46,16 +48,19 @@ public class StructUnwinding {
|
||||
/** Information about how a single struct variable was unwound. */
|
||||
public static class VariableUnwinding implements StructMemberUnwinding {
|
||||
|
||||
/** Maps member names to the unwound variables. */
|
||||
Map<String, RValue> memberUnwinding = new LinkedHashMap<>();
|
||||
StructDefinition structDefinition;
|
||||
|
||||
/** Maps member names to the unwound variable types. */
|
||||
Map<String, SymbolType> typesUnwinding = new LinkedHashMap<>();
|
||||
/** Maps member names to the unwound variables. */
|
||||
Map<String, RValue> memberUnwinding;
|
||||
|
||||
public VariableUnwinding(StructDefinition structDefinition) {
|
||||
this.structDefinition = structDefinition;
|
||||
memberUnwinding = new LinkedHashMap<>();
|
||||
}
|
||||
|
||||
/** Set how a member variable was unwound to a specific (new) variable. */
|
||||
public void setMemberUnwinding(String memberName, RValue memberVariableUnwound, SymbolType memberType) {
|
||||
public void setMemberUnwinding(String memberName, RValue memberVariableUnwound) {
|
||||
this.memberUnwinding.put(memberName, memberVariableUnwound);
|
||||
this.typesUnwinding.put(memberName, memberType);
|
||||
}
|
||||
|
||||
public List<String> getMemberNames() {
|
||||
@ -68,7 +73,12 @@ public class StructUnwinding {
|
||||
|
||||
@Override
|
||||
public SymbolType getMemberType(String memberName) {
|
||||
return this.typesUnwinding.get(memberName);
|
||||
return structDefinition.getMember(memberName).getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArraySpec getArraySpec(String memberName) {
|
||||
return structDefinition.getMember(memberName).getArraySpec();
|
||||
}
|
||||
}
|
||||
|
||||
@ -97,5 +107,12 @@ public class StructUnwinding {
|
||||
* @return The type of the member
|
||||
*/
|
||||
SymbolType getMemberType(String memberName);
|
||||
|
||||
/**
|
||||
* Get the array nature of a specific member
|
||||
* @param memberName The member name
|
||||
* @return The array nature of the member
|
||||
*/
|
||||
ArraySpec getArraySpec(String memberName);
|
||||
}
|
||||
}
|
||||
|
@ -795,6 +795,69 @@ public interface ProgramValue {
|
||||
|
||||
}
|
||||
|
||||
/** Value inside a memset value . */
|
||||
class ProgramValueMemsetValue implements ProgramValue {
|
||||
private final MemsetValue memsetValue;
|
||||
|
||||
ProgramValueMemsetValue(MemsetValue memsetValue) {
|
||||
this.memsetValue = memsetValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Value get() {
|
||||
return memsetValue.getSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(Value val) {
|
||||
memsetValue.setSize((ConstantRef) val);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Size inside a memcpy value . */
|
||||
class ProgramValueMempySize implements ProgramValue {
|
||||
|
||||
private final MemcpyValue memcpyValue;
|
||||
|
||||
ProgramValueMempySize(MemcpyValue memcpyValue) {
|
||||
this.memcpyValue = memcpyValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Value get() {
|
||||
return memcpyValue.getSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(Value val) {
|
||||
memcpyValue.setSize((ConstantRef) val);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Source inside a memcpy value . */
|
||||
class ProgramValueMempySource implements ProgramValue {
|
||||
|
||||
private final MemcpyValue memcpyValue;
|
||||
|
||||
ProgramValueMempySource(MemcpyValue memcpyValue) {
|
||||
this.memcpyValue = memcpyValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Value get() {
|
||||
return memcpyValue.getSource();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void set(Value val) {
|
||||
memcpyValue.setSource((RValue) val);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Pointer inside a pointer derefence value.
|
||||
*/
|
||||
|
@ -247,6 +247,11 @@ public class ProgramValueIterator {
|
||||
subValues.add(new ProgramValue.ProgramValueParamValue((ParamValue) value));
|
||||
} else if(value instanceof StackIdxValue) {
|
||||
subValues.add(new ProgramValue.ProgramValueStackIdxValue((StackIdxValue) value));
|
||||
} else if(value instanceof MemsetValue) {
|
||||
subValues.add(new ProgramValue.ProgramValueMemsetValue((MemsetValue) value));
|
||||
} else if(value instanceof MemcpyValue) {
|
||||
subValues.add(new ProgramValue.ProgramValueMempySize((MemcpyValue) value));
|
||||
subValues.add(new ProgramValue.ProgramValueMempySource((MemcpyValue) value));
|
||||
} else if(value == null ||
|
||||
value instanceof SymbolVariableRef ||
|
||||
value instanceof Variable ||
|
||||
|
@ -113,6 +113,10 @@ public class SymbolTypeInference {
|
||||
return inferType(symbols, ((ParamValue) rValue).getParameter());
|
||||
} else if(rValue instanceof StackIdxValue) {
|
||||
return SymbolType.BYTE;
|
||||
} else if(rValue instanceof MemsetValue) {
|
||||
return SymbolType.BYTE;
|
||||
} else if(rValue instanceof MemcpyValue) {
|
||||
return SymbolType.BYTE;
|
||||
} else if(rValue instanceof StructUnwoundPlaceholder) {
|
||||
return ((StructUnwoundPlaceholder) rValue).getTypeStruct();
|
||||
} else if(rValue instanceof ConstantStructValue) {
|
||||
|
@ -0,0 +1,41 @@
|
||||
package dk.camelot64.kickc.model.values;
|
||||
|
||||
import dk.camelot64.kickc.model.Program;
|
||||
|
||||
/** Value representing intrinsic call to memcpy(dest, src, size). */
|
||||
public class MemcpyValue implements RValue {
|
||||
|
||||
/** The pointer dereference to copy from. */
|
||||
private RValue source;
|
||||
|
||||
/** The constant holding the size to set to zero. */
|
||||
private ConstantValue size;
|
||||
|
||||
public MemcpyValue(RValue source, ConstantValue size) {
|
||||
this.source = source;
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public ConstantValue getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(ConstantValue size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public RValue getSource() {
|
||||
return source;
|
||||
}
|
||||
|
||||
public void setSource(RValue source) {
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(Program program) {
|
||||
return "memcpy("+source.toString(program)+", "+size.toString(program)+")";
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package dk.camelot64.kickc.model.values;
|
||||
|
||||
import dk.camelot64.kickc.model.Program;
|
||||
import dk.camelot64.kickc.model.types.SymbolType;
|
||||
|
||||
/** Value representing intrinsic call to memset(dest, 0, size). */
|
||||
public class MemsetValue implements RValue {
|
||||
|
||||
/** The constant holding the size to set to zero. */
|
||||
private ConstantValue size;
|
||||
|
||||
public MemsetValue(ConstantValue size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public ConstantValue getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(ConstantValue size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(Program program) {
|
||||
return "memset("+size.toString(program)+")";
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -207,14 +207,27 @@ public class Pass1UnwindStructValues extends Pass1Base {
|
||||
List<RValue> membersUnwound = new ArrayList<>();
|
||||
stmtIt.previous();
|
||||
for(String memberName : memberUnwinding.getMemberNames()) {
|
||||
LValue memberVarRef = (LValue) memberUnwinding.getMemberUnwinding(memberName, getScope());
|
||||
membersUnwound.add(memberVarRef);
|
||||
StatementSource statementSource = assignment.getSource();
|
||||
SymbolType memberType = memberUnwinding.getMemberType(memberName);
|
||||
RValue initValue = Initializers.createZeroValue(memberType, statementSource);
|
||||
Statement initStmt = new StatementAssignment(memberVarRef, initValue, assignment.isInitialAssignment(), statementSource, Comment.NO_COMMENTS);
|
||||
stmtIt.add(initStmt);
|
||||
getLog().append("Adding struct value member variable default initializer " + initStmt.toString(getProgram(), false));
|
||||
if(memberUnwinding.getArraySpec(memberName) != null) {
|
||||
// Member is an array - return pointer to array start
|
||||
RValue memberVarPointer = memberUnwinding.getMemberUnwinding(memberName, getScope());
|
||||
membersUnwound.add(memberVarPointer);
|
||||
LValue memberVarRef = new PointerDereferenceSimple(memberVarPointer);
|
||||
StatementSource statementSource = assignment.getSource();
|
||||
MemsetValue memClearValue = new MemsetValue(memberUnwinding.getArraySpec(memberName).getArraySize());
|
||||
Statement initStmt = new StatementAssignment(memberVarRef, memClearValue, assignment.isInitialAssignment(), statementSource, Comment.NO_COMMENTS);
|
||||
stmtIt.add(initStmt);
|
||||
getLog().append("Adding struct value member variable default initializer " + initStmt.toString(getProgram(), false));
|
||||
} else {
|
||||
// Member is not an array - return deref(pointer to element)
|
||||
LValue memberVarRef = (LValue) memberUnwinding.getMemberUnwinding(memberName, getScope());
|
||||
membersUnwound.add(memberVarRef);
|
||||
StatementSource statementSource = assignment.getSource();
|
||||
SymbolType memberType = memberUnwinding.getMemberType(memberName);
|
||||
RValue initValue = Initializers.createZeroValue(memberType, statementSource);
|
||||
Statement initStmt = new StatementAssignment(memberVarRef, initValue, assignment.isInitialAssignment(), statementSource, Comment.NO_COMMENTS);
|
||||
stmtIt.add(initStmt);
|
||||
getLog().append("Adding struct value member variable default initializer " + initStmt.toString(getProgram(), false));
|
||||
}
|
||||
}
|
||||
stmtIt.next();
|
||||
if(assignment.getlValue() instanceof VariableRef) {
|
||||
@ -264,12 +277,25 @@ public class Pass1UnwindStructValues extends Pass1Base {
|
||||
List<RValue> membersUnwound = new ArrayList<>();
|
||||
stmtIt.previous();
|
||||
for(String memberName : memberUnwinding.getMemberNames()) {
|
||||
LValue assignedMemberVarRef = (LValue) memberUnwinding.getMemberUnwinding(memberName, getScope());
|
||||
RValue sourceMemberVarRef = sourceMemberUnwinding.getMemberUnwinding(memberName, getScope());
|
||||
membersUnwound.add(assignedMemberVarRef);
|
||||
Statement copyStmt = new StatementAssignment(assignedMemberVarRef, sourceMemberVarRef, assignment.isInitialAssignment(), assignment.getSource(), Comment.NO_COMMENTS);
|
||||
stmtIt.add(copyStmt);
|
||||
getLog().append("Adding struct value member variable copy " + copyStmt.toString(getProgram(), false));
|
||||
if(memberUnwinding.getArraySpec(memberName)!=null) {
|
||||
RValue assignedMemberVarPointer = memberUnwinding.getMemberUnwinding(memberName, getScope());
|
||||
LValue assignedMemberVarRef = new PointerDereferenceSimple(assignedMemberVarPointer);
|
||||
RValue sourceMemberVarPointer = sourceMemberUnwinding.getMemberUnwinding(memberName, getScope());
|
||||
LValue sourceMemberVarRef = new PointerDereferenceSimple(sourceMemberVarPointer);
|
||||
ConstantValue arraySize = memberUnwinding.getArraySpec(memberName).getArraySize();
|
||||
membersUnwound.add(assignedMemberVarPointer);
|
||||
Statement copyStmt = new StatementAssignment(assignedMemberVarRef, new MemcpyValue(sourceMemberVarRef, arraySize), assignment.isInitialAssignment(), assignment.getSource(), Comment.NO_COMMENTS);
|
||||
stmtIt.add(copyStmt);
|
||||
getLog().append("Adding struct value member variable copy " + copyStmt.toString(getProgram(), false));
|
||||
|
||||
} else {
|
||||
LValue assignedMemberVarRef = (LValue) memberUnwinding.getMemberUnwinding(memberName, getScope());
|
||||
RValue sourceMemberVarRef = sourceMemberUnwinding.getMemberUnwinding(memberName, getScope());
|
||||
membersUnwound.add(assignedMemberVarRef);
|
||||
Statement copyStmt = new StatementAssignment(assignedMemberVarRef, sourceMemberVarRef, assignment.isInitialAssignment(), assignment.getSource(), Comment.NO_COMMENTS);
|
||||
stmtIt.add(copyStmt);
|
||||
getLog().append("Adding struct value member variable copy " + copyStmt.toString(getProgram(), false));
|
||||
}
|
||||
}
|
||||
stmtIt.next();
|
||||
if(assignment.getlValue() instanceof VariableRef) {
|
||||
@ -343,6 +369,11 @@ public class Pass1UnwindStructValues extends Pass1Base {
|
||||
public SymbolType getMemberType(String memberName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArraySpec getArraySpec(String memberName) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
|
||||
/** Unwinding for a simple pointer deref to a struct. */
|
||||
@ -389,6 +420,11 @@ public class Pass1UnwindStructValues extends Pass1Base {
|
||||
public SymbolType getMemberType(String memberName) {
|
||||
return structDefinition.getMember(memberName).getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArraySpec getArraySpec(String memberName) {
|
||||
return structDefinition.getMember(memberName).getArraySpec();
|
||||
}
|
||||
}
|
||||
|
||||
/** Unwinding for a indexed pointer deref to a struct. */
|
||||
@ -436,6 +472,11 @@ public class Pass1UnwindStructValues extends Pass1Base {
|
||||
return structDefinition.getMember(memberName).getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArraySpec getArraySpec(String memberName) {
|
||||
return structDefinition.getMember(memberName).getArraySpec();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Unwinding for constant struct value. */
|
||||
@ -469,6 +510,11 @@ public class Pass1UnwindStructValues extends Pass1Base {
|
||||
return structDefinition.getMember(memberName).getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArraySpec getArraySpec(String memberName) {
|
||||
return structDefinition.getMember(memberName).getArraySpec();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Unwinding for a struct value with C-classic memory layout. */
|
||||
@ -501,26 +547,23 @@ public class Pass1UnwindStructValues extends Pass1Base {
|
||||
public RValue getMemberUnwinding(String memberName, ProgramScope programScope) {
|
||||
ConstantRef memberOffsetConstant = PassNStructPointerRewriting.getMemberOffsetConstant(programScope, structDefinition, memberName);
|
||||
Variable member = structDefinition.getMember(memberName);
|
||||
Scope scope = programScope.getScope(currentBlock.getScope());
|
||||
ConstantSymbolPointer structPointer = new ConstantSymbolPointer(variable.getRef());
|
||||
ConstantCastValue structTypedPointer;
|
||||
if(member.isArray()) {
|
||||
// Pointer to array element type
|
||||
SymbolTypePointer arrayType = (SymbolTypePointer) member.getType();
|
||||
//memberAddress.setArraySpec(member.getArraySpec());
|
||||
//memberAddress.setType(member.getType());
|
||||
ConstantSymbolPointer structPointer = new ConstantSymbolPointer(variable.getRef());
|
||||
ConstantCastValue structTypedPointer = new ConstantCastValue(new SymbolTypePointer(arrayType.getElementType()), structPointer);
|
||||
// Calculate member address (element*)&struct + OFFSET_STRUCT_NAME_MEMBER
|
||||
structTypedPointer = new ConstantCastValue(new SymbolTypePointer(arrayType.getElementType()), structPointer);
|
||||
// Calculate member address (elementtype*)&struct + OFFSET_STRUCT_NAME_MEMBER
|
||||
ConstantBinary memberArrayPointer = new ConstantBinary(structTypedPointer, Operators.PLUS, memberOffsetConstant);
|
||||
// Unwind to *(ptr_struct+OFFSET_STRUCT_NAME_MEMBER)
|
||||
// Unwind to *(&struct + OFFSET_STRUCT_NAME_MEMBER)
|
||||
return memberArrayPointer;
|
||||
} else {
|
||||
Variable memberAddress = scope.addVariableIntermediate();
|
||||
memberAddress.setType(new SymbolTypePointer(member.getType()));
|
||||
ConstantSymbolPointer structPointer = new ConstantSymbolPointer(variable.getRef());
|
||||
CastValue structTypedPointer = new CastValue(new SymbolTypePointer(member.getType()), structPointer);
|
||||
// Add statement $1 = ptr_struct + OFFSET_STRUCT_NAME_MEMBER
|
||||
stmtIt.add(new StatementAssignment((LValue) memberAddress.getRef(), structTypedPointer, Operators.PLUS, memberOffsetConstant, true, currentStmt.getSource(), currentStmt.getComments()));
|
||||
// Unwind to *(ptr_struct+OFFSET_STRUCT_NAME_MEMBER)
|
||||
return new PointerDereferenceSimple(memberAddress.getRef());
|
||||
} else {
|
||||
// Pointer to member element type
|
||||
structTypedPointer = new ConstantCastValue(new SymbolTypePointer(member.getType()), structPointer);
|
||||
// Calculate member address (elementtype*)&struct + OFFSET_STRUCT_NAME_MEMBER
|
||||
ConstantBinary memberArrayPointer = new ConstantBinary(structTypedPointer, Operators.PLUS, memberOffsetConstant);
|
||||
// Unwind to *(&struct + OFFSET_STRUCT_NAME_MEMBER)
|
||||
return new PointerDereferenceSimple(memberArrayPointer);
|
||||
}
|
||||
}
|
||||
|
||||
@ -529,6 +572,11 @@ public class Pass1UnwindStructValues extends Pass1Base {
|
||||
return structDefinition.getMember(memberName).getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArraySpec getArraySpec(String memberName) {
|
||||
return structDefinition.getMember(memberName).getArraySpec();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** Unwinding for StructZero */
|
||||
@ -560,5 +608,11 @@ public class Pass1UnwindStructValues extends Pass1Base {
|
||||
public SymbolType getMemberType(String memberName) {
|
||||
return structDefinition.getMember(memberName).getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArraySpec getArraySpec(String memberName) {
|
||||
return structDefinition.getMember(memberName).getArraySpec();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -43,12 +43,12 @@ public class Pass1UnwindStructVariables extends Pass1Base {
|
||||
if(!(scope instanceof StructDefinition)) {
|
||||
// Not inside another struct
|
||||
StructDefinition structDefinition = ((SymbolTypeStruct) variable.getType()).getStructDefinition(getProgram().getScope());
|
||||
StructUnwinding.VariableUnwinding variableUnwinding = structUnwinding.createVariableUnwinding(variable.getRef());
|
||||
StructUnwinding.VariableUnwinding variableUnwinding = structUnwinding.createVariableUnwinding(variable.getRef(), structDefinition);
|
||||
for(Variable member : structDefinition.getAllVars(false)) {
|
||||
boolean isParameter = scope instanceof Procedure && ((Procedure) scope).getParameters().contains(variable);
|
||||
Variable memberVariable = Variable.createStructMemberUnwound(variable, member, isParameter);
|
||||
scope.add(memberVariable);
|
||||
variableUnwinding.setMemberUnwinding(member.getLocalName(), memberVariable.getRef(), memberVariable.getType());
|
||||
variableUnwinding.setMemberUnwinding(member.getLocalName(), memberVariable.getRef());
|
||||
getLog().append("Created struct value member variable " + memberVariable.toString(getProgram()));
|
||||
}
|
||||
getLog().append("Converted struct value to member variables " + variable.toString(getProgram()));
|
||||
|
@ -34,10 +34,10 @@ public class Pass1UnwindStructVersions extends Pass1Base {
|
||||
if(assignment.getOperator() == null && assignment.getlValue() instanceof VariableRef && assignment.getrValue2() instanceof StructUnwoundPlaceholder) {
|
||||
VariableRef structVarRef = (VariableRef) assignment.getlValue();
|
||||
if(structUnwinding.getVariableUnwinding(structVarRef) == null) {
|
||||
StructUnwinding.VariableUnwinding versionedUnwinding = structUnwinding.createVariableUnwinding(structVarRef);
|
||||
StructUnwoundPlaceholder placeholder = (StructUnwoundPlaceholder) assignment.getrValue2();
|
||||
SymbolTypeStruct typeStruct = placeholder.getTypeStruct();
|
||||
StructDefinition structDefinition = typeStruct.getStructDefinition(getProgram().getScope());
|
||||
StructUnwinding.VariableUnwinding versionedUnwinding = structUnwinding.createVariableUnwinding(structVarRef, structDefinition);
|
||||
Collection<Variable> members = structDefinition.getAllVariables(false);
|
||||
Iterator<Variable> memberDefIt = members.iterator();
|
||||
List<RValue> unwoundMembers = placeholder.getUnwoundMembers();
|
||||
@ -45,7 +45,7 @@ public class Pass1UnwindStructVersions extends Pass1Base {
|
||||
while(memberDefIt.hasNext()) {
|
||||
Variable memberVar = memberDefIt.next();
|
||||
RValue memberVal = memberUnwoundIt.next();
|
||||
versionedUnwinding.setMemberUnwinding(memberVar.getLocalName(), memberVal, memberVar.getType());
|
||||
versionedUnwinding.setMemberUnwinding(memberVar.getLocalName(), memberVal);
|
||||
}
|
||||
getLog().append("Adding versioned struct unwinding for "+assignment.getlValue().toString(getProgram()));
|
||||
modified = true;
|
||||
|
@ -1,6 +1,6 @@
|
||||
Setting inferred volatile on symbol affected by address-of (struct foo*) main::barp ← &(struct foo) bar
|
||||
Adding struct value member variable copy *((byte*~) $0) ← (byte) 'a'
|
||||
Adding struct value member variable copy *((byte*~) $1) ← (byte) 'b'
|
||||
Adding struct value member variable copy *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING1) ← (byte) 'a'
|
||||
Adding struct value member variable copy *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING2) ← (byte) 'b'
|
||||
Rewriting struct pointer member access *((struct foo*) main::barp).thing1
|
||||
Rewriting struct pointer member access *((struct foo*) main::barp).thing2
|
||||
Identified constant variable (struct foo*) main::barp
|
||||
@ -8,11 +8,9 @@ Adding versioned struct unwinding for (struct foo) bar
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@begin: scope:[] from
|
||||
(byte*~) $0 ← (byte*)&(struct foo) bar + (const byte) OFFSET_STRUCT_FOO_THING1
|
||||
*((byte*~) $0) ← (byte) 'a'
|
||||
(byte*~) $1 ← (byte*)&(struct foo) bar + (const byte) OFFSET_STRUCT_FOO_THING2
|
||||
*((byte*~) $1) ← (byte) 'b'
|
||||
(struct foo) bar ← struct-unwound {*((byte*~) $0), *((byte*~) $1)}
|
||||
*((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING1) ← (byte) 'a'
|
||||
*((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING2) ← (byte) 'b'
|
||||
(struct foo) bar ← struct-unwound {*((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING1), *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING2)}
|
||||
to:@1
|
||||
|
||||
(void()) main()
|
||||
@ -36,8 +34,6 @@ main::@return: scope:[main] from main
|
||||
@end: scope:[] from @2
|
||||
|
||||
SYMBOL TABLE SSA
|
||||
(byte*~) $0
|
||||
(byte*~) $1
|
||||
(label) @1
|
||||
(label) @2
|
||||
(label) @begin
|
||||
@ -67,21 +63,17 @@ Simplifying constant integer cast 0
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [4] (struct foo) bar ← struct-unwound {*((byte*~) $0), *((byte*~) $1)}
|
||||
Constant right-side identified [0] (byte*~) $0 ← (byte*)&(struct foo) bar + (const byte) OFFSET_STRUCT_FOO_THING1
|
||||
Constant right-side identified [2] (byte*~) $1 ← (byte*)&(struct foo) bar + (const byte) OFFSET_STRUCT_FOO_THING2
|
||||
Constant right-side identified [6] (byte*~) main::$0 ← (byte*)(const struct foo*) main::barp + (const byte) OFFSET_STRUCT_FOO_THING1
|
||||
Constant right-side identified [9] (byte*~) main::$1 ← (byte*)(const struct foo*) main::barp + (const byte) OFFSET_STRUCT_FOO_THING2
|
||||
Removing C-classic struct-unwound assignment [2] (struct foo) bar ← struct-unwound {*((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING1), *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING2)}
|
||||
Constant right-side identified [4] (byte*~) main::$0 ← (byte*)(const struct foo*) main::barp + (const byte) OFFSET_STRUCT_FOO_THING1
|
||||
Constant right-side identified [7] (byte*~) main::$1 ← (byte*)(const struct foo*) main::barp + (const byte) OFFSET_STRUCT_FOO_THING2
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) $0 = (byte*)&bar+OFFSET_STRUCT_FOO_THING1
|
||||
Constant (const byte*) $1 = (byte*)&bar+OFFSET_STRUCT_FOO_THING2
|
||||
Constant (const byte) main::i#0 = 0
|
||||
Constant (const byte*) main::$0 = (byte*)main::barp+OFFSET_STRUCT_FOO_THING1
|
||||
Constant (const byte*) main::$1 = (byte*)main::barp+OFFSET_STRUCT_FOO_THING2
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Simplifying expression containing zero (byte*)main::barp in
|
||||
Simplifying expression containing zero (byte*)&bar in
|
||||
Simplifying expression containing zero main::SCREEN in [7] *((const byte*) main::SCREEN + (const byte) main::i#0) ← *((const byte*) main::$0)
|
||||
Simplifying expression containing zero (byte*)&bar in [0] *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING1) ← (byte) 'a'
|
||||
Simplifying expression containing zero main::SCREEN in [5] *((const byte*) main::SCREEN + (const byte) main::i#0) ← *((const byte*) main::$0)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused variable (byte) main::i#2 and assignment [5] (byte) main::i#2 ← ++ (byte) main::i#1
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_FOO_THING1
|
||||
@ -95,8 +87,6 @@ Inlining constant with different constant siblings (const byte) main::i#1
|
||||
Constant inlined main::i#0 = (byte) 0
|
||||
Constant inlined main::i#1 = ++(byte) 0
|
||||
Constant inlined main::$1 = (byte*)(const struct foo*) main::barp+(const byte) OFFSET_STRUCT_FOO_THING2
|
||||
Constant inlined $0 = (byte*)&(struct foo) bar
|
||||
Constant inlined $1 = (byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING2
|
||||
Constant inlined main::$0 = (byte*)(const struct foo*) main::barp
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *(main::SCREEN+++0)
|
||||
|
@ -1,26 +1,22 @@
|
||||
Adding struct value member variable copy *((byte*~) $0) ← (byte) 'a'
|
||||
Adding struct value member variable copy *((byte*~) $1) ← (byte) 'b'
|
||||
Replacing struct member reference (struct foo) bar.thing1 with member unwinding reference *((byte*~) main::$0)
|
||||
Replacing struct member reference (struct foo) bar.thing2 with member unwinding reference *((byte*~) main::$1)
|
||||
Adding struct value member variable copy *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING1) ← (byte) 'a'
|
||||
Adding struct value member variable copy *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING2) ← (byte) 'b'
|
||||
Replacing struct member reference (struct foo) bar.thing1 with member unwinding reference *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING1)
|
||||
Replacing struct member reference (struct foo) bar.thing2 with member unwinding reference *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING2)
|
||||
Adding versioned struct unwinding for (struct foo) bar
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@begin: scope:[] from
|
||||
(byte*~) $0 ← (byte*)&(struct foo) bar + (const byte) OFFSET_STRUCT_FOO_THING1
|
||||
*((byte*~) $0) ← (byte) 'a'
|
||||
(byte*~) $1 ← (byte*)&(struct foo) bar + (const byte) OFFSET_STRUCT_FOO_THING2
|
||||
*((byte*~) $1) ← (byte) 'b'
|
||||
(struct foo) bar ← struct-unwound {*((byte*~) $0), *((byte*~) $1)}
|
||||
*((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING1) ← (byte) 'a'
|
||||
*((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING2) ← (byte) 'b'
|
||||
(struct foo) bar ← struct-unwound {*((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING1), *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING2)}
|
||||
to:@1
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
(byte) main::i#0 ← (number) 0
|
||||
*((const byte*) main::SCREEN + (byte) main::i#0) ← *((byte*~) main::$0)
|
||||
(byte*~) main::$0 ← (byte*)&(struct foo) bar + (const byte) OFFSET_STRUCT_FOO_THING1
|
||||
*((const byte*) main::SCREEN + (byte) main::i#0) ← *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING1)
|
||||
(byte) main::i#1 ← ++ (byte) main::i#0
|
||||
*((const byte*) main::SCREEN + (byte) main::i#1) ← *((byte*~) main::$1)
|
||||
(byte*~) main::$1 ← (byte*)&(struct foo) bar + (const byte) OFFSET_STRUCT_FOO_THING2
|
||||
*((const byte*) main::SCREEN + (byte) main::i#1) ← *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING2)
|
||||
(byte) main::i#2 ← ++ (byte) main::i#1
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
@ -34,8 +30,6 @@ main::@return: scope:[main] from main
|
||||
@end: scope:[] from @2
|
||||
|
||||
SYMBOL TABLE SSA
|
||||
(byte*~) $0
|
||||
(byte*~) $1
|
||||
(label) @1
|
||||
(label) @2
|
||||
(label) @begin
|
||||
@ -46,8 +40,6 @@ SYMBOL TABLE SSA
|
||||
(byte) foo::thing1
|
||||
(byte) foo::thing2
|
||||
(void()) main()
|
||||
(byte*~) main::$0
|
||||
(byte*~) main::$1
|
||||
(label) main::@return
|
||||
(const byte*) main::SCREEN = (byte*)(number) $400
|
||||
(byte) main::i
|
||||
@ -64,21 +56,12 @@ Simplifying constant integer cast 0
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [4] (struct foo) bar ← struct-unwound {*((byte*~) $0), *((byte*~) $1)}
|
||||
Constant right-side identified [0] (byte*~) $0 ← (byte*)&(struct foo) bar + (const byte) OFFSET_STRUCT_FOO_THING1
|
||||
Constant right-side identified [2] (byte*~) $1 ← (byte*)&(struct foo) bar + (const byte) OFFSET_STRUCT_FOO_THING2
|
||||
Constant right-side identified [7] (byte*~) main::$0 ← (byte*)&(struct foo) bar + (const byte) OFFSET_STRUCT_FOO_THING1
|
||||
Constant right-side identified [10] (byte*~) main::$1 ← (byte*)&(struct foo) bar + (const byte) OFFSET_STRUCT_FOO_THING2
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) $0 = (byte*)&bar+OFFSET_STRUCT_FOO_THING1
|
||||
Constant (const byte*) $1 = (byte*)&bar+OFFSET_STRUCT_FOO_THING2
|
||||
Removing C-classic struct-unwound assignment [2] (struct foo) bar ← struct-unwound {*((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING1), *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING2)}
|
||||
Constant (const byte) main::i#0 = 0
|
||||
Constant (const byte*) main::$0 = (byte*)&bar+OFFSET_STRUCT_FOO_THING1
|
||||
Constant (const byte*) main::$1 = (byte*)&bar+OFFSET_STRUCT_FOO_THING2
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Simplifying expression containing zero (byte*)&bar in
|
||||
Simplifying expression containing zero (byte*)&bar in
|
||||
Simplifying expression containing zero main::SCREEN in [6] *((const byte*) main::SCREEN + (const byte) main::i#0) ← *((const byte*) main::$0)
|
||||
Simplifying expression containing zero (byte*)&bar in [0] *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING1) ← (byte) 'a'
|
||||
Simplifying expression containing zero (byte*)&bar in [4] *((const byte*) main::SCREEN + (const byte) main::i#0) ← *((byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING1)
|
||||
Simplifying expression containing zero main::SCREEN in [4] *((const byte*) main::SCREEN + (const byte) main::i#0) ← *((byte*)&(struct foo) bar)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused variable (byte) main::i#2 and assignment [5] (byte) main::i#2 ← ++ (byte) main::i#1
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_FOO_THING1
|
||||
@ -91,10 +74,6 @@ Inlining constant with different constant siblings (const byte) main::i#0
|
||||
Inlining constant with different constant siblings (const byte) main::i#1
|
||||
Constant inlined main::i#0 = (byte) 0
|
||||
Constant inlined main::i#1 = ++(byte) 0
|
||||
Constant inlined main::$1 = (byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING2
|
||||
Constant inlined $0 = (byte*)&(struct foo) bar
|
||||
Constant inlined $1 = (byte*)&(struct foo) bar+(const byte) OFFSET_STRUCT_FOO_THING2
|
||||
Constant inlined main::$0 = (byte*)&(struct foo) bar
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *(main::SCREEN+++0)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
|
@ -1,30 +1,24 @@
|
||||
Adding struct value member variable default initializer *((byte*~) $0) ← (byte) 0
|
||||
Adding struct value member variable default initializer *((byte*~) $1) ← (byte) 0
|
||||
Replacing struct member reference (struct Point) point.x with member unwinding reference *((byte*~) main::$0)
|
||||
Replacing struct member reference (struct Point) point.y with member unwinding reference *((byte*~) main::$1)
|
||||
Replacing struct member reference (struct Point) point.x with member unwinding reference *((byte*~) main::$2)
|
||||
Replacing struct member reference (struct Point) point.y with member unwinding reference *((byte*~) main::$3)
|
||||
Adding struct value member variable default initializer *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
Adding struct value member variable default initializer *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte) 0
|
||||
Replacing struct member reference (struct Point) point.x with member unwinding reference *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Replacing struct member reference (struct Point) point.y with member unwinding reference *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Replacing struct member reference (struct Point) point.x with member unwinding reference *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Replacing struct member reference (struct Point) point.y with member unwinding reference *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Adding versioned struct unwinding for (struct Point) point
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@begin: scope:[] from
|
||||
(byte*~) $0 ← (byte*)&(struct Point) point + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) $0) ← (byte) 0
|
||||
(byte*~) $1 ← (byte*)&(struct Point) point + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) $1) ← (byte) 0
|
||||
(struct Point) point ← struct-unwound {*((byte*~) $0), *((byte*~) $1)}
|
||||
*((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
*((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte) 0
|
||||
(struct Point) point ← struct-unwound {*((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
to:@1
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
*((byte*~) main::$0) ← (number) 2
|
||||
(byte*~) main::$0 ← (byte*)&(struct Point) point + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$1) ← (number) 3
|
||||
(byte*~) main::$1 ← (byte*)&(struct Point) point + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$2)
|
||||
(byte*~) main::$2 ← (byte*)&(struct Point) point + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$3)
|
||||
(byte*~) main::$3 ← (byte*)&(struct Point) point + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X) ← (number) 2
|
||||
*((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y) ← (number) 3
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
@ -37,8 +31,6 @@ main::@return: scope:[main] from main
|
||||
@end: scope:[] from @2
|
||||
|
||||
SYMBOL TABLE SSA
|
||||
(byte*~) $0
|
||||
(byte*~) $1
|
||||
(label) @1
|
||||
(label) @2
|
||||
(label) @begin
|
||||
@ -49,20 +41,16 @@ SYMBOL TABLE SSA
|
||||
(byte) Point::y
|
||||
(const byte*) SCREEN = (byte*)(number) $400
|
||||
(void()) main()
|
||||
(byte*~) main::$0
|
||||
(byte*~) main::$1
|
||||
(byte*~) main::$2
|
||||
(byte*~) main::$3
|
||||
(label) main::@return
|
||||
(struct Point) point loadstore
|
||||
|
||||
Adding number conversion cast (unumber) 2 in *((byte*~) main::$0) ← (number) 2
|
||||
Adding number conversion cast (unumber) 3 in *((byte*~) main::$1) ← (number) 3
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$2)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$3)
|
||||
Adding number conversion cast (unumber) 2 in *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X) ← (number) 2
|
||||
Adding number conversion cast (unumber) 3 in *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y) ← (number) 3
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast *((byte*~) main::$0) ← (unumber)(number) 2
|
||||
Inlining cast *((byte*~) main::$1) ← (unumber)(number) 3
|
||||
Inlining cast *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X) ← (unumber)(number) 2
|
||||
Inlining cast *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y) ← (unumber)(number) 3
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 2
|
||||
@ -75,35 +63,14 @@ Finalized unsigned number type (byte) 3
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [4] (struct Point) point ← struct-unwound {*((byte*~) $0), *((byte*~) $1)}
|
||||
Constant right-side identified [0] (byte*~) $0 ← (byte*)&(struct Point) point + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [2] (byte*~) $1 ← (byte*)&(struct Point) point + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [6] (byte*~) main::$0 ← (byte*)&(struct Point) point + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [8] (byte*~) main::$1 ← (byte*)&(struct Point) point + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [10] (byte*~) main::$2 ← (byte*)&(struct Point) point + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [12] (byte*~) main::$3 ← (byte*)&(struct Point) point + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) $0 = (byte*)&point+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) $1 = (byte*)&point+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$0 = (byte*)&point+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$1 = (byte*)&point+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$2 = (byte*)&point+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$3 = (byte*)&point+OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Simplifying expression containing zero (byte*)&point in
|
||||
Simplifying expression containing zero (byte*)&point in
|
||||
Simplifying expression containing zero (byte*)&point in
|
||||
Simplifying expression containing zero SCREEN in [9] *((const byte*) SCREEN + (byte) 0) ← *((const byte*) main::$2)
|
||||
Removing C-classic struct-unwound assignment [2] (struct Point) point ← struct-unwound {*((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Simplifying expression containing zero (byte*)&point in [0] *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
Simplifying expression containing zero (byte*)&point in [3] *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
||||
Simplifying expression containing zero (byte*)&point in [5] *((const byte*) SCREEN + (byte) 0) ← *((byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero SCREEN in [5] *((const byte*) SCREEN + (byte) 0) ← *((byte*)&(struct Point) point)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant inlined main::$1 = (byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$2 = (byte*)&(struct Point) point
|
||||
Constant inlined main::$0 = (byte*)&(struct Point) point
|
||||
Constant inlined main::$3 = (byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined $0 = (byte*)&(struct Point) point
|
||||
Constant inlined $1 = (byte*)&(struct Point) point+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *(SCREEN+1)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Adding NOP phi() at start of @1
|
||||
|
@ -1,11 +1,11 @@
|
||||
Adding struct value member variable default initializer *((byte*~) main::$0) ← (byte) 0
|
||||
Adding struct value member variable default initializer *((byte*~) main::$1) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$2) ← *((byte*~) main::$3)
|
||||
Adding struct value member variable copy *((byte*~) main::$4) ← *((byte*~) main::$5)
|
||||
Replacing struct member reference (struct Point) main::point1.x with member unwinding reference *((byte*~) main::$6)
|
||||
Replacing struct member reference (struct Point) main::point1.y with member unwinding reference *((byte*~) main::$7)
|
||||
Replacing struct member reference (struct Point) main::point2.x with member unwinding reference *((byte*~) main::$8)
|
||||
Replacing struct member reference (struct Point) main::point2.y with member unwinding reference *((byte*~) main::$9)
|
||||
Adding struct value member variable default initializer *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
Adding struct value member variable default initializer *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Replacing struct member reference (struct Point) main::point1.x with member unwinding reference *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Replacing struct member reference (struct Point) main::point1.y with member unwinding reference *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Replacing struct member reference (struct Point) main::point2.x with member unwinding reference *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Replacing struct member reference (struct Point) main::point2.y with member unwinding reference *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Adding versioned struct unwinding for (struct Point) main::point1
|
||||
Adding versioned struct unwinding for (struct Point) main::point2
|
||||
|
||||
@ -15,26 +15,16 @@ CONTROL FLOW GRAPH SSA
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
(byte*~) main::$0 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$0) ← (byte) 0
|
||||
(byte*~) main::$1 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$1) ← (byte) 0
|
||||
(struct Point) main::point1 ← struct-unwound {*((byte*~) main::$0), *((byte*~) main::$1)}
|
||||
*((byte*~) main::$6) ← (number) 2
|
||||
(byte*~) main::$6 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$7) ← (number) 3
|
||||
(byte*~) main::$7 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
(byte*~) main::$2 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
(byte*~) main::$3 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$2) ← *((byte*~) main::$3)
|
||||
(byte*~) main::$4 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
(byte*~) main::$5 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$4) ← *((byte*~) main::$5)
|
||||
(struct Point) main::point2 ← struct-unwound {*((byte*~) main::$2), *((byte*~) main::$4)}
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$8)
|
||||
(byte*~) main::$8 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$9)
|
||||
(byte*~) main::$9 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte) 0
|
||||
(struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (number) 2
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y) ← (number) 3
|
||||
*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
(struct Point) main::point2 ← struct-unwound {*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
@ -57,27 +47,17 @@ SYMBOL TABLE SSA
|
||||
(byte) Point::y
|
||||
(const byte*) SCREEN = (byte*)(number) $400
|
||||
(void()) main()
|
||||
(byte*~) main::$0
|
||||
(byte*~) main::$1
|
||||
(byte*~) main::$2
|
||||
(byte*~) main::$3
|
||||
(byte*~) main::$4
|
||||
(byte*~) main::$5
|
||||
(byte*~) main::$6
|
||||
(byte*~) main::$7
|
||||
(byte*~) main::$8
|
||||
(byte*~) main::$9
|
||||
(label) main::@return
|
||||
(struct Point) main::point1 loadstore
|
||||
(struct Point) main::point2 loadstore
|
||||
|
||||
Adding number conversion cast (unumber) 2 in *((byte*~) main::$6) ← (number) 2
|
||||
Adding number conversion cast (unumber) 3 in *((byte*~) main::$7) ← (number) 3
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$8)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$9)
|
||||
Adding number conversion cast (unumber) 2 in *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (number) 2
|
||||
Adding number conversion cast (unumber) 3 in *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y) ← (number) 3
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast *((byte*~) main::$6) ← (unumber)(number) 2
|
||||
Inlining cast *((byte*~) main::$7) ← (unumber)(number) 3
|
||||
Inlining cast *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (unumber)(number) 2
|
||||
Inlining cast *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y) ← (unumber)(number) 3
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 2
|
||||
@ -90,50 +70,17 @@ Finalized unsigned number type (byte) 3
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [4] (struct Point) main::point1 ← struct-unwound {*((byte*~) main::$0), *((byte*~) main::$1)}
|
||||
Removing C-classic struct-unwound assignment [15] (struct Point) main::point2 ← struct-unwound {*((byte*~) main::$2), *((byte*~) main::$4)}
|
||||
Constant right-side identified [0] (byte*~) main::$0 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [2] (byte*~) main::$1 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [6] (byte*~) main::$6 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [8] (byte*~) main::$7 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [9] (byte*~) main::$2 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [10] (byte*~) main::$3 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [12] (byte*~) main::$4 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [13] (byte*~) main::$5 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [17] (byte*~) main::$8 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [19] (byte*~) main::$9 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) main::$0 = (byte*)&main::point1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$1 = (byte*)&main::point1+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$6 = (byte*)&main::point1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$7 = (byte*)&main::point1+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$2 = (byte*)&main::point2+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$3 = (byte*)&main::point1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$4 = (byte*)&main::point2+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$5 = (byte*)&main::point1+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$8 = (byte*)&main::point2+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$9 = (byte*)&main::point2+OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Simplifying expression containing zero (byte*)&main::point1 in
|
||||
Simplifying expression containing zero (byte*)&main::point1 in
|
||||
Simplifying expression containing zero (byte*)&main::point2 in
|
||||
Simplifying expression containing zero (byte*)&main::point1 in
|
||||
Simplifying expression containing zero (byte*)&main::point2 in
|
||||
Simplifying expression containing zero SCREEN in [16] *((const byte*) SCREEN + (byte) 0) ← *((const byte*) main::$8)
|
||||
Removing C-classic struct-unwound assignment [2] (struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Removing C-classic struct-unwound assignment [7] (struct Point) main::point2 ← struct-unwound {*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [0] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [3] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [5] *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero (byte*)&main::point2 in [5] *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← *((byte*)&(struct Point) main::point1)
|
||||
Simplifying expression containing zero (byte*)&main::point2 in [8] *((const byte*) SCREEN + (byte) 0) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero SCREEN in [8] *((const byte*) SCREEN + (byte) 0) ← *((byte*)&(struct Point) main::point2)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant inlined main::$1 = (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$2 = (byte*)&(struct Point) main::point2
|
||||
Constant inlined main::$0 = (byte*)&(struct Point) main::point1
|
||||
Constant inlined main::$5 = (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$6 = (byte*)&(struct Point) main::point1
|
||||
Constant inlined main::$3 = (byte*)&(struct Point) main::point1
|
||||
Constant inlined main::$4 = (byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$9 = (byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$7 = (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$8 = (byte*)&(struct Point) main::point2
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *(SCREEN+1)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Adding NOP phi() at start of @begin
|
||||
|
@ -1,7 +1,7 @@
|
||||
Adding struct value member variable copy *((byte*~) main::$0) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*~) main::$1) ← (byte)(number) 3
|
||||
Replacing struct member reference (struct Point) main::point1.x with member unwinding reference *((byte*~) main::$2)
|
||||
Replacing struct member reference (struct Point) main::point1.y with member unwinding reference *((byte*~) main::$3)
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
Replacing struct member reference (struct Point) main::point1.x with member unwinding reference *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Replacing struct member reference (struct Point) main::point1.y with member unwinding reference *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Adding versioned struct unwinding for (struct Point) main::point1
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@ -10,15 +10,11 @@ CONTROL FLOW GRAPH SSA
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
(byte*~) main::$0 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$0) ← (byte)(number) 2
|
||||
(byte*~) main::$1 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$1) ← (byte)(number) 3
|
||||
(struct Point) main::point1 ← struct-unwound {*((byte*~) main::$0), *((byte*~) main::$1)}
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$2)
|
||||
(byte*~) main::$2 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$3)
|
||||
(byte*~) main::$3 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
(struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
@ -41,15 +37,11 @@ SYMBOL TABLE SSA
|
||||
(byte) Point::y
|
||||
(const byte*) SCREEN = (byte*)(number) $400
|
||||
(void()) main()
|
||||
(byte*~) main::$0
|
||||
(byte*~) main::$1
|
||||
(byte*~) main::$2
|
||||
(byte*~) main::$3
|
||||
(label) main::@return
|
||||
(struct Point) main::point1 loadstore
|
||||
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$2)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$3)
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 2
|
||||
@ -60,28 +52,13 @@ Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [4] (struct Point) main::point1 ← struct-unwound {*((byte*~) main::$0), *((byte*~) main::$1)}
|
||||
Constant right-side identified [0] (byte*~) main::$0 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [2] (byte*~) main::$1 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [6] (byte*~) main::$2 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [8] (byte*~) main::$3 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) main::$0 = (byte*)&main::point1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$1 = (byte*)&main::point1+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$2 = (byte*)&main::point1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$3 = (byte*)&main::point1+OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Simplifying expression containing zero (byte*)&main::point1 in
|
||||
Simplifying expression containing zero (byte*)&main::point1 in
|
||||
Simplifying expression containing zero SCREEN in [5] *((const byte*) SCREEN + (byte) 0) ← *((const byte*) main::$2)
|
||||
Removing C-classic struct-unwound assignment [2] (struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [0] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [3] *((const byte*) SCREEN + (byte) 0) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero SCREEN in [3] *((const byte*) SCREEN + (byte) 0) ← *((byte*)&(struct Point) main::point1)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant inlined main::$3 = (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$1 = (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$2 = (byte*)&(struct Point) main::point1
|
||||
Constant inlined main::$0 = (byte*)&(struct Point) main::point1
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *(SCREEN+1)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Adding NOP phi() at start of @begin
|
||||
|
@ -1,25 +1,25 @@
|
||||
Adding struct value member variable default initializer *((struct Point*~) main::$0) ← {}
|
||||
Adding struct value member variable default initializer *((struct Point*~) main::$1) ← {}
|
||||
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*~) main::$2)
|
||||
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*~) main::$3)
|
||||
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*~) main::$4)
|
||||
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*~) main::$5)
|
||||
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*~) main::$6)
|
||||
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*~) main::$7)
|
||||
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*~) main::$8)
|
||||
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*~) main::$9)
|
||||
Adding struct value member variable copy *((byte*~) main::$10) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$11) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$12) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$13) ← (byte) 0
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$2).x
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$3).y
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$4).x
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$5).y
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$6).x
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$7).y
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$8).x
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$9).y
|
||||
Adding struct value member variable default initializer *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P) ← {}
|
||||
Adding struct value member variable default initializer *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q) ← {}
|
||||
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)
|
||||
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)
|
||||
Adding struct value member variable copy *((byte*~) main::$0) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$1) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$2) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$3) ← (byte) 0
|
||||
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
|
||||
Rewriting struct pointer member access *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q).y
|
||||
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
|
||||
Rewriting struct pointer member access *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q).y
|
||||
Adding versioned struct unwinding for (struct Vector) main::v
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@ -28,41 +28,31 @@ CONTROL FLOW GRAPH SSA
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
(struct Point*~) main::$0 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$10 ← (byte*)(struct Point*~) main::$0 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$10) ← (byte) 0
|
||||
(byte*~) main::$11 ← (byte*)(struct Point*~) main::$0 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$11) ← (byte) 0
|
||||
(struct Point*~) main::$1 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$12 ← (byte*)(struct Point*~) main::$1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$12) ← (byte) 0
|
||||
(byte*~) main::$13 ← (byte*)(struct Point*~) main::$1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$13) ← (byte) 0
|
||||
(struct Vector) main::v ← struct-unwound {*((struct Point*~) main::$0), *((struct Point*~) main::$1)}
|
||||
(byte*~) main::$14 ← (byte*)(struct Point*~) main::$2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$14) ← (number) 2
|
||||
(struct Point*~) main::$2 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$15 ← (byte*)(struct Point*~) main::$3 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$15) ← (number) 3
|
||||
(struct Point*~) main::$3 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$16 ← (byte*)(struct Point*~) main::$4 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$16) ← (number) 4
|
||||
(struct Point*~) main::$4 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$17 ← (byte*)(struct Point*~) main::$5 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$17) ← (number) 5
|
||||
(struct Point*~) main::$5 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$18 ← (byte*)(struct Point*~) main::$6 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$18)
|
||||
(struct Point*~) main::$6 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$19 ← (byte*)(struct Point*~) main::$7 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$19)
|
||||
(struct Point*~) main::$7 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$20 ← (byte*)(struct Point*~) main::$8 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$20)
|
||||
(struct Point*~) main::$8 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$21 ← (byte*)(struct Point*~) main::$9 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$21)
|
||||
(struct Point*~) main::$9 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$0) ← (byte) 0
|
||||
(byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$1) ← (byte) 0
|
||||
(byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$2) ← (byte) 0
|
||||
(byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$3) ← (byte) 0
|
||||
(struct Vector) main::v ← struct-unwound {*((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q)}
|
||||
(byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$4) ← (number) 2
|
||||
(byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$5) ← (number) 3
|
||||
(byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$6) ← (number) 4
|
||||
(byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$7) ← (number) 5
|
||||
(byte*~) main::$8 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$8)
|
||||
(byte*~) main::$9 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$9)
|
||||
(byte*~) main::$10 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$10)
|
||||
(byte*~) main::$11 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$11)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
@ -89,44 +79,34 @@ SYMBOL TABLE SSA
|
||||
(struct Point) Vector::p
|
||||
(struct Point) Vector::q
|
||||
(void()) main()
|
||||
(struct Point*~) main::$0
|
||||
(struct Point*~) main::$1
|
||||
(byte*~) main::$0
|
||||
(byte*~) main::$1
|
||||
(byte*~) main::$10
|
||||
(byte*~) main::$11
|
||||
(byte*~) main::$12
|
||||
(byte*~) main::$13
|
||||
(byte*~) main::$14
|
||||
(byte*~) main::$15
|
||||
(byte*~) main::$16
|
||||
(byte*~) main::$17
|
||||
(byte*~) main::$18
|
||||
(byte*~) main::$19
|
||||
(struct Point*~) main::$2
|
||||
(byte*~) main::$20
|
||||
(byte*~) main::$21
|
||||
(struct Point*~) main::$3
|
||||
(struct Point*~) main::$4
|
||||
(struct Point*~) main::$5
|
||||
(struct Point*~) main::$6
|
||||
(struct Point*~) main::$7
|
||||
(struct Point*~) main::$8
|
||||
(struct Point*~) main::$9
|
||||
(byte*~) main::$2
|
||||
(byte*~) main::$3
|
||||
(byte*~) main::$4
|
||||
(byte*~) main::$5
|
||||
(byte*~) main::$6
|
||||
(byte*~) main::$7
|
||||
(byte*~) main::$8
|
||||
(byte*~) main::$9
|
||||
(label) main::@return
|
||||
(struct Vector) main::v loadstore
|
||||
|
||||
Adding number conversion cast (unumber) 2 in *((byte*~) main::$14) ← (number) 2
|
||||
Adding number conversion cast (unumber) 3 in *((byte*~) main::$15) ← (number) 3
|
||||
Adding number conversion cast (unumber) 4 in *((byte*~) main::$16) ← (number) 4
|
||||
Adding number conversion cast (unumber) 5 in *((byte*~) main::$17) ← (number) 5
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$18)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$19)
|
||||
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$20)
|
||||
Adding number conversion cast (unumber) 3 in *((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$21)
|
||||
Adding number conversion cast (unumber) 2 in *((byte*~) main::$4) ← (number) 2
|
||||
Adding number conversion cast (unumber) 3 in *((byte*~) main::$5) ← (number) 3
|
||||
Adding number conversion cast (unumber) 4 in *((byte*~) main::$6) ← (number) 4
|
||||
Adding number conversion cast (unumber) 5 in *((byte*~) main::$7) ← (number) 5
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$8)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$9)
|
||||
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$10)
|
||||
Adding number conversion cast (unumber) 3 in *((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$11)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast *((byte*~) main::$14) ← (unumber)(number) 2
|
||||
Inlining cast *((byte*~) main::$15) ← (unumber)(number) 3
|
||||
Inlining cast *((byte*~) main::$16) ← (unumber)(number) 4
|
||||
Inlining cast *((byte*~) main::$17) ← (unumber)(number) 5
|
||||
Inlining cast *((byte*~) main::$4) ← (unumber)(number) 2
|
||||
Inlining cast *((byte*~) main::$5) ← (unumber)(number) 3
|
||||
Inlining cast *((byte*~) main::$6) ← (unumber)(number) 4
|
||||
Inlining cast *((byte*~) main::$7) ← (unumber)(number) 5
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 2
|
||||
@ -147,108 +127,65 @@ Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 3
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [10] (struct Vector) main::v ← struct-unwound {*((struct Point*~) main::$0), *((struct Point*~) main::$1)}
|
||||
Constant right-side identified [0] (struct Point*~) main::$0 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [5] (struct Point*~) main::$1 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant right-side identified [13] (struct Point*~) main::$2 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [16] (struct Point*~) main::$3 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [19] (struct Point*~) main::$4 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant right-side identified [22] (struct Point*~) main::$5 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant right-side identified [25] (struct Point*~) main::$6 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [28] (struct Point*~) main::$7 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [31] (struct Point*~) main::$8 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant right-side identified [34] (struct Point*~) main::$9 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Removing C-classic struct-unwound assignment [8] (struct Vector) main::v ← struct-unwound {*((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q)}
|
||||
Constant right-side identified [0] (byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [2] (byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [4] (byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [6] (byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [9] (byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [11] (byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [13] (byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [15] (byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [17] (byte*~) main::$8 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [19] (byte*~) main::$9 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [21] (byte*~) main::$10 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [23] (byte*~) main::$11 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const struct Point*) main::$0 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const struct Point*) main::$1 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const struct Point*) main::$2 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const struct Point*) main::$3 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const struct Point*) main::$4 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const struct Point*) main::$5 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const struct Point*) main::$6 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const struct Point*) main::$7 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const struct Point*) main::$8 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const struct Point*) main::$9 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const byte*) main::$0 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$1 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$2 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$3 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$4 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$5 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$6 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$7 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$8 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$9 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$10 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$11 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant value identified (byte*)main::$0 in [1] (byte*~) main::$10 ← (byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$0 in [3] (byte*~) main::$11 ← (byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$1 in [6] (byte*~) main::$12 ← (byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$1 in [8] (byte*~) main::$13 ← (byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$2 in [11] (byte*~) main::$14 ← (byte*)(const struct Point*) main::$2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$3 in [14] (byte*~) main::$15 ← (byte*)(const struct Point*) main::$3 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$4 in [17] (byte*~) main::$16 ← (byte*)(const struct Point*) main::$4 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$5 in [20] (byte*~) main::$17 ← (byte*)(const struct Point*) main::$5 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$6 in [23] (byte*~) main::$18 ← (byte*)(const struct Point*) main::$6 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$7 in [26] (byte*~) main::$19 ← (byte*)(const struct Point*) main::$7 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$8 in [29] (byte*~) main::$20 ← (byte*)(const struct Point*) main::$8 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$9 in [32] (byte*~) main::$21 ← (byte*)(const struct Point*) main::$9 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantValues
|
||||
Converting *(pointer+n) to pointer[n] [2] *((byte*~) main::$10) ← (byte) 0 -- *((byte*)main::$0 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [4] *((byte*~) main::$11) ← (byte) 0 -- *((byte*)main::$0 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [7] *((byte*~) main::$12) ← (byte) 0 -- *((byte*)main::$1 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [9] *((byte*~) main::$13) ← (byte) 0 -- *((byte*)main::$1 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [12] *((byte*~) main::$14) ← (byte) 2 -- *((byte*)main::$2 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [15] *((byte*~) main::$15) ← (byte) 3 -- *((byte*)main::$3 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [18] *((byte*~) main::$16) ← (byte) 4 -- *((byte*)main::$4 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [21] *((byte*~) main::$17) ← (byte) 5 -- *((byte*)main::$5 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [24] *((const byte*) SCREEN + (byte) 0) ← *((byte*~) main::$18) -- *((byte*)main::$6 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [27] *((const byte*) SCREEN + (byte) 1) ← *((byte*~) main::$19) -- *((byte*)main::$7 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [30] *((const byte*) SCREEN + (byte) 2) ← *((byte*~) main::$20) -- *((byte*)main::$8 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [33] *((const byte*) SCREEN + (byte) 3) ← *((byte*~) main::$21) -- *((byte*)main::$9 + OFFSET_STRUCT_POINT_Y)
|
||||
Successful SSA optimization Pass2InlineDerefIdx
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)main::$0 in [1] (byte*~) main::$10 ← (byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$0 in [2] *((byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
Simplifying expression containing zero (byte*)main::$1 in [6] (byte*~) main::$12 ← (byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$1 in [7] *((byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
Simplifying expression containing zero (byte*)main::$2 in [11] (byte*~) main::$14 ← (byte*)(const struct Point*) main::$2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$2 in [12] *((byte*)(const struct Point*) main::$2 + (const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
||||
Simplifying expression containing zero (byte*)main::$4 in [17] (byte*~) main::$16 ← (byte*)(const struct Point*) main::$4 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$4 in [18] *((byte*)(const struct Point*) main::$4 + (const byte) OFFSET_STRUCT_POINT_X) ← (byte) 4
|
||||
Simplifying expression containing zero (byte*)main::$6 in [23] (byte*~) main::$18 ← (byte*)(const struct Point*) main::$6 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$6 in [24] *((const byte*) SCREEN + (byte) 0) ← *((byte*)(const struct Point*) main::$6 + (const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero SCREEN in [24] *((const byte*) SCREEN + (byte) 0) ← *((byte*)(const struct Point*) main::$6)
|
||||
Simplifying expression containing zero (byte*)main::$8 in [29] (byte*~) main::$20 ← (byte*)(const struct Point*) main::$8 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$8 in [30] *((const byte*) SCREEN + (byte) 2) ← *((byte*)(const struct Point*) main::$8 + (const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q in
|
||||
Simplifying expression containing zero SCREEN in [18] *((const byte*) SCREEN + (byte) 0) ← *((const byte*) main::$8)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused variable (byte*~) main::$10 and assignment [0] (byte*~) main::$10 ← (byte*)(const struct Point*) main::$0
|
||||
Eliminating unused variable (byte*~) main::$11 and assignment [2] (byte*~) main::$11 ← (byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$12 and assignment [4] (byte*~) main::$12 ← (byte*)(const struct Point*) main::$1
|
||||
Eliminating unused variable (byte*~) main::$13 and assignment [6] (byte*~) main::$13 ← (byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$14 and assignment [8] (byte*~) main::$14 ← (byte*)(const struct Point*) main::$2
|
||||
Eliminating unused variable (byte*~) main::$15 and assignment [10] (byte*~) main::$15 ← (byte*)(const struct Point*) main::$3 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$16 and assignment [12] (byte*~) main::$16 ← (byte*)(const struct Point*) main::$4
|
||||
Eliminating unused variable (byte*~) main::$17 and assignment [14] (byte*~) main::$17 ← (byte*)(const struct Point*) main::$5 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$18 and assignment [16] (byte*~) main::$18 ← (byte*)(const struct Point*) main::$6
|
||||
Eliminating unused variable (byte*~) main::$19 and assignment [18] (byte*~) main::$19 ← (byte*)(const struct Point*) main::$7 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$20 and assignment [20] (byte*~) main::$20 ← (byte*)(const struct Point*) main::$8
|
||||
Eliminating unused variable (byte*~) main::$21 and assignment [22] (byte*~) main::$21 ← (byte*)(const struct Point*) main::$9 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant inlined main::$1 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$2 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$0 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$5 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$6 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$3 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$4 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$9 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$7 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$8 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$10 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$11 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$1 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$2 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$0 = (byte*)(struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$5 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$6 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$3 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$4 = (byte*)(struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$9 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$7 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$8 = (byte*)(struct Point*)&(struct Vector) main::v
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *(SCREEN+1)
|
||||
Consolidated array index constant in *(SCREEN+2)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *(SCREEN+3)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Adding NOP phi() at start of @begin
|
||||
|
@ -1,17 +1,17 @@
|
||||
Adding struct value member variable copy *((struct Point*~) main::$0) ← { x: (byte)(number) 2, y: (byte)(number) 3 }
|
||||
Adding struct value member variable copy *((struct Point*~) main::$1) ← { x: (byte)(number) 4, y: (byte)(number) 5 }
|
||||
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*~) main::$2)
|
||||
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*~) main::$3)
|
||||
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*~) main::$4)
|
||||
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*~) main::$5)
|
||||
Adding struct value member variable copy *((byte*~) main::$6) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*~) main::$7) ← (byte)(number) 3
|
||||
Adding struct value member variable copy *((byte*~) main::$8) ← (byte)(number) 4
|
||||
Adding struct value member variable copy *((byte*~) main::$9) ← (byte)(number) 5
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$2).x
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$3).y
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$4).x
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$5).y
|
||||
Adding struct value member variable copy *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P) ← { x: (byte)(number) 2, y: (byte)(number) 3 }
|
||||
Adding struct value member variable copy *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q) ← { x: (byte)(number) 4, y: (byte)(number) 5 }
|
||||
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)
|
||||
Adding struct value member variable copy *((byte*~) main::$0) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*~) main::$1) ← (byte)(number) 3
|
||||
Adding struct value member variable copy *((byte*~) main::$2) ← (byte)(number) 4
|
||||
Adding struct value member variable copy *((byte*~) main::$3) ← (byte)(number) 5
|
||||
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
|
||||
Rewriting struct pointer member access *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q).y
|
||||
Adding versioned struct unwinding for (struct Vector) main::v
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@ -20,29 +20,23 @@ CONTROL FLOW GRAPH SSA
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
(struct Point*~) main::$0 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$6 ← (byte*)(struct Point*~) main::$0 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$6) ← (byte)(number) 2
|
||||
(byte*~) main::$7 ← (byte*)(struct Point*~) main::$0 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$7) ← (byte)(number) 3
|
||||
(struct Point*~) main::$1 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$8 ← (byte*)(struct Point*~) main::$1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$8) ← (byte)(number) 4
|
||||
(byte*~) main::$9 ← (byte*)(struct Point*~) main::$1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$9) ← (byte)(number) 5
|
||||
(struct Vector) main::v ← struct-unwound {*((struct Point*~) main::$0), *((struct Point*~) main::$1)}
|
||||
(byte*~) main::$10 ← (byte*)(struct Point*~) main::$2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$10)
|
||||
(struct Point*~) main::$2 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$11 ← (byte*)(struct Point*~) main::$3 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$11)
|
||||
(struct Point*~) main::$3 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$12 ← (byte*)(struct Point*~) main::$4 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$12)
|
||||
(struct Point*~) main::$4 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$13 ← (byte*)(struct Point*~) main::$5 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$13)
|
||||
(struct Point*~) main::$5 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$0) ← (byte)(number) 2
|
||||
(byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$1) ← (byte)(number) 3
|
||||
(byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$2) ← (byte)(number) 4
|
||||
(byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$3) ← (byte)(number) 5
|
||||
(struct Vector) main::v ← struct-unwound {*((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q)}
|
||||
(byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$4)
|
||||
(byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$5)
|
||||
(byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$6)
|
||||
(byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$7)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
@ -69,27 +63,21 @@ SYMBOL TABLE SSA
|
||||
(struct Point) Vector::p
|
||||
(struct Point) Vector::q
|
||||
(void()) main()
|
||||
(struct Point*~) main::$0
|
||||
(struct Point*~) main::$1
|
||||
(byte*~) main::$10
|
||||
(byte*~) main::$11
|
||||
(byte*~) main::$12
|
||||
(byte*~) main::$13
|
||||
(struct Point*~) main::$2
|
||||
(struct Point*~) main::$3
|
||||
(struct Point*~) main::$4
|
||||
(struct Point*~) main::$5
|
||||
(byte*~) main::$0
|
||||
(byte*~) main::$1
|
||||
(byte*~) main::$2
|
||||
(byte*~) main::$3
|
||||
(byte*~) main::$4
|
||||
(byte*~) main::$5
|
||||
(byte*~) main::$6
|
||||
(byte*~) main::$7
|
||||
(byte*~) main::$8
|
||||
(byte*~) main::$9
|
||||
(label) main::@return
|
||||
(struct Vector) main::v loadstore
|
||||
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$10)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$11)
|
||||
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$12)
|
||||
Adding number conversion cast (unumber) 3 in *((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$13)
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$4)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$5)
|
||||
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$6)
|
||||
Adding number conversion cast (unumber) 3 in *((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$7)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 2
|
||||
@ -106,76 +94,49 @@ Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 3
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [10] (struct Vector) main::v ← struct-unwound {*((struct Point*~) main::$0), *((struct Point*~) main::$1)}
|
||||
Constant right-side identified [0] (struct Point*~) main::$0 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [5] (struct Point*~) main::$1 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant right-side identified [13] (struct Point*~) main::$2 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [16] (struct Point*~) main::$3 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [19] (struct Point*~) main::$4 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant right-side identified [22] (struct Point*~) main::$5 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Removing C-classic struct-unwound assignment [8] (struct Vector) main::v ← struct-unwound {*((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q)}
|
||||
Constant right-side identified [0] (byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [2] (byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [4] (byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [6] (byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [9] (byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [11] (byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [13] (byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [15] (byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const struct Point*) main::$0 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const struct Point*) main::$1 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const struct Point*) main::$2 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const struct Point*) main::$3 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const struct Point*) main::$4 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const struct Point*) main::$5 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const byte*) main::$0 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$1 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$2 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$3 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$4 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$5 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$6 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$7 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant value identified (byte*)main::$0 in [1] (byte*~) main::$6 ← (byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$0 in [3] (byte*~) main::$7 ← (byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$1 in [6] (byte*~) main::$8 ← (byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$1 in [8] (byte*~) main::$9 ← (byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$2 in [11] (byte*~) main::$10 ← (byte*)(const struct Point*) main::$2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$3 in [14] (byte*~) main::$11 ← (byte*)(const struct Point*) main::$3 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$4 in [17] (byte*~) main::$12 ← (byte*)(const struct Point*) main::$4 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$5 in [20] (byte*~) main::$13 ← (byte*)(const struct Point*) main::$5 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantValues
|
||||
Converting *(pointer+n) to pointer[n] [2] *((byte*~) main::$6) ← (byte) 2 -- *((byte*)main::$0 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [4] *((byte*~) main::$7) ← (byte) 3 -- *((byte*)main::$0 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [7] *((byte*~) main::$8) ← (byte) 4 -- *((byte*)main::$1 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [9] *((byte*~) main::$9) ← (byte) 5 -- *((byte*)main::$1 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [12] *((const byte*) SCREEN + (byte) 0) ← *((byte*~) main::$10) -- *((byte*)main::$2 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [15] *((const byte*) SCREEN + (byte) 1) ← *((byte*~) main::$11) -- *((byte*)main::$3 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [18] *((const byte*) SCREEN + (byte) 2) ← *((byte*~) main::$12) -- *((byte*)main::$4 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [21] *((const byte*) SCREEN + (byte) 3) ← *((byte*~) main::$13) -- *((byte*)main::$5 + OFFSET_STRUCT_POINT_Y)
|
||||
Successful SSA optimization Pass2InlineDerefIdx
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)main::$0 in [1] (byte*~) main::$6 ← (byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$0 in [2] *((byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
||||
Simplifying expression containing zero (byte*)main::$1 in [6] (byte*~) main::$8 ← (byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$1 in [7] *((byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_X) ← (byte) 4
|
||||
Simplifying expression containing zero (byte*)main::$2 in [11] (byte*~) main::$10 ← (byte*)(const struct Point*) main::$2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$2 in [12] *((const byte*) SCREEN + (byte) 0) ← *((byte*)(const struct Point*) main::$2 + (const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero SCREEN in [12] *((const byte*) SCREEN + (byte) 0) ← *((byte*)(const struct Point*) main::$2)
|
||||
Simplifying expression containing zero (byte*)main::$4 in [17] (byte*~) main::$12 ← (byte*)(const struct Point*) main::$4 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$4 in [18] *((const byte*) SCREEN + (byte) 2) ← *((byte*)(const struct Point*) main::$4 + (const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q in
|
||||
Simplifying expression containing zero SCREEN in [10] *((const byte*) SCREEN + (byte) 0) ← *((const byte*) main::$4)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused variable (byte*~) main::$6 and assignment [0] (byte*~) main::$6 ← (byte*)(const struct Point*) main::$0
|
||||
Eliminating unused variable (byte*~) main::$7 and assignment [2] (byte*~) main::$7 ← (byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$8 and assignment [4] (byte*~) main::$8 ← (byte*)(const struct Point*) main::$1
|
||||
Eliminating unused variable (byte*~) main::$9 and assignment [6] (byte*~) main::$9 ← (byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$10 and assignment [8] (byte*~) main::$10 ← (byte*)(const struct Point*) main::$2
|
||||
Eliminating unused variable (byte*~) main::$11 and assignment [10] (byte*~) main::$11 ← (byte*)(const struct Point*) main::$3 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$12 and assignment [12] (byte*~) main::$12 ← (byte*)(const struct Point*) main::$4
|
||||
Eliminating unused variable (byte*~) main::$13 and assignment [14] (byte*~) main::$13 ← (byte*)(const struct Point*) main::$5 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant inlined main::$1 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$2 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$0 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$5 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$3 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$4 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$1 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$2 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$0 = (byte*)(struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$5 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$6 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$3 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$4 = (byte*)(struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$7 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *(SCREEN+1)
|
||||
Consolidated array index constant in *(SCREEN+2)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *(SCREEN+3)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Adding NOP phi() at start of @begin
|
||||
|
@ -1,27 +1,27 @@
|
||||
Adding struct value member variable default initializer *((struct Point*~) main::$0) ← {}
|
||||
Adding struct value member variable default initializer *((struct Point*~) main::$1) ← {}
|
||||
Adding struct value member variable copy *((byte*~) main::$2) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*~) main::$3) ← (byte)(number) 3
|
||||
Adding struct value member variable copy *((byte*~) main::$4) ← (byte)(number) 4
|
||||
Adding struct value member variable copy *((byte*~) main::$5) ← (byte)(number) 5
|
||||
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*~) main::$6)
|
||||
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*~) main::$7)
|
||||
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*~) main::$8)
|
||||
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*~) main::$9)
|
||||
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*~) main::$10)
|
||||
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*~) main::$11)
|
||||
Adding struct value member variable copy *((byte*~) main::$12) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$13) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$14) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$15) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$16) ← *((byte*~) main::$17)
|
||||
Adding struct value member variable copy *((byte*~) main::$18) ← *((byte*~) main::$19)
|
||||
Adding struct value member variable copy *((byte*~) main::$20) ← *((byte*~) main::$21)
|
||||
Adding struct value member variable copy *((byte*~) main::$22) ← *((byte*~) main::$23)
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$8).x
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$9).y
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$10).x
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$11).y
|
||||
Adding struct value member variable default initializer *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P) ← {}
|
||||
Adding struct value member variable default initializer *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q) ← {}
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 4
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 5
|
||||
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.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)
|
||||
Adding struct value member variable copy *((byte*~) main::$0) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$1) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$2) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$3) ← (byte) 0
|
||||
Adding struct value member variable copy *((byte*~) main::$4) ← *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Adding struct value member variable copy *((byte*~) main::$5) ← *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Adding struct value member variable copy *((byte*~) main::$6) ← *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Adding struct value member variable copy *((byte*~) main::$7) ← *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
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
|
||||
Rewriting struct pointer member access *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q).y
|
||||
Adding versioned struct unwinding for (struct Vector) main::v
|
||||
Adding versioned struct unwinding for (struct Point) main::p1
|
||||
Adding versioned struct unwinding for (struct Point) main::p2
|
||||
@ -32,53 +32,37 @@ CONTROL FLOW GRAPH SSA
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
(struct Point*~) main::$0 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$12 ← (byte*)(struct Point*~) main::$0 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$12) ← (byte) 0
|
||||
(byte*~) main::$13 ← (byte*)(struct Point*~) main::$0 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$13) ← (byte) 0
|
||||
(struct Point*~) main::$1 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$14 ← (byte*)(struct Point*~) main::$1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$14) ← (byte) 0
|
||||
(byte*~) main::$15 ← (byte*)(struct Point*~) main::$1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$15) ← (byte) 0
|
||||
(struct Vector) main::v ← struct-unwound {*((struct Point*~) main::$0), *((struct Point*~) main::$1)}
|
||||
(byte*~) main::$2 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$2) ← (byte)(number) 2
|
||||
(byte*~) main::$3 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$3) ← (byte)(number) 3
|
||||
(struct Point) main::p1 ← struct-unwound {*((byte*~) main::$2), *((byte*~) main::$3)}
|
||||
(byte*~) main::$4 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$4) ← (byte)(number) 4
|
||||
(byte*~) main::$5 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$5) ← (byte)(number) 5
|
||||
(struct Point) main::p2 ← struct-unwound {*((byte*~) main::$4), *((byte*~) main::$5)}
|
||||
(byte*~) main::$16 ← (byte*)(struct Point*~) main::$6 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
(byte*~) main::$17 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$16) ← *((byte*~) main::$17)
|
||||
(byte*~) main::$18 ← (byte*)(struct Point*~) main::$6 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
(byte*~) main::$19 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$18) ← *((byte*~) main::$19)
|
||||
(struct Point*~) main::$6 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$20 ← (byte*)(struct Point*~) main::$7 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
(byte*~) main::$21 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$20) ← *((byte*~) main::$21)
|
||||
(byte*~) main::$22 ← (byte*)(struct Point*~) main::$7 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
(byte*~) main::$23 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$22) ← *((byte*~) main::$23)
|
||||
(struct Point*~) main::$7 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$24 ← (byte*)(struct Point*~) main::$8 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$24)
|
||||
(struct Point*~) main::$8 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$25 ← (byte*)(struct Point*~) main::$9 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$25)
|
||||
(struct Point*~) main::$9 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$26 ← (byte*)(struct Point*~) main::$10 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$26)
|
||||
(struct Point*~) main::$10 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$27 ← (byte*)(struct Point*~) main::$11 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$27)
|
||||
(struct Point*~) main::$11 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$0) ← (byte) 0
|
||||
(byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$1) ← (byte) 0
|
||||
(byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$2) ← (byte) 0
|
||||
(byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$3) ← (byte) 0
|
||||
(struct Vector) main::v ← struct-unwound {*((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q)}
|
||||
*((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
*((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
(struct Point) main::p1 ← struct-unwound {*((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
*((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 4
|
||||
*((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 5
|
||||
(struct Point) main::p2 ← struct-unwound {*((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
(byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$4) ← *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
(byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$5) ← *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
(byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$6) ← *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
(byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$7) ← *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
(byte*~) main::$8 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$8)
|
||||
(byte*~) main::$9 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$9)
|
||||
(byte*~) main::$10 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$10)
|
||||
(byte*~) main::$11 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$11)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
@ -105,43 +89,27 @@ SYMBOL TABLE SSA
|
||||
(struct Point) Vector::p
|
||||
(struct Point) Vector::q
|
||||
(void()) main()
|
||||
(struct Point*~) main::$0
|
||||
(struct Point*~) main::$1
|
||||
(struct Point*~) main::$10
|
||||
(struct Point*~) main::$11
|
||||
(byte*~) main::$12
|
||||
(byte*~) main::$13
|
||||
(byte*~) main::$14
|
||||
(byte*~) main::$15
|
||||
(byte*~) main::$16
|
||||
(byte*~) main::$17
|
||||
(byte*~) main::$18
|
||||
(byte*~) main::$19
|
||||
(byte*~) main::$0
|
||||
(byte*~) main::$1
|
||||
(byte*~) main::$10
|
||||
(byte*~) main::$11
|
||||
(byte*~) main::$2
|
||||
(byte*~) main::$20
|
||||
(byte*~) main::$21
|
||||
(byte*~) main::$22
|
||||
(byte*~) main::$23
|
||||
(byte*~) main::$24
|
||||
(byte*~) main::$25
|
||||
(byte*~) main::$26
|
||||
(byte*~) main::$27
|
||||
(byte*~) main::$3
|
||||
(byte*~) main::$4
|
||||
(byte*~) main::$5
|
||||
(struct Point*~) main::$6
|
||||
(struct Point*~) main::$7
|
||||
(struct Point*~) main::$8
|
||||
(struct Point*~) main::$9
|
||||
(byte*~) main::$6
|
||||
(byte*~) main::$7
|
||||
(byte*~) main::$8
|
||||
(byte*~) main::$9
|
||||
(label) main::@return
|
||||
(struct Point) main::p1 loadstore
|
||||
(struct Point) main::p2 loadstore
|
||||
(struct Vector) main::v loadstore
|
||||
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$24)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$25)
|
||||
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$26)
|
||||
Adding number conversion cast (unumber) 3 in *((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$27)
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$8)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$9)
|
||||
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$10)
|
||||
Adding number conversion cast (unumber) 3 in *((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$11)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 2
|
||||
@ -158,131 +126,71 @@ Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 3
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [10] (struct Vector) main::v ← struct-unwound {*((struct Point*~) main::$0), *((struct Point*~) main::$1)}
|
||||
Removing C-classic struct-unwound assignment [15] (struct Point) main::p1 ← struct-unwound {*((byte*~) main::$2), *((byte*~) main::$3)}
|
||||
Removing C-classic struct-unwound assignment [20] (struct Point) main::p2 ← struct-unwound {*((byte*~) main::$4), *((byte*~) main::$5)}
|
||||
Constant right-side identified [0] (struct Point*~) main::$0 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [5] (struct Point*~) main::$1 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant right-side identified [11] (byte*~) main::$2 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [13] (byte*~) main::$3 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [16] (byte*~) main::$4 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [18] (byte*~) main::$5 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [22] (byte*~) main::$17 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [25] (byte*~) main::$19 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [27] (struct Point*~) main::$6 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [29] (byte*~) main::$21 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [32] (byte*~) main::$23 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [34] (struct Point*~) main::$7 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant right-side identified [37] (struct Point*~) main::$8 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [40] (struct Point*~) main::$9 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [43] (struct Point*~) main::$10 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant right-side identified [46] (struct Point*~) main::$11 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Removing C-classic struct-unwound assignment [8] (struct Vector) main::v ← struct-unwound {*((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q)}
|
||||
Removing C-classic struct-unwound assignment [11] (struct Point) main::p1 ← struct-unwound {*((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Removing C-classic struct-unwound assignment [14] (struct Point) main::p2 ← struct-unwound {*((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Constant right-side identified [0] (byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [2] (byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [4] (byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [6] (byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [15] (byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [17] (byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [19] (byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [21] (byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [23] (byte*~) main::$8 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [25] (byte*~) main::$9 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [27] (byte*~) main::$10 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [29] (byte*~) main::$11 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const struct Point*) main::$0 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const struct Point*) main::$1 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const byte*) main::$2 = (byte*)&main::p1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$3 = (byte*)&main::p1+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$4 = (byte*)&main::p2+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$5 = (byte*)&main::p2+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$17 = (byte*)&main::p1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$19 = (byte*)&main::p1+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const struct Point*) main::$6 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const byte*) main::$21 = (byte*)&main::p2+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$23 = (byte*)&main::p2+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const struct Point*) main::$7 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const struct Point*) main::$8 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const struct Point*) main::$9 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const struct Point*) main::$10 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const struct Point*) main::$11 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const byte*) main::$0 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$1 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$2 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$3 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$4 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$5 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$6 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$7 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$8 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$9 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$10 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$11 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant value identified (byte*)main::$0 in [1] (byte*~) main::$12 ← (byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$0 in [3] (byte*~) main::$13 ← (byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$1 in [6] (byte*~) main::$14 ← (byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$1 in [8] (byte*~) main::$15 ← (byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$6 in [21] (byte*~) main::$16 ← (byte*)(const struct Point*) main::$6 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$6 in [24] (byte*~) main::$18 ← (byte*)(const struct Point*) main::$6 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$7 in [28] (byte*~) main::$20 ← (byte*)(const struct Point*) main::$7 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$7 in [31] (byte*~) main::$22 ← (byte*)(const struct Point*) main::$7 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$8 in [35] (byte*~) main::$24 ← (byte*)(const struct Point*) main::$8 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$9 in [38] (byte*~) main::$25 ← (byte*)(const struct Point*) main::$9 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$10 in [41] (byte*~) main::$26 ← (byte*)(const struct Point*) main::$10 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$11 in [44] (byte*~) main::$27 ← (byte*)(const struct Point*) main::$11 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantValues
|
||||
Converting *(pointer+n) to pointer[n] [2] *((byte*~) main::$12) ← (byte) 0 -- *((byte*)main::$0 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [4] *((byte*~) main::$13) ← (byte) 0 -- *((byte*)main::$0 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [7] *((byte*~) main::$14) ← (byte) 0 -- *((byte*)main::$1 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [9] *((byte*~) main::$15) ← (byte) 0 -- *((byte*)main::$1 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [23] *((byte*~) main::$16) ← *((const byte*) main::$17) -- *((byte*)main::$6 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [26] *((byte*~) main::$18) ← *((const byte*) main::$19) -- *((byte*)main::$6 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [30] *((byte*~) main::$20) ← *((const byte*) main::$21) -- *((byte*)main::$7 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [33] *((byte*~) main::$22) ← *((const byte*) main::$23) -- *((byte*)main::$7 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [36] *((const byte*) SCREEN + (byte) 0) ← *((byte*~) main::$24) -- *((byte*)main::$8 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [39] *((const byte*) SCREEN + (byte) 1) ← *((byte*~) main::$25) -- *((byte*)main::$9 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [42] *((const byte*) SCREEN + (byte) 2) ← *((byte*~) main::$26) -- *((byte*)main::$10 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [45] *((const byte*) SCREEN + (byte) 3) ← *((byte*~) main::$27) -- *((byte*)main::$11 + OFFSET_STRUCT_POINT_Y)
|
||||
Successful SSA optimization Pass2InlineDerefIdx
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)&main::p1 in
|
||||
Simplifying expression containing zero (byte*)&main::p2 in
|
||||
Simplifying expression containing zero (byte*)&main::p1 in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)&main::p2 in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)main::$0 in [1] (byte*~) main::$12 ← (byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$0 in [2] *((byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
Simplifying expression containing zero (byte*)main::$1 in [6] (byte*~) main::$14 ← (byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$1 in [7] *((byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
Simplifying expression containing zero (byte*)main::$6 in [21] (byte*~) main::$16 ← (byte*)(const struct Point*) main::$6 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$6 in [23] *((byte*)(const struct Point*) main::$6 + (const byte) OFFSET_STRUCT_POINT_X) ← *((const byte*) main::$17)
|
||||
Simplifying expression containing zero (byte*)main::$7 in [28] (byte*~) main::$20 ← (byte*)(const struct Point*) main::$7 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$7 in [30] *((byte*)(const struct Point*) main::$7 + (const byte) OFFSET_STRUCT_POINT_X) ← *((const byte*) main::$21)
|
||||
Simplifying expression containing zero (byte*)main::$8 in [35] (byte*~) main::$24 ← (byte*)(const struct Point*) main::$8 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$8 in [36] *((const byte*) SCREEN + (byte) 0) ← *((byte*)(const struct Point*) main::$8 + (const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero SCREEN in [36] *((const byte*) SCREEN + (byte) 0) ← *((byte*)(const struct Point*) main::$8)
|
||||
Simplifying expression containing zero (byte*)main::$10 in [41] (byte*~) main::$26 ← (byte*)(const struct Point*) main::$10 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$10 in [42] *((const byte*) SCREEN + (byte) 2) ← *((byte*)(const struct Point*) main::$10 + (const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q in
|
||||
Simplifying expression containing zero (byte*)&main::p1 in [9] *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
||||
Simplifying expression containing zero (byte*)&main::p2 in [12] *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 4
|
||||
Simplifying expression containing zero (byte*)&main::p1 in [16] *((const byte*) main::$4) ← *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero (byte*)&main::p2 in [20] *((const byte*) main::$6) ← *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero SCREEN in [24] *((const byte*) SCREEN + (byte) 0) ← *((const byte*) main::$8)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused variable (byte*~) main::$12 and assignment [0] (byte*~) main::$12 ← (byte*)(const struct Point*) main::$0
|
||||
Eliminating unused variable (byte*~) main::$13 and assignment [2] (byte*~) main::$13 ← (byte*)(const struct Point*) main::$0 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$14 and assignment [4] (byte*~) main::$14 ← (byte*)(const struct Point*) main::$1
|
||||
Eliminating unused variable (byte*~) main::$15 and assignment [6] (byte*~) main::$15 ← (byte*)(const struct Point*) main::$1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$16 and assignment [12] (byte*~) main::$16 ← (byte*)(const struct Point*) main::$6
|
||||
Eliminating unused variable (byte*~) main::$18 and assignment [14] (byte*~) main::$18 ← (byte*)(const struct Point*) main::$6 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$20 and assignment [16] (byte*~) main::$20 ← (byte*)(const struct Point*) main::$7
|
||||
Eliminating unused variable (byte*~) main::$22 and assignment [18] (byte*~) main::$22 ← (byte*)(const struct Point*) main::$7 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$24 and assignment [20] (byte*~) main::$24 ← (byte*)(const struct Point*) main::$8
|
||||
Eliminating unused variable (byte*~) main::$25 and assignment [22] (byte*~) main::$25 ← (byte*)(const struct Point*) main::$9 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$26 and assignment [24] (byte*~) main::$26 ← (byte*)(const struct Point*) main::$10
|
||||
Eliminating unused variable (byte*~) main::$27 and assignment [26] (byte*~) main::$27 ← (byte*)(const struct Point*) main::$11 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant inlined main::$23 = (byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$21 = (byte*)&(struct Point) main::p2
|
||||
Constant inlined main::$10 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$11 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$1 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$2 = (byte*)&(struct Point) main::p1
|
||||
Constant inlined main::$17 = (byte*)&(struct Point) main::p1
|
||||
Constant inlined main::$0 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$19 = (byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$5 = (byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$6 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$3 = (byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$4 = (byte*)&(struct Point) main::p2
|
||||
Constant inlined main::$9 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$7 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$8 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$10 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$11 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$1 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$2 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$0 = (byte*)(struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$5 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$6 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$3 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$4 = (byte*)(struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$9 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$7 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$8 = (byte*)(struct Point*)&(struct Vector) main::v
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *(SCREEN+1)
|
||||
Consolidated array index constant in *(SCREEN+2)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *(SCREEN+3)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Adding NOP phi() at start of @begin
|
||||
|
@ -1,21 +1,21 @@
|
||||
Adding struct value member variable copy *((byte*~) main::$0) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*~) main::$1) ← (byte)(number) 3
|
||||
Adding struct value member variable copy *((byte*~) main::$2) ← (byte)(number) 4
|
||||
Adding struct value member variable copy *((byte*~) main::$3) ← (byte)(number) 5
|
||||
Adding struct value list initializer *((struct Point*~) main::$4) ← (struct Point) main::p1
|
||||
Adding struct value list initializer *((struct Point*~) main::$5) ← (struct Point) main::p2
|
||||
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*~) main::$6)
|
||||
Replacing struct member reference (struct Vector) main::v.p with member unwinding reference *((struct Point*~) main::$7)
|
||||
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*~) main::$8)
|
||||
Replacing struct member reference (struct Vector) main::v.q with member unwinding reference *((struct Point*~) main::$9)
|
||||
Adding struct value member variable copy *((byte*~) main::$10) ← *((byte*~) main::$11)
|
||||
Adding struct value member variable copy *((byte*~) main::$12) ← *((byte*~) main::$13)
|
||||
Adding struct value member variable copy *((byte*~) main::$14) ← *((byte*~) main::$15)
|
||||
Adding struct value member variable copy *((byte*~) main::$16) ← *((byte*~) main::$17)
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$6).x
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$7).y
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$8).x
|
||||
Rewriting struct pointer member access *((struct Point*~) main::$9).y
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 4
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 5
|
||||
Adding struct value list initializer *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P) ← (struct Point) main::p1
|
||||
Adding struct value list initializer *((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)
|
||||
Adding struct value member variable copy *((byte*~) main::$0) ← *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Adding struct value member variable copy *((byte*~) main::$1) ← *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Adding struct value member variable copy *((byte*~) main::$2) ← *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Adding struct value member variable copy *((byte*~) main::$3) ← *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
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
|
||||
Rewriting struct pointer member access *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q).y
|
||||
Adding versioned struct unwinding for (struct Point) main::p1
|
||||
Adding versioned struct unwinding for (struct Point) main::p2
|
||||
Adding versioned struct unwinding for (struct Vector) main::v
|
||||
@ -26,43 +26,29 @@ CONTROL FLOW GRAPH SSA
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
(byte*~) main::$0 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$0) ← (byte)(number) 2
|
||||
(byte*~) main::$1 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$1) ← (byte)(number) 3
|
||||
(struct Point) main::p1 ← struct-unwound {*((byte*~) main::$0), *((byte*~) main::$1)}
|
||||
(byte*~) main::$2 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$2) ← (byte)(number) 4
|
||||
(byte*~) main::$3 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$3) ← (byte)(number) 5
|
||||
(struct Point) main::p2 ← struct-unwound {*((byte*~) main::$2), *((byte*~) main::$3)}
|
||||
(struct Point*~) main::$4 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$10 ← (byte*)(struct Point*~) main::$4 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
(byte*~) main::$11 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$10) ← *((byte*~) main::$11)
|
||||
(byte*~) main::$12 ← (byte*)(struct Point*~) main::$4 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
(byte*~) main::$13 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$12) ← *((byte*~) main::$13)
|
||||
(struct Point*~) main::$5 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$14 ← (byte*)(struct Point*~) main::$5 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
(byte*~) main::$15 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$14) ← *((byte*~) main::$15)
|
||||
(byte*~) main::$16 ← (byte*)(struct Point*~) main::$5 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
(byte*~) main::$17 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$16) ← *((byte*~) main::$17)
|
||||
(struct Vector) main::v ← struct-unwound {*((struct Point*~) main::$4), *((struct Point*~) main::$5)}
|
||||
(byte*~) main::$18 ← (byte*)(struct Point*~) main::$6 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$18)
|
||||
(struct Point*~) main::$6 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$19 ← (byte*)(struct Point*~) main::$7 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$19)
|
||||
(struct Point*~) main::$7 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
(byte*~) main::$20 ← (byte*)(struct Point*~) main::$8 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$20)
|
||||
(struct Point*~) main::$8 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
(byte*~) main::$21 ← (byte*)(struct Point*~) main::$9 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$21)
|
||||
(struct Point*~) main::$9 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
*((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
*((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
(struct Point) main::p1 ← struct-unwound {*((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
*((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 4
|
||||
*((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 5
|
||||
(struct Point) main::p2 ← struct-unwound {*((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
(byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$0) ← *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
(byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$1) ← *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
(byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$2) ← *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
(byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$3) ← *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
(struct Vector) main::v ← struct-unwound {*((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q)}
|
||||
(byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$4)
|
||||
(byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$5)
|
||||
(byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$6)
|
||||
(byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$7)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
@ -91,35 +77,21 @@ SYMBOL TABLE SSA
|
||||
(void()) main()
|
||||
(byte*~) main::$0
|
||||
(byte*~) main::$1
|
||||
(byte*~) main::$10
|
||||
(byte*~) main::$11
|
||||
(byte*~) main::$12
|
||||
(byte*~) main::$13
|
||||
(byte*~) main::$14
|
||||
(byte*~) main::$15
|
||||
(byte*~) main::$16
|
||||
(byte*~) main::$17
|
||||
(byte*~) main::$18
|
||||
(byte*~) main::$19
|
||||
(byte*~) main::$2
|
||||
(byte*~) main::$20
|
||||
(byte*~) main::$21
|
||||
(byte*~) main::$3
|
||||
(struct Point*~) main::$4
|
||||
(struct Point*~) main::$5
|
||||
(struct Point*~) main::$6
|
||||
(struct Point*~) main::$7
|
||||
(struct Point*~) main::$8
|
||||
(struct Point*~) main::$9
|
||||
(byte*~) main::$4
|
||||
(byte*~) main::$5
|
||||
(byte*~) main::$6
|
||||
(byte*~) main::$7
|
||||
(label) main::@return
|
||||
(struct Point) main::p1 loadstore
|
||||
(struct Point) main::p2 loadstore
|
||||
(struct Vector) main::v loadstore
|
||||
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$18)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$19)
|
||||
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$20)
|
||||
Adding number conversion cast (unumber) 3 in *((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$21)
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$4)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$5)
|
||||
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$6)
|
||||
Adding number conversion cast (unumber) 3 in *((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$7)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 2
|
||||
@ -136,106 +108,55 @@ Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 3
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [4] (struct Point) main::p1 ← struct-unwound {*((byte*~) main::$0), *((byte*~) main::$1)}
|
||||
Removing C-classic struct-unwound assignment [9] (struct Point) main::p2 ← struct-unwound {*((byte*~) main::$2), *((byte*~) main::$3)}
|
||||
Removing C-classic struct-unwound assignment [24] (struct Vector) main::v ← struct-unwound {*((struct Point*~) main::$4), *((struct Point*~) main::$5)}
|
||||
Constant right-side identified [0] (byte*~) main::$0 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [2] (byte*~) main::$1 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [5] (byte*~) main::$2 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [7] (byte*~) main::$3 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [10] (struct Point*~) main::$4 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [12] (byte*~) main::$11 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [15] (byte*~) main::$13 ← (byte*)&(struct Point) main::p1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [17] (struct Point*~) main::$5 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant right-side identified [19] (byte*~) main::$15 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [22] (byte*~) main::$17 ← (byte*)&(struct Point) main::p2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [27] (struct Point*~) main::$6 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [30] (struct Point*~) main::$7 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Constant right-side identified [33] (struct Point*~) main::$8 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant right-side identified [36] (struct Point*~) main::$9 ← (struct Point*)&(struct Vector) main::v + (const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Removing C-classic struct-unwound assignment [2] (struct Point) main::p1 ← struct-unwound {*((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Removing C-classic struct-unwound assignment [5] (struct Point) main::p2 ← struct-unwound {*((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Removing C-classic struct-unwound assignment [14] (struct Vector) main::v ← struct-unwound {*((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q)}
|
||||
Constant right-side identified [6] (byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [8] (byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [10] (byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [12] (byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [15] (byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [17] (byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [19] (byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [21] (byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) main::$0 = (byte*)&main::p1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$1 = (byte*)&main::p1+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$2 = (byte*)&main::p2+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$3 = (byte*)&main::p2+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const struct Point*) main::$4 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const byte*) main::$11 = (byte*)&main::p1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$13 = (byte*)&main::p1+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const struct Point*) main::$5 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const byte*) main::$15 = (byte*)&main::p2+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$17 = (byte*)&main::p2+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const struct Point*) main::$6 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const struct Point*) main::$7 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P
|
||||
Constant (const struct Point*) main::$8 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const struct Point*) main::$9 = (struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q
|
||||
Constant (const byte*) main::$0 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$1 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$2 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$3 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$4 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$5 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$6 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$7 = (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant value identified (byte*)main::$4 in [11] (byte*~) main::$10 ← (byte*)(const struct Point*) main::$4 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$4 in [14] (byte*~) main::$12 ← (byte*)(const struct Point*) main::$4 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$5 in [18] (byte*~) main::$14 ← (byte*)(const struct Point*) main::$5 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$5 in [21] (byte*~) main::$16 ← (byte*)(const struct Point*) main::$5 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$6 in [25] (byte*~) main::$18 ← (byte*)(const struct Point*) main::$6 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$7 in [28] (byte*~) main::$19 ← (byte*)(const struct Point*) main::$7 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)main::$8 in [31] (byte*~) main::$20 ← (byte*)(const struct Point*) main::$8 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)main::$9 in [34] (byte*~) main::$21 ← (byte*)(const struct Point*) main::$9 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantValues
|
||||
Converting *(pointer+n) to pointer[n] [13] *((byte*~) main::$10) ← *((const byte*) main::$11) -- *((byte*)main::$4 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [16] *((byte*~) main::$12) ← *((const byte*) main::$13) -- *((byte*)main::$4 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [20] *((byte*~) main::$14) ← *((const byte*) main::$15) -- *((byte*)main::$5 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [23] *((byte*~) main::$16) ← *((const byte*) main::$17) -- *((byte*)main::$5 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [26] *((const byte*) SCREEN + (byte) 0) ← *((byte*~) main::$18) -- *((byte*)main::$6 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [29] *((const byte*) SCREEN + (byte) 1) ← *((byte*~) main::$19) -- *((byte*)main::$7 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [32] *((const byte*) SCREEN + (byte) 2) ← *((byte*~) main::$20) -- *((byte*)main::$8 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [35] *((const byte*) SCREEN + (byte) 3) ← *((byte*~) main::$21) -- *((byte*)main::$9 + OFFSET_STRUCT_POINT_Y)
|
||||
Successful SSA optimization Pass2InlineDerefIdx
|
||||
Simplifying expression containing zero (byte*)&main::p1 in
|
||||
Simplifying expression containing zero (byte*)&main::p2 in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)&main::p1 in
|
||||
Simplifying expression containing zero (byte*)&main::p2 in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)main::$4 in [11] (byte*~) main::$10 ← (byte*)(const struct Point*) main::$4 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$4 in [13] *((byte*)(const struct Point*) main::$4 + (const byte) OFFSET_STRUCT_POINT_X) ← *((const byte*) main::$11)
|
||||
Simplifying expression containing zero (byte*)main::$5 in [18] (byte*~) main::$14 ← (byte*)(const struct Point*) main::$5 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$5 in [20] *((byte*)(const struct Point*) main::$5 + (const byte) OFFSET_STRUCT_POINT_X) ← *((const byte*) main::$15)
|
||||
Simplifying expression containing zero (byte*)main::$6 in [25] (byte*~) main::$18 ← (byte*)(const struct Point*) main::$6 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$6 in [26] *((const byte*) SCREEN + (byte) 0) ← *((byte*)(const struct Point*) main::$6 + (const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero SCREEN in [26] *((const byte*) SCREEN + (byte) 0) ← *((byte*)(const struct Point*) main::$6)
|
||||
Simplifying expression containing zero (byte*)main::$8 in [31] (byte*~) main::$20 ← (byte*)(const struct Point*) main::$8 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)main::$8 in [32] *((const byte*) SCREEN + (byte) 2) ← *((byte*)(const struct Point*) main::$8 + (const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_P in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (struct Point*)&main::v in
|
||||
Simplifying expression containing zero (byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q in
|
||||
Simplifying expression containing zero (byte*)&main::p1 in [0] *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
||||
Simplifying expression containing zero (byte*)&main::p2 in [3] *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 4
|
||||
Simplifying expression containing zero (byte*)&main::p1 in [7] *((const byte*) main::$0) ← *((byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero (byte*)&main::p2 in [11] *((const byte*) main::$2) ← *((byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero SCREEN in [16] *((const byte*) SCREEN + (byte) 0) ← *((const byte*) main::$4)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused variable (byte*~) main::$10 and assignment [4] (byte*~) main::$10 ← (byte*)(const struct Point*) main::$4
|
||||
Eliminating unused variable (byte*~) main::$12 and assignment [6] (byte*~) main::$12 ← (byte*)(const struct Point*) main::$4 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$14 and assignment [8] (byte*~) main::$14 ← (byte*)(const struct Point*) main::$5
|
||||
Eliminating unused variable (byte*~) main::$16 and assignment [10] (byte*~) main::$16 ← (byte*)(const struct Point*) main::$5 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$18 and assignment [12] (byte*~) main::$18 ← (byte*)(const struct Point*) main::$6
|
||||
Eliminating unused variable (byte*~) main::$19 and assignment [14] (byte*~) main::$19 ← (byte*)(const struct Point*) main::$7 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused variable (byte*~) main::$20 and assignment [16] (byte*~) main::$20 ← (byte*)(const struct Point*) main::$8
|
||||
Eliminating unused variable (byte*~) main::$21 and assignment [18] (byte*~) main::$21 ← (byte*)(const struct Point*) main::$9 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_VECTOR_P
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant inlined main::$13 = (byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$15 = (byte*)&(struct Point) main::p2
|
||||
Constant inlined main::$11 = (byte*)&(struct Point) main::p1
|
||||
Constant inlined main::$1 = (byte*)&(struct Point) main::p1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$2 = (byte*)&(struct Point) main::p2
|
||||
Constant inlined main::$17 = (byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$0 = (byte*)&(struct Point) main::p1
|
||||
Constant inlined main::$5 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$6 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$3 = (byte*)&(struct Point) main::p2+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$4 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$9 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$7 = (struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$8 = (struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$1 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$2 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$0 = (byte*)(struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$5 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$6 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q
|
||||
Constant inlined main::$3 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$4 = (byte*)(struct Point*)&(struct Vector) main::v
|
||||
Constant inlined main::$7 = (byte*)(struct Point*)&(struct Vector) main::v+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *(SCREEN+1)
|
||||
Consolidated array index constant in *(SCREEN+2)
|
||||
Consolidated array index constant in *((byte*)(struct Point*)&main::v+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y)
|
||||
Consolidated array index constant in *(SCREEN+3)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Adding NOP phi() at start of @begin
|
||||
|
@ -1,6 +1,6 @@
|
||||
Setting inferred volatile on symbol affected by address-of (struct Point*) main::ptr ← &(struct Point) main::point1
|
||||
Adding struct value member variable copy *((byte*~) main::$0) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*~) main::$1) ← (byte)(number) 3
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
Rewriting struct pointer member access *((struct Point*) main::ptr).x
|
||||
Rewriting struct pointer member access *((struct Point*) main::ptr).y
|
||||
Identified constant variable (struct Point*) main::ptr
|
||||
@ -12,15 +12,13 @@ CONTROL FLOW GRAPH SSA
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
(byte*~) main::$0 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$0) ← (byte)(number) 2
|
||||
(byte*~) main::$1 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$1) ← (byte)(number) 3
|
||||
(struct Point) main::point1 ← struct-unwound {*((byte*~) main::$0), *((byte*~) main::$1)}
|
||||
(byte*~) main::$2 ← (byte*)(const struct Point*) main::ptr + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$2)
|
||||
(byte*~) main::$3 ← (byte*)(const struct Point*) main::ptr + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$3)
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
(struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
(byte*~) main::$0 ← (byte*)(const struct Point*) main::ptr + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$0)
|
||||
(byte*~) main::$1 ← (byte*)(const struct Point*) main::ptr + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$1)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
@ -45,14 +43,12 @@ SYMBOL TABLE SSA
|
||||
(void()) main()
|
||||
(byte*~) main::$0
|
||||
(byte*~) main::$1
|
||||
(byte*~) main::$2
|
||||
(byte*~) main::$3
|
||||
(label) main::@return
|
||||
(struct Point) main::point1 loadstore
|
||||
(const struct Point*) main::ptr = &(struct Point) main::point1
|
||||
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$2)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$3)
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$0)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$1)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 2
|
||||
@ -63,27 +59,21 @@ Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [4] (struct Point) main::point1 ← struct-unwound {*((byte*~) main::$0), *((byte*~) main::$1)}
|
||||
Constant right-side identified [0] (byte*~) main::$0 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [2] (byte*~) main::$1 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [5] (byte*~) main::$2 ← (byte*)(const struct Point*) main::ptr + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [7] (byte*~) main::$3 ← (byte*)(const struct Point*) main::ptr + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Removing C-classic struct-unwound assignment [2] (struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Constant right-side identified [3] (byte*~) main::$0 ← (byte*)(const struct Point*) main::ptr + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [5] (byte*~) main::$1 ← (byte*)(const struct Point*) main::ptr + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) main::$0 = (byte*)&main::point1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$1 = (byte*)&main::point1+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$2 = (byte*)main::ptr+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$3 = (byte*)main::ptr+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$0 = (byte*)main::ptr+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$1 = (byte*)main::ptr+OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Simplifying expression containing zero (byte*)&main::point1 in
|
||||
Simplifying expression containing zero (byte*)main::ptr in
|
||||
Simplifying expression containing zero SCREEN in [6] *((const byte*) SCREEN + (byte) 0) ← *((const byte*) main::$2)
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [0] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
||||
Simplifying expression containing zero SCREEN in [4] *((const byte*) SCREEN + (byte) 0) ← *((const byte*) main::$0)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant inlined main::$3 = (byte*)(const struct Point*) main::ptr+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$1 = (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$2 = (byte*)(const struct Point*) main::ptr
|
||||
Constant inlined main::$0 = (byte*)&(struct Point) main::point1
|
||||
Constant inlined main::$1 = (byte*)(const struct Point*) main::ptr+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$0 = (byte*)(const struct Point*) main::ptr
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *(SCREEN+1)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
|
@ -2,12 +2,12 @@ Created struct value member variable (byte) print::p_x
|
||||
Created struct value member variable (byte) print::p_y
|
||||
Converted struct value to member variables (struct Point) print::p
|
||||
Converted procedure struct value parameter to member unwinding (void()) print((byte) print::p_x , (byte) print::p_y)
|
||||
Adding struct value member variable copy *((byte*~) main::$2) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*~) main::$3) ← (byte)(number) 3
|
||||
Adding struct value member variable copy *((byte*~) main::$4) ← (byte)(number) 4
|
||||
Adding struct value member variable copy *((byte*~) main::$5) ← (byte)(number) 5
|
||||
Converted procedure struct value parameter to member unwinding in call (void~) main::$0 ← call print *((byte*~) main::$6) *((byte*~) main::$7)
|
||||
Converted procedure struct value parameter to member unwinding in call (void~) main::$1 ← call print *((byte*~) main::$8) *((byte*~) main::$9)
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 4
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 5
|
||||
Converted procedure struct value parameter to member unwinding in call (void~) main::$0 ← call print *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Converted procedure struct value parameter to member unwinding in call (void~) main::$1 ← call print *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Replacing struct member reference (struct Point) print::p.x with member unwinding reference (byte) print::p_x
|
||||
Replacing struct member reference (struct Point) print::p.y with member unwinding reference (byte) print::p_y
|
||||
Culled Empty Block (label) @1
|
||||
@ -20,30 +20,22 @@ CONTROL FLOW GRAPH SSA
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @2
|
||||
(byte*~) main::$2 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$2) ← (byte)(number) 2
|
||||
(byte*~) main::$3 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$3) ← (byte)(number) 3
|
||||
(struct Point) main::point1 ← struct-unwound {*((byte*~) main::$2), *((byte*~) main::$3)}
|
||||
(byte*~) main::$4 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$4) ← (byte)(number) 4
|
||||
(byte*~) main::$5 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$5) ← (byte)(number) 5
|
||||
(struct Point) main::point2 ← struct-unwound {*((byte*~) main::$4), *((byte*~) main::$5)}
|
||||
(byte) print::p_x#0 ← *((byte*~) main::$6)
|
||||
(byte) print::p_y#0 ← *((byte*~) main::$7)
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
(struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 4
|
||||
*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 5
|
||||
(struct Point) main::point2 ← struct-unwound {*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
(byte) print::p_x#0 ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
(byte) print::p_y#0 ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
call print
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main
|
||||
(byte*~) main::$6 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
(byte*~) main::$7 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
(byte) print::p_x#1 ← *((byte*~) main::$8)
|
||||
(byte) print::p_y#1 ← *((byte*~) main::$9)
|
||||
(byte) print::p_x#1 ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
(byte) print::p_y#1 ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
call print
|
||||
to:main::@2
|
||||
main::@2: scope:[main] from main::@1
|
||||
(byte*~) main::$8 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
(byte*~) main::$9 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@2
|
||||
return
|
||||
@ -77,14 +69,6 @@ SYMBOL TABLE SSA
|
||||
(byte) Point::y
|
||||
(const byte*) SCREEN = (byte*)(number) $400
|
||||
(void()) main()
|
||||
(byte*~) main::$2
|
||||
(byte*~) main::$3
|
||||
(byte*~) main::$4
|
||||
(byte*~) main::$5
|
||||
(byte*~) main::$6
|
||||
(byte*~) main::$7
|
||||
(byte*~) main::$8
|
||||
(byte*~) main::$9
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@return
|
||||
@ -116,43 +100,16 @@ Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [4] (struct Point) main::point1 ← struct-unwound {*((byte*~) main::$2), *((byte*~) main::$3)}
|
||||
Removing C-classic struct-unwound assignment [9] (struct Point) main::point2 ← struct-unwound {*((byte*~) main::$4), *((byte*~) main::$5)}
|
||||
Constant right-side identified [0] (byte*~) main::$2 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [2] (byte*~) main::$3 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [5] (byte*~) main::$4 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [7] (byte*~) main::$5 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [13] (byte*~) main::$6 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [14] (byte*~) main::$7 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [18] (byte*~) main::$8 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [19] (byte*~) main::$9 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) main::$2 = (byte*)&main::point1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$3 = (byte*)&main::point1+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$4 = (byte*)&main::point2+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$5 = (byte*)&main::point2+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$6 = (byte*)&main::point1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$7 = (byte*)&main::point1+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$8 = (byte*)&main::point2+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$9 = (byte*)&main::point2+OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Simplifying expression containing zero (byte*)&main::point1 in
|
||||
Simplifying expression containing zero (byte*)&main::point2 in
|
||||
Simplifying expression containing zero (byte*)&main::point1 in
|
||||
Simplifying expression containing zero (byte*)&main::point2 in
|
||||
Simplifying expression containing zero SCREEN in [22] *((const byte*) SCREEN + (byte) 0) ← (byte) print::p_x#2
|
||||
Removing C-classic struct-unwound assignment [2] (struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Removing C-classic struct-unwound assignment [5] (struct Point) main::point2 ← struct-unwound {*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [0] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
||||
Simplifying expression containing zero (byte*)&main::point2 in [3] *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 4
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [6] (byte) print::p_x#0 ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero (byte*)&main::point2 in [9] (byte) print::p_x#1 ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero SCREEN in [14] *((const byte*) SCREEN + (byte) 0) ← (byte) print::p_x#2
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant inlined main::$2 = (byte*)&(struct Point) main::point1
|
||||
Constant inlined main::$5 = (byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$6 = (byte*)&(struct Point) main::point1
|
||||
Constant inlined main::$3 = (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$4 = (byte*)&(struct Point) main::point2
|
||||
Constant inlined main::$9 = (byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$7 = (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$8 = (byte*)&(struct Point) main::point2
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *(SCREEN+1)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Adding NOP phi() at start of @begin
|
||||
|
@ -11,11 +11,11 @@ Created struct value member variable (byte) getPoint::p_x
|
||||
Created struct value member variable (byte) getPoint::p_y
|
||||
Converted struct value to member variables (struct Point) getPoint::p
|
||||
Converted procedure call LValue to member unwinding { (byte~) main::$0_x, (byte~) main::$0_y } ← call getPoint (number) 2 (number) 3
|
||||
Adding struct value member variable copy *((byte*~) main::$2) ← (byte~) main::$0_x
|
||||
Adding struct value member variable copy *((byte*~) main::$3) ← (byte~) main::$0_y
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$0_x
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte~) main::$0_y
|
||||
Converted procedure call LValue to member unwinding { (byte~) main::$1_x, (byte~) main::$1_y } ← call getPoint (number) 4 (number) 5
|
||||
Adding struct value member variable copy *((byte*~) main::$4) ← (byte~) main::$1_x
|
||||
Adding struct value member variable copy *((byte*~) main::$5) ← (byte~) main::$1_y
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$1_x
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte~) main::$1_y
|
||||
Adding struct value list initializer (byte) getPoint::p_x ← (byte) getPoint::x
|
||||
Adding struct value list initializer (byte) getPoint::p_y ← (byte) getPoint::y
|
||||
Adding struct value member variable copy (byte) getPoint::return_x ← (byte) getPoint::p_x
|
||||
@ -23,10 +23,10 @@ Adding struct value member variable copy (byte) getPoint::return_y ← (byte) ge
|
||||
Adding struct value member variable copy (byte) getPoint::return_x ← (byte) getPoint::return_x
|
||||
Adding struct value member variable copy (byte) getPoint::return_y ← (byte) getPoint::return_y
|
||||
Converted procedure struct return value to member unwinding return { (byte) getPoint::return_x, (byte) getPoint::return_y }
|
||||
Replacing struct member reference (struct Point) main::point1.x with member unwinding reference *((byte*~) main::$6)
|
||||
Replacing struct member reference (struct Point) main::point1.y with member unwinding reference *((byte*~) main::$7)
|
||||
Replacing struct member reference (struct Point) main::point2.x with member unwinding reference *((byte*~) main::$8)
|
||||
Replacing struct member reference (struct Point) main::point2.y with member unwinding reference *((byte*~) main::$9)
|
||||
Replacing struct member reference (struct Point) main::point1.x with member unwinding reference *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Replacing struct member reference (struct Point) main::point1.y with member unwinding reference *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Replacing struct member reference (struct Point) main::point2.x with member unwinding reference *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Replacing struct member reference (struct Point) main::point2.y with member unwinding reference *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Culled Empty Block (label) @1
|
||||
Culled Empty Block (label) getPoint::@1
|
||||
Unwinding list assignment { (byte~) main::$0_x, (byte~) main::$0_y } ← { (byte) getPoint::return_x, (byte) getPoint::return_y }
|
||||
@ -55,15 +55,11 @@ main::@1: scope:[main] from main
|
||||
(byte) getPoint::return_x#4 ← phi( main/(byte) getPoint::return_x#0 )
|
||||
(byte~) main::$0_x ← (byte) getPoint::return_x#4
|
||||
(byte~) main::$0_y ← (byte) getPoint::return_y#4
|
||||
(byte*~) main::$2 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$2) ← (byte~) main::$0_x
|
||||
(byte*~) main::$3 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$3) ← (byte~) main::$0_y
|
||||
(struct Point) main::point1 ← struct-unwound {*((byte*~) main::$2), *((byte*~) main::$3)}
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$6)
|
||||
(byte*~) main::$6 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$7)
|
||||
(byte*~) main::$7 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$0_x
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte~) main::$0_y
|
||||
(struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
(byte) getPoint::x#1 ← (number) 4
|
||||
(byte) getPoint::y#1 ← (number) 5
|
||||
call getPoint
|
||||
@ -75,15 +71,11 @@ main::@2: scope:[main] from main::@1
|
||||
(byte) getPoint::return_x#5 ← phi( main::@1/(byte) getPoint::return_x#1 )
|
||||
(byte~) main::$1_x ← (byte) getPoint::return_x#5
|
||||
(byte~) main::$1_y ← (byte) getPoint::return_y#5
|
||||
(byte*~) main::$4 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$4) ← (byte~) main::$1_x
|
||||
(byte*~) main::$5 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$5) ← (byte~) main::$1_y
|
||||
(struct Point) main::point2 ← struct-unwound {*((byte*~) main::$4), *((byte*~) main::$5)}
|
||||
*((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$8)
|
||||
(byte*~) main::$8 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$9)
|
||||
(byte*~) main::$9 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$1_x
|
||||
*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte~) main::$1_y
|
||||
(struct Point) main::point2 ← struct-unwound {*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
*((const byte*) SCREEN + (number) 2) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
*((const byte*) SCREEN + (number) 3) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@2
|
||||
return
|
||||
@ -164,14 +156,6 @@ SYMBOL TABLE SSA
|
||||
(struct Point~) main::$1
|
||||
(byte~) main::$1_x
|
||||
(byte~) main::$1_y
|
||||
(byte*~) main::$2
|
||||
(byte*~) main::$3
|
||||
(byte*~) main::$4
|
||||
(byte*~) main::$5
|
||||
(byte*~) main::$6
|
||||
(byte*~) main::$7
|
||||
(byte*~) main::$8
|
||||
(byte*~) main::$9
|
||||
(label) main::@1
|
||||
(label) main::@2
|
||||
(label) main::@return
|
||||
@ -180,12 +164,12 @@ SYMBOL TABLE SSA
|
||||
|
||||
Adding number conversion cast (unumber) 2 in (byte) getPoint::x#0 ← (number) 2
|
||||
Adding number conversion cast (unumber) 3 in (byte) getPoint::y#0 ← (number) 3
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$6)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*~) main::$7)
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Adding number conversion cast (unumber) 4 in (byte) getPoint::x#1 ← (number) 4
|
||||
Adding number conversion cast (unumber) 5 in (byte) getPoint::y#1 ← (number) 5
|
||||
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← *((byte*~) main::$8)
|
||||
Adding number conversion cast (unumber) 3 in *((const byte*) SCREEN + (number) 3) ← *((byte*~) main::$9)
|
||||
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Adding number conversion cast (unumber) 3 in *((const byte*) SCREEN + (number) 3) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast (byte) getPoint::x#0 ← (unumber)(number) 2
|
||||
Inlining cast (byte) getPoint::y#0 ← (unumber)(number) 3
|
||||
@ -218,35 +202,18 @@ Alias (byte) getPoint::return_y#1 = (byte) getPoint::return_y#5
|
||||
Alias (byte) getPoint::return_x#2 = (byte) getPoint::p_x#0 (byte) getPoint::x#2 (byte) getPoint::return_x#6 (byte) getPoint::return_x#3
|
||||
Alias (byte) getPoint::return_y#2 = (byte) getPoint::p_y#0 (byte) getPoint::y#2 (byte) getPoint::return_y#6 (byte) getPoint::return_y#3
|
||||
Successful SSA optimization Pass2AliasElimination
|
||||
Removing C-classic struct-unwound assignment [12] (struct Point) main::point1 ← struct-unwound {*((byte*~) main::$2), *((byte*~) main::$3)}
|
||||
Removing C-classic struct-unwound assignment [29] (struct Point) main::point2 ← struct-unwound {*((byte*~) main::$4), *((byte*~) main::$5)}
|
||||
Constant right-side identified [8] (byte*~) main::$2 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [10] (byte*~) main::$3 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [14] (byte*~) main::$6 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [16] (byte*~) main::$7 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [25] (byte*~) main::$4 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [27] (byte*~) main::$5 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [31] (byte*~) main::$8 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [33] (byte*~) main::$9 ← (byte*)&(struct Point) main::point2 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Removing C-classic struct-unwound assignment [10] (struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Removing C-classic struct-unwound assignment [23] (struct Point) main::point2 ← struct-unwound {*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Constant (const byte) getPoint::x#0 = 2
|
||||
Constant (const byte) getPoint::y#0 = 3
|
||||
Constant (const byte*) main::$2 = (byte*)&main::point1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$3 = (byte*)&main::point1+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$6 = (byte*)&main::point1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$7 = (byte*)&main::point1+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte) getPoint::x#1 = 4
|
||||
Constant (const byte) getPoint::y#1 = 5
|
||||
Constant (const byte*) main::$4 = (byte*)&main::point2+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$5 = (byte*)&main::point2+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$8 = (byte*)&main::point2+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$9 = (byte*)&main::point2+OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Simplifying expression containing zero (byte*)&main::point1 in
|
||||
Simplifying expression containing zero (byte*)&main::point1 in
|
||||
Simplifying expression containing zero (byte*)&main::point2 in
|
||||
Simplifying expression containing zero (byte*)&main::point2 in
|
||||
Simplifying expression containing zero SCREEN in [13] *((const byte*) SCREEN + (byte) 0) ← *((const byte*) main::$6)
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [8] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$0_x
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [11] *((const byte*) SCREEN + (byte) 0) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero SCREEN in [11] *((const byte*) SCREEN + (byte) 0) ← *((byte*)&(struct Point) main::point1)
|
||||
Simplifying expression containing zero (byte*)&main::point2 in [21] *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$1_x
|
||||
Simplifying expression containing zero (byte*)&main::point2 in [24] *((const byte*) SCREEN + (byte) 2) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused variable (struct Point) getPoint::return#0 and assignment [20] (struct Point) getPoint::return#0 ← struct-unwound {(byte) getPoint::return_x#2, (byte) getPoint::return_y#2}
|
||||
Eliminating unused variable (struct Point) getPoint::return#1 and assignment [21] (struct Point) getPoint::return#1 ← struct-unwound {(byte) getPoint::return_x#2, (byte) getPoint::return_y#2}
|
||||
@ -256,18 +223,10 @@ Inlining constant with different constant siblings (const byte) getPoint::x#0
|
||||
Inlining constant with different constant siblings (const byte) getPoint::y#0
|
||||
Inlining constant with different constant siblings (const byte) getPoint::x#1
|
||||
Inlining constant with different constant siblings (const byte) getPoint::y#1
|
||||
Constant inlined main::$2 = (byte*)&(struct Point) main::point1
|
||||
Constant inlined main::$5 = (byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$6 = (byte*)&(struct Point) main::point1
|
||||
Constant inlined main::$3 = (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined getPoint::y#0 = (byte) 3
|
||||
Constant inlined getPoint::x#1 = (byte) 4
|
||||
Constant inlined main::$4 = (byte*)&(struct Point) main::point2
|
||||
Constant inlined getPoint::y#1 = (byte) 5
|
||||
Constant inlined main::$9 = (byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined getPoint::x#0 = (byte) 2
|
||||
Constant inlined main::$7 = (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$8 = (byte*)&(struct Point) main::point2
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *(SCREEN+1)
|
||||
Consolidated array index constant in *(SCREEN+2)
|
||||
|
@ -8,6 +8,11 @@ main: {
|
||||
.label point1 = 2
|
||||
lda #0
|
||||
sta.z point1
|
||||
ldx #2
|
||||
!:
|
||||
dex
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
bne !-
|
||||
lda #2
|
||||
sta.z point1
|
||||
lda #'j'
|
||||
|
@ -11,13 +11,14 @@
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
[4] *((byte*)&(struct Point) main::point1) ← (byte) 0
|
||||
[5] *((byte*)&(struct Point) main::point1) ← (byte) 2
|
||||
[6] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j'
|
||||
[7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g'
|
||||
[8] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point1)
|
||||
[9] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS)
|
||||
[10] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1)
|
||||
[5] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2)
|
||||
[6] *((byte*)&(struct Point) main::point1) ← (byte) 2
|
||||
[7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j'
|
||||
[8] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g'
|
||||
[9] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point1)
|
||||
[10] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS)
|
||||
[11] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[11] return
|
||||
[12] return
|
||||
to:@return
|
||||
|
@ -1,11 +1,12 @@
|
||||
Fixing struct type size struct Point to 3
|
||||
Fixing struct type SIZE_OF struct Point to 3
|
||||
Fixing struct type SIZE_OF struct Point to 3
|
||||
Adding struct value member variable default initializer *((byte*~) main::$0) ← (byte) 0
|
||||
Replacing struct member reference (struct Point) main::point1.x with member unwinding reference *((byte*~) main::$1)
|
||||
Adding struct value member variable default initializer *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
Adding struct value member variable default initializer *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2)
|
||||
Replacing struct member reference (struct Point) main::point1.x with member unwinding reference *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Replacing struct member reference (struct Point) main::point1.initials with member unwinding reference (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS
|
||||
Replacing struct member reference (struct Point) main::point1.initials with member unwinding reference (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS
|
||||
Replacing struct member reference (struct Point) main::point1.x with member unwinding reference *((byte*~) main::$2)
|
||||
Replacing struct member reference (struct Point) main::point1.x with member unwinding reference *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Replacing struct member reference (struct Point) main::point1.initials with member unwinding reference (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS
|
||||
Replacing struct member reference (struct Point) main::point1.initials with member unwinding reference (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS
|
||||
Adding versioned struct unwinding for (struct Point) main::point1
|
||||
@ -16,15 +17,13 @@ CONTROL FLOW GRAPH SSA
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
(byte*~) main::$0 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$0) ← (byte) 0
|
||||
(struct Point) main::point1 ← struct-unwound {*((byte*~) main::$0)}
|
||||
*((byte*~) main::$1) ← (number) 2
|
||||
(byte*~) main::$1 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2)
|
||||
(struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS}
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (number) 2
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 0) ← (byte) 'j'
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 1) ← (byte) 'g'
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$2)
|
||||
(byte*~) main::$2 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 0)
|
||||
*((const byte*) SCREEN + (number) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 1)
|
||||
to:main::@return
|
||||
@ -49,22 +48,19 @@ SYMBOL TABLE SSA
|
||||
(byte) Point::x
|
||||
(const byte*) SCREEN = (byte*)(number) $400
|
||||
(void()) main()
|
||||
(byte*~) main::$0
|
||||
(byte*~) main::$1
|
||||
(byte*~) main::$2
|
||||
(label) main::@return
|
||||
(struct Point) main::point1 loadstore
|
||||
|
||||
Adding number conversion cast (unumber) 2 in *((byte*~) main::$1) ← (number) 2
|
||||
Adding number conversion cast (unumber) 2 in *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (number) 2
|
||||
Adding number conversion cast (unumber) 0 in *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 0) ← (byte) 'j'
|
||||
Adding number conversion cast (unumber) 1 in *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 1) ← (byte) 'g'
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*~) main::$2)
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 0)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (unumber)(number) 0)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 1)
|
||||
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (unumber)(number) 1)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast *((byte*~) main::$1) ← (unumber)(number) 2
|
||||
Inlining cast *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (unumber)(number) 2
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 2
|
||||
@ -85,28 +81,16 @@ Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 2
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [2] (struct Point) main::point1 ← struct-unwound {*((byte*~) main::$0)}
|
||||
Constant right-side identified [0] (byte*~) main::$0 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [4] (byte*~) main::$1 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [8] (byte*~) main::$2 ← (byte*)&(struct Point) main::point1 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) main::$0 = (byte*)&main::point1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$1 = (byte*)&main::point1+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$2 = (byte*)&main::point1+OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Simplifying expression containing zero (byte*)&main::point1 in
|
||||
Simplifying expression containing zero (byte*)&main::point1 in
|
||||
Simplifying expression containing zero (byte*)&main::point1 in
|
||||
Simplifying expression containing zero (byte*)&main::point1+OFFSET_STRUCT_POINT_INITIALS in [5] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (byte) 0) ← (byte) 'j'
|
||||
Simplifying expression containing zero SCREEN in [7] *((const byte*) SCREEN + (byte) 0) ← *((const byte*) main::$2)
|
||||
Simplifying expression containing zero (byte*)&main::point1+OFFSET_STRUCT_POINT_INITIALS in [9] *((const byte*) SCREEN + (byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (byte) 0)
|
||||
Removing C-classic struct-unwound assignment [2] (struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS}
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [0] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [3] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
||||
Simplifying expression containing zero (byte*)&main::point1+OFFSET_STRUCT_POINT_INITIALS in [4] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (byte) 0) ← (byte) 'j'
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [6] *((const byte*) SCREEN + (byte) 0) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero SCREEN in [6] *((const byte*) SCREEN + (byte) 0) ← *((byte*)&(struct Point) main::point1)
|
||||
Simplifying expression containing zero (byte*)&main::point1+OFFSET_STRUCT_POINT_INITIALS in [7] *((const byte*) SCREEN + (byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (byte) 0)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant inlined main::$1 = (byte*)&(struct Point) main::point1
|
||||
Constant inlined main::$2 = (byte*)&(struct Point) main::point1
|
||||
Constant inlined main::$0 = (byte*)&(struct Point) main::point1
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *((byte*)&main::point1+OFFSET_STRUCT_POINT_INITIALS+1)
|
||||
Consolidated array index constant in *(SCREEN+1)
|
||||
Consolidated array index constant in *((byte*)&main::point1+OFFSET_STRUCT_POINT_INITIALS+1)
|
||||
@ -140,15 +124,16 @@ FINAL CONTROL FLOW GRAPH
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
[4] *((byte*)&(struct Point) main::point1) ← (byte) 0
|
||||
[5] *((byte*)&(struct Point) main::point1) ← (byte) 2
|
||||
[6] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j'
|
||||
[7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g'
|
||||
[8] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point1)
|
||||
[9] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS)
|
||||
[10] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1)
|
||||
[5] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2)
|
||||
[6] *((byte*)&(struct Point) main::point1) ← (byte) 2
|
||||
[7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j'
|
||||
[8] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g'
|
||||
[9] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point1)
|
||||
[10] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS)
|
||||
[11] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[11] return
|
||||
[12] return
|
||||
to:@return
|
||||
|
||||
|
||||
@ -194,40 +179,48 @@ main: {
|
||||
// [4] *((byte*)&(struct Point) main::point1) ← (byte) 0 -- _deref_pbuc1=vbuc2
|
||||
lda #0
|
||||
sta.z point1
|
||||
// [5] *((byte*)&(struct Point) main::point1) ← (byte) 2 -- _deref_pbuc1=vbuc2
|
||||
// [5] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2) -- _deref_pbuc1=_memset_vbuc2
|
||||
ldx #2
|
||||
lda #0
|
||||
!:
|
||||
dex
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
bne !-
|
||||
// [6] *((byte*)&(struct Point) main::point1) ← (byte) 2 -- _deref_pbuc1=vbuc2
|
||||
lda #2
|
||||
sta.z point1
|
||||
// [6] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j' -- _deref_pbuc1=vbuc2
|
||||
// [7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j' -- _deref_pbuc1=vbuc2
|
||||
lda #'j'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS
|
||||
// [7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g' -- _deref_pbuc1=vbuc2
|
||||
// [8] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g' -- _deref_pbuc1=vbuc2
|
||||
lda #'g'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
// [8] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point1) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [9] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda.z point1
|
||||
sta SCREEN
|
||||
// [9] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [10] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda point1+OFFSET_STRUCT_POINT_INITIALS
|
||||
sta SCREEN+1
|
||||
// [10] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [11] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda point1+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
sta SCREEN+2
|
||||
jmp __breturn
|
||||
// main::@return
|
||||
__breturn:
|
||||
// [11] return
|
||||
// [12] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [4] *((byte*)&(struct Point) main::point1) ← (byte) 0 [ main::point1 ] ( main:2 [ main::point1 ] ) always clobbers reg byte a
|
||||
Statement [5] *((byte*)&(struct Point) main::point1) ← (byte) 2 [ main::point1 ] ( main:2 [ main::point1 ] ) always clobbers reg byte a
|
||||
Statement [6] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j' [ main::point1 ] ( main:2 [ main::point1 ] ) always clobbers reg byte a
|
||||
Statement [7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g' [ main::point1 ] ( main:2 [ main::point1 ] ) always clobbers reg byte a
|
||||
Statement [8] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point1) [ main::point1 ] ( main:2 [ main::point1 ] ) always clobbers reg byte a
|
||||
Statement [9] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) [ main::point1 ] ( main:2 [ main::point1 ] ) always clobbers reg byte a
|
||||
Statement [10] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Statement [5] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2) [ main::point1 ] ( main:2 [ main::point1 ] ) always clobbers reg byte a reg byte x
|
||||
Statement [6] *((byte*)&(struct Point) main::point1) ← (byte) 2 [ main::point1 ] ( main:2 [ main::point1 ] ) always clobbers reg byte a
|
||||
Statement [7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j' [ main::point1 ] ( main:2 [ main::point1 ] ) always clobbers reg byte a
|
||||
Statement [8] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g' [ main::point1 ] ( main:2 [ main::point1 ] ) always clobbers reg byte a
|
||||
Statement [9] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point1) [ main::point1 ] ( main:2 [ main::point1 ] ) always clobbers reg byte a
|
||||
Statement [10] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) [ main::point1 ] ( main:2 [ main::point1 ] ) always clobbers reg byte a
|
||||
Statement [11] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Potential registers zp[3]:2 [ main::point1 ] : zp[3]:2 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
@ -235,9 +228,9 @@ Uplift Scope [Point]
|
||||
Uplift Scope [main] 0: zp[3]:2 [ main::point1 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [Point] best 66 combination
|
||||
Uplifting [main] best 66 combination zp[3]:2 [ main::point1 ]
|
||||
Uplifting [] best 66 combination
|
||||
Uplifting [Point] best 79 combination
|
||||
Uplifting [main] best 79 combination zp[3]:2 [ main::point1 ]
|
||||
Uplifting [] best 79 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
@ -269,28 +262,35 @@ main: {
|
||||
// [4] *((byte*)&(struct Point) main::point1) ← (byte) 0 -- _deref_pbuc1=vbuc2
|
||||
lda #0
|
||||
sta.z point1
|
||||
// [5] *((byte*)&(struct Point) main::point1) ← (byte) 2 -- _deref_pbuc1=vbuc2
|
||||
// [5] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2) -- _deref_pbuc1=_memset_vbuc2
|
||||
ldx #2
|
||||
lda #0
|
||||
!:
|
||||
dex
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
bne !-
|
||||
// [6] *((byte*)&(struct Point) main::point1) ← (byte) 2 -- _deref_pbuc1=vbuc2
|
||||
lda #2
|
||||
sta.z point1
|
||||
// [6] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j' -- _deref_pbuc1=vbuc2
|
||||
// [7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j' -- _deref_pbuc1=vbuc2
|
||||
lda #'j'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS
|
||||
// [7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g' -- _deref_pbuc1=vbuc2
|
||||
// [8] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g' -- _deref_pbuc1=vbuc2
|
||||
lda #'g'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
// [8] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point1) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [9] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda.z point1
|
||||
sta SCREEN
|
||||
// [9] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [10] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda point1+OFFSET_STRUCT_POINT_INITIALS
|
||||
sta SCREEN+1
|
||||
// [10] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [11] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda point1+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
sta SCREEN+2
|
||||
jmp __breturn
|
||||
// main::@return
|
||||
__breturn:
|
||||
// [11] return
|
||||
// [12] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
@ -300,6 +300,8 @@ Removing instruction jmp __b1
|
||||
Removing instruction jmp __bend
|
||||
Removing instruction jmp __breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction lda #0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Replacing label __bbegin with __b1
|
||||
Removing instruction __bbegin:
|
||||
Removing instruction __b1_from___bbegin:
|
||||
@ -330,7 +332,7 @@ zp[3]:2 [ main::point1 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 51
|
||||
Score: 62
|
||||
|
||||
// File Comments
|
||||
// Minimal struct with C-Standard behavior - member array
|
||||
@ -354,33 +356,39 @@ main: {
|
||||
// [4] *((byte*)&(struct Point) main::point1) ← (byte) 0 -- _deref_pbuc1=vbuc2
|
||||
lda #0
|
||||
sta.z point1
|
||||
// [5] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2) -- _deref_pbuc1=_memset_vbuc2
|
||||
ldx #2
|
||||
!:
|
||||
dex
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
bne !-
|
||||
// point1.x = 2
|
||||
// [5] *((byte*)&(struct Point) main::point1) ← (byte) 2 -- _deref_pbuc1=vbuc2
|
||||
// [6] *((byte*)&(struct Point) main::point1) ← (byte) 2 -- _deref_pbuc1=vbuc2
|
||||
lda #2
|
||||
sta.z point1
|
||||
// point1.initials[0] = 'j'
|
||||
// [6] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j' -- _deref_pbuc1=vbuc2
|
||||
// [7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j' -- _deref_pbuc1=vbuc2
|
||||
lda #'j'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS
|
||||
// point1.initials[1] = 'g'
|
||||
// [7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g' -- _deref_pbuc1=vbuc2
|
||||
// [8] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g' -- _deref_pbuc1=vbuc2
|
||||
lda #'g'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
// SCREEN[0] = point1.x
|
||||
// [8] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point1) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [9] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda.z point1
|
||||
sta SCREEN
|
||||
// SCREEN[1] = point1.initials[0]
|
||||
// [9] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [10] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda point1+OFFSET_STRUCT_POINT_INITIALS
|
||||
sta SCREEN+1
|
||||
// SCREEN[2] = point1.initials[1]
|
||||
// [10] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) -- _deref_pbuc1=_deref_pbuc2
|
||||
// [11] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda point1+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
sta SCREEN+2
|
||||
// main::@return
|
||||
// }
|
||||
// [11] return
|
||||
// [12] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
|
38
src/test/ref/struct-26.asm
Normal file
38
src/test/ref/struct-26.asm
Normal file
@ -0,0 +1,38 @@
|
||||
// Minimal struct with C-Standard behavior - member is array, copy assignment (not supported yet)
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
.label SCREEN = $400
|
||||
.const OFFSET_STRUCT_POINT_INITIALS = 1
|
||||
main: {
|
||||
.label point1 = 2
|
||||
.label point2 = 5
|
||||
lda #0
|
||||
sta.z point1
|
||||
ldx #2
|
||||
!:
|
||||
dex
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
bne !-
|
||||
lda #2
|
||||
sta.z point1
|
||||
lda #'j'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS
|
||||
lda #'g'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
lda.z point1
|
||||
sta.z point2
|
||||
ldx #2
|
||||
!:
|
||||
dex
|
||||
lda point1+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
sta point2+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
bne !-
|
||||
lda.z point2
|
||||
sta SCREEN
|
||||
lda point2+OFFSET_STRUCT_POINT_INITIALS
|
||||
sta SCREEN+1
|
||||
lda point2+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
sta SCREEN+2
|
||||
rts
|
||||
}
|
26
src/test/ref/struct-26.cfg
Normal file
26
src/test/ref/struct-26.cfg
Normal file
@ -0,0 +1,26 @@
|
||||
@begin: scope:[] from
|
||||
[0] phi()
|
||||
to:@1
|
||||
@1: scope:[] from @begin
|
||||
[1] phi()
|
||||
[2] call main
|
||||
to:@end
|
||||
@end: scope:[] from @1
|
||||
[3] phi()
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
[4] *((byte*)&(struct Point) main::point1) ← (byte) 0
|
||||
[5] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2)
|
||||
[6] *((byte*)&(struct Point) main::point1) ← (byte) 2
|
||||
[7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j'
|
||||
[8] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g'
|
||||
[9] *((byte*)&(struct Point) main::point2) ← *((byte*)&(struct Point) main::point1)
|
||||
[10] *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memcpy(*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS), (number) 2)
|
||||
[11] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point2)
|
||||
[12] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS)
|
||||
[13] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[14] return
|
||||
to:@return
|
451
src/test/ref/struct-26.log
Normal file
451
src/test/ref/struct-26.log
Normal file
@ -0,0 +1,451 @@
|
||||
Fixing struct type size struct Point to 3
|
||||
Fixing struct type size struct Point to 3
|
||||
Fixing struct type SIZE_OF struct Point to 3
|
||||
Fixing struct type SIZE_OF struct Point to 3
|
||||
Adding struct value member variable default initializer *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
Adding struct value member variable default initializer *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2)
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memcpy(*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS), (number) 2)
|
||||
Replacing struct member reference (struct Point) main::point1.x with member unwinding reference *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Replacing struct member reference (struct Point) main::point1.initials with member unwinding reference (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS
|
||||
Replacing struct member reference (struct Point) main::point1.initials with member unwinding reference (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS
|
||||
Replacing struct member reference (struct Point) main::point2.x with member unwinding reference *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Replacing struct member reference (struct Point) main::point2.initials with member unwinding reference (byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS
|
||||
Replacing struct member reference (struct Point) main::point2.initials with member unwinding reference (byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS
|
||||
Adding versioned struct unwinding for (struct Point) main::point1
|
||||
Adding versioned struct unwinding for (struct Point) main::point2
|
||||
|
||||
CONTROL FLOW GRAPH SSA
|
||||
@begin: scope:[] from
|
||||
to:@1
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2)
|
||||
(struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS}
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (number) 2
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 0) ← (byte) 'j'
|
||||
*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 1) ← (byte) 'g'
|
||||
*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memcpy(*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS), (number) 2)
|
||||
(struct Point) main::point2 ← struct-unwound {*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X), (byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS}
|
||||
*((const byte*) SCREEN + (number) 0) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
*((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 0)
|
||||
*((const byte*) SCREEN + (number) 2) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 1)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
to:@return
|
||||
@1: scope:[] from @begin
|
||||
call main
|
||||
to:@2
|
||||
@2: scope:[] from @1
|
||||
to:@end
|
||||
@end: scope:[] from @2
|
||||
|
||||
SYMBOL TABLE SSA
|
||||
(label) @1
|
||||
(label) @2
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte) OFFSET_STRUCT_POINT_INITIALS = (byte) 1
|
||||
(const byte) OFFSET_STRUCT_POINT_X = (byte) 0
|
||||
(const byte*) Point::initials[(number) 2] = { fill( 2, 0) }
|
||||
(byte) Point::x
|
||||
(const byte*) SCREEN = (byte*)(number) $400
|
||||
(void()) main()
|
||||
(label) main::@return
|
||||
(struct Point) main::point1 loadstore
|
||||
(struct Point) main::point2 loadstore
|
||||
|
||||
Adding number conversion cast (unumber) 2 in *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (number) 2
|
||||
Adding number conversion cast (unumber) 0 in *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 0) ← (byte) 'j'
|
||||
Adding number conversion cast (unumber) 1 in *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 1) ← (byte) 'g'
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 0) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 0)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 1) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS + (unumber)(number) 0)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) SCREEN + (number) 2) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS + (number) 1)
|
||||
Adding number conversion cast (unumber) 2 in *((const byte*) SCREEN + (number) 2) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS + (unumber)(number) 1)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Inlining cast *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (unumber)(number) 2
|
||||
Successful SSA optimization Pass2InlineCast
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 2
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 1
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 0
|
||||
Simplifying constant integer cast 1
|
||||
Simplifying constant integer cast 1
|
||||
Simplifying constant integer cast 2
|
||||
Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 2
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 1
|
||||
Finalized unsigned number type (byte) 2
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [2] (struct Point) main::point1 ← struct-unwound {*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X), (byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS}
|
||||
Removing C-classic struct-unwound assignment [8] (struct Point) main::point2 ← struct-unwound {*((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X), (byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS}
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [0] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 0
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [3] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
||||
Simplifying expression containing zero (byte*)&main::point1+OFFSET_STRUCT_POINT_INITIALS in [4] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS + (byte) 0) ← (byte) 'j'
|
||||
Simplifying expression containing zero (byte*)&main::point1 in [6] *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero (byte*)&main::point2 in [6] *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← *((byte*)&(struct Point) main::point1)
|
||||
Simplifying expression containing zero (byte*)&main::point2 in [9] *((const byte*) SCREEN + (byte) 0) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X)
|
||||
Simplifying expression containing zero SCREEN in [9] *((const byte*) SCREEN + (byte) 0) ← *((byte*)&(struct Point) main::point2)
|
||||
Simplifying expression containing zero (byte*)&main::point2+OFFSET_STRUCT_POINT_INITIALS in [10] *((const byte*) SCREEN + (byte) 1) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS + (byte) 0)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Consolidated array index constant in *((byte*)&main::point1+OFFSET_STRUCT_POINT_INITIALS+1)
|
||||
Consolidated array index constant in *(SCREEN+1)
|
||||
Consolidated array index constant in *((byte*)&main::point2+OFFSET_STRUCT_POINT_INITIALS+1)
|
||||
Consolidated array index constant in *(SCREEN+2)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @2
|
||||
Adding NOP phi() at start of @end
|
||||
CALL GRAPH
|
||||
Calls in [] to main:2
|
||||
|
||||
Created 0 initial phi equivalence classes
|
||||
Coalesced down to 0 phi equivalence classes
|
||||
Culled Empty Block (label) @2
|
||||
Adding NOP phi() at start of @begin
|
||||
Adding NOP phi() at start of @1
|
||||
Adding NOP phi() at start of @end
|
||||
|
||||
FINAL CONTROL FLOW GRAPH
|
||||
@begin: scope:[] from
|
||||
[0] phi()
|
||||
to:@1
|
||||
@1: scope:[] from @begin
|
||||
[1] phi()
|
||||
[2] call main
|
||||
to:@end
|
||||
@end: scope:[] from @1
|
||||
[3] phi()
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
[4] *((byte*)&(struct Point) main::point1) ← (byte) 0
|
||||
[5] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2)
|
||||
[6] *((byte*)&(struct Point) main::point1) ← (byte) 2
|
||||
[7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j'
|
||||
[8] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g'
|
||||
[9] *((byte*)&(struct Point) main::point2) ← *((byte*)&(struct Point) main::point1)
|
||||
[10] *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memcpy(*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS), (number) 2)
|
||||
[11] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point2)
|
||||
[12] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS)
|
||||
[13] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
[14] return
|
||||
to:@return
|
||||
|
||||
|
||||
VARIABLE REGISTER WEIGHTS
|
||||
(byte) Point::x
|
||||
(void()) main()
|
||||
(struct Point) main::point1 loadstore
|
||||
(struct Point) main::point2 loadstore
|
||||
|
||||
Initial phi equivalence classes
|
||||
Added variable main::point1 to live range equivalence class [ main::point1 ]
|
||||
Added variable main::point2 to live range equivalence class [ main::point2 ]
|
||||
Complete equivalence classes
|
||||
[ main::point1 ]
|
||||
[ main::point2 ]
|
||||
Allocated zp[3]:2 [ main::point1 ]
|
||||
Allocated zp[3]:5 [ main::point2 ]
|
||||
|
||||
INITIAL ASM
|
||||
Target platform is c64basic / MOS6502X
|
||||
// File Comments
|
||||
// Minimal struct with C-Standard behavior - member is array, copy assignment (not supported yet)
|
||||
// Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(__bbegin)
|
||||
.pc = $80d "Program"
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.const OFFSET_STRUCT_POINT_INITIALS = 1
|
||||
// @begin
|
||||
__bbegin:
|
||||
// [1] phi from @begin to @1 [phi:@begin->@1]
|
||||
__b1_from___bbegin:
|
||||
jmp __b1
|
||||
// @1
|
||||
__b1:
|
||||
// [2] call main
|
||||
jsr main
|
||||
// [3] phi from @1 to @end [phi:@1->@end]
|
||||
__bend_from___b1:
|
||||
jmp __bend
|
||||
// @end
|
||||
__bend:
|
||||
// main
|
||||
main: {
|
||||
.label point1 = 2
|
||||
.label point2 = 5
|
||||
// [4] *((byte*)&(struct Point) main::point1) ← (byte) 0 -- _deref_pbuc1=vbuc2
|
||||
lda #0
|
||||
sta.z point1
|
||||
// [5] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2) -- _deref_pbuc1=_memset_vbuc2
|
||||
ldx #2
|
||||
lda #0
|
||||
!:
|
||||
dex
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
bne !-
|
||||
// [6] *((byte*)&(struct Point) main::point1) ← (byte) 2 -- _deref_pbuc1=vbuc2
|
||||
lda #2
|
||||
sta.z point1
|
||||
// [7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j' -- _deref_pbuc1=vbuc2
|
||||
lda #'j'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS
|
||||
// [8] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g' -- _deref_pbuc1=vbuc2
|
||||
lda #'g'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
// [9] *((byte*)&(struct Point) main::point2) ← *((byte*)&(struct Point) main::point1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda.z point1
|
||||
sta.z point2
|
||||
// [10] *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memcpy(*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS), (number) 2) -- _deref_pbuc1=_deref_pbuc2_memcpy__vbuc3
|
||||
ldx #2
|
||||
!:
|
||||
dex
|
||||
lda point1+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
sta point2+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
bne !-
|
||||
// [11] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point2) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda.z point2
|
||||
sta SCREEN
|
||||
// [12] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda point2+OFFSET_STRUCT_POINT_INITIALS
|
||||
sta SCREEN+1
|
||||
// [13] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda point2+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
sta SCREEN+2
|
||||
jmp __breturn
|
||||
// main::@return
|
||||
__breturn:
|
||||
// [14] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
|
||||
REGISTER UPLIFT POTENTIAL REGISTERS
|
||||
Statement [4] *((byte*)&(struct Point) main::point1) ← (byte) 0 [ main::point1 main::point2 ] ( main:2 [ main::point1 main::point2 ] ) always clobbers reg byte a
|
||||
Statement [5] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2) [ main::point1 main::point2 ] ( main:2 [ main::point1 main::point2 ] ) always clobbers reg byte a reg byte x
|
||||
Statement [6] *((byte*)&(struct Point) main::point1) ← (byte) 2 [ main::point1 main::point2 ] ( main:2 [ main::point1 main::point2 ] ) always clobbers reg byte a
|
||||
Statement [7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j' [ main::point1 main::point2 ] ( main:2 [ main::point1 main::point2 ] ) always clobbers reg byte a
|
||||
Statement [8] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g' [ main::point1 main::point2 ] ( main:2 [ main::point1 main::point2 ] ) always clobbers reg byte a
|
||||
Statement [9] *((byte*)&(struct Point) main::point2) ← *((byte*)&(struct Point) main::point1) [ main::point1 main::point2 ] ( main:2 [ main::point1 main::point2 ] ) always clobbers reg byte a
|
||||
Statement [10] *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memcpy(*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS), (number) 2) [ main::point2 ] ( main:2 [ main::point2 ] ) always clobbers reg byte a reg byte x
|
||||
Statement [11] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point2) [ main::point2 ] ( main:2 [ main::point2 ] ) always clobbers reg byte a
|
||||
Statement [12] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS) [ main::point2 ] ( main:2 [ main::point2 ] ) always clobbers reg byte a
|
||||
Statement [13] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) [ ] ( main:2 [ ] ) always clobbers reg byte a
|
||||
Potential registers zp[3]:2 [ main::point1 ] : zp[3]:2 ,
|
||||
Potential registers zp[3]:5 [ main::point2 ] : zp[3]:5 ,
|
||||
|
||||
REGISTER UPLIFT SCOPES
|
||||
Uplift Scope [Point]
|
||||
Uplift Scope [main] 0: zp[3]:2 [ main::point1 ] 0: zp[3]:5 [ main::point2 ]
|
||||
Uplift Scope []
|
||||
|
||||
Uplifting [Point] best 101 combination
|
||||
Uplifting [main] best 101 combination zp[3]:2 [ main::point1 ] zp[3]:5 [ main::point2 ]
|
||||
Uplifting [] best 101 combination
|
||||
|
||||
ASSEMBLER BEFORE OPTIMIZATION
|
||||
// File Comments
|
||||
// Minimal struct with C-Standard behavior - member is array, copy assignment (not supported yet)
|
||||
// Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(__bbegin)
|
||||
.pc = $80d "Program"
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.const OFFSET_STRUCT_POINT_INITIALS = 1
|
||||
// @begin
|
||||
__bbegin:
|
||||
// [1] phi from @begin to @1 [phi:@begin->@1]
|
||||
__b1_from___bbegin:
|
||||
jmp __b1
|
||||
// @1
|
||||
__b1:
|
||||
// [2] call main
|
||||
jsr main
|
||||
// [3] phi from @1 to @end [phi:@1->@end]
|
||||
__bend_from___b1:
|
||||
jmp __bend
|
||||
// @end
|
||||
__bend:
|
||||
// main
|
||||
main: {
|
||||
.label point1 = 2
|
||||
.label point2 = 5
|
||||
// [4] *((byte*)&(struct Point) main::point1) ← (byte) 0 -- _deref_pbuc1=vbuc2
|
||||
lda #0
|
||||
sta.z point1
|
||||
// [5] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2) -- _deref_pbuc1=_memset_vbuc2
|
||||
ldx #2
|
||||
lda #0
|
||||
!:
|
||||
dex
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
bne !-
|
||||
// [6] *((byte*)&(struct Point) main::point1) ← (byte) 2 -- _deref_pbuc1=vbuc2
|
||||
lda #2
|
||||
sta.z point1
|
||||
// [7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j' -- _deref_pbuc1=vbuc2
|
||||
lda #'j'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS
|
||||
// [8] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g' -- _deref_pbuc1=vbuc2
|
||||
lda #'g'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
// [9] *((byte*)&(struct Point) main::point2) ← *((byte*)&(struct Point) main::point1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda.z point1
|
||||
sta.z point2
|
||||
// [10] *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memcpy(*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS), (number) 2) -- _deref_pbuc1=_deref_pbuc2_memcpy__vbuc3
|
||||
ldx #2
|
||||
!:
|
||||
dex
|
||||
lda point1+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
sta point2+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
bne !-
|
||||
// [11] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point2) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda.z point2
|
||||
sta SCREEN
|
||||
// [12] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda point2+OFFSET_STRUCT_POINT_INITIALS
|
||||
sta SCREEN+1
|
||||
// [13] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda point2+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
sta SCREEN+2
|
||||
jmp __breturn
|
||||
// main::@return
|
||||
__breturn:
|
||||
// [14] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
|
||||
ASSEMBLER OPTIMIZATIONS
|
||||
Removing instruction jmp __b1
|
||||
Removing instruction jmp __bend
|
||||
Removing instruction jmp __breturn
|
||||
Succesful ASM optimization Pass5NextJumpElimination
|
||||
Removing instruction lda #0
|
||||
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
||||
Replacing label __bbegin with __b1
|
||||
Removing instruction __bbegin:
|
||||
Removing instruction __b1_from___bbegin:
|
||||
Removing instruction __bend_from___b1:
|
||||
Succesful ASM optimization Pass5RedundantLabelElimination
|
||||
Removing instruction __bend:
|
||||
Removing instruction __breturn:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
Updating BasicUpstart to call main directly
|
||||
Removing instruction jsr main
|
||||
Succesful ASM optimization Pass5SkipBegin
|
||||
Removing instruction __b1:
|
||||
Succesful ASM optimization Pass5UnusedLabelElimination
|
||||
|
||||
FINAL SYMBOL TABLE
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte) OFFSET_STRUCT_POINT_INITIALS = (byte) 1
|
||||
(const byte*) Point::initials[(number) 2] = { fill( 2, 0) }
|
||||
(byte) Point::x
|
||||
(const byte*) SCREEN = (byte*) 1024
|
||||
(void()) main()
|
||||
(label) main::@return
|
||||
(struct Point) main::point1 loadstore zp[3]:2
|
||||
(struct Point) main::point2 loadstore zp[3]:5
|
||||
|
||||
zp[3]:2 [ main::point1 ]
|
||||
zp[3]:5 [ main::point2 ]
|
||||
|
||||
|
||||
FINAL ASSEMBLER
|
||||
Score: 84
|
||||
|
||||
// File Comments
|
||||
// Minimal struct with C-Standard behavior - member is array, copy assignment (not supported yet)
|
||||
// Upstart
|
||||
.pc = $801 "Basic"
|
||||
:BasicUpstart(main)
|
||||
.pc = $80d "Program"
|
||||
// Global Constants & labels
|
||||
.label SCREEN = $400
|
||||
.const OFFSET_STRUCT_POINT_INITIALS = 1
|
||||
// @begin
|
||||
// [1] phi from @begin to @1 [phi:@begin->@1]
|
||||
// @1
|
||||
// [2] call main
|
||||
// [3] phi from @1 to @end [phi:@1->@end]
|
||||
// @end
|
||||
// main
|
||||
main: {
|
||||
.label point1 = 2
|
||||
.label point2 = 5
|
||||
// point1
|
||||
// [4] *((byte*)&(struct Point) main::point1) ← (byte) 0 -- _deref_pbuc1=vbuc2
|
||||
lda #0
|
||||
sta.z point1
|
||||
// [5] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memset((number) 2) -- _deref_pbuc1=_memset_vbuc2
|
||||
ldx #2
|
||||
!:
|
||||
dex
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
bne !-
|
||||
// point1.x = 2
|
||||
// [6] *((byte*)&(struct Point) main::point1) ← (byte) 2 -- _deref_pbuc1=vbuc2
|
||||
lda #2
|
||||
sta.z point1
|
||||
// point1.initials[0] = 'j'
|
||||
// [7] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← (byte) 'j' -- _deref_pbuc1=vbuc2
|
||||
lda #'j'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS
|
||||
// point1.initials[1] = 'g'
|
||||
// [8] *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) ← (byte) 'g' -- _deref_pbuc1=vbuc2
|
||||
lda #'g'
|
||||
sta point1+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
// point2 = point1
|
||||
// [9] *((byte*)&(struct Point) main::point2) ← *((byte*)&(struct Point) main::point1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda.z point1
|
||||
sta.z point2
|
||||
// [10] *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS) ← memcpy(*((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_INITIALS), (number) 2) -- _deref_pbuc1=_deref_pbuc2_memcpy__vbuc3
|
||||
ldx #2
|
||||
!:
|
||||
dex
|
||||
lda point1+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
sta point2+OFFSET_STRUCT_POINT_INITIALS,x
|
||||
bne !-
|
||||
// SCREEN[0] = point2.x
|
||||
// [11] *((const byte*) SCREEN) ← *((byte*)&(struct Point) main::point2) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda.z point2
|
||||
sta SCREEN
|
||||
// SCREEN[1] = point2.initials[0]
|
||||
// [12] *((const byte*) SCREEN+(byte) 1) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda point2+OFFSET_STRUCT_POINT_INITIALS
|
||||
sta SCREEN+1
|
||||
// SCREEN[2] = point2.initials[1]
|
||||
// [13] *((const byte*) SCREEN+(byte) 2) ← *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_INITIALS+(byte) 1) -- _deref_pbuc1=_deref_pbuc2
|
||||
lda point2+OFFSET_STRUCT_POINT_INITIALS+1
|
||||
sta SCREEN+2
|
||||
// main::@return
|
||||
// }
|
||||
// [14] return
|
||||
rts
|
||||
}
|
||||
// File Data
|
||||
|
14
src/test/ref/struct-26.sym
Normal file
14
src/test/ref/struct-26.sym
Normal file
@ -0,0 +1,14 @@
|
||||
(label) @1
|
||||
(label) @begin
|
||||
(label) @end
|
||||
(const byte) OFFSET_STRUCT_POINT_INITIALS = (byte) 1
|
||||
(const byte*) Point::initials[(number) 2] = { fill( 2, 0) }
|
||||
(byte) Point::x
|
||||
(const byte*) SCREEN = (byte*) 1024
|
||||
(void()) main()
|
||||
(label) main::@return
|
||||
(struct Point) main::point1 loadstore zp[3]:2
|
||||
(struct Point) main::point2 loadstore zp[3]:5
|
||||
|
||||
zp[3]:2 [ main::point1 ]
|
||||
zp[3]:5 [ main::point2 ]
|
@ -1,6 +1,6 @@
|
||||
Setting inferred volatile on symbol affected by address-of (struct Point*) main::q ← &(struct Point) main::p
|
||||
Adding struct value member variable copy *((byte*~) main::$0) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*~) main::$1) ← (byte)(number) 3
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
Rewriting struct pointer member access *((struct Point*) main::q).x
|
||||
Rewriting struct pointer member access *((struct Point*) main::q).y
|
||||
Identified constant variable (struct Point*) main::q
|
||||
@ -12,15 +12,13 @@ CONTROL FLOW GRAPH SSA
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @1
|
||||
(byte*~) main::$0 ← (byte*)&(struct Point) main::p + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$0) ← (byte)(number) 2
|
||||
(byte*~) main::$1 ← (byte*)&(struct Point) main::p + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$1) ← (byte)(number) 3
|
||||
(struct Point) main::p ← struct-unwound {*((byte*~) main::$0), *((byte*~) main::$1)}
|
||||
(byte*~) main::$2 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) main::SCREEN + (number) 0) ← *((byte*~) main::$2)
|
||||
(byte*~) main::$3 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) main::SCREEN + (number) 1) ← *((byte*~) main::$3)
|
||||
*((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
*((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
(struct Point) main::p ← struct-unwound {*((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
(byte*~) main::$0 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) main::SCREEN + (number) 0) ← *((byte*~) main::$0)
|
||||
(byte*~) main::$1 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) main::SCREEN + (number) 1) ← *((byte*~) main::$1)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main
|
||||
return
|
||||
@ -44,15 +42,13 @@ SYMBOL TABLE SSA
|
||||
(void()) main()
|
||||
(byte*~) main::$0
|
||||
(byte*~) main::$1
|
||||
(byte*~) main::$2
|
||||
(byte*~) main::$3
|
||||
(label) main::@return
|
||||
(const byte*) main::SCREEN = (byte*)(number) $400
|
||||
(struct Point) main::p loadstore
|
||||
(const struct Point*) main::q = &(struct Point) main::p
|
||||
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) main::SCREEN + (number) 0) ← *((byte*~) main::$2)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) main::SCREEN + (number) 1) ← *((byte*~) main::$3)
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) main::SCREEN + (number) 0) ← *((byte*~) main::$0)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) main::SCREEN + (number) 1) ← *((byte*~) main::$1)
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
Simplifying constant pointer cast (byte*) 1024
|
||||
Simplifying constant integer cast 2
|
||||
@ -63,27 +59,21 @@ Successful SSA optimization PassNCastSimplification
|
||||
Finalized unsigned number type (byte) 0
|
||||
Finalized unsigned number type (byte) 1
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Removing C-classic struct-unwound assignment [4] (struct Point) main::p ← struct-unwound {*((byte*~) main::$0), *((byte*~) main::$1)}
|
||||
Constant right-side identified [0] (byte*~) main::$0 ← (byte*)&(struct Point) main::p + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [2] (byte*~) main::$1 ← (byte*)&(struct Point) main::p + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [5] (byte*~) main::$2 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [7] (byte*~) main::$3 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Removing C-classic struct-unwound assignment [2] (struct Point) main::p ← struct-unwound {*((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Constant right-side identified [3] (byte*~) main::$0 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [5] (byte*~) main::$1 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) main::$0 = (byte*)&main::p+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$1 = (byte*)&main::p+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$2 = (byte*)main::q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$3 = (byte*)main::q+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$0 = (byte*)main::q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$1 = (byte*)main::q+OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Simplifying expression containing zero (byte*)&main::p in
|
||||
Simplifying expression containing zero (byte*)main::q in
|
||||
Simplifying expression containing zero main::SCREEN in [6] *((const byte*) main::SCREEN + (byte) 0) ← *((const byte*) main::$2)
|
||||
Simplifying expression containing zero (byte*)&main::p in [0] *((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
||||
Simplifying expression containing zero main::SCREEN in [4] *((const byte*) main::SCREEN + (byte) 0) ← *((const byte*) main::$0)
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant inlined main::$3 = (byte*)(const struct Point*) main::q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$1 = (byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$2 = (byte*)(const struct Point*) main::q
|
||||
Constant inlined main::$0 = (byte*)&(struct Point) main::p
|
||||
Constant inlined main::$1 = (byte*)(const struct Point*) main::q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$0 = (byte*)(const struct Point*) main::q
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *(main::SCREEN+1)
|
||||
Successful SSA optimization Pass2ConstantAdditionElimination
|
||||
|
@ -1,6 +1,6 @@
|
||||
Setting inferred volatile on symbol affected by address-of (struct Point*) main::q ← &(struct Point) main::p
|
||||
Adding struct value member variable copy *((byte*~) main::$1) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*~) main::$2) ← (byte)(number) 3
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
Adding struct value member variable copy *((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
Rewriting struct pointer member access *((struct Point*) main::q).x
|
||||
Rewriting struct pointer member access *((struct Point*) main::q).y
|
||||
Rewriting struct pointer member access *((struct Point*) set::ptr).x
|
||||
@ -15,19 +15,17 @@ CONTROL FLOW GRAPH SSA
|
||||
|
||||
(void()) main()
|
||||
main: scope:[main] from @2
|
||||
(byte*~) main::$1 ← (byte*)&(struct Point) main::p + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((byte*~) main::$1) ← (byte)(number) 2
|
||||
(byte*~) main::$2 ← (byte*)&(struct Point) main::p + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((byte*~) main::$2) ← (byte)(number) 3
|
||||
(struct Point) main::p ← struct-unwound {*((byte*~) main::$1), *((byte*~) main::$2)}
|
||||
*((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_X) ← (byte)(number) 2
|
||||
*((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte)(number) 3
|
||||
(struct Point) main::p ← struct-unwound {*((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
(struct Point*) set::ptr#0 ← (const struct Point*) main::q
|
||||
call set
|
||||
to:main::@1
|
||||
main::@1: scope:[main] from main
|
||||
(byte*~) main::$3 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) main::SCREEN + (number) 0) ← *((byte*~) main::$3)
|
||||
(byte*~) main::$4 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) main::SCREEN + (number) 1) ← *((byte*~) main::$4)
|
||||
(byte*~) main::$1 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
*((const byte*) main::SCREEN + (number) 0) ← *((byte*~) main::$1)
|
||||
(byte*~) main::$2 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
*((const byte*) main::SCREEN + (number) 1) ← *((byte*~) main::$2)
|
||||
to:main::@return
|
||||
main::@return: scope:[main] from main::@1
|
||||
return
|
||||
@ -63,8 +61,6 @@ SYMBOL TABLE SSA
|
||||
(void()) main()
|
||||
(byte*~) main::$1
|
||||
(byte*~) main::$2
|
||||
(byte*~) main::$3
|
||||
(byte*~) main::$4
|
||||
(label) main::@1
|
||||
(label) main::@return
|
||||
(const byte*) main::SCREEN = (byte*)(number) $400
|
||||
@ -78,8 +74,8 @@ SYMBOL TABLE SSA
|
||||
(struct Point*) set::ptr#0
|
||||
(struct Point*) set::ptr#1
|
||||
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) main::SCREEN + (number) 0) ← *((byte*~) main::$3)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) main::SCREEN + (number) 1) ← *((byte*~) main::$4)
|
||||
Adding number conversion cast (unumber) 0 in *((const byte*) main::SCREEN + (number) 0) ← *((byte*~) main::$1)
|
||||
Adding number conversion cast (unumber) 1 in *((const byte*) main::SCREEN + (number) 1) ← *((byte*~) main::$2)
|
||||
Adding number conversion cast (unumber) 4 in *((byte*~) set::$0) ← (number) 4
|
||||
Adding number conversion cast (unumber) 5 in *((byte*~) set::$1) ← (number) 5
|
||||
Successful SSA optimization PassNAddNumberTypeConversions
|
||||
@ -101,39 +97,33 @@ Finalized unsigned number type (byte) 5
|
||||
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
||||
Identical Phi Values (struct Point*) set::ptr#1 (struct Point*) set::ptr#0
|
||||
Successful SSA optimization Pass2IdenticalPhiElimination
|
||||
Removing C-classic struct-unwound assignment [4] (struct Point) main::p ← struct-unwound {*((byte*~) main::$1), *((byte*~) main::$2)}
|
||||
Constant right-side identified [0] (byte*~) main::$1 ← (byte*)&(struct Point) main::p + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [2] (byte*~) main::$2 ← (byte*)&(struct Point) main::p + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant right-side identified [7] (byte*~) main::$3 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [9] (byte*~) main::$4 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Removing C-classic struct-unwound assignment [2] (struct Point) main::p ← struct-unwound {*((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_Y)}
|
||||
Constant right-side identified [5] (byte*~) main::$1 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant right-side identified [7] (byte*~) main::$2 ← (byte*)(const struct Point*) main::q + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantRValueConsolidation
|
||||
Constant (const byte*) main::$1 = (byte*)&main::p+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$2 = (byte*)&main::p+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const struct Point*) set::ptr#0 = main::q
|
||||
Constant (const byte*) main::$3 = (byte*)main::q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$4 = (byte*)main::q+OFFSET_STRUCT_POINT_Y
|
||||
Constant (const byte*) main::$1 = (byte*)main::q+OFFSET_STRUCT_POINT_X
|
||||
Constant (const byte*) main::$2 = (byte*)main::q+OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantIdentification
|
||||
Constant value identified (byte*)set::ptr#0 in [13] (byte*~) set::$0 ← (byte*)(const struct Point*) set::ptr#0 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)set::ptr#0 in [15] (byte*~) set::$1 ← (byte*)(const struct Point*) set::ptr#0 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant value identified (byte*)set::ptr#0 in [11] (byte*~) set::$0 ← (byte*)(const struct Point*) set::ptr#0 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Constant value identified (byte*)set::ptr#0 in [13] (byte*~) set::$1 ← (byte*)(const struct Point*) set::ptr#0 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantValues
|
||||
Converting *(pointer+n) to pointer[n] [14] *((byte*~) set::$0) ← (byte) 4 -- *((byte*)set::ptr#0 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [16] *((byte*~) set::$1) ← (byte) 5 -- *((byte*)set::ptr#0 + OFFSET_STRUCT_POINT_Y)
|
||||
Converting *(pointer+n) to pointer[n] [12] *((byte*~) set::$0) ← (byte) 4 -- *((byte*)set::ptr#0 + OFFSET_STRUCT_POINT_X)
|
||||
Converting *(pointer+n) to pointer[n] [14] *((byte*~) set::$1) ← (byte) 5 -- *((byte*)set::ptr#0 + OFFSET_STRUCT_POINT_Y)
|
||||
Successful SSA optimization Pass2InlineDerefIdx
|
||||
Simplifying expression containing zero (byte*)&main::p in
|
||||
Simplifying expression containing zero (byte*)main::q in
|
||||
Simplifying expression containing zero main::SCREEN in [8] *((const byte*) main::SCREEN + (byte) 0) ← *((const byte*) main::$3)
|
||||
Simplifying expression containing zero (byte*)set::ptr#0 in [13] (byte*~) set::$0 ← (byte*)(const struct Point*) set::ptr#0 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)set::ptr#0 in [14] *((byte*)(const struct Point*) set::ptr#0 + (const byte) OFFSET_STRUCT_POINT_X) ← (byte) 4
|
||||
Simplifying expression containing zero (byte*)&main::p in [0] *((byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
||||
Simplifying expression containing zero main::SCREEN in [6] *((const byte*) main::SCREEN + (byte) 0) ← *((const byte*) main::$1)
|
||||
Simplifying expression containing zero (byte*)set::ptr#0 in [11] (byte*~) set::$0 ← (byte*)(const struct Point*) set::ptr#0 + (const byte) OFFSET_STRUCT_POINT_X
|
||||
Simplifying expression containing zero (byte*)set::ptr#0 in [12] *((byte*)(const struct Point*) set::ptr#0 + (const byte) OFFSET_STRUCT_POINT_X) ← (byte) 4
|
||||
Successful SSA optimization PassNSimplifyExpressionWithZero
|
||||
Eliminating unused variable (byte*~) set::$0 and assignment [6] (byte*~) set::$0 ← (byte*)(const struct Point*) set::ptr#0
|
||||
Eliminating unused variable (byte*~) set::$1 and assignment [8] (byte*~) set::$1 ← (byte*)(const struct Point*) set::ptr#0 + (const byte) OFFSET_STRUCT_POINT_Y
|
||||
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
||||
Successful SSA optimization PassNEliminateUnusedVars
|
||||
Constant inlined set::ptr#0 = (const struct Point*) main::q
|
||||
Constant inlined main::$3 = (byte*)(const struct Point*) main::q
|
||||
Constant inlined main::$4 = (byte*)(const struct Point*) main::q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$1 = (byte*)&(struct Point) main::p
|
||||
Constant inlined main::$2 = (byte*)&(struct Point) main::p+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Constant inlined main::$1 = (byte*)(const struct Point*) main::q
|
||||
Constant inlined main::$2 = (byte*)(const struct Point*) main::q+(const byte) OFFSET_STRUCT_POINT_Y
|
||||
Successful SSA optimization Pass2ConstantInlining
|
||||
Consolidated array index constant in *(main::SCREEN+1)
|
||||
Consolidated array index constant in *((byte*)main::q+OFFSET_STRUCT_POINT_Y)
|
||||
|
Loading…
x
Reference in New Issue
Block a user