1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-02-12 07:31:36 +00:00

Unwindings moving to ValueSource

This commit is contained in:
Jesper Gravgaard 2020-02-05 09:24:55 +01:00
parent 0336b18a62
commit b17d4ab8fc
36 changed files with 449 additions and 469 deletions

View File

@ -190,6 +190,8 @@ public class Compiler {
new Pass1PointerSizeofFix(program).execute(); // After this point in the code all pointer math is byte-based
new PassNSizeOfSimplification(program).execute(); // Needed to eliminate sizeof() referencing pointer value variables
new Pass2AssertTypeMatch(program).check();
new Pass1ConstantifyRValue(program).execute();
new Pass1UnwindStructVariables(program).execute();
new Pass1UnwindStructValues(program).execute();

View File

@ -29,19 +29,6 @@ public class Pass2AssertTypeMatch extends Pass2SsaAssertion {
if(statement instanceof StatementAssignment) {
checkAssignment((StatementAssignment) statement);
}
if(statement instanceof StatementConditionalJump) {
StatementConditionalJump conditionalJump = (StatementConditionalJump) statement;
if(conditionalJump.getOperator()==null) {
RValue rValue = conditionalJump.getrValue2();
SymbolType rValueType = SymbolTypeInference.inferType(getScope(), rValue);
if(!SymbolType.BOOLEAN.equals(rValueType)) {
getLog().append("ERROR! Type mismatch non-boolean condition from (" + rValueType.getTypeName() + "). In " + statement.toString(getProgram(), false));
throw new CompileError("ERROR! Type mismatch non-boolean condition from (" + rValueType.getTypeName() + "). In " + statement.toString(getProgram(), false), statement.getSource());
}
} else {
// Conditions with operators always result in booleans?
}
}
// TODO: Implement checking for calls / ...
}
}

View File

@ -52,8 +52,12 @@ public class ValueSourceVariable extends ValueSourceBase {
@Override
public LValue getBulkLValue(ProgramScope scope) {
ConstantSymbolPointer pointer = new ConstantSymbolPointer(variable.getRef());
return new PointerDereferenceSimple(pointer);
if(getArraySpec()!=null) {
return new PointerDereferenceSimple(variable.getRef());
} else {
ConstantSymbolPointer pointer = new ConstantSymbolPointer(variable.getRef());
return new PointerDereferenceSimple(pointer);
}
}
@Override

View File

@ -528,7 +528,7 @@ public class TestPrograms {
@Test
public void testCastError() throws IOException, URISyntaxException {
assertError("cast-error", "Error! Dereferencing a non-pointer type number");
assertError("cast-error", "Type mismatch");
}
@Test
@ -1140,12 +1140,12 @@ public class TestPrograms {
@Test
public void testStructError2() throws IOException, URISyntaxException {
assertError("struct-err-2", "Incompatible struct assignment");
assertError("struct-err-2", "Type mismatch");
}
@Test
public void testStructError1() throws IOException, URISyntaxException {
assertError("struct-err-1", "Incompatible struct assignment");
assertError("struct-err-1", "Type mismatch");
}
@Test

View File

@ -44,22 +44,26 @@ Converted struct value to member variables (struct ProcessingChar) startProcessi
Converted procedure struct value parameter to member unwinding (void()) startProcessing((byte) startProcessing::center_x , (byte) startProcessing::center_y , (byte) startProcessing::center_dist)
Adding value bulk copy *((const struct ProcessingSprite*) PROCESSING + (byte~) main::$10) ← memcpy(*(&(const struct ProcessingSprite) $2), struct ProcessingSprite, (const byte) SIZEOF_STRUCT_PROCESSINGSPRITE)
Converted procedure call LValue to member unwinding { (byte~) main::$5_x, (byte~) main::$5_y, (byte~) main::$5_dist } ← call getCharToProcess
Adding struct value member variable copy (byte) main::center_x ← (byte~) main::$5_x
Adding struct value member variable copy (byte) main::center_y ← (byte~) main::$5_y
Adding struct value member variable copy (byte) main::center_dist ← (byte~) main::$5_dist
Unwinding value copy (struct ProcessingChar) main::center ← (struct ProcessingChar~) main::$5
Adding value simple copy (byte) main::center_x ← (byte~) main::$5_x
Adding value simple copy (byte) main::center_y ← (byte~) main::$5_y
Adding value simple copy (byte) main::center_dist ← (byte~) main::$5_dist
Converted procedure struct value parameter to member unwinding in call (void~) main::$8 ← call startProcessing (byte) main::center_x (byte) main::center_y (byte) main::center_dist
Adding struct value member variable copy (byte) getCharToProcess::closest_x ← (byte) 0
Adding struct value member variable copy (byte) getCharToProcess::closest_y ← (byte) 0
Adding struct value member variable copy (byte) getCharToProcess::closest_dist ← (const byte) NOT_FOUND
Unwinding value copy (struct ProcessingChar) getCharToProcess::closest ← { x: (byte) 0, y: (byte) 0, dist: (const byte) NOT_FOUND }
Adding value simple copy (byte) getCharToProcess::closest_x ← (byte) 0
Adding value simple copy (byte) getCharToProcess::closest_y ← (byte) 0
Adding value simple copy (byte) getCharToProcess::closest_dist ← (const byte) NOT_FOUND
Adding struct value member variable copy (byte) getCharToProcess::closest_x ← (byte) getCharToProcess::x
Adding struct value member variable copy (byte) getCharToProcess::closest_y ← (byte) getCharToProcess::y
Adding struct value member variable copy (byte) getCharToProcess::closest_dist ← (byte) getCharToProcess::dist
Adding struct value member variable copy (byte) getCharToProcess::return_x ← (byte) getCharToProcess::closest_x
Adding struct value member variable copy (byte) getCharToProcess::return_y ← (byte) getCharToProcess::closest_y
Adding struct value member variable copy (byte) getCharToProcess::return_dist ← (byte) getCharToProcess::closest_dist
Adding struct value member variable copy (byte) getCharToProcess::return_x ← (byte) getCharToProcess::return_x
Adding struct value member variable copy (byte) getCharToProcess::return_y ← (byte) getCharToProcess::return_y
Adding struct value member variable copy (byte) getCharToProcess::return_dist ← (byte) getCharToProcess::return_dist
Unwinding value copy (struct ProcessingChar) getCharToProcess::return ← (struct ProcessingChar) getCharToProcess::closest
Adding value simple copy (byte) getCharToProcess::return_x ← (byte) getCharToProcess::closest_x
Adding value simple copy (byte) getCharToProcess::return_y ← (byte) getCharToProcess::closest_y
Adding value simple copy (byte) getCharToProcess::return_dist ← (byte) getCharToProcess::closest_dist
Unwinding value copy (struct ProcessingChar) getCharToProcess::return ← (struct ProcessingChar) getCharToProcess::return
Adding value simple copy (byte) getCharToProcess::return_x ← (byte) getCharToProcess::return_x
Adding value simple copy (byte) getCharToProcess::return_y ← (byte) getCharToProcess::return_y
Adding value simple copy (byte) getCharToProcess::return_dist ← (byte) getCharToProcess::return_dist
Converted procedure struct return value to member unwinding return { (byte) getCharToProcess::return_x, (byte) getCharToProcess::return_y, (byte) getCharToProcess::return_dist }
Adding struct value member variable copy *((word*~) startProcessing::$29 + (byte~) startProcessing::$28) ← (word) startProcessing::spriteX
Adding struct value member variable copy *((word*~) startProcessing::$30 + (byte~) startProcessing::$28) ← (word) startProcessing::spriteY

View File

@ -1,8 +1,9 @@
Created struct value member variable (byte) main::button_color
Created struct value member variable (byte) main::button_size
Converted struct value to member variables (struct Button) main::button
Adding struct value member variable copy (byte) main::button_color ← (const byte) RED
Adding struct value member variable copy (byte) main::button_size ← (byte) $18
Unwinding value copy (struct Button) main::button ← { color: (const byte) RED, size: (byte) $18 }
Adding value simple copy (byte) main::button_color ← (const byte) RED
Adding value simple copy (byte) main::button_size ← (byte) $18
Replacing struct member reference (struct Button) main::button.color with member unwinding reference (byte) main::button_color
Replacing struct member reference (struct Button) main::button.size with member unwinding reference (byte) main::button_size
Identified constant variable (byte) main::button_color

View File

@ -1,8 +1,9 @@
Created struct value member variable (byte) main::button_color
Created struct value member variable (byte) main::button_size
Converted struct value to member variables (struct Button) main::button
Adding struct value member variable copy (byte) main::button_color ← (const byte) RED
Adding struct value member variable copy (byte) main::button_size ← (byte) $18
Unwinding value copy (struct Button) main::button ← { color: (const byte) RED, size: (byte) $18 }
Adding value simple copy (byte) main::button_color ← (const byte) RED
Adding value simple copy (byte) main::button_size ← (byte) $18
Replacing struct member reference (struct Button) main::button.color with member unwinding reference (byte) main::button_color
Replacing struct member reference (struct Button) main::button.size with member unwinding reference (byte) main::button_size
Identified constant variable (byte) main::button_color

View File

@ -9,12 +9,14 @@ Converted struct value to member variables (struct Circle) main::c
Created struct value member variable (byte) main::c_center_x
Created struct value member variable (byte) main::c_center_y
Converted struct value to member variables (struct Point) main::c_center
Adding struct value member variable copy (byte) main::p_x ← (byte) 0
Adding struct value member variable copy (byte) main::p_y ← (byte) 0
Adding struct value member variable copy (struct Point) main::c_center ← {}
Adding struct value member variable copy (byte) main::c_radius ← (byte) 0
Adding struct value member variable copy (byte) main::c_center_x ← (byte) 0
Adding struct value member variable copy (byte) main::c_center_y ← (byte) 0
Unwinding value copy (struct Point) main::p ← {}
Adding value simple copy (byte) main::p_x ← (byte) 0
Adding value simple copy (byte) main::p_y ← (byte) 0
Unwinding value copy (struct Circle) main::c ← {}
Unwinding value copy (struct Circle) main::c ← {}
Adding value simple copy (byte) main::c_center_x ← (byte) 0
Adding value simple copy (byte) main::c_center_y ← (byte) 0
Adding value simple copy (byte) main::c_radius ← (byte) 0
Identified constant variable (byte) main::p_x
Identified constant variable (byte) main::p_y
Identified constant variable (byte) main::c_radius
@ -101,6 +103,7 @@ SYMBOL TABLE SSA
(label) main::@return
(const byte) main::NUM_CIRCLES = (byte)(const byte) main::NUM_POINTS-(number) 1
(const byte) main::NUM_POINTS = (byte) 4
(struct Point) main::c_center
(const struct Circle*) main::circles[(const byte) main::NUM_CIRCLES] = { fill( main::NUM_CIRCLES, 0) }
(byte) main::idx
(byte) main::idx#0
@ -310,6 +313,7 @@ VARIABLE REGISTER WEIGHTS
(byte) Point::x
(byte) Point::y
(void()) main()
(struct Point) main::c_center
(byte) main::idx
Initial phi equivalence classes
@ -497,6 +501,7 @@ FINAL SYMBOL TABLE
(label) main::@return
(const byte) main::NUM_CIRCLES = (const byte) main::NUM_POINTS-(byte) 1
(const byte) main::NUM_POINTS = (byte) 4
(struct Point) main::c_center
(byte) main::idx

View File

@ -12,5 +12,6 @@
(label) main::@return
(const byte) main::NUM_CIRCLES = (const byte) main::NUM_POINTS-(byte) 1
(const byte) main::NUM_POINTS = (byte) 4
(struct Point) main::c_center
(byte) main::idx

View File

@ -4,7 +4,8 @@ Fixing pointer array-indexing *((const word*) RADIX_DECIMAL_VALUES + (number) 1)
Fixing pointer array-indexing *((const word*) main::SCREEN + (number) 1)
Created struct value member variable (word*) main::info_values
Converted struct value to member variables (struct RadixInfo) main::info
Adding struct value member variable copy (word*) main::info_values ← (const word*) RADIX_DECIMAL_VALUES
Unwinding value copy (struct RadixInfo) main::info ← { values: (const word*) RADIX_DECIMAL_VALUES }
Adding value simple copy (word*) main::info_values ← (const word*) RADIX_DECIMAL_VALUES
Replacing struct member reference (struct RadixInfo) main::info.values with member unwinding reference (word*) main::info_values
Identified constant variable (word*) main::info_values

View File

@ -13,11 +13,13 @@ Created struct value member variable (byte) print_person::person_id
Created struct value member variable (byte*) print_person::person_name
Converted struct value to member variables (struct Person) print_person::person
Converted procedure struct value parameter to member unwinding (void()) print_person((byte) print_person::person_id , (byte*) print_person::person_name)
Adding struct value member variable copy (byte) main::jesper_id ← (byte) 4
Adding struct value member variable copy *((const byte*) main::jesper_name) ← memcpy(*(&(const byte*) $0), byte, (number) $40)
Unwinding value copy (struct Person) main::jesper ← { id: (byte) 4, name: (string) "jesper" }
Adding value simple copy (byte) main::jesper_id ← (byte) 4
Adding value bulk copy *((const byte*) main::jesper_name) ← memcpy(*(&(const byte*) $0), byte, (number) $40)
Converted procedure struct value parameter to member unwinding in call (void~) main::$0 ← call print_person (byte) main::jesper_id (const byte*) main::jesper_name
Adding struct value member variable copy (byte) main::henriette_id ← (byte) 7
Adding struct value member variable copy *((const byte*) main::henriette_name) ← memcpy(*(&(const byte*) $1), byte, (number) $40)
Unwinding value copy (struct Person) main::henriette ← { id: (byte) 7, name: (string) "henriette" }
Adding value simple copy (byte) main::henriette_id ← (byte) 7
Adding value bulk copy *((const byte*) main::henriette_name) ← memcpy(*(&(const byte*) $1), byte, (number) $40)
Converted procedure struct value parameter to member unwinding in call (void~) main::$1 ← call print_person (byte) main::henriette_id (const byte*) main::henriette_name
Replacing struct member reference (struct Person) print_person::person.id with member unwinding reference (byte) print_person::person_id
Replacing struct member reference (struct Person) print_person::person.name with member unwinding reference (byte*) print_person::person_name

View File

@ -11,17 +11,21 @@ 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*)&(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
Unwinding value copy (struct Point) main::point1 ← (struct Point~) main::$0
Adding value simple copy *((byte*)&(struct Point) main::point1+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$0_x
Adding value simple 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*)&(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
Unwinding value copy (struct Point) main::point2 ← (struct Point~) main::$1
Adding value simple copy *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$1_x
Adding value simple copy *((byte*)&(struct Point) main::point2+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte~) main::$1_y
Adding struct value member variable copy (byte) getPoint::p_x ← (byte) getPoint::x
Adding struct value member variable copy (byte) getPoint::p_y ← (byte) getPoint::y
Adding struct value member variable copy (byte) getPoint::return_x ← (byte) getPoint::p_x
Adding struct value member variable copy (byte) getPoint::return_y ← (byte) getPoint::p_y
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
Unwinding value copy (struct Point) getPoint::return ← (struct Point) getPoint::p
Adding value simple copy (byte) getPoint::return_x ← (byte) getPoint::p_x
Adding value simple copy (byte) getPoint::return_y ← (byte) getPoint::p_y
Unwinding value copy (struct Point) getPoint::return ← (struct Point) getPoint::return
Adding value simple copy (byte) getPoint::return_x ← (byte) getPoint::return_x
Adding value simple 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*)&(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)

View File

@ -5,8 +5,9 @@ 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::p1_x ← (byte) 0
Adding struct value member variable copy (byte) main::p1_y ← (byte) 0
Unwinding value copy (struct Point) main::p1 ← {}
Adding value simple copy (byte) main::p1_x ← (byte) 0
Adding value simple copy (byte) main::p1_y ← (byte) 0
Converted procedure struct value parameter to member unwinding in call (void~) main::$0 ← call print (byte) main::p1_x (byte) main::p1_y
Converted procedure struct value parameter to member unwinding in call (void~) main::$1 ← call print (byte) main::p1_x (byte) main::p1_y
Replacing struct member reference (struct Point) main::p1.x with member unwinding reference (byte) main::p1_x

View File

@ -4,8 +4,9 @@ Fixing struct type SIZE_OF struct Point to 4
Created struct value member variable (byte) main::point1_x
Created struct value member variable (const byte*) main::point1_initials
Converted struct value to member variables (struct Point) main::point1
Adding struct value member variable copy (byte) main::point1_x ← (byte) 2
Adding struct value member variable copy *((const byte*) main::point1_initials) ← memcpy(*(&(const byte*) $0), byte, (number) 3)
Unwinding value copy (struct Point) main::point1 ← { x: (byte) 2, initials: (string) "jg" }
Adding value simple copy (byte) main::point1_x ← (byte) 2
Adding value bulk copy *((const byte*) main::point1_initials) ← memcpy(*(&(const byte*) $0), byte, (number) 3)
Replacing struct member reference (struct Point) main::point1.x with member unwinding reference (byte) main::point1_x
Replacing struct member reference (struct Point) main::point1.initials with member unwinding reference (const byte*) main::point1_initials
Replacing struct member reference (struct Point) main::point1.initials with member unwinding reference (const byte*) main::point1_initials

View File

@ -1,8 +1,9 @@
Created struct value member variable (byte) main::point1_x
Created struct value member variable (byte) main::point1_y
Converted struct value to member variables (struct Point) main::point1
Adding struct value member variable copy (byte) main::point1_x ← (byte) 2
Adding struct value member variable copy (byte) main::point1_y ← (byte) 3
Unwinding value copy (struct Point) main::point1 ← { x: (byte) 2, y: (byte) 3 }
Adding value simple copy (byte) main::point1_x ← (byte) 2
Adding value simple copy (byte) main::point1_y ← (byte) 3
Replacing struct member reference (struct Point) main::point1.x with member unwinding reference (byte) main::point1_x
Replacing struct member reference (struct Point) main::point1.y with member unwinding reference (byte) main::point1_y
Identified constant variable (byte) main::point1_x

View File

@ -1,8 +1,9 @@
Created struct value member variable (byte) point_x
Created struct value member variable (byte) point_y
Converted struct value to member variables (struct Point) point
Adding struct value member variable copy (byte) point_x ← (byte) 0
Adding struct value member variable copy (byte) point_y ← (byte) 0
Unwinding value copy (struct Point) point ← {}
Adding value simple copy (byte) point_x ← (byte) 0
Adding value simple copy (byte) point_y ← (byte) 0
Replacing struct member reference (struct Point) point.x with member unwinding reference (byte) point_x
Replacing struct member reference (struct Point) point.y with member unwinding reference (byte) point_y
Replacing struct member reference (struct Point) point.x with member unwinding reference (byte) point_x

View File

@ -15,10 +15,10 @@ main: scope:[main] from @1
main::@1: scope:[main] from main main::@1
[5] (byte) main::j#3 ← phi( main/(byte) 0 main::@1/(byte) main::j#2 )
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
[6] (byte~) main::$6 ← (byte) main::i#2 << (byte) 2
[7] (byte~) main::$1 ← (byte~) main::$6 + (byte) main::i#2
[8] (byte) main::to_x#0 ← *((byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1)
[9] (byte) main::to_y#0 ← *((byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1)
[6] (byte~) main::$2 ← (byte) main::i#2 << (byte) 2
[7] (byte~) main::$1 ← (byte~) main::$2 + (byte) main::i#2
[8] (byte) main::to_x#0 ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1)
[9] (byte) main::to_y#0 ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1)
[10] *((const byte*) SCREEN + (byte) main::j#3) ← (byte) main::to_x#0
[11] (byte) main::j#1 ← ++ (byte) main::j#3
[12] *((const byte*) SCREEN + (byte) main::j#1) ← (byte) main::to_y#0

View File

@ -2,8 +2,9 @@ Fixing pointer array-indexing *((const struct Segment*) letter_c + (byte) main::
Created struct value member variable (byte) main::to_x
Created struct value member variable (byte) main::to_y
Converted struct value to member variables (struct SplineVector16) main::to
Adding struct value member variable copy (byte) main::to_x ← *((byte*~) main::$3 + (byte~) main::$1)
Adding struct value member variable copy (byte) main::to_y ← *((byte*~) main::$5 + (byte~) main::$1)
Unwinding value copy (struct SplineVector16) main::to ← *((const struct Segment*) letter_c + (byte~) main::$1).to
Adding value simple copy (byte) main::to_x ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_X + (byte~) main::$1)
Adding value simple copy (byte) main::to_y ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1)
Replacing struct member reference (struct SplineVector16) main::to.x with member unwinding reference (byte) main::to_x
Replacing struct member reference (struct SplineVector16) main::to.y with member unwinding reference (byte) main::to_y
Culled Empty Block (label) main::@2
@ -21,12 +22,8 @@ main::@1: scope:[main] from main main::@1
(byte) main::j#3 ← phi( main/(byte) main::j#0 main::@1/(byte) main::j#2 )
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 )
(byte~) main::$1 ← (byte) main::i#2 * (const byte) SIZEOF_STRUCT_SEGMENT
(byte*~) main::$3 ← (byte*)(byte*~) main::$2 + (const byte) OFFSET_STRUCT_SPLINEVECTOR16_X
(byte) main::to_x#0 ← *((byte*~) main::$3 + (byte~) main::$1)
(byte*~) main::$2 ← (byte*)(const struct Segment*) letter_c + (const byte) OFFSET_STRUCT_SEGMENT_TO
(byte*~) main::$5 ← (byte*)(byte*~) main::$4 + (const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y
(byte) main::to_y#0 ← *((byte*~) main::$5 + (byte~) main::$1)
(byte*~) main::$4 ← (byte*)(const struct Segment*) letter_c + (const byte) OFFSET_STRUCT_SEGMENT_TO
(byte) main::to_x#0 ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_X + (byte~) main::$1)
(byte) main::to_y#0 ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1)
*((const byte*) SCREEN + (byte) main::j#3) ← (byte) main::to_x#0
(byte) main::j#1 ← ++ (byte) main::j#3
*((const byte*) SCREEN + (byte) main::j#1) ← (byte) main::to_y#0
@ -69,10 +66,6 @@ SYMBOL TABLE SSA
(void()) main()
(bool~) main::$0
(byte~) main::$1
(byte*~) main::$2
(byte*~) main::$3
(byte*~) main::$4
(byte*~) main::$5
(label) main::@1
(label) main::@return
(byte) main::i
@ -90,22 +83,15 @@ SYMBOL TABLE SSA
(byte) main::to_y#0
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast (byte*~) main::$2
Simplifying constant integer cast (byte*~) main::$4
Successful SSA optimization PassNCastSimplification
Simple Condition (bool~) main::$0 [16] if((byte) main::i#1!=rangelast(0,2)) goto main::@1
Simple Condition (bool~) main::$0 [12] if((byte) main::i#1!=rangelast(0,2)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [6] (byte*~) main::$2 ← (byte*)(const struct Segment*) letter_c + (const byte) OFFSET_STRUCT_SEGMENT_TO
Constant right-side identified [9] (byte*~) main::$4 ← (byte*)(const struct Segment*) letter_c + (const byte) OFFSET_STRUCT_SEGMENT_TO
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::j#0 = 0
Constant (const byte) main::i#0 = 0
Constant (const byte*) main::$2 = (byte*)letter_c+OFFSET_STRUCT_SEGMENT_TO
Constant (const byte*) main::$4 = (byte*)letter_c+OFFSET_STRUCT_SEGMENT_TO
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [14] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [16] if(main::i#1!=rangelast(0,2)) goto main::@1 to (number) 3
Simplifying expression containing zero main::$2 in [4] (byte*~) main::$3 ← (const byte*) main::$2 + (const byte) OFFSET_STRUCT_SPLINEVECTOR16_X
Resolved ranged next value [10] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [12] if(main::i#1!=rangelast(0,2)) goto main::@1 to (number) 3
Simplifying expression containing zero (byte*)(struct SplineVector16*)letter_c+OFFSET_STRUCT_SEGMENT_TO in [4] (byte) main::to_x#0 ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_X + (byte~) main::$1)
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) OFFSET_STRUCT_SPLINEVECTOR16_X
Successful SSA optimization PassNEliminateUnusedVars
@ -115,22 +101,13 @@ Simplifying constant integer cast 3
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 3
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [4] (byte*~) main::$5 ← (const byte*) main::$4 + (const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte*) main::$3 = main::$2
Constant (const byte*) main::$5 = main::$4+OFFSET_STRUCT_SPLINEVECTOR16_Y
Successful SSA optimization Pass2ConstantIdentification
Rewriting multiplication to use shift and addition[1] (byte~) main::$1 ← (byte) main::i#2 * (const byte) SIZEOF_STRUCT_SEGMENT
Inlining constant with var siblings (const byte) main::j#0
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::$5 = (byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y
Constant inlined main::i#0 = (byte) 0
Constant inlined main::$3 = (byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO
Constant inlined main::$4 = (byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO
Constant inlined main::j#0 = (byte) 0
Constant inlined main::$2 = (byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO
Successful SSA optimization Pass2ConstantInlining
Alias (byte~) main::$1 = (byte~) main::$7
Alias (byte~) main::$1 = (byte~) main::$3
Successful SSA optimization Pass2AliasElimination
Eliminating unused constant (const byte) SIZEOF_STRUCT_SEGMENT
Successful SSA optimization PassNEliminateUnusedVars
@ -172,10 +149,10 @@ main: scope:[main] from @1
main::@1: scope:[main] from main main::@1
[5] (byte) main::j#3 ← phi( main/(byte) 0 main::@1/(byte) main::j#2 )
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
[6] (byte~) main::$6 ← (byte) main::i#2 << (byte) 2
[7] (byte~) main::$1 ← (byte~) main::$6 + (byte) main::i#2
[8] (byte) main::to_x#0 ← *((byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1)
[9] (byte) main::to_y#0 ← *((byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1)
[6] (byte~) main::$2 ← (byte) main::i#2 << (byte) 2
[7] (byte~) main::$1 ← (byte~) main::$2 + (byte) main::i#2
[8] (byte) main::to_x#0 ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1)
[9] (byte) main::to_y#0 ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1)
[10] *((const byte*) SCREEN + (byte) main::j#3) ← (byte) main::to_x#0
[11] (byte) main::j#1 ← ++ (byte) main::j#3
[12] *((const byte*) SCREEN + (byte) main::j#1) ← (byte) main::to_y#0
@ -196,7 +173,7 @@ VARIABLE REGISTER WEIGHTS
(byte) SplineVector16::y
(void()) main()
(byte~) main::$1 16.5
(byte~) main::$6 22.0
(byte~) main::$2 22.0
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#2 4.888888888888889
@ -212,7 +189,7 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ main::i#2 main::i#1 ]
[ main::j#3 main::j#2 ]
Added variable main::$6 to live range equivalence class [ main::$6 ]
Added variable main::$2 to live range equivalence class [ main::$2 ]
Added variable main::$1 to live range equivalence class [ main::$1 ]
Added variable main::to_x#0 to live range equivalence class [ main::to_x#0 ]
Added variable main::to_y#0 to live range equivalence class [ main::to_y#0 ]
@ -220,14 +197,14 @@ Added variable main::j#1 to live range equivalence class [ main::j#1 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::j#3 main::j#2 ]
[ main::$6 ]
[ main::$2 ]
[ main::$1 ]
[ main::to_x#0 ]
[ main::to_y#0 ]
[ main::j#1 ]
Allocated zp[1]:2 [ main::i#2 main::i#1 ]
Allocated zp[1]:3 [ main::j#3 main::j#2 ]
Allocated zp[1]:4 [ main::$6 ]
Allocated zp[1]:4 [ main::$2 ]
Allocated zp[1]:5 [ main::$1 ]
Allocated zp[1]:6 [ main::to_x#0 ]
Allocated zp[1]:7 [ main::to_y#0 ]
@ -271,7 +248,7 @@ main: {
.label j = 8
.label j_1 = 3
.label i = 2
.label __6 = 4
.label __2 = 4
// [5] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [5] phi (byte) main::j#3 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
@ -288,21 +265,21 @@ main: {
jmp __b1
// main::@1
__b1:
// [6] (byte~) main::$6 ← (byte) main::i#2 << (byte) 2 -- vbuz1=vbuz2_rol_2
// [6] (byte~) main::$2 ← (byte) main::i#2 << (byte) 2 -- vbuz1=vbuz2_rol_2
lda.z i
asl
asl
sta.z __6
// [7] (byte~) main::$1 ← (byte~) main::$6 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3
lda.z __6
sta.z __2
// [7] (byte~) main::$1 ← (byte~) main::$2 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3
lda.z __2
clc
adc.z i
sta.z __1
// [8] (byte) main::to_x#0 ← *((byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) -- vbuz1=pbuc1_derefidx_vbuz2
// [8] (byte) main::to_x#0 ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) -- vbuz1=pbuc1_derefidx_vbuz2
ldy.z __1
lda letter_c+OFFSET_STRUCT_SEGMENT_TO,y
sta.z to_x
// [9] (byte) main::to_y#0 ← *((byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) -- vbuz1=pbuc1_derefidx_vbuz2
// [9] (byte) main::to_y#0 ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) -- vbuz1=pbuc1_derefidx_vbuz2
ldy.z __1
lda letter_c+OFFSET_STRUCT_SEGMENT_TO+OFFSET_STRUCT_SPLINEVECTOR16_Y,y
sta.z to_y
@ -339,28 +316,28 @@ main: {
letter_c: .byte MOVE_TO, 'a', 'b', 0, 0, SPLINE_TO, 'c', 'd', $67, $a9, SPLINE_TO, 'e', 'f', $4b, $c3
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] (byte~) main::$6 ← (byte) main::i#2 << (byte) 2 [ main::i#2 main::j#3 main::$6 ] ( main:2 [ main::i#2 main::j#3 main::$6 ] ) always clobbers reg byte a
Statement [6] (byte~) main::$2 ← (byte) main::i#2 << (byte) 2 [ main::i#2 main::j#3 main::$2 ] ( main:2 [ main::i#2 main::j#3 main::$2 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::i#2 main::i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::j#3 main::j#2 ]
Statement [7] (byte~) main::$1 ← (byte~) main::$6 + (byte) main::i#2 [ main::i#2 main::j#3 main::$1 ] ( main:2 [ main::i#2 main::j#3 main::$1 ] ) always clobbers reg byte a
Statement [6] (byte~) main::$6 ← (byte) main::i#2 << (byte) 2 [ main::i#2 main::j#3 main::$6 ] ( main:2 [ main::i#2 main::j#3 main::$6 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$1 ← (byte~) main::$6 + (byte) main::i#2 [ main::i#2 main::j#3 main::$1 ] ( main:2 [ main::i#2 main::j#3 main::$1 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$1 ← (byte~) main::$2 + (byte) main::i#2 [ main::i#2 main::j#3 main::$1 ] ( main:2 [ main::i#2 main::j#3 main::$1 ] ) always clobbers reg byte a
Statement [6] (byte~) main::$2 ← (byte) main::i#2 << (byte) 2 [ main::i#2 main::j#3 main::$2 ] ( main:2 [ main::i#2 main::j#3 main::$2 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$1 ← (byte~) main::$2 + (byte) main::i#2 [ main::i#2 main::j#3 main::$1 ] ( main:2 [ main::i#2 main::j#3 main::$1 ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ main::i#2 main::i#1 ] : zp[1]:2 , reg byte x , reg byte y ,
Potential registers zp[1]:3 [ main::j#3 main::j#2 ] : zp[1]:3 , reg byte x , reg byte y ,
Potential registers zp[1]:4 [ main::$6 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:4 [ main::$2 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:5 [ main::$1 ] : zp[1]:5 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:6 [ main::to_x#0 ] : zp[1]:6 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:7 [ main::to_y#0 ] : zp[1]:7 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:8 [ main::j#1 ] : zp[1]:8 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 22: zp[1]:4 [ main::$6 ] 21.39: zp[1]:2 [ main::i#2 main::i#1 ] 16.5: zp[1]:5 [ main::$1 ] 16.5: zp[1]:8 [ main::j#1 ] 12.83: zp[1]:3 [ main::j#3 main::j#2 ] 11: zp[1]:6 [ main::to_x#0 ] 7.33: zp[1]:7 [ main::to_y#0 ]
Uplift Scope [main] 22: zp[1]:4 [ main::$2 ] 21.39: zp[1]:2 [ main::i#2 main::i#1 ] 16.5: zp[1]:5 [ main::$1 ] 16.5: zp[1]:8 [ main::j#1 ] 12.83: zp[1]:3 [ main::j#3 main::j#2 ] 11: zp[1]:6 [ main::to_x#0 ] 7.33: zp[1]:7 [ main::to_y#0 ]
Uplift Scope [SplineVector16]
Uplift Scope [Segment]
Uplift Scope [Segment::SegmentType]
Uplift Scope []
Uplifting [main] best 933 combination reg byte a [ main::$6 ] reg byte x [ main::i#2 main::i#1 ] reg byte y [ main::$1 ] zp[1]:8 [ main::j#1 ] zp[1]:3 [ main::j#3 main::j#2 ] zp[1]:6 [ main::to_x#0 ] zp[1]:7 [ main::to_y#0 ]
Uplifting [main] best 933 combination reg byte a [ main::$2 ] reg byte x [ main::i#2 main::i#1 ] reg byte y [ main::$1 ] zp[1]:8 [ main::j#1 ] zp[1]:3 [ main::j#3 main::j#2 ] zp[1]:6 [ main::to_x#0 ] zp[1]:7 [ main::to_y#0 ]
Limited combination testing to 100 combinations of 9216 possible.
Uplifting [SplineVector16] best 933 combination
Uplifting [Segment] best 933 combination
@ -427,19 +404,19 @@ main: {
jmp __b1
// main::@1
__b1:
// [6] (byte~) main::$6 ← (byte) main::i#2 << (byte) 2 -- vbuaa=vbuxx_rol_2
// [6] (byte~) main::$2 ← (byte) main::i#2 << (byte) 2 -- vbuaa=vbuxx_rol_2
txa
asl
asl
// [7] (byte~) main::$1 ← (byte~) main::$6 + (byte) main::i#2 -- vbuyy=vbuaa_plus_vbuxx
// [7] (byte~) main::$1 ← (byte~) main::$2 + (byte) main::i#2 -- vbuyy=vbuaa_plus_vbuxx
stx.z $ff
clc
adc.z $ff
tay
// [8] (byte) main::to_x#0 ← *((byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) -- vbuz1=pbuc1_derefidx_vbuyy
// [8] (byte) main::to_x#0 ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) -- vbuz1=pbuc1_derefidx_vbuyy
lda letter_c+OFFSET_STRUCT_SEGMENT_TO,y
sta.z to_x
// [9] (byte) main::to_y#0 ← *((byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) -- vbuz1=pbuc1_derefidx_vbuyy
// [9] (byte) main::to_y#0 ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) -- vbuz1=pbuc1_derefidx_vbuyy
lda letter_c+OFFSET_STRUCT_SEGMENT_TO+OFFSET_STRUCT_SPLINEVECTOR16_Y,y
sta.z to_y
// [10] *((const byte*) SCREEN + (byte) main::j#3) ← (byte) main::to_x#0 -- pbuc1_derefidx_vbuz1=vbuz2
@ -519,7 +496,7 @@ FINAL SYMBOL TABLE
(const struct Segment*) letter_c[] = { { type: (const byte) MOVE_TO, to: { x: (byte) 'a', y: (byte) 'b' }, via: { x: (byte) 0, y: (byte) 0 } }, { type: (const byte) SPLINE_TO, to: { x: (byte) 'c', y: (byte) 'd' }, via: { x: (byte) $67, y: (byte) $a9 } }, { type: (const byte) SPLINE_TO, to: { x: (byte) 'e', y: (byte) 'f' }, via: { x: (byte) $4b, y: (byte) $c3 } } }
(void()) main()
(byte~) main::$1 reg byte y 16.5
(byte~) main::$6 reg byte a 22.0
(byte~) main::$2 reg byte a 22.0
(label) main::@1
(label) main::@return
(byte) main::i
@ -536,7 +513,7 @@ FINAL SYMBOL TABLE
reg byte x [ main::i#2 main::i#1 ]
zp[1]:2 [ main::j#3 main::j#2 ]
reg byte a [ main::$6 ]
reg byte a [ main::$2 ]
reg byte y [ main::$1 ]
zp[1]:3 [ main::to_x#0 ]
zp[1]:4 [ main::to_y#0 ]
@ -582,19 +559,19 @@ main: {
// main::@1
__b1:
// to = letter_c[i].to
// [6] (byte~) main::$6 ← (byte) main::i#2 << (byte) 2 -- vbuaa=vbuxx_rol_2
// [6] (byte~) main::$2 ← (byte) main::i#2 << (byte) 2 -- vbuaa=vbuxx_rol_2
txa
asl
asl
// [7] (byte~) main::$1 ← (byte~) main::$6 + (byte) main::i#2 -- vbuyy=vbuaa_plus_vbuxx
// [7] (byte~) main::$1 ← (byte~) main::$2 + (byte) main::i#2 -- vbuyy=vbuaa_plus_vbuxx
stx.z $ff
clc
adc.z $ff
tay
// [8] (byte) main::to_x#0 ← *((byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) -- vbuz1=pbuc1_derefidx_vbuyy
// [8] (byte) main::to_x#0 ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) -- vbuz1=pbuc1_derefidx_vbuyy
lda letter_c+OFFSET_STRUCT_SEGMENT_TO,y
sta.z to_x
// [9] (byte) main::to_y#0 ← *((byte*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) -- vbuz1=pbuc1_derefidx_vbuyy
// [9] (byte) main::to_y#0 ← *((byte*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) -- vbuz1=pbuc1_derefidx_vbuyy
lda letter_c+OFFSET_STRUCT_SEGMENT_TO+OFFSET_STRUCT_SPLINEVECTOR16_Y,y
sta.z to_y
// SCREEN[j++] = to.x

View File

@ -17,7 +17,7 @@
(const struct Segment*) letter_c[] = { { type: (const byte) MOVE_TO, to: { x: (byte) 'a', y: (byte) 'b' }, via: { x: (byte) 0, y: (byte) 0 } }, { type: (const byte) SPLINE_TO, to: { x: (byte) 'c', y: (byte) 'd' }, via: { x: (byte) $67, y: (byte) $a9 } }, { type: (const byte) SPLINE_TO, to: { x: (byte) 'e', y: (byte) 'f' }, via: { x: (byte) $4b, y: (byte) $c3 } } }
(void()) main()
(byte~) main::$1 reg byte y 16.5
(byte~) main::$6 reg byte a 22.0
(byte~) main::$2 reg byte a 22.0
(label) main::@1
(label) main::@return
(byte) main::i
@ -34,7 +34,7 @@
reg byte x [ main::i#2 main::i#1 ]
zp[1]:2 [ main::j#3 main::j#2 ]
reg byte a [ main::$6 ]
reg byte a [ main::$2 ]
reg byte y [ main::$1 ]
zp[1]:3 [ main::to_x#0 ]
zp[1]:4 [ main::to_y#0 ]

View File

@ -15,10 +15,10 @@ main: scope:[main] from @1
main::@1: scope:[main] from main main::@1
[5] (byte) main::j#3 ← phi( main/(byte) 0 main::@1/(byte) main::j#2 )
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
[6] (byte~) main::$8 ← (byte) main::i#2 << (byte) 3
[7] (byte~) main::$1 ← (byte~) main::$8 + (byte) main::i#2
[8] (signed word) main::to_x#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1)
[9] (signed word) main::to_y#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1)
[6] (byte~) main::$4 ← (byte) main::i#2 << (byte) 3
[7] (byte~) main::$1 ← (byte~) main::$4 + (byte) main::i#2
[8] (signed word) main::to_x#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1)
[9] (signed word) main::to_y#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1)
[10] (byte~) main::$2 ← (byte) main::j#3 << (byte) 1
[11] *((const signed word*) SCREEN + (byte~) main::$2) ← (signed word) main::to_x#0
[12] (byte) main::j#1 ← ++ (byte) main::j#3

View File

@ -4,8 +4,9 @@ Fixing pointer array-indexing *((const signed word*) SCREEN + (byte) main::j)
Created struct value member variable (signed word) main::to_x
Created struct value member variable (signed word) main::to_y
Converted struct value to member variables (struct SplineVector16) main::to
Adding struct value member variable copy (signed word) main::to_x ← *((signed word*~) main::$5 + (byte~) main::$1)
Adding struct value member variable copy (signed word) main::to_y ← *((signed word*~) main::$7 + (byte~) main::$1)
Unwinding value copy (struct SplineVector16) main::to ← *((const struct Segment*) letter_c + (byte~) main::$1).to
Adding value simple copy (signed word) main::to_x ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_X + (byte~) main::$1)
Adding value simple copy (signed word) main::to_y ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1)
Replacing struct member reference (struct SplineVector16) main::to.x with member unwinding reference (signed word) main::to_x
Replacing struct member reference (struct SplineVector16) main::to.y with member unwinding reference (signed word) main::to_y
Culled Empty Block (label) main::@2
@ -23,12 +24,8 @@ main::@1: scope:[main] from main main::@1
(byte) main::j#3 ← phi( main/(byte) main::j#0 main::@1/(byte) main::j#2 )
(byte) main::i#2 ← phi( main/(byte) main::i#0 main::@1/(byte) main::i#1 )
(byte~) main::$1 ← (byte) main::i#2 * (const byte) SIZEOF_STRUCT_SEGMENT
(signed word*~) main::$5 ← (signed word*)(signed word*~) main::$4 + (const byte) OFFSET_STRUCT_SPLINEVECTOR16_X
(signed word) main::to_x#0 ← *((signed word*~) main::$5 + (byte~) main::$1)
(signed word*~) main::$4 ← (signed word*)(const struct Segment*) letter_c + (const byte) OFFSET_STRUCT_SEGMENT_TO
(signed word*~) main::$7 ← (signed word*)(signed word*~) main::$6 + (const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y
(signed word) main::to_y#0 ← *((signed word*~) main::$7 + (byte~) main::$1)
(signed word*~) main::$6 ← (signed word*)(const struct Segment*) letter_c + (const byte) OFFSET_STRUCT_SEGMENT_TO
(signed word) main::to_x#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_X + (byte~) main::$1)
(signed word) main::to_y#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1)
(byte~) main::$2 ← (byte) main::j#3 * (const byte) SIZEOF_SIGNED_WORD
*((const signed word*) SCREEN + (byte~) main::$2) ← (signed word) main::to_x#0
(byte) main::j#1 ← ++ (byte) main::j#3
@ -76,10 +73,6 @@ SYMBOL TABLE SSA
(byte~) main::$1
(byte~) main::$2
(byte~) main::$3
(signed word*~) main::$4
(signed word*~) main::$5
(signed word*~) main::$6
(signed word*~) main::$7
(label) main::@1
(label) main::@return
(byte) main::i
@ -97,22 +90,15 @@ SYMBOL TABLE SSA
(signed word) main::to_y#0
Simplifying constant pointer cast (signed word*) 1024
Simplifying constant integer cast (signed word*~) main::$4
Simplifying constant integer cast (signed word*~) main::$6
Successful SSA optimization PassNCastSimplification
Simple Condition (bool~) main::$0 [18] if((byte) main::i#1!=rangelast(0,2)) goto main::@1
Simple Condition (bool~) main::$0 [14] if((byte) main::i#1!=rangelast(0,2)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [6] (signed word*~) main::$4 ← (signed word*)(const struct Segment*) letter_c + (const byte) OFFSET_STRUCT_SEGMENT_TO
Constant right-side identified [9] (signed word*~) main::$6 ← (signed word*)(const struct Segment*) letter_c + (const byte) OFFSET_STRUCT_SEGMENT_TO
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::j#0 = 0
Constant (const byte) main::i#0 = 0
Constant (const signed word*) main::$4 = (signed word*)letter_c+OFFSET_STRUCT_SEGMENT_TO
Constant (const signed word*) main::$6 = (signed word*)letter_c+OFFSET_STRUCT_SEGMENT_TO
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [16] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [18] if(main::i#1!=rangelast(0,2)) goto main::@1 to (number) 3
Simplifying expression containing zero main::$4 in [4] (signed word*~) main::$5 ← (const signed word*) main::$4 + (const byte) OFFSET_STRUCT_SPLINEVECTOR16_X
Resolved ranged next value [12] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [14] if(main::i#1!=rangelast(0,2)) goto main::@1 to (number) 3
Simplifying expression containing zero (signed word*)(struct SplineVector16*)letter_c+OFFSET_STRUCT_SEGMENT_TO in [4] (signed word) main::to_x#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_X + (byte~) main::$1)
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) OFFSET_STRUCT_SPLINEVECTOR16_X
Successful SSA optimization PassNEliminateUnusedVars
@ -122,25 +108,16 @@ Simplifying constant integer cast 3
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 3
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [4] (signed word*~) main::$7 ← (const signed word*) main::$6 + (const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const signed word*) main::$5 = main::$4
Constant (const signed word*) main::$7 = main::$6+OFFSET_STRUCT_SPLINEVECTOR16_Y
Successful SSA optimization Pass2ConstantIdentification
Rewriting multiplication to use shift and addition[1] (byte~) main::$1 ← (byte) main::i#2 * (const byte) SIZEOF_STRUCT_SEGMENT
Rewriting multiplication to use shift [4] (byte~) main::$2 ← (byte) main::j#3 * (const byte) SIZEOF_SIGNED_WORD
Rewriting multiplication to use shift [7] (byte~) main::$3 ← (byte) main::j#1 * (const byte) SIZEOF_SIGNED_WORD
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte) main::j#0
Inlining constant with var siblings (const byte) main::i#0
Constant inlined main::$5 = (signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO
Constant inlined main::i#0 = (byte) 0
Constant inlined main::$6 = (signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO
Constant inlined main::$4 = (signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO
Constant inlined main::j#0 = (byte) 0
Constant inlined main::$7 = (signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y
Successful SSA optimization Pass2ConstantInlining
Alias (byte~) main::$1 = (byte~) main::$9
Alias (byte~) main::$1 = (byte~) main::$5
Successful SSA optimization Pass2AliasElimination
Eliminating unused constant (const byte) SIZEOF_STRUCT_SEGMENT
Eliminating unused constant (const byte) SIZEOF_SIGNED_WORD
@ -183,10 +160,10 @@ main: scope:[main] from @1
main::@1: scope:[main] from main main::@1
[5] (byte) main::j#3 ← phi( main/(byte) 0 main::@1/(byte) main::j#2 )
[5] (byte) main::i#2 ← phi( main/(byte) 0 main::@1/(byte) main::i#1 )
[6] (byte~) main::$8 ← (byte) main::i#2 << (byte) 3
[7] (byte~) main::$1 ← (byte~) main::$8 + (byte) main::i#2
[8] (signed word) main::to_x#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1)
[9] (signed word) main::to_y#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1)
[6] (byte~) main::$4 ← (byte) main::i#2 << (byte) 3
[7] (byte~) main::$1 ← (byte~) main::$4 + (byte) main::i#2
[8] (signed word) main::to_x#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1)
[9] (signed word) main::to_y#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1)
[10] (byte~) main::$2 ← (byte) main::j#3 << (byte) 1
[11] *((const signed word*) SCREEN + (byte~) main::$2) ← (signed word) main::to_x#0
[12] (byte) main::j#1 ← ++ (byte) main::j#3
@ -211,7 +188,7 @@ VARIABLE REGISTER WEIGHTS
(byte~) main::$1 16.5
(byte~) main::$2 22.0
(byte~) main::$3 22.0
(byte~) main::$8 22.0
(byte~) main::$4 22.0
(byte) main::i
(byte) main::i#1 16.5
(byte) main::i#2 4.0
@ -227,7 +204,7 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ main::i#2 main::i#1 ]
[ main::j#3 main::j#2 ]
Added variable main::$8 to live range equivalence class [ main::$8 ]
Added variable main::$4 to live range equivalence class [ main::$4 ]
Added variable main::$1 to live range equivalence class [ main::$1 ]
Added variable main::to_x#0 to live range equivalence class [ main::to_x#0 ]
Added variable main::to_y#0 to live range equivalence class [ main::to_y#0 ]
@ -237,7 +214,7 @@ Added variable main::$3 to live range equivalence class [ main::$3 ]
Complete equivalence classes
[ main::i#2 main::i#1 ]
[ main::j#3 main::j#2 ]
[ main::$8 ]
[ main::$4 ]
[ main::$1 ]
[ main::to_x#0 ]
[ main::to_y#0 ]
@ -246,7 +223,7 @@ Complete equivalence classes
[ main::$3 ]
Allocated zp[1]:2 [ main::i#2 main::i#1 ]
Allocated zp[1]:3 [ main::j#3 main::j#2 ]
Allocated zp[1]:4 [ main::$8 ]
Allocated zp[1]:4 [ main::$4 ]
Allocated zp[1]:5 [ main::$1 ]
Allocated zp[2]:6 [ main::to_x#0 ]
Allocated zp[2]:8 [ main::to_y#0 ]
@ -294,7 +271,7 @@ main: {
.label j = $b
.label j_1 = 3
.label i = 2
.label __8 = 4
.label __4 = 4
// [5] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [5] phi (byte) main::j#3 = (byte) 0 [phi:main->main::@1#0] -- vbuz1=vbuc1
@ -311,24 +288,24 @@ main: {
jmp __b1
// main::@1
__b1:
// [6] (byte~) main::$8 ← (byte) main::i#2 << (byte) 3 -- vbuz1=vbuz2_rol_3
// [6] (byte~) main::$4 ← (byte) main::i#2 << (byte) 3 -- vbuz1=vbuz2_rol_3
lda.z i
asl
asl
asl
sta.z __8
// [7] (byte~) main::$1 ← (byte~) main::$8 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3
lda.z __8
sta.z __4
// [7] (byte~) main::$1 ← (byte~) main::$4 + (byte) main::i#2 -- vbuz1=vbuz2_plus_vbuz3
lda.z __4
clc
adc.z i
sta.z __1
// [8] (signed word) main::to_x#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) -- vwsz1=pwsc1_derefidx_vbuz2
// [8] (signed word) main::to_x#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) -- vwsz1=pwsc1_derefidx_vbuz2
ldy.z __1
lda letter_c+OFFSET_STRUCT_SEGMENT_TO,y
sta.z to_x
lda letter_c+OFFSET_STRUCT_SEGMENT_TO+1,y
sta.z to_x+1
// [9] (signed word) main::to_y#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) -- vwsz1=pwsc1_derefidx_vbuz2
// [9] (signed word) main::to_y#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) -- vwsz1=pwsc1_derefidx_vbuz2
ldy.z __1
lda letter_c+OFFSET_STRUCT_SEGMENT_TO+OFFSET_STRUCT_SPLINEVECTOR16_Y,y
sta.z to_y
@ -384,29 +361,29 @@ main: {
.word 'e', 'f', $4b, $c3
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] (byte~) main::$8 ← (byte) main::i#2 << (byte) 3 [ main::i#2 main::j#3 main::$8 ] ( main:2 [ main::i#2 main::j#3 main::$8 ] ) always clobbers reg byte a
Statement [6] (byte~) main::$4 ← (byte) main::i#2 << (byte) 3 [ main::i#2 main::j#3 main::$4 ] ( main:2 [ main::i#2 main::j#3 main::$4 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::i#2 main::i#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::j#3 main::j#2 ]
Statement [7] (byte~) main::$1 ← (byte~) main::$8 + (byte) main::i#2 [ main::i#2 main::j#3 main::$1 ] ( main:2 [ main::i#2 main::j#3 main::$1 ] ) always clobbers reg byte a
Statement [8] (signed word) main::to_x#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) [ main::i#2 main::j#3 main::$1 main::to_x#0 ] ( main:2 [ main::i#2 main::j#3 main::$1 main::to_x#0 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$1 ← (byte~) main::$4 + (byte) main::i#2 [ main::i#2 main::j#3 main::$1 ] ( main:2 [ main::i#2 main::j#3 main::$1 ] ) always clobbers reg byte a
Statement [8] (signed word) main::to_x#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) [ main::i#2 main::j#3 main::$1 main::to_x#0 ] ( main:2 [ main::i#2 main::j#3 main::$1 main::to_x#0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:5 [ main::$1 ]
Statement [9] (signed word) main::to_y#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) [ main::i#2 main::j#3 main::to_x#0 main::to_y#0 ] ( main:2 [ main::i#2 main::j#3 main::to_x#0 main::to_y#0 ] ) always clobbers reg byte a
Statement [9] (signed word) main::to_y#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) [ main::i#2 main::j#3 main::to_x#0 main::to_y#0 ] ( main:2 [ main::i#2 main::j#3 main::to_x#0 main::to_y#0 ] ) always clobbers reg byte a
Statement [10] (byte~) main::$2 ← (byte) main::j#3 << (byte) 1 [ main::i#2 main::j#3 main::to_x#0 main::to_y#0 main::$2 ] ( main:2 [ main::i#2 main::j#3 main::to_x#0 main::to_y#0 main::$2 ] ) always clobbers reg byte a
Statement [11] *((const signed word*) SCREEN + (byte~) main::$2) ← (signed word) main::to_x#0 [ main::i#2 main::j#3 main::to_y#0 ] ( main:2 [ main::i#2 main::j#3 main::to_y#0 ] ) always clobbers reg byte a
Statement [13] (byte~) main::$3 ← (byte) main::j#1 << (byte) 1 [ main::i#2 main::to_y#0 main::j#1 main::$3 ] ( main:2 [ main::i#2 main::to_y#0 main::j#1 main::$3 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:11 [ main::j#1 ]
Statement [14] *((const signed word*) SCREEN + (byte~) main::$3) ← (signed word) main::to_y#0 [ main::i#2 main::j#1 ] ( main:2 [ main::i#2 main::j#1 ] ) always clobbers reg byte a
Statement [6] (byte~) main::$8 ← (byte) main::i#2 << (byte) 3 [ main::i#2 main::j#3 main::$8 ] ( main:2 [ main::i#2 main::j#3 main::$8 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$1 ← (byte~) main::$8 + (byte) main::i#2 [ main::i#2 main::j#3 main::$1 ] ( main:2 [ main::i#2 main::j#3 main::$1 ] ) always clobbers reg byte a
Statement [8] (signed word) main::to_x#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) [ main::i#2 main::j#3 main::$1 main::to_x#0 ] ( main:2 [ main::i#2 main::j#3 main::$1 main::to_x#0 ] ) always clobbers reg byte a
Statement [9] (signed word) main::to_y#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) [ main::i#2 main::j#3 main::to_x#0 main::to_y#0 ] ( main:2 [ main::i#2 main::j#3 main::to_x#0 main::to_y#0 ] ) always clobbers reg byte a
Statement [6] (byte~) main::$4 ← (byte) main::i#2 << (byte) 3 [ main::i#2 main::j#3 main::$4 ] ( main:2 [ main::i#2 main::j#3 main::$4 ] ) always clobbers reg byte a
Statement [7] (byte~) main::$1 ← (byte~) main::$4 + (byte) main::i#2 [ main::i#2 main::j#3 main::$1 ] ( main:2 [ main::i#2 main::j#3 main::$1 ] ) always clobbers reg byte a
Statement [8] (signed word) main::to_x#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) [ main::i#2 main::j#3 main::$1 main::to_x#0 ] ( main:2 [ main::i#2 main::j#3 main::$1 main::to_x#0 ] ) always clobbers reg byte a
Statement [9] (signed word) main::to_y#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) [ main::i#2 main::j#3 main::to_x#0 main::to_y#0 ] ( main:2 [ main::i#2 main::j#3 main::to_x#0 main::to_y#0 ] ) always clobbers reg byte a
Statement [10] (byte~) main::$2 ← (byte) main::j#3 << (byte) 1 [ main::i#2 main::j#3 main::to_x#0 main::to_y#0 main::$2 ] ( main:2 [ main::i#2 main::j#3 main::to_x#0 main::to_y#0 main::$2 ] ) always clobbers reg byte a
Statement [11] *((const signed word*) SCREEN + (byte~) main::$2) ← (signed word) main::to_x#0 [ main::i#2 main::j#3 main::to_y#0 ] ( main:2 [ main::i#2 main::j#3 main::to_y#0 ] ) always clobbers reg byte a
Statement [13] (byte~) main::$3 ← (byte) main::j#1 << (byte) 1 [ main::i#2 main::to_y#0 main::j#1 main::$3 ] ( main:2 [ main::i#2 main::to_y#0 main::j#1 main::$3 ] ) always clobbers reg byte a
Statement [14] *((const signed word*) SCREEN + (byte~) main::$3) ← (signed word) main::to_y#0 [ main::i#2 main::j#1 ] ( main:2 [ main::i#2 main::j#1 ] ) always clobbers reg byte a
Potential registers zp[1]:2 [ main::i#2 main::i#1 ] : zp[1]:2 , reg byte x , reg byte y ,
Potential registers zp[1]:3 [ main::j#3 main::j#2 ] : zp[1]:3 , reg byte x , reg byte y ,
Potential registers zp[1]:4 [ main::$8 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:4 [ main::$4 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:5 [ main::$1 ] : zp[1]:5 , reg byte x , reg byte y ,
Potential registers zp[2]:6 [ main::to_x#0 ] : zp[2]:6 ,
Potential registers zp[2]:8 [ main::to_y#0 ] : zp[2]:8 ,
@ -415,13 +392,13 @@ Potential registers zp[1]:11 [ main::j#1 ] : zp[1]:11 , reg byte x , reg byte y
Potential registers zp[1]:12 [ main::$3 ] : zp[1]:12 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [main] 22: zp[1]:4 [ main::$8 ] 22: zp[1]:10 [ main::$2 ] 22: zp[1]:12 [ main::$3 ] 20.5: zp[1]:2 [ main::i#2 main::i#1 ] 16.5: zp[1]:5 [ main::$1 ] 12.05: zp[1]:3 [ main::j#3 main::j#2 ] 11: zp[1]:11 [ main::j#1 ] 7.33: zp[2]:6 [ main::to_x#0 ] 4.4: zp[2]:8 [ main::to_y#0 ]
Uplift Scope [main] 22: zp[1]:4 [ main::$4 ] 22: zp[1]:10 [ main::$2 ] 22: zp[1]:12 [ main::$3 ] 20.5: zp[1]:2 [ main::i#2 main::i#1 ] 16.5: zp[1]:5 [ main::$1 ] 12.05: zp[1]:3 [ main::j#3 main::j#2 ] 11: zp[1]:11 [ main::j#1 ] 7.33: zp[2]:6 [ main::to_x#0 ] 4.4: zp[2]:8 [ main::to_y#0 ]
Uplift Scope [SplineVector16]
Uplift Scope [Segment]
Uplift Scope [Segment::SegmentType]
Uplift Scope []
Uplifting [main] best 1413 combination reg byte a [ main::$8 ] reg byte a [ main::$2 ] reg byte a [ main::$3 ] reg byte x [ main::i#2 main::i#1 ] zp[1]:5 [ main::$1 ] zp[1]:3 [ main::j#3 main::j#2 ] zp[1]:11 [ main::j#1 ] zp[2]:6 [ main::to_x#0 ] zp[2]:8 [ main::to_y#0 ]
Uplifting [main] best 1413 combination reg byte a [ main::$4 ] reg byte a [ main::$2 ] reg byte a [ main::$3 ] reg byte x [ main::i#2 main::i#1 ] zp[1]:5 [ main::$1 ] zp[1]:3 [ main::j#3 main::j#2 ] zp[1]:11 [ main::j#1 ] zp[2]:6 [ main::to_x#0 ] zp[2]:8 [ main::to_y#0 ]
Limited combination testing to 100 combinations of 5184 possible.
Uplifting [SplineVector16] best 1413 combination
Uplifting [Segment] best 1413 combination
@ -487,22 +464,22 @@ main: {
jmp __b1
// main::@1
__b1:
// [6] (byte~) main::$8 ← (byte) main::i#2 << (byte) 3 -- vbuaa=vbuxx_rol_3
// [6] (byte~) main::$4 ← (byte) main::i#2 << (byte) 3 -- vbuaa=vbuxx_rol_3
txa
asl
asl
asl
// [7] (byte~) main::$1 ← (byte~) main::$8 + (byte) main::i#2 -- vbuyy=vbuaa_plus_vbuxx
// [7] (byte~) main::$1 ← (byte~) main::$4 + (byte) main::i#2 -- vbuyy=vbuaa_plus_vbuxx
stx.z $ff
clc
adc.z $ff
tay
// [8] (signed word) main::to_x#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) -- vwsz1=pwsc1_derefidx_vbuyy
// [8] (signed word) main::to_x#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) -- vwsz1=pwsc1_derefidx_vbuyy
lda letter_c+OFFSET_STRUCT_SEGMENT_TO,y
sta.z to_x
lda letter_c+OFFSET_STRUCT_SEGMENT_TO+1,y
sta.z to_x+1
// [9] (signed word) main::to_y#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) -- vwsz1=pwsc1_derefidx_vbuyy
// [9] (signed word) main::to_y#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) -- vwsz1=pwsc1_derefidx_vbuyy
lda letter_c+OFFSET_STRUCT_SEGMENT_TO+OFFSET_STRUCT_SPLINEVECTOR16_Y,y
sta.z to_y
lda letter_c+OFFSET_STRUCT_SEGMENT_TO+OFFSET_STRUCT_SPLINEVECTOR16_Y+1,y
@ -598,7 +575,7 @@ FINAL SYMBOL TABLE
(byte~) main::$1 reg byte y 16.5
(byte~) main::$2 reg byte a 22.0
(byte~) main::$3 reg byte a 22.0
(byte~) main::$8 reg byte a 22.0
(byte~) main::$4 reg byte a 22.0
(label) main::@1
(label) main::@return
(byte) main::i
@ -615,7 +592,7 @@ FINAL SYMBOL TABLE
reg byte x [ main::i#2 main::i#1 ]
zp[1]:2 [ main::j#3 main::j#2 main::j#1 ]
reg byte a [ main::$8 ]
reg byte a [ main::$4 ]
reg byte y [ main::$1 ]
zp[2]:3 [ main::to_x#0 ]
zp[2]:5 [ main::to_y#0 ]
@ -662,22 +639,22 @@ main: {
// main::@1
__b1:
// to = letter_c[i].to
// [6] (byte~) main::$8 ← (byte) main::i#2 << (byte) 3 -- vbuaa=vbuxx_rol_3
// [6] (byte~) main::$4 ← (byte) main::i#2 << (byte) 3 -- vbuaa=vbuxx_rol_3
txa
asl
asl
asl
// [7] (byte~) main::$1 ← (byte~) main::$8 + (byte) main::i#2 -- vbuyy=vbuaa_plus_vbuxx
// [7] (byte~) main::$1 ← (byte~) main::$4 + (byte) main::i#2 -- vbuyy=vbuaa_plus_vbuxx
stx.z $ff
clc
adc.z $ff
tay
// [8] (signed word) main::to_x#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) -- vwsz1=pwsc1_derefidx_vbuyy
// [8] (signed word) main::to_x#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO + (byte~) main::$1) -- vwsz1=pwsc1_derefidx_vbuyy
lda letter_c+OFFSET_STRUCT_SEGMENT_TO,y
sta.z to_x
lda letter_c+OFFSET_STRUCT_SEGMENT_TO+1,y
sta.z to_x+1
// [9] (signed word) main::to_y#0 ← *((signed word*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) -- vwsz1=pwsc1_derefidx_vbuyy
// [9] (signed word) main::to_y#0 ← *((signed word*)(struct SplineVector16*)(const struct Segment*) letter_c+(const byte) OFFSET_STRUCT_SEGMENT_TO+(const byte) OFFSET_STRUCT_SPLINEVECTOR16_Y + (byte~) main::$1) -- vwsz1=pwsc1_derefidx_vbuyy
lda letter_c+OFFSET_STRUCT_SEGMENT_TO+OFFSET_STRUCT_SPLINEVECTOR16_Y,y
sta.z to_y
lda letter_c+OFFSET_STRUCT_SEGMENT_TO+OFFSET_STRUCT_SPLINEVECTOR16_Y+1,y

View File

@ -19,7 +19,7 @@
(byte~) main::$1 reg byte y 16.5
(byte~) main::$2 reg byte a 22.0
(byte~) main::$3 reg byte a 22.0
(byte~) main::$8 reg byte a 22.0
(byte~) main::$4 reg byte a 22.0
(label) main::@1
(label) main::@return
(byte) main::i
@ -36,7 +36,7 @@
reg byte x [ main::i#2 main::i#1 ]
zp[1]:2 [ main::j#3 main::j#2 main::j#1 ]
reg byte a [ main::$8 ]
reg byte a [ main::$4 ]
reg byte y [ main::$1 ]
zp[2]:3 [ main::to_x#0 ]
zp[2]:5 [ main::to_y#0 ]

View File

@ -34,10 +34,20 @@ Converted struct value to member variables (struct Point) main::v4_p
Created struct value member variable (byte) main::v4_q_x
Created struct value member variable (byte) main::v4_q_y
Converted struct value to member variables (struct Point) main::v4_q
Adding struct value member variable copy (struct Point) main::v1_p ← { x: (byte) 2, y: (byte) 3 }
Adding struct value member variable copy (struct Point) main::v1_q ← { x: (byte) 4, y: (byte) 5 }
Adding struct value member variable copy (struct Point) main::v2_p ← (struct Point) main::v1_p
Adding struct value member variable copy (struct Point) main::v2_q ← (struct Point) main::v1_q
Unwinding value copy (struct Vector) main::v1 ← { p: { x: (byte) 2, y: (byte) 3 }, q: { x: (byte) 4, y: (byte) 5 } }
Unwinding value copy (struct Vector) main::v1 ← { p: { x: (byte) 2, y: (byte) 3 }, q: { x: (byte) 4, y: (byte) 5 } }
Adding value simple copy (byte) main::v1_p_x ← (byte) 2
Adding value simple copy (byte) main::v1_p_y ← (byte) 3
Unwinding value copy (struct Vector) main::v1 ← { p: { x: (byte) 2, y: (byte) 3 }, q: { x: (byte) 4, y: (byte) 5 } }
Adding value simple copy (byte) main::v1_q_x ← (byte) 4
Adding value simple copy (byte) main::v1_q_y ← (byte) 5
Unwinding value copy (struct Vector) main::v2 ← (struct Vector) main::v1
Unwinding value copy (struct Vector) main::v2 ← (struct Vector) main::v1
Adding value simple copy (byte) main::v2_p_x ← (byte) main::v1_p_x
Adding value simple copy (byte) main::v2_p_y ← (byte) main::v1_p_y
Unwinding value copy (struct Vector) main::v2 ← (struct Vector) main::v1
Adding value simple copy (byte) main::v2_q_x ← (byte) main::v1_q_x
Adding value simple copy (byte) main::v2_q_y ← (byte) main::v1_q_y
Adding struct value member variable copy (struct Point) main::v3_p ← (struct Vector) main::v1.p
Adding struct value member variable copy (struct Point) main::v3_q ← { x: (byte) 6, y: (byte) 7 }
Adding struct value member variable copy (struct Point) main::v4_p ← (struct Point){ (struct Vector) main::v1.p.x, (struct Vector) main::v1.p.y }
@ -61,22 +71,17 @@ Replacing struct member reference (struct Vector) main::v4.p with member unwindi
Replacing struct member reference (struct Vector) main::v4.p with member unwinding reference (struct Point) main::v4_p
Replacing struct member reference (struct Vector) main::v4.q with member unwinding reference (struct Point) main::v4_q
Replacing struct member reference (struct Vector) main::v4.q with member unwinding reference (struct Point) main::v4_q
Adding struct value member variable copy (byte) main::v1_p_x ← (byte) 2
Adding struct value member variable copy (byte) main::v1_p_y ← (byte) 3
Adding struct value member variable copy (byte) main::v1_q_x ← (byte) 4
Adding struct value member variable copy (byte) main::v1_q_y ← (byte) 5
Adding struct value member variable copy (byte) main::v2_p_x ← (byte) main::v1_p_x
Adding struct value member variable copy (byte) main::v2_p_y ← (byte) main::v1_p_y
Adding struct value member variable copy (byte) main::v2_q_x ← (byte) main::v1_q_x
Adding struct value member variable copy (byte) main::v2_q_y ← (byte) main::v1_q_y
Adding struct value member variable copy (byte) main::v3_p_x ← (byte) main::v1_p_x
Adding struct value member variable copy (byte) main::v3_p_y ← (byte) main::v1_p_y
Adding struct value member variable copy (byte) main::v3_q_x ← (byte) 6
Adding struct value member variable copy (byte) main::v3_q_y ← (byte) 7
Unwinding value copy (struct Point) main::v3_p ← (struct Point) main::v1_p
Adding value simple copy (byte) main::v3_p_x ← (byte) main::v1_p_x
Adding value simple copy (byte) main::v3_p_y ← (byte) main::v1_p_y
Unwinding value copy (struct Point) main::v3_q ← { x: (byte) 6, y: (byte) 7 }
Adding value simple copy (byte) main::v3_q_x ← (byte) 6
Adding value simple copy (byte) main::v3_q_y ← (byte) 7
Adding struct value member variable copy (byte) main::v4_p_x ← (struct Point) main::v1_p.x
Adding struct value member variable copy (byte) main::v4_p_y ← (struct Point) main::v1_p.y
Adding struct value member variable copy (byte) main::v4_q_x ← (byte) 8
Adding struct value member variable copy (byte) main::v4_q_y ← (byte) 9
Unwinding value copy (struct Point) main::v4_q ← { x: (byte) 8, y: (byte) 9 }
Adding value simple copy (byte) main::v4_q_x ← (byte) 8
Adding value simple copy (byte) main::v4_q_y ← (byte) 9
Replacing struct member reference (struct Point) main::v1_p.x with member unwinding reference (byte) main::v1_p_x
Replacing struct member reference (struct Point) main::v1_p.y with member unwinding reference (byte) main::v1_p_y
Replacing struct member reference (struct Point) main::v1_p.x with member unwinding reference (byte) main::v1_p_x
@ -192,14 +197,18 @@ SYMBOL TABLE SSA
(byte) main::idx#7
(byte) main::idx#8
(byte) main::idx#9
(struct Point) main::v1_p
(const byte) main::v1_p_x = (byte) 2
(const byte) main::v1_p_y = (byte) 3
(struct Point) main::v1_q
(const byte) main::v1_q_x = (byte) 4
(const byte) main::v1_q_y = (byte) 5
(struct Point) main::v2_p
(byte) main::v2_p_x
(byte) main::v2_p_x#0
(byte) main::v2_p_y
(byte) main::v2_p_y#0
(struct Point) main::v2_q
(byte) main::v2_q_x
(byte) main::v2_q_x#0
(byte) main::v2_q_y
@ -437,8 +446,12 @@ VARIABLE REGISTER WEIGHTS
(struct Point) Vector::q
(void()) main()
(byte) main::idx
(struct Point) main::v1_p
(struct Point) main::v1_q
(struct Point) main::v2_p
(byte) main::v2_p_x
(byte) main::v2_p_y
(struct Point) main::v2_q
(byte) main::v2_q_x
(byte) main::v2_q_y
(byte) main::v3_p_x
@ -688,12 +701,16 @@ FINAL SYMBOL TABLE
(void()) main()
(label) main::@return
(byte) main::idx
(struct Point) main::v1_p
(const byte) main::v1_p_x = (byte) 2
(const byte) main::v1_p_y = (byte) 3
(struct Point) main::v1_q
(const byte) main::v1_q_x = (byte) 4
(const byte) main::v1_q_y = (byte) 5
(struct Point) main::v2_p
(byte) main::v2_p_x
(byte) main::v2_p_y
(struct Point) main::v2_q
(byte) main::v2_q_x
(byte) main::v2_q_y
(byte) main::v3_p_x

View File

@ -9,12 +9,16 @@
(void()) main()
(label) main::@return
(byte) main::idx
(struct Point) main::v1_p
(const byte) main::v1_p_x = (byte) 2
(const byte) main::v1_p_y = (byte) 3
(struct Point) main::v1_q
(const byte) main::v1_q_x = (byte) 4
(const byte) main::v1_q_y = (byte) 5
(struct Point) main::v2_p
(byte) main::v2_p_x
(byte) main::v2_p_y
(struct Point) main::v2_q
(byte) main::v2_q_x
(byte) main::v2_q_y
(byte) main::v3_p_x

View File

@ -3,9 +3,9 @@
:BasicUpstart(main)
.pc = $80d "Program"
.label SCREEN = $400
.const OFFSET_STRUCT_POINT_Y = 1
.const OFFSET_STRUCT_VECTOR_Q = 2
.const SIZEOF_STRUCT_VECTOR = 4
.const OFFSET_STRUCT_POINT_Y = 1
.const SIZEOF_STRUCT_POINT = 2
main: {
.const v1_p_x = 2

View File

@ -16,10 +16,20 @@ Converted struct value to member variables (struct Point) main::v5_p
Created struct value member variable (byte) main::v5_q_x
Created struct value member variable (byte) main::v5_q_y
Converted struct value to member variables (struct Point) main::v5_q
Adding struct value member variable copy (struct Point) main::v1_p ← { x: (byte) 2, y: (byte) 3 }
Adding struct value member variable copy (struct Point) main::v1_q ← { x: (byte) 4, y: (byte) 5 }
Adding struct value member variable copy *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P) ← (struct Point) main::v1_p
Adding struct value member variable copy *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q) ← (struct Point) main::v1_q
Unwinding value copy (struct Vector) main::v1 ← { p: { x: (byte) 2, y: (byte) 3 }, q: { x: (byte) 4, y: (byte) 5 } }
Unwinding value copy (struct Vector) main::v1 ← { p: { x: (byte) 2, y: (byte) 3 }, q: { x: (byte) 4, y: (byte) 5 } }
Adding value simple copy (byte) main::v1_p_x ← (byte) 2
Adding value simple copy (byte) main::v1_p_y ← (byte) 3
Unwinding value copy (struct Vector) main::v1 ← { p: { x: (byte) 2, y: (byte) 3 }, q: { x: (byte) 4, y: (byte) 5 } }
Adding value simple copy (byte) main::v1_q_x ← (byte) 4
Adding value simple copy (byte) main::v1_q_y ← (byte) 5
Unwinding value copy (struct Vector) main::v2 ← (struct Vector) main::v1
Unwinding value copy (struct Vector) main::v2 ← (struct Vector) main::v1
Adding value simple copy *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) main::v1_p_x
Adding value simple copy *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte) main::v1_p_y
Unwinding value copy (struct Vector) main::v2 ← (struct Vector) main::v1
Adding value simple copy *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) main::v1_q_x
Adding value simple copy *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte) main::v1_q_y
Adding struct value member variable copy *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P) ← (struct Vector) main::v2.p
Adding struct value member variable copy *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q) ← { x: (byte) 6, y: (byte) 7 }
Adding value bulk copy *(&(struct Vector) main::v4) ← memcpy(*(&(struct Vector) main::v3), struct Vector, (const byte) SIZEOF_STRUCT_VECTOR)
@ -48,20 +58,13 @@ Replacing struct member reference (struct Vector) main::v5.p with member unwindi
Replacing struct member reference (struct Vector) main::v5.p with member unwinding reference (struct Point) main::v5_p
Replacing struct member reference (struct Vector) main::v5.q with member unwinding reference (struct Point) main::v5_q
Replacing struct member reference (struct Vector) main::v5.q with member unwinding reference (struct Point) main::v5_q
Adding struct value member variable copy (byte) main::v1_p_x ← (byte) 2
Adding struct value member variable copy (byte) main::v1_p_y ← (byte) 3
Adding struct value member variable copy (byte) main::v1_q_x ← (byte) 4
Adding struct value member variable copy (byte) main::v1_q_y ← (byte) 5
Adding struct value member variable copy *((byte*~) main::$0) ← (byte) main::v1_p_x
Adding struct value member variable copy *((byte*~) main::$1) ← (byte) main::v1_p_y
Adding struct value member variable copy *((byte*~) main::$2) ← (byte) main::v1_q_x
Adding struct value member variable copy *((byte*~) main::$3) ← (byte) main::v1_q_y
Adding value bulk copy *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P) ← memcpy(*((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Adding value bulk copy *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q) ← memcpy(*(&(const struct Point) $0), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Adding struct value member variable copy (byte) main::v5_p_x ← *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P).x
Adding struct value member variable copy (byte) main::v5_p_y ← *((struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P).y
Adding struct value member variable copy (byte) main::v5_q_x ← (byte) 8
Adding struct value member variable copy (byte) main::v5_q_y ← (byte) 9
Unwinding value copy (struct Point) main::v5_q ← { x: (byte) 8, y: (byte) 9 }
Adding value simple copy (byte) main::v5_q_x ← (byte) 8
Adding value simple copy (byte) main::v5_q_y ← (byte) 9
Replacing struct member reference (struct Point) main::v1_p.x with member unwinding reference (byte) main::v1_p_x
Replacing struct member reference (struct Point) main::v1_p.y with member unwinding reference (byte) main::v1_p_y
Replacing struct member reference (struct Point) main::v1_q.x with member unwinding reference (byte) main::v1_q_x
@ -98,24 +101,20 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
(byte) main::idx#0 ← (byte) 0
(byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
*((byte*~) main::$0) ← (const byte) main::v1_p_x
(byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
*((byte*~) main::$1) ← (const byte) main::v1_p_y
(byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
*((byte*~) main::$2) ← (const byte) main::v1_q_x
(byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
*((byte*~) main::$3) ← (const byte) main::v1_q_y
(struct Vector) main::v2 ← struct-unwound {*((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q)}
*((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_X) ← (const byte) main::v1_p_x
*((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) main::v1_p_y
*((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_X) ← (const byte) main::v1_q_x
*((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) main::v1_q_y
(struct Vector) main::v2 ← struct-unwound {*((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_Y), *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y)}
*((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P) ← memcpy(*((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P), struct Point, (const byte) SIZEOF_STRUCT_POINT)
*((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q) ← memcpy(*(&(const struct Point) $0), struct Point, (const byte) SIZEOF_STRUCT_POINT)
(struct Vector) main::v3 ← struct-unwound {*((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q)}
*(&(struct Vector) main::v4) ← memcpy(*(&(struct Vector) main::v3), struct Vector, (const byte) SIZEOF_STRUCT_VECTOR)
(struct Vector) main::v4 ← struct-unwound {*(&(struct Vector) main::v4)}
(byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
(byte) main::v5_p_x#0 ← *((byte*~) main::$4)
(byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
(byte) main::v5_p_y#0 ← *((byte*~) main::$5)
(byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
(byte) main::v5_p_x#0 ← *((byte*~) main::$0)
(byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
(byte) main::v5_p_y#0 ← *((byte*~) main::$1)
*((const byte*) SCREEN + (byte) main::idx#0) ← (const byte) main::v1_p_x
(byte) main::idx#1 ← ++ (byte) main::idx#0
*((const byte*) SCREEN + (byte) main::idx#1) ← (const byte) main::v1_p_y
@ -124,41 +123,41 @@ main: scope:[main] from @1
(byte) main::idx#3 ← ++ (byte) main::idx#2
*((const byte*) SCREEN + (byte) main::idx#3) ← (const byte) main::v1_q_y
(byte) main::idx#4 ← ++ (byte) main::idx#3
(byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#4) ← *((byte*~) main::$6)
(byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#4) ← *((byte*~) main::$2)
(byte) main::idx#5 ← ++ (byte) main::idx#4
(byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#5) ← *((byte*~) main::$7)
(byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#5) ← *((byte*~) main::$3)
(byte) main::idx#6 ← ++ (byte) main::idx#5
(byte*~) main::$8 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#6) ← *((byte*~) main::$8)
(byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#6) ← *((byte*~) main::$4)
(byte) main::idx#7 ← ++ (byte) main::idx#6
(byte*~) main::$9 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#7) ← *((byte*~) main::$9)
(byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#7) ← *((byte*~) main::$5)
(byte) main::idx#8 ← ++ (byte) main::idx#7
(byte*~) main::$10 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#8) ← *((byte*~) main::$10)
(byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#8) ← *((byte*~) main::$6)
(byte) main::idx#9 ← ++ (byte) main::idx#8
(byte*~) main::$11 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#9) ← *((byte*~) main::$11)
(byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#9) ← *((byte*~) main::$7)
(byte) main::idx#10 ← ++ (byte) main::idx#9
(byte*~) main::$12 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#10) ← *((byte*~) main::$12)
(byte*~) main::$8 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#10) ← *((byte*~) main::$8)
(byte) main::idx#11 ← ++ (byte) main::idx#10
(byte*~) main::$13 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#11) ← *((byte*~) main::$13)
(byte*~) main::$9 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#11) ← *((byte*~) main::$9)
(byte) main::idx#12 ← ++ (byte) main::idx#11
(byte*~) main::$14 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#12) ← *((byte*~) main::$14)
(byte*~) main::$10 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#12) ← *((byte*~) main::$10)
(byte) main::idx#13 ← ++ (byte) main::idx#12
(byte*~) main::$15 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#13) ← *((byte*~) main::$15)
(byte*~) main::$11 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#13) ← *((byte*~) main::$11)
(byte) main::idx#14 ← ++ (byte) main::idx#13
(byte*~) main::$16 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#14) ← *((byte*~) main::$16)
(byte*~) main::$12 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
*((const byte*) SCREEN + (byte) main::idx#14) ← *((byte*~) main::$12)
(byte) main::idx#15 ← ++ (byte) main::idx#14
(byte*~) main::$17 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#15) ← *((byte*~) main::$17)
(byte*~) main::$13 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
*((const byte*) SCREEN + (byte) main::idx#15) ← *((byte*~) main::$13)
(byte) main::idx#16 ← ++ (byte) main::idx#15
*((const byte*) SCREEN + (byte) main::idx#16) ← (byte) main::v5_p_x#0
(byte) main::idx#17 ← ++ (byte) main::idx#16
@ -203,10 +202,6 @@ SYMBOL TABLE SSA
(byte*~) main::$11
(byte*~) main::$12
(byte*~) main::$13
(byte*~) main::$14
(byte*~) main::$15
(byte*~) main::$16
(byte*~) main::$17
(byte*~) main::$2
(byte*~) main::$3
(byte*~) main::$4
@ -238,8 +233,10 @@ SYMBOL TABLE SSA
(byte) main::idx#7
(byte) main::idx#8
(byte) main::idx#9
(struct Point) main::v1_p
(const byte) main::v1_p_x = (byte) 2
(const byte) main::v1_p_y = (byte) 3
(struct Point) main::v1_q
(const byte) main::v1_q_x = (byte) 4
(const byte) main::v1_q_y = (byte) 5
(struct Vector) main::v2 loadstore
@ -254,52 +251,40 @@ SYMBOL TABLE SSA
Simplifying constant pointer cast (byte*) 1024
Successful SSA optimization PassNCastSimplification
Removing C-classic struct-unwound assignment [9] (struct Vector) main::v2 ← struct-unwound {*((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q)}
Removing C-classic struct-unwound assignment [12] (struct Vector) main::v3 ← struct-unwound {*((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q)}
Removing C-classic struct-unwound assignment [14] (struct Vector) main::v4 ← struct-unwound {*(&(struct Vector) main::v4)}
Constant right-side identified [1] (byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [3] (byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [5] (byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [7] (byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [15] (byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v4+(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::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [27] (byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [30] (byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [33] (byte*~) main::$8 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [36] (byte*~) main::$9 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [39] (byte*~) main::$10 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [42] (byte*~) main::$11 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [45] (byte*~) main::$12 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [48] (byte*~) main::$13 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [51] (byte*~) main::$14 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [54] (byte*~) main::$15 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [57] (byte*~) main::$16 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [60] (byte*~) main::$17 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
Removing C-classic struct-unwound assignment [5] (struct Vector) main::v2 ← struct-unwound {*((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_Y), *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_X), *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y)}
Removing C-classic struct-unwound assignment [8] (struct Vector) main::v3 ← struct-unwound {*((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P), *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q)}
Removing C-classic struct-unwound assignment [10] (struct Vector) main::v4 ← struct-unwound {*(&(struct Vector) main::v4)}
Constant right-side identified [11] (byte*~) main::$0 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [13] (byte*~) main::$1 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [23] (byte*~) main::$2 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [26] (byte*~) main::$3 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [29] (byte*~) main::$4 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [32] (byte*~) main::$5 ← (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [35] (byte*~) main::$6 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [38] (byte*~) main::$7 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [41] (byte*~) main::$8 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [44] (byte*~) main::$9 ← (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [47] (byte*~) main::$10 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [50] (byte*~) main::$11 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_P + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [53] (byte*~) main::$12 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [56] (byte*~) main::$13 ← (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q + (const byte) OFFSET_STRUCT_POINT_Y
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::idx#0 = 0
Constant (const byte*) main::$0 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$1 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$2 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$3 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$4 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$5 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$6 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$7 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$8 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$9 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$10 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$11 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$12 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$13 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$14 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$15 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$16 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$17 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$0 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$1 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$2 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$3 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$4 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$5 = (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$6 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$7 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$8 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$9 = (byte*)(struct Point*)&main::v3+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$10 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$11 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P+OFFSET_STRUCT_POINT_Y
Constant (const byte*) main::$12 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$13 = (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_Q+OFFSET_STRUCT_POINT_Y
Successful SSA optimization Pass2ConstantIdentification
Simplifying expression containing zero (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_P in
Simplifying expression containing zero (struct Point*)&main::v2 in
Simplifying expression containing zero (struct Point*)&main::v2 in
Simplifying expression containing zero (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_Q in
Simplifying expression containing zero (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_P in
Simplifying expression containing zero (struct Point*)&main::v4 in
Simplifying expression containing zero (struct Point*)&main::v4 in
@ -315,9 +300,13 @@ Simplifying expression containing zero (byte*)(struct Point*)&main::v4+OFFSET_ST
Simplifying expression containing zero (struct Point*)&main::v4 in
Simplifying expression containing zero (struct Point*)&main::v4 in
Simplifying expression containing zero (byte*)(struct Point*)&main::v4+OFFSET_STRUCT_VECTOR_Q in
Simplifying expression containing zero (struct Point*)&main::v2 in [10] *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P) ← memcpy(*((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Simplifying expression containing zero (struct Point*)&main::v3 in [10] *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P) ← memcpy(*((struct Point*)&(struct Vector) main::v2), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Simplifying expression containing zero SCREEN in [19] *((const byte*) SCREEN + (const byte) main::idx#0) ← (const byte) main::v1_p_x
Simplifying expression containing zero (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_P in [1] *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_X) ← (const byte) main::v1_p_x
Simplifying expression containing zero (struct Point*)&main::v2 in [1] *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P) ← (const byte) main::v1_p_x
Simplifying expression containing zero (struct Point*)&main::v2 in [2] *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P+(const byte) OFFSET_STRUCT_POINT_Y) ← (const byte) main::v1_p_y
Simplifying expression containing zero (byte*)(struct Point*)&main::v2+OFFSET_STRUCT_VECTOR_Q in [3] *((byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_X) ← (const byte) main::v1_q_x
Simplifying expression containing zero (struct Point*)&main::v2 in [6] *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P) ← memcpy(*((struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_P), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Simplifying expression containing zero (struct Point*)&main::v3 in [6] *((struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_P) ← memcpy(*((struct Point*)&(struct Vector) main::v2), struct Point, (const byte) SIZEOF_STRUCT_POINT)
Simplifying expression containing zero SCREEN in [15] *((const byte*) SCREEN + (const byte) main::idx#0) ← (const byte) main::v1_p_x
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (byte) main::idx#20 and assignment [48] (byte) main::idx#20 ← ++ (byte) main::idx#19
Eliminating unused constant (const byte) OFFSET_STRUCT_VECTOR_P
@ -427,36 +416,32 @@ Constant inlined main::idx#12 = ++++++++++++++++++++++++(byte) 0
Constant inlined main::idx#13 = ++++++++++++++++++++++++++(byte) 0
Constant inlined main::idx#14 = ++++++++++++++++++++++++++++(byte) 0
Constant inlined main::idx#15 = ++++++++++++++++++++++++++++++(byte) 0
Constant inlined main::$12 = (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q
Constant inlined main::$13 = (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$14 = (byte*)(struct Point*)&(struct Vector) main::v4
Constant inlined main::$15 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$10 = (byte*)(struct Point*)&(struct Vector) main::v3
Constant inlined main::$11 = (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$16 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q
Constant inlined main::$17 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$12 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q
Constant inlined main::$13 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$10 = (byte*)(struct Point*)&(struct Vector) main::v4
Constant inlined main::$11 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::idx#0 = (byte) 0
Constant inlined main::idx#1 = ++(byte) 0
Constant inlined main::idx#2 = ++++(byte) 0
Constant inlined main::$1 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$1 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::idx#3 = ++++++(byte) 0
Constant inlined main::$2 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q
Constant inlined main::$2 = (byte*)(struct Point*)&(struct Vector) main::v2
Constant inlined main::idx#4 = ++++++++(byte) 0
Constant inlined main::idx#5 = ++++++++++(byte) 0
Constant inlined main::$0 = (byte*)(struct Point*)&(struct Vector) main::v2
Constant inlined main::$0 = (byte*)(struct Point*)&(struct Vector) main::v4
Constant inlined main::idx#6 = ++++++++++++(byte) 0
Constant inlined main::$5 = (byte*)(struct Point*)&(struct Vector) main::v4+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$5 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::idx#7 = ++++++++++++++(byte) 0
Constant inlined main::$6 = (byte*)(struct Point*)&(struct Vector) main::v2
Constant inlined main::$6 = (byte*)(struct Point*)&(struct Vector) main::v3
Constant inlined main::idx#8 = ++++++++++++++++(byte) 0
Constant inlined main::$3 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$3 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::idx#9 = ++++++++++++++++++(byte) 0
Constant inlined main::idx#10 = ++++++++++++++++++++(byte) 0
Constant inlined main::$4 = (byte*)(struct Point*)&(struct Vector) main::v4
Constant inlined main::$4 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q
Constant inlined main::idx#11 = ++++++++++++++++++++++(byte) 0
Constant inlined main::$9 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$7 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$8 = (byte*)(struct Point*)&(struct Vector) main::v2+(const byte) OFFSET_STRUCT_VECTOR_Q
Constant inlined main::$9 = (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$7 = (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::$8 = (byte*)(struct Point*)&(struct Vector) main::v3+(const byte) OFFSET_STRUCT_VECTOR_Q
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(SCREEN+++0)
Consolidated array index constant in *(SCREEN+++++0)
@ -586,6 +571,8 @@ VARIABLE REGISTER WEIGHTS
(struct Point) Vector::q
(void()) main()
(byte) main::idx
(struct Point) main::v1_p
(struct Point) main::v1_q
(struct Vector) main::v2 loadstore
(struct Vector) main::v3 loadstore
(struct Vector) main::v4 loadstore
@ -622,9 +609,9 @@ Target platform is c64basic / MOS6502X
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
.const OFFSET_STRUCT_POINT_Y = 1
.const OFFSET_STRUCT_VECTOR_Q = 2
.const SIZEOF_STRUCT_VECTOR = 4
.const OFFSET_STRUCT_POINT_Y = 1
.const SIZEOF_STRUCT_POINT = 2
// @begin
__bbegin:
@ -843,9 +830,9 @@ ASSEMBLER BEFORE OPTIMIZATION
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
.const OFFSET_STRUCT_POINT_Y = 1
.const OFFSET_STRUCT_VECTOR_Q = 2
.const SIZEOF_STRUCT_VECTOR = 4
.const OFFSET_STRUCT_POINT_Y = 1
.const SIZEOF_STRUCT_POINT = 2
// @begin
__bbegin:
@ -1014,8 +1001,10 @@ FINAL SYMBOL TABLE
(void()) main()
(label) main::@return
(byte) main::idx
(struct Point) main::v1_p
(const byte) main::v1_p_x = (byte) 2
(const byte) main::v1_p_y = (byte) 3
(struct Point) main::v1_q
(const byte) main::v1_q_x = (byte) 4
(const byte) main::v1_q_y = (byte) 5
(struct Vector) main::v2 loadstore zp[4]:2
@ -1046,9 +1035,9 @@ Score: 218
.pc = $80d "Program"
// Global Constants & labels
.label SCREEN = $400
.const OFFSET_STRUCT_POINT_Y = 1
.const OFFSET_STRUCT_VECTOR_Q = 2
.const SIZEOF_STRUCT_VECTOR = 4
.const OFFSET_STRUCT_POINT_Y = 1
.const SIZEOF_STRUCT_POINT = 2
// @begin
// [1] phi from @begin to @1 [phi:@begin->@1]

View File

@ -14,8 +14,10 @@
(void()) main()
(label) main::@return
(byte) main::idx
(struct Point) main::v1_p
(const byte) main::v1_p_x = (byte) 2
(const byte) main::v1_p_y = (byte) 3
(struct Point) main::v1_q
(const byte) main::v1_q_x = (byte) 4
(const byte) main::v1_q_y = (byte) 5
(struct Vector) main::v2 loadstore zp[4]:2

View File

@ -10,17 +10,22 @@ Converted struct value to member variables (struct Point) point::return
Created struct value member variable (byte) point::p_x
Created struct value member variable (byte) point::p_y
Converted struct value to member variables (struct Point) point::p
Adding struct value member variable copy (byte) main::q_x ← (byte) 0
Adding struct value member variable copy (byte) main::q_y ← (byte) 0
Unwinding value copy (struct Point) main::q ← {}
Adding value simple copy (byte) main::q_x ← (byte) 0
Adding value simple copy (byte) main::q_y ← (byte) 0
Converted procedure call LValue to member unwinding { (byte~) main::$0_x, (byte~) main::$0_y } ← call point
Adding struct value member variable copy (byte) main::q_x ← (byte~) main::$0_x
Adding struct value member variable copy (byte) main::q_y ← (byte~) main::$0_y
Adding struct value member variable copy (byte) point::p_x ← (byte) 2
Adding struct value member variable copy (byte) point::p_y ← (byte) 3
Adding struct value member variable copy (byte) point::return_x ← (byte) point::p_x
Adding struct value member variable copy (byte) point::return_y ← (byte) point::p_y
Adding struct value member variable copy (byte) point::return_x ← (byte) point::return_x
Adding struct value member variable copy (byte) point::return_y ← (byte) point::return_y
Unwinding value copy (struct Point) main::q ← (struct Point~) main::$0
Adding value simple copy (byte) main::q_x ← (byte~) main::$0_x
Adding value simple copy (byte) main::q_y ← (byte~) main::$0_y
Unwinding value copy (struct Point) point::p ← { x: (byte) 2, y: (byte) 3 }
Adding value simple copy (byte) point::p_x ← (byte) 2
Adding value simple copy (byte) point::p_y ← (byte) 3
Unwinding value copy (struct Point) point::return ← (struct Point) point::p
Adding value simple copy (byte) point::return_x ← (byte) point::p_x
Adding value simple copy (byte) point::return_y ← (byte) point::p_y
Unwinding value copy (struct Point) point::return ← (struct Point) point::return
Adding value simple copy (byte) point::return_x ← (byte) point::return_x
Adding value simple copy (byte) point::return_y ← (byte) point::return_y
Converted procedure struct return value to member unwinding return { (byte) point::return_x, (byte) point::return_y }
Replacing struct member reference (struct Point) main::q.x with member unwinding reference (byte) main::q_x
Replacing struct member reference (struct Point) main::q.y with member unwinding reference (byte) main::q_y

View File

@ -7,15 +7,17 @@ Converted struct value to member variables (struct Circle) main::c
Created struct value member variable (byte) main::c_center_x
Created struct value member variable (byte) main::c_center_y
Converted struct value to member variables (struct Point) main::c_center
Adding struct value member variable copy (byte) main::p_x ← (byte) $a
Adding struct value member variable copy (byte) main::p_y ← (byte) $a
Unwinding value copy (struct Point) main::p ← { x: (byte) $a, y: (byte) $a }
Adding value simple copy (byte) main::p_x ← (byte) $a
Adding value simple copy (byte) main::p_y ← (byte) $a
Adding struct value member variable copy (struct Point) main::c_center ← (struct Point) main::p
Adding struct value member variable copy (byte) main::c_radius ← (byte) 5
Replacing struct member reference (struct Circle) main::c.center with member unwinding reference (struct Point) main::c_center
Replacing struct member reference (struct Circle) main::c.center with member unwinding reference (struct Point) main::c_center
Replacing struct member reference (struct Circle) main::c.radius with member unwinding reference (byte) main::c_radius
Adding struct value member variable copy (byte) main::c_center_x ← (byte) main::p_x
Adding struct value member variable copy (byte) main::c_center_y ← (byte) main::p_y
Unwinding value copy (struct Point) main::c_center ← (struct Point) main::p
Adding value simple copy (byte) main::c_center_x ← (byte) main::p_x
Adding value simple copy (byte) main::c_center_y ← (byte) main::p_y
Replacing struct member reference (struct Point) main::c_center.x with member unwinding reference (byte) main::c_center_x
Replacing struct member reference (struct Point) main::c_center.y with member unwinding reference (byte) main::c_center_y
Identified constant variable (byte) main::p_x

View File

@ -13,28 +13,29 @@ Converted struct value to member variables (struct Point) main::t_c1_center
Created struct value member variable (byte) main::t_c2_center_x
Created struct value member variable (byte) main::t_c2_center_y
Converted struct value to member variables (struct Point) main::t_c2_center
Adding struct value member variable copy (struct Circle) main::t_c1 ← { center: { x: (byte) 1, y: (byte) 2 }, radius: (byte) 3 }
Adding struct value member variable copy (struct Circle) main::t_c2 ← { center: { x: (byte) 4, y: (byte) 5 }, radius: (byte) 6 }
Unwinding value copy (struct TwoCircles) main::t ← { c1: { center: { x: (byte) 1, y: (byte) 2 }, radius: (byte) 3 }, c2: { center: { x: (byte) 4, y: (byte) 5 }, radius: (byte) 6 } }
Unwinding value copy (struct TwoCircles) main::t ← { c1: { center: { x: (byte) 1, y: (byte) 2 }, radius: (byte) 3 }, c2: { center: { x: (byte) 4, y: (byte) 5 }, radius: (byte) 6 } }
Unwinding value copy (struct TwoCircles) main::t ← { c1: { center: { x: (byte) 1, y: (byte) 2 }, radius: (byte) 3 }, c2: { center: { x: (byte) 4, y: (byte) 5 }, radius: (byte) 6 } }
Adding value simple copy (byte) main::t_c1_center_x ← (byte) 1
Adding value simple copy (byte) main::t_c1_center_y ← (byte) 2
Adding value simple copy (byte) main::t_c1_radius ← (byte) 3
Unwinding value copy (struct TwoCircles) main::t ← { c1: { center: { x: (byte) 1, y: (byte) 2 }, radius: (byte) 3 }, c2: { center: { x: (byte) 4, y: (byte) 5 }, radius: (byte) 6 } }
Unwinding value copy (struct TwoCircles) main::t ← { c1: { center: { x: (byte) 1, y: (byte) 2 }, radius: (byte) 3 }, c2: { center: { x: (byte) 4, y: (byte) 5 }, radius: (byte) 6 } }
Adding value simple copy (byte) main::t_c2_center_x ← (byte) 4
Adding value simple copy (byte) main::t_c2_center_y ← (byte) 5
Adding value simple copy (byte) main::t_c2_radius ← (byte) 6
Replacing struct member reference (struct TwoCircles) main::t.c1 with member unwinding reference (struct Circle) main::t_c1
Replacing struct member reference (struct TwoCircles) main::t.c1 with member unwinding reference (struct Circle) main::t_c1
Replacing struct member reference (struct TwoCircles) main::t.c1 with member unwinding reference (struct Circle) main::t_c1
Replacing struct member reference (struct TwoCircles) main::t.c2 with member unwinding reference (struct Circle) main::t_c2
Replacing struct member reference (struct TwoCircles) main::t.c2 with member unwinding reference (struct Circle) main::t_c2
Replacing struct member reference (struct TwoCircles) main::t.c2 with member unwinding reference (struct Circle) main::t_c2
Adding struct value member variable copy (struct Point) main::t_c1_center ← { x: (byte) 1, y: (byte) 2 }
Adding struct value member variable copy (byte) main::t_c1_radius ← (byte) 3
Adding struct value member variable copy (struct Point) main::t_c2_center ← { x: (byte) 4, y: (byte) 5 }
Adding struct value member variable copy (byte) main::t_c2_radius ← (byte) 6
Replacing struct member reference (struct Circle) main::t_c1.center with member unwinding reference (struct Point) main::t_c1_center
Replacing struct member reference (struct Circle) main::t_c1.center with member unwinding reference (struct Point) main::t_c1_center
Replacing struct member reference (struct Circle) main::t_c1.radius with member unwinding reference (byte) main::t_c1_radius
Replacing struct member reference (struct Circle) main::t_c2.center with member unwinding reference (struct Point) main::t_c2_center
Replacing struct member reference (struct Circle) main::t_c2.center with member unwinding reference (struct Point) main::t_c2_center
Replacing struct member reference (struct Circle) main::t_c2.radius with member unwinding reference (byte) main::t_c2_radius
Adding struct value member variable copy (byte) main::t_c1_center_x ← (byte) 1
Adding struct value member variable copy (byte) main::t_c1_center_y ← (byte) 2
Adding struct value member variable copy (byte) main::t_c2_center_x ← (byte) 4
Adding struct value member variable copy (byte) main::t_c2_center_y ← (byte) 5
Replacing struct member reference (struct Point) main::t_c1_center.x with member unwinding reference (byte) main::t_c1_center_x
Replacing struct member reference (struct Point) main::t_c1_center.y with member unwinding reference (byte) main::t_c1_center_y
Replacing struct member reference (struct Point) main::t_c2_center.x with member unwinding reference (byte) main::t_c2_center_x
@ -83,9 +84,13 @@ SYMBOL TABLE SSA
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*)(number) $400
(struct Circle) main::t_c1
(struct Point) main::t_c1_center
(const byte) main::t_c1_center_x = (byte) 1
(const byte) main::t_c1_center_y = (byte) 2
(const byte) main::t_c1_radius = (byte) 3
(struct Circle) main::t_c2
(struct Point) main::t_c2_center
(const byte) main::t_c2_center_x = (byte) 4
(const byte) main::t_c2_center_y = (byte) 5
(const byte) main::t_c2_radius = (byte) 6
@ -167,6 +172,10 @@ VARIABLE REGISTER WEIGHTS
(struct Circle) TwoCircles::c1
(struct Circle) TwoCircles::c2
(void()) main()
(struct Circle) main::t_c1
(struct Point) main::t_c1_center
(struct Circle) main::t_c2
(struct Point) main::t_c2_center
Initial phi equivalence classes
Complete equivalence classes
@ -339,9 +348,13 @@ FINAL SYMBOL TABLE
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(struct Circle) main::t_c1
(struct Point) main::t_c1_center
(const byte) main::t_c1_center_x = (byte) 1
(const byte) main::t_c1_center_y = (byte) 2
(const byte) main::t_c1_radius = (byte) 3
(struct Circle) main::t_c2
(struct Point) main::t_c2_center
(const byte) main::t_c2_center_x = (byte) 4
(const byte) main::t_c2_center_y = (byte) 5
(const byte) main::t_c2_radius = (byte) 6

View File

@ -10,9 +10,13 @@
(void()) main()
(label) main::@return
(const byte*) main::SCREEN = (byte*) 1024
(struct Circle) main::t_c1
(struct Point) main::t_c1_center
(const byte) main::t_c1_center_x = (byte) 1
(const byte) main::t_c1_center_y = (byte) 2
(const byte) main::t_c1_radius = (byte) 3
(struct Circle) main::t_c2
(struct Point) main::t_c2_center
(const byte) main::t_c2_center_x = (byte) 4
(const byte) main::t_c2_center_y = (byte) 5
(const byte) main::t_c2_radius = (byte) 6

View File

@ -9,19 +9,25 @@ Created struct value member variable (byte) get::return_x
Created struct value member variable (byte) get::return_y
Converted struct value to member variables (struct Point) get::return
Converted procedure call LValue to member unwinding { (byte~) main::$0_x, (byte~) main::$0_y } ← call get (number) 0
Adding struct value member variable copy *((byte*~) main::$4) ← (byte~) main::$0_x
Adding struct value member variable copy *((byte*~) main::$5) ← (byte~) main::$0_y
Unwinding value copy *((const struct Point*) SCREEN) ← (struct Point~) main::$0
Adding value simple copy *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$0_x
Adding value simple copy *((byte*)(const struct Point*) SCREEN+(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 get (byte) main::i
Adding struct value member variable copy *((byte*~) main::$6 + (byte~) main::$3) ← (byte~) main::$1_x
Adding struct value member variable copy *((byte*~) main::$7 + (byte~) main::$3) ← (byte~) main::$1_y
Adding struct value member variable copy (byte) get::return_x ← *((byte*~) get::$2)
Adding struct value member variable copy (byte) get::return_y ← *((byte*~) get::$3)
Adding struct value member variable copy (byte) get::return_x ← *((byte*~) get::$4)
Adding struct value member variable copy (byte) get::return_y ← *((byte*~) get::$5)
Adding struct value member variable copy (byte) get::return_x ← *((byte*~) get::$6)
Adding struct value member variable copy (byte) get::return_y ← *((byte*~) get::$7)
Adding struct value member variable copy (byte) get::return_x ← (byte) get::return_x
Adding struct value member variable copy (byte) get::return_y ← (byte) get::return_y
Unwinding value copy *((const struct Point*) SCREEN + (byte~) main::$3) ← (struct Point~) main::$1
Adding value simple copy *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_X + (byte~) main::$3) ← (byte~) main::$1_x
Adding value simple copy *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (byte~) main::$1_y
Unwinding value copy (struct Point) get::return ← *((struct Point*) p0)
Adding value simple copy (byte) get::return_x ← *((byte*~) get::$2)
Adding value simple copy (byte) get::return_y ← *((byte*~) get::$3)
Unwinding value copy (struct Point) get::return ← *((struct Point*) p1)
Adding value simple copy (byte) get::return_x ← *((byte*~) get::$4)
Adding value simple copy (byte) get::return_y ← *((byte*~) get::$5)
Unwinding value copy (struct Point) get::return ← *((struct Point*) p2)
Adding value simple copy (byte) get::return_x ← *((byte*~) get::$6)
Adding value simple copy (byte) get::return_y ← *((byte*~) get::$7)
Unwinding value copy (struct Point) get::return ← (struct Point) get::return
Adding value simple copy (byte) get::return_x ← (byte) get::return_x
Adding value simple copy (byte) get::return_y ← (byte) get::return_y
Converted procedure struct return value to member unwinding return { (byte) get::return_x, (byte) get::return_y }
Identified constant variable (byte) idx
Identified constant variable (struct Point*) p0
@ -57,10 +63,8 @@ main::@3: scope:[main] from main
(byte) get::return_x#6 ← phi( main/(byte) get::return_x#0 )
(byte~) main::$0_x ← (byte) get::return_x#6
(byte~) main::$0_y ← (byte) get::return_y#6
(byte*~) main::$4 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_X
*((byte*~) main::$4) ← (byte~) main::$0_x
(byte*~) main::$5 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_Y
*((byte*~) main::$5) ← (byte~) main::$0_y
*((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$0_x
*((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte~) main::$0_y
(byte) main::i#0 ← (byte) 1
to:main::@1
main::@1: scope:[main] from main::@3 main::@4
@ -77,10 +81,8 @@ main::@4: scope:[main] from main::@1
(byte~) main::$1_x ← (byte) get::return_x#7
(byte~) main::$1_y ← (byte) get::return_y#7
(byte~) main::$3 ← (byte) main::i#3 * (const byte) SIZEOF_STRUCT_POINT
(byte*~) main::$6 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_X
*((byte*~) main::$6 + (byte~) main::$3) ← (byte~) main::$1_x
(byte*~) main::$7 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_Y
*((byte*~) main::$7 + (byte~) main::$3) ← (byte~) main::$1_y
*((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_X + (byte~) main::$3) ← (byte~) main::$1_x
*((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (byte~) main::$1_y
(byte) main::i#1 ← (byte) main::i#3 + rangenext(1,2)
(bool~) main::$2 ← (byte) main::i#1 != rangelast(1,2)
if((bool~) main::$2) goto main::@1
@ -200,10 +202,6 @@ SYMBOL TABLE SSA
(byte~) main::$1_y
(bool~) main::$2
(byte~) main::$3
(byte*~) main::$4
(byte*~) main::$5
(byte*~) main::$6
(byte*~) main::$7
(label) main::@1
(label) main::@3
(label) main::@4
@ -244,27 +242,19 @@ Alias (byte) get::i#2 = (byte) get::i#3
Alias (byte) get::return_x#5 = (byte) get::return_x#8
Alias (byte) get::return_y#5 = (byte) get::return_y#8
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$2 [27] if((byte) main::i#1!=rangelast(1,2)) goto main::@1
Simple Condition (bool~) get::$0 [31] if((byte) get::i#2==(byte) 0) goto get::@1
Simple Condition (bool~) get::$1 [39] if((byte) get::i#2==(byte) 1) goto get::@2
Simple Condition (bool~) main::$2 [23] if((byte) main::i#1!=rangelast(1,2)) goto main::@1
Simple Condition (bool~) get::$0 [27] if((byte) get::i#2==(byte) 0) goto get::@1
Simple Condition (bool~) get::$1 [35] if((byte) get::i#2==(byte) 1) goto get::@2
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [7] (byte*~) main::$4 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [9] (byte*~) main::$5 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [21] (byte*~) main::$6 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [23] (byte*~) main::$7 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [32] (byte*~) get::$2 ← (byte*)(const struct Point*) p0 + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [34] (byte*~) get::$3 ← (byte*)(const struct Point*) p0 + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [40] (byte*~) get::$4 ← (byte*)(const struct Point*) p1 + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [42] (byte*~) get::$5 ← (byte*)(const struct Point*) p1 + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [45] (byte*~) get::$6 ← (byte*)(const struct Point*) p2 + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [47] (byte*~) get::$7 ← (byte*)(const struct Point*) p2 + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [28] (byte*~) get::$2 ← (byte*)(const struct Point*) p0 + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [30] (byte*~) get::$3 ← (byte*)(const struct Point*) p0 + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [36] (byte*~) get::$4 ← (byte*)(const struct Point*) p1 + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [38] (byte*~) get::$5 ← (byte*)(const struct Point*) p1 + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [41] (byte*~) get::$6 ← (byte*)(const struct Point*) p2 + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [43] (byte*~) get::$7 ← (byte*)(const struct Point*) p2 + (const byte) OFFSET_STRUCT_POINT_Y
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) get::i#0 = 0
Constant (const byte*) main::$4 = (byte*)SCREEN+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$5 = (byte*)SCREEN+OFFSET_STRUCT_POINT_Y
Constant (const byte) main::i#0 = 1
Constant (const byte*) main::$6 = (byte*)SCREEN+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$7 = (byte*)SCREEN+OFFSET_STRUCT_POINT_Y
Constant (const byte*) get::$2 = (byte*)p0+OFFSET_STRUCT_POINT_X
Constant (const byte*) get::$3 = (byte*)p0+OFFSET_STRUCT_POINT_Y
Constant (const byte*) get::$4 = (byte*)p1+OFFSET_STRUCT_POINT_X
@ -272,13 +262,13 @@ Constant (const byte*) get::$5 = (byte*)p1+OFFSET_STRUCT_POINT_Y
Constant (const byte*) get::$6 = (byte*)p2+OFFSET_STRUCT_POINT_X
Constant (const byte*) get::$7 = (byte*)p2+OFFSET_STRUCT_POINT_Y
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [25] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [27] if(main::i#1!=rangelast(1,2)) goto main::@1 to (number) 3
Simplifying expression containing zero (byte*)SCREEN in
Simplifying expression containing zero (byte*)SCREEN in
Resolved ranged next value [21] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [23] if(main::i#1!=rangelast(1,2)) goto main::@1 to (number) 3
Simplifying expression containing zero (byte*)p0 in
Simplifying expression containing zero (byte*)p1 in
Simplifying expression containing zero (byte*)p2 in
Simplifying expression containing zero (byte*)SCREEN in [7] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$0_x
Simplifying expression containing zero (byte*)SCREEN in [19] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_X + (byte~) main::$3) ← (byte~) main::$1_x
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (struct Point) get::return#0 and assignment [24] (struct Point) get::return#0 ← struct-unwound {(byte) get::return_x#2, (byte) get::return_y#2}
Eliminating unused variable (struct Point) get::return#1 and assignment [28] (struct Point) get::return#1 ← struct-unwound {(byte) get::return_x#3, (byte) get::return_y#3}
@ -298,14 +288,10 @@ Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte) get::i#0
Constant inlined get::$7 = (byte*)(const struct Point*) p2+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined get::$6 = (byte*)(const struct Point*) p2
Constant inlined main::$5 = (byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::i#0 = (byte) 1
Constant inlined main::$6 = (byte*)(const struct Point*) SCREEN
Constant inlined main::$4 = (byte*)(const struct Point*) SCREEN
Constant inlined get::$3 = (byte*)(const struct Point*) p0+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined get::$2 = (byte*)(const struct Point*) p0
Constant inlined get::i#0 = (byte) 0
Constant inlined main::$7 = (byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined get::$5 = (byte*)(const struct Point*) p1+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined get::$4 = (byte*)(const struct Point*) p1
Successful SSA optimization Pass2ConstantInlining

View File

@ -12,17 +12,21 @@ Created struct value member variable (byte) get::p_x
Created struct value member variable (byte) get::p_y
Converted struct value to member variables (struct Point) get::p
Converted procedure call LValue to member unwinding { (byte~) main::$0_x, (byte~) main::$0_y } ← call get (number) 0
Adding struct value member variable copy *((byte*~) main::$4) ← (byte~) main::$0_x
Adding struct value member variable copy *((byte*~) main::$5) ← (byte~) main::$0_y
Unwinding value copy *((const struct Point*) SCREEN) ← (struct Point~) main::$0
Adding value simple copy *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$0_x
Adding value simple copy *((byte*)(const struct Point*) SCREEN+(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 get (byte) main::i
Adding struct value member variable copy *((byte*~) main::$6 + (byte~) main::$3) ← (byte~) main::$1_x
Adding struct value member variable copy *((byte*~) main::$7 + (byte~) main::$3) ← (byte~) main::$1_y
Unwinding value copy *((const struct Point*) SCREEN + (byte~) main::$3) ← (struct Point~) main::$1
Adding value simple copy *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_X + (byte~) main::$3) ← (byte~) main::$1_x
Adding value simple copy *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (byte~) main::$1_y
Adding struct value member variable copy (byte) get::p_x ← (byte) get::i
Adding struct value member variable copy (byte) get::p_y ← (byte) 7
Adding struct value member variable copy (byte) get::return_x ← (byte) get::p_x
Adding struct value member variable copy (byte) get::return_y ← (byte) get::p_y
Adding struct value member variable copy (byte) get::return_x ← (byte) get::return_x
Adding struct value member variable copy (byte) get::return_y ← (byte) get::return_y
Unwinding value copy (struct Point) get::return ← (struct Point) get::p
Adding value simple copy (byte) get::return_x ← (byte) get::p_x
Adding value simple copy (byte) get::return_y ← (byte) get::p_y
Unwinding value copy (struct Point) get::return ← (struct Point) get::return
Adding value simple copy (byte) get::return_x ← (byte) get::return_x
Adding value simple copy (byte) get::return_y ← (byte) get::return_y
Converted procedure struct return value to member unwinding return { (byte) get::return_x, (byte) get::return_y }
Identified constant variable (byte) idx
Identified constant variable (byte) get::p_y
@ -50,10 +54,8 @@ main::@3: scope:[main] from main
(byte) get::return_x#4 ← phi( main/(byte) get::return_x#0 )
(byte~) main::$0_x ← (byte) get::return_x#4
(byte~) main::$0_y ← (byte) get::return_y#4
(byte*~) main::$4 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_X
*((byte*~) main::$4) ← (byte~) main::$0_x
(byte*~) main::$5 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_Y
*((byte*~) main::$5) ← (byte~) main::$0_y
*((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$0_x
*((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte~) main::$0_y
(byte) main::i#0 ← (byte) 1
to:main::@1
main::@1: scope:[main] from main::@3 main::@4
@ -70,10 +72,8 @@ main::@4: scope:[main] from main::@1
(byte~) main::$1_x ← (byte) get::return_x#5
(byte~) main::$1_y ← (byte) get::return_y#5
(byte~) main::$3 ← (byte) main::i#3 * (const byte) SIZEOF_STRUCT_POINT
(byte*~) main::$6 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_X
*((byte*~) main::$6 + (byte~) main::$3) ← (byte~) main::$1_x
(byte*~) main::$7 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_Y
*((byte*~) main::$7 + (byte~) main::$3) ← (byte~) main::$1_y
*((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_X + (byte~) main::$3) ← (byte~) main::$1_x
*((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y + (byte~) main::$3) ← (byte~) main::$1_y
(byte) main::i#1 ← (byte) main::i#3 + rangenext(1,2)
(bool~) main::$2 ← (byte) main::i#1 != rangelast(1,2)
if((bool~) main::$2) goto main::@1
@ -153,10 +153,6 @@ SYMBOL TABLE SSA
(byte~) main::$1_y
(bool~) main::$2
(byte~) main::$3
(byte*~) main::$4
(byte*~) main::$5
(byte*~) main::$6
(byte*~) main::$7
(label) main::@1
(label) main::@3
(label) main::@4
@ -184,19 +180,10 @@ Alias (byte) main::i#2 = (byte) main::i#3
Alias (byte) get::return_x#2 = (byte) get::p_x#0 (byte) get::i#2 (byte) get::return_x#6 (byte) get::return_x#3
Alias (byte) get::return_y#2 = (byte) get::return_y#6 (byte) get::return_y#3
Successful SSA optimization Pass2AliasElimination
Simple Condition (bool~) main::$2 [27] if((byte) main::i#1!=rangelast(1,2)) goto main::@1
Simple Condition (bool~) main::$2 [23] if((byte) main::i#1!=rangelast(1,2)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant right-side identified [7] (byte*~) main::$4 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [9] (byte*~) main::$5 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_Y
Constant right-side identified [21] (byte*~) main::$6 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_X
Constant right-side identified [23] (byte*~) main::$7 ← (byte*)(const struct Point*) SCREEN + (const byte) OFFSET_STRUCT_POINT_Y
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) get::i#0 = 0
Constant (const byte*) main::$4 = (byte*)SCREEN+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$5 = (byte*)SCREEN+OFFSET_STRUCT_POINT_Y
Constant (const byte) main::i#0 = 1
Constant (const byte*) main::$6 = (byte*)SCREEN+OFFSET_STRUCT_POINT_X
Constant (const byte*) main::$7 = (byte*)SCREEN+OFFSET_STRUCT_POINT_Y
Constant (const byte) get::return_y#2 = get::p_y
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) get::return_y#0 = get::return_y#2
@ -205,10 +192,10 @@ Successful SSA optimization Pass2ConstantIdentification
Constant (const byte) main::$0_y = get::return_y#0
Constant (const byte) main::$1_y = get::return_y#1
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [25] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [27] if(main::i#1!=rangelast(1,2)) goto main::@1 to (number) 3
Simplifying expression containing zero (byte*)SCREEN in
Simplifying expression containing zero (byte*)SCREEN in
Resolved ranged next value [21] main::i#1 ← ++ main::i#2 to ++
Resolved ranged comparison value [23] if(main::i#1!=rangelast(1,2)) goto main::@1 to (number) 3
Simplifying expression containing zero (byte*)SCREEN in [7] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_X) ← (byte~) main::$0_x
Simplifying expression containing zero (byte*)SCREEN in [19] *((byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_X + (byte~) main::$3) ← (byte~) main::$1_x
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (struct Point) get::return#0 and assignment [17] (struct Point) get::return#0 ← struct-unwound {(byte) get::return_x#2, (const byte) get::return_y#2}
Eliminating unused variable (struct Point) get::return#1 and assignment [18] (struct Point) get::return#1 ← struct-unwound {(byte) get::return_x#2, (const byte) get::return_y#2}
@ -226,14 +213,10 @@ Inlining constant with var siblings (const byte) main::i#0
Inlining constant with var siblings (const byte) get::i#0
Constant inlined main::$1_y = (const byte) get::p_y
Constant inlined main::$0_y = (const byte) get::p_y
Constant inlined main::$5 = (byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined main::i#0 = (byte) 1
Constant inlined main::$6 = (byte*)(const struct Point*) SCREEN
Constant inlined main::$4 = (byte*)(const struct Point*) SCREEN
Constant inlined get::return_y#0 = (const byte) get::p_y
Constant inlined get::i#0 = (byte) 0
Constant inlined get::return_y#1 = (const byte) get::p_y
Constant inlined main::$7 = (byte*)(const struct Point*) SCREEN+(const byte) OFFSET_STRUCT_POINT_Y
Constant inlined get::return_y#2 = (const byte) get::p_y
Successful SSA optimization Pass2ConstantInlining
Eliminating unused constant (const byte) SIZEOF_STRUCT_POINT

View File

@ -6,8 +6,9 @@ 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::point_x ← (byte) 1
Adding struct value member variable copy (byte) main::point_y ← (byte) 2
Unwinding value copy (struct Point) main::point ← { x: (byte) 1, y: (byte) 2 }
Adding value simple copy (byte) main::point_x ← (byte) 1
Adding value simple copy (byte) main::point_y ← (byte) 2
Converted procedure struct value parameter to member unwinding in call (void~) main::$0 ← call print (byte) main::point_x (byte) main::point_y
Converted procedure struct value parameter to member unwinding in call (void~) main::$1 ← call print *((byte*~) main::$2) *((byte*~) main::$3)
Replacing struct member reference (struct Point) print::p.x with member unwinding reference (byte) print::p_x

View File

@ -13,11 +13,13 @@ Created struct value member variable (byte) print_person::person_id
Created struct value member variable (byte*) print_person::person_name
Converted struct value to member variables (struct Person) print_person::person
Converted procedure struct value parameter to member unwinding (void()) print_person((byte) print_person::person_id , (byte*) print_person::person_name)
Adding struct value member variable copy (byte) main::jesper_id ← (byte) 4
Adding struct value member variable copy *((const byte*) main::jesper_name) ← memcpy(*(&(const byte*) $0), byte, (number) $10)
Unwinding value copy (struct Person) main::jesper ← { id: (byte) 4, name: (string) "jesper" }
Adding value simple copy (byte) main::jesper_id ← (byte) 4
Adding value bulk copy *((const byte*) main::jesper_name) ← memcpy(*(&(const byte*) $0), byte, (number) $10)
Converted procedure struct value parameter to member unwinding in call (void~) main::$0 ← call print_person (byte) main::jesper_id (const byte*) main::jesper_name
Adding struct value member variable copy (byte) main::henriette_id ← (byte) 7
Adding struct value member variable copy *((const byte*) main::henriette_name) ← memcpy(*(&(const byte*) $1), byte, (number) $10)
Unwinding value copy (struct Person) main::henriette ← { id: (byte) 7, name: (string) "henriette" }
Adding value simple copy (byte) main::henriette_id ← (byte) 7
Adding value bulk copy *((const byte*) main::henriette_name) ← memcpy(*(&(const byte*) $1), byte, (number) $10)
Converted procedure struct value parameter to member unwinding in call (void~) main::$1 ← call print_person (byte) main::henriette_id (const byte*) main::henriette_name
Replacing struct member reference (struct Person) print_person::person.id with member unwinding reference (byte) print_person::person_id
Replacing struct member reference (struct Person) print_person::person.name with member unwinding reference (byte*) print_person::person_name

View File

@ -1,10 +1,12 @@
Created struct value member variable (byte) main::p_x
Created struct value member variable (byte) main::p_y
Converted struct value to member variables (struct PointDef) main::p
Adding struct value member variable copy (byte) main::p_x ← (byte) 4
Adding struct value member variable copy (byte) main::p_y ← (byte) 7
Adding struct value member variable copy *((byte*~) main::$0) ← (byte) main::p_x
Adding struct value member variable copy *((byte*~) main::$1) ← (byte) main::p_y
Unwinding value copy (struct PointDef) main::p ← { x: (byte) 4, y: (byte) 7 }
Adding value simple copy (byte) main::p_x ← (byte) 4
Adding value simple copy (byte) main::p_y ← (byte) 7
Unwinding value copy *((struct PointDef*) main::SCREEN) ← (struct PointDef) main::p
Adding value simple copy *((byte*~) main::$0) ← (byte) main::p_x
Adding value simple copy *((byte*~) main::$1) ← (byte) main::p_y
Identified constant variable (struct PointDef*) main::SCREEN
Identified constant variable (byte) main::p_x
Identified constant variable (byte) main::p_y