2019-06-10 19:24:33 +00:00
|
|
|
|
|
|
|
CONTROL FLOW GRAPH SSA
|
|
|
|
@begin: scope:[] from
|
|
|
|
to:@1
|
2019-09-18 21:00:30 +00:00
|
|
|
|
|
|
|
(void()) main()
|
2019-06-10 19:24:33 +00:00
|
|
|
main: scope:[main] from @1
|
|
|
|
(number~) main::$0 ← (number) 0 * (const byte) SIZEOF_STRUCT_POINT
|
2020-02-06 00:08:55 +00:00
|
|
|
*((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (number~) main::$0) ← (number) 2
|
2019-06-10 19:24:33 +00:00
|
|
|
(number~) main::$1 ← (number) 0 * (const byte) SIZEOF_STRUCT_POINT
|
2020-02-06 00:08:55 +00:00
|
|
|
*((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (number~) main::$1) ← (number) 3
|
2019-06-10 19:24:33 +00:00
|
|
|
(number~) main::$2 ← (number) 1 * (const byte) SIZEOF_STRUCT_POINT
|
2020-02-06 00:08:55 +00:00
|
|
|
*((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (number~) main::$2) ← (number) 5
|
2019-06-10 19:24:33 +00:00
|
|
|
(number~) main::$3 ← (number) 1 * (const byte) SIZEOF_STRUCT_POINT
|
2020-02-06 00:08:55 +00:00
|
|
|
*((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (number~) main::$3) ← (number) 6
|
2019-06-10 19:24:33 +00:00
|
|
|
(number~) main::$4 ← (number) 0 * (const byte) SIZEOF_STRUCT_POINT
|
2020-03-29 19:00:25 +00:00
|
|
|
*((const nomodify byte*) main::SCREEN + (number) 0) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (number~) main::$4)
|
2019-06-10 19:24:33 +00:00
|
|
|
(number~) main::$5 ← (number) 0 * (const byte) SIZEOF_STRUCT_POINT
|
2020-03-29 19:00:25 +00:00
|
|
|
*((const nomodify byte*) main::SCREEN + (number) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (number~) main::$5)
|
2019-06-10 19:24:33 +00:00
|
|
|
(number~) main::$6 ← (number) 1 * (const byte) SIZEOF_STRUCT_POINT
|
2020-03-29 19:00:25 +00:00
|
|
|
*((const nomodify byte*) main::SCREEN + (number) 3) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (number~) main::$6)
|
2019-06-10 19:24:33 +00:00
|
|
|
(number~) main::$7 ← (number) 1 * (const byte) SIZEOF_STRUCT_POINT
|
2020-03-29 19:00:25 +00:00
|
|
|
*((const nomodify byte*) main::SCREEN + (number) 4) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (number~) main::$7)
|
2019-06-10 19:24:33 +00:00
|
|
|
to:main::@return
|
|
|
|
main::@return: scope:[main] from main
|
|
|
|
return
|
|
|
|
to:@return
|
|
|
|
@1: scope:[] from @begin
|
|
|
|
call main
|
|
|
|
to:@2
|
|
|
|
@2: scope:[] from @1
|
|
|
|
to:@end
|
|
|
|
@end: scope:[] from @2
|
|
|
|
|
|
|
|
SYMBOL TABLE SSA
|
|
|
|
(label) @1
|
|
|
|
(label) @2
|
|
|
|
(label) @begin
|
|
|
|
(label) @end
|
|
|
|
(const byte) OFFSET_STRUCT_POINT_X = (byte) 0
|
|
|
|
(const byte) OFFSET_STRUCT_POINT_Y = (byte) 1
|
2019-11-03 19:11:06 +00:00
|
|
|
(byte) Point::x
|
|
|
|
(byte) Point::y
|
2019-06-10 19:24:33 +00:00
|
|
|
(const byte) SIZEOF_STRUCT_POINT = (byte) 2
|
|
|
|
(void()) main()
|
|
|
|
(number~) main::$0
|
|
|
|
(number~) main::$1
|
|
|
|
(number~) main::$2
|
|
|
|
(number~) main::$3
|
|
|
|
(number~) main::$4
|
|
|
|
(number~) main::$5
|
|
|
|
(number~) main::$6
|
|
|
|
(number~) main::$7
|
|
|
|
(label) main::@return
|
2020-03-29 19:00:25 +00:00
|
|
|
(const nomodify byte*) main::SCREEN = (byte*)(number) $400
|
2019-12-21 09:38:44 +00:00
|
|
|
(const struct Point*) points[(number) 2] = { fill( 2, 0) }
|
2019-06-10 19:24:33 +00:00
|
|
|
|
|
|
|
Adding number conversion cast (unumber) 0 in (number~) main::$0 ← (number) 0 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Adding number conversion cast (unumber) main::$0 in (number~) main::$0 ← (unumber)(number) 0 * (const byte) SIZEOF_STRUCT_POINT
|
2020-02-06 00:08:55 +00:00
|
|
|
Adding number conversion cast (unumber) 2 in *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (unumber~) main::$0) ← (number) 2
|
2019-06-10 19:24:33 +00:00
|
|
|
Adding number conversion cast (unumber) 0 in (number~) main::$1 ← (number) 0 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Adding number conversion cast (unumber) main::$1 in (number~) main::$1 ← (unumber)(number) 0 * (const byte) SIZEOF_STRUCT_POINT
|
2020-02-06 00:08:55 +00:00
|
|
|
Adding number conversion cast (unumber) 3 in *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (unumber~) main::$1) ← (number) 3
|
2019-06-10 19:24:33 +00:00
|
|
|
Adding number conversion cast (unumber) 1 in (number~) main::$2 ← (number) 1 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Adding number conversion cast (unumber) main::$2 in (number~) main::$2 ← (unumber)(number) 1 * (const byte) SIZEOF_STRUCT_POINT
|
2020-02-06 00:08:55 +00:00
|
|
|
Adding number conversion cast (unumber) 5 in *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (unumber~) main::$2) ← (number) 5
|
2019-06-10 19:24:33 +00:00
|
|
|
Adding number conversion cast (unumber) 1 in (number~) main::$3 ← (number) 1 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Adding number conversion cast (unumber) main::$3 in (number~) main::$3 ← (unumber)(number) 1 * (const byte) SIZEOF_STRUCT_POINT
|
2020-02-06 00:08:55 +00:00
|
|
|
Adding number conversion cast (unumber) 6 in *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (unumber~) main::$3) ← (number) 6
|
2019-06-10 19:24:33 +00:00
|
|
|
Adding number conversion cast (unumber) 0 in (number~) main::$4 ← (number) 0 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Adding number conversion cast (unumber) main::$4 in (number~) main::$4 ← (unumber)(number) 0 * (const byte) SIZEOF_STRUCT_POINT
|
2020-03-29 19:00:25 +00:00
|
|
|
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) main::SCREEN + (number) 0) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (unumber~) main::$4)
|
2019-06-10 19:24:33 +00:00
|
|
|
Adding number conversion cast (unumber) 0 in (number~) main::$5 ← (number) 0 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Adding number conversion cast (unumber) main::$5 in (number~) main::$5 ← (unumber)(number) 0 * (const byte) SIZEOF_STRUCT_POINT
|
2020-03-29 19:00:25 +00:00
|
|
|
Adding number conversion cast (unumber) 1 in *((const nomodify byte*) main::SCREEN + (number) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (unumber~) main::$5)
|
2019-06-10 19:24:33 +00:00
|
|
|
Adding number conversion cast (unumber) 1 in (number~) main::$6 ← (number) 1 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Adding number conversion cast (unumber) main::$6 in (number~) main::$6 ← (unumber)(number) 1 * (const byte) SIZEOF_STRUCT_POINT
|
2020-03-29 19:00:25 +00:00
|
|
|
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) main::SCREEN + (number) 3) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (unumber~) main::$6)
|
2019-06-10 19:24:33 +00:00
|
|
|
Adding number conversion cast (unumber) 1 in (number~) main::$7 ← (number) 1 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Adding number conversion cast (unumber) main::$7 in (number~) main::$7 ← (unumber)(number) 1 * (const byte) SIZEOF_STRUCT_POINT
|
2020-03-29 19:00:25 +00:00
|
|
|
Adding number conversion cast (unumber) 4 in *((const nomodify byte*) main::SCREEN + (number) 4) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (unumber~) main::$7)
|
2019-06-10 19:24:33 +00:00
|
|
|
Successful SSA optimization PassNAddNumberTypeConversions
|
2020-02-06 00:08:55 +00:00
|
|
|
Inlining cast *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (unumber~) main::$0) ← (unumber)(number) 2
|
|
|
|
Inlining cast *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (unumber~) main::$1) ← (unumber)(number) 3
|
|
|
|
Inlining cast *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (unumber~) main::$2) ← (unumber)(number) 5
|
|
|
|
Inlining cast *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (unumber~) main::$3) ← (unumber)(number) 6
|
2019-06-10 19:24:33 +00:00
|
|
|
Successful SSA optimization Pass2InlineCast
|
2019-11-03 16:05:55 +00:00
|
|
|
Simplifying constant pointer cast (byte*) 1024
|
2019-06-10 19:24:33 +00:00
|
|
|
Simplifying constant integer cast 0
|
|
|
|
Simplifying constant integer cast 2
|
|
|
|
Simplifying constant integer cast 0
|
|
|
|
Simplifying constant integer cast 3
|
|
|
|
Simplifying constant integer cast 1
|
|
|
|
Simplifying constant integer cast 5
|
|
|
|
Simplifying constant integer cast 1
|
|
|
|
Simplifying constant integer cast 6
|
|
|
|
Simplifying constant integer cast 0
|
|
|
|
Simplifying constant integer cast 0
|
|
|
|
Simplifying constant integer cast 0
|
|
|
|
Simplifying constant integer cast 1
|
|
|
|
Simplifying constant integer cast 1
|
|
|
|
Simplifying constant integer cast 3
|
|
|
|
Simplifying constant integer cast 1
|
|
|
|
Simplifying constant integer cast 4
|
|
|
|
Successful SSA optimization PassNCastSimplification
|
|
|
|
Finalized unsigned number type (byte) 0
|
|
|
|
Finalized unsigned number type (byte) 2
|
|
|
|
Finalized unsigned number type (byte) 0
|
|
|
|
Finalized unsigned number type (byte) 3
|
|
|
|
Finalized unsigned number type (byte) 1
|
|
|
|
Finalized unsigned number type (byte) 5
|
|
|
|
Finalized unsigned number type (byte) 1
|
|
|
|
Finalized unsigned number type (byte) 6
|
|
|
|
Finalized unsigned number type (byte) 0
|
|
|
|
Finalized unsigned number type (byte) 0
|
|
|
|
Finalized unsigned number type (byte) 0
|
|
|
|
Finalized unsigned number type (byte) 1
|
|
|
|
Finalized unsigned number type (byte) 1
|
|
|
|
Finalized unsigned number type (byte) 3
|
|
|
|
Finalized unsigned number type (byte) 1
|
|
|
|
Finalized unsigned number type (byte) 4
|
|
|
|
Successful SSA optimization PassNFinalizeNumberTypeConversions
|
|
|
|
Inferred type updated to byte in (unumber~) main::$0 ← (byte) 0 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Inferred type updated to byte in (unumber~) main::$1 ← (byte) 0 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Inferred type updated to byte in (unumber~) main::$2 ← (byte) 1 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Inferred type updated to byte in (unumber~) main::$3 ← (byte) 1 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Inferred type updated to byte in (unumber~) main::$4 ← (byte) 0 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Inferred type updated to byte in (unumber~) main::$5 ← (byte) 0 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Inferred type updated to byte in (unumber~) main::$6 ← (byte) 1 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Inferred type updated to byte in (unumber~) main::$7 ← (byte) 1 * (const byte) SIZEOF_STRUCT_POINT
|
2019-11-18 21:02:29 +00:00
|
|
|
Constant right-side identified [0] (byte~) main::$0 ← (byte) 0 * (const byte) SIZEOF_STRUCT_POINT
|
2020-02-06 00:08:55 +00:00
|
|
|
Constant right-side identified [2] (byte~) main::$1 ← (byte) 0 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Constant right-side identified [4] (byte~) main::$2 ← (byte) 1 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Constant right-side identified [6] (byte~) main::$3 ← (byte) 1 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Constant right-side identified [8] (byte~) main::$4 ← (byte) 0 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Constant right-side identified [10] (byte~) main::$5 ← (byte) 0 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Constant right-side identified [12] (byte~) main::$6 ← (byte) 1 * (const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Constant right-side identified [14] (byte~) main::$7 ← (byte) 1 * (const byte) SIZEOF_STRUCT_POINT
|
2019-06-10 19:24:33 +00:00
|
|
|
Successful SSA optimization Pass2ConstantRValueConsolidation
|
|
|
|
Constant (const byte) main::$0 = 0*SIZEOF_STRUCT_POINT
|
|
|
|
Constant (const byte) main::$1 = 0*SIZEOF_STRUCT_POINT
|
|
|
|
Constant (const byte) main::$2 = 1*SIZEOF_STRUCT_POINT
|
|
|
|
Constant (const byte) main::$3 = 1*SIZEOF_STRUCT_POINT
|
|
|
|
Constant (const byte) main::$4 = 0*SIZEOF_STRUCT_POINT
|
|
|
|
Constant (const byte) main::$5 = 0*SIZEOF_STRUCT_POINT
|
|
|
|
Constant (const byte) main::$6 = 1*SIZEOF_STRUCT_POINT
|
|
|
|
Constant (const byte) main::$7 = 1*SIZEOF_STRUCT_POINT
|
|
|
|
Successful SSA optimization Pass2ConstantIdentification
|
|
|
|
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_STRUCT_POINT in
|
|
|
|
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_STRUCT_POINT in
|
|
|
|
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_STRUCT_POINT in
|
|
|
|
Simplifying constant evaluating to zero (byte) 0*(const byte) SIZEOF_STRUCT_POINT in
|
|
|
|
Successful SSA optimization PassNSimplifyConstantZero
|
2020-02-06 00:08:55 +00:00
|
|
|
Simplifying expression containing zero (byte*)points+OFFSET_STRUCT_POINT_X in [1] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (const byte) main::$0) ← (byte) 2
|
|
|
|
Simplifying expression containing zero (byte*)points in [1] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X) ← (byte) 2
|
|
|
|
Simplifying expression containing zero (byte*)points+OFFSET_STRUCT_POINT_Y in [3] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (const byte) main::$1) ← (byte) 3
|
|
|
|
Simplifying expression containing zero (byte*)points in [5] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (const byte) main::$2) ← (byte) 5
|
2020-03-29 19:00:25 +00:00
|
|
|
Simplifying expression containing zero (byte*)points+OFFSET_STRUCT_POINT_X in [9] *((const nomodify byte*) main::SCREEN + (byte) 0) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (const byte) main::$4)
|
|
|
|
Simplifying expression containing zero (byte*)points in [9] *((const nomodify byte*) main::SCREEN + (byte) 0) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X)
|
|
|
|
Simplifying expression containing zero main::SCREEN in [9] *((const nomodify byte*) main::SCREEN + (byte) 0) ← *((byte*)(const struct Point*) points)
|
|
|
|
Simplifying expression containing zero (byte*)points+OFFSET_STRUCT_POINT_Y in [11] *((const nomodify byte*) main::SCREEN + (byte) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y + (const byte) main::$5)
|
|
|
|
Simplifying expression containing zero (byte*)points in [13] *((const nomodify byte*) main::SCREEN + (byte) 3) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_X + (const byte) main::$6)
|
2019-06-10 19:24:33 +00:00
|
|
|
Successful SSA optimization PassNSimplifyExpressionWithZero
|
|
|
|
Eliminating unused constant (const byte) main::$0
|
|
|
|
Eliminating unused constant (const byte) main::$1
|
|
|
|
Eliminating unused constant (const byte) main::$4
|
|
|
|
Eliminating unused constant (const byte) main::$5
|
|
|
|
Eliminating unused constant (const byte) OFFSET_STRUCT_POINT_X
|
|
|
|
Successful SSA optimization PassNEliminateUnusedVars
|
|
|
|
Constant inlined main::$6 = (byte) 1*(const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Constant inlined main::$3 = (byte) 1*(const byte) SIZEOF_STRUCT_POINT
|
2020-02-06 00:08:55 +00:00
|
|
|
Constant inlined main::$2 = (byte) 1*(const byte) SIZEOF_STRUCT_POINT
|
2019-06-10 19:24:33 +00:00
|
|
|
Constant inlined main::$7 = (byte) 1*(const byte) SIZEOF_STRUCT_POINT
|
|
|
|
Successful SSA optimization Pass2ConstantInlining
|
2019-09-29 18:57:23 +00:00
|
|
|
Consolidated array index constant in *((byte*)points+1*SIZEOF_STRUCT_POINT)
|
|
|
|
Consolidated array index constant in *((byte*)points+OFFSET_STRUCT_POINT_Y+1*SIZEOF_STRUCT_POINT)
|
|
|
|
Consolidated array index constant in *(main::SCREEN+1)
|
|
|
|
Consolidated array index constant in *((byte*)points+1*SIZEOF_STRUCT_POINT)
|
|
|
|
Consolidated array index constant in *(main::SCREEN+3)
|
|
|
|
Consolidated array index constant in *((byte*)points+OFFSET_STRUCT_POINT_Y+1*SIZEOF_STRUCT_POINT)
|
|
|
|
Consolidated array index constant in *(main::SCREEN+4)
|
2019-06-10 19:24:33 +00:00
|
|
|
Successful SSA optimization Pass2ConstantAdditionElimination
|
|
|
|
Adding NOP phi() at start of @begin
|
|
|
|
Adding NOP phi() at start of @1
|
|
|
|
Adding NOP phi() at start of @2
|
|
|
|
Adding NOP phi() at start of @end
|
|
|
|
CALL GRAPH
|
|
|
|
Calls in [] to main:2
|
|
|
|
|
|
|
|
Created 0 initial phi equivalence classes
|
|
|
|
Coalesced down to 0 phi equivalence classes
|
|
|
|
Culled Empty Block (label) @2
|
|
|
|
Adding NOP phi() at start of @begin
|
|
|
|
Adding NOP phi() at start of @1
|
|
|
|
Adding NOP phi() at start of @end
|
|
|
|
|
|
|
|
FINAL CONTROL FLOW GRAPH
|
|
|
|
@begin: scope:[] from
|
|
|
|
[0] phi()
|
|
|
|
to:@1
|
|
|
|
@1: scope:[] from @begin
|
|
|
|
[1] phi()
|
|
|
|
[2] call main
|
|
|
|
to:@end
|
|
|
|
@end: scope:[] from @1
|
|
|
|
[3] phi()
|
2019-09-18 21:00:30 +00:00
|
|
|
|
|
|
|
(void()) main()
|
2019-06-10 19:24:33 +00:00
|
|
|
main: scope:[main] from @1
|
2019-11-18 21:02:29 +00:00
|
|
|
[4] *((byte*)(const struct Point*) points) ← (byte) 2
|
|
|
|
[5] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte) 3
|
|
|
|
[6] *((byte*)(const struct Point*) points+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) ← (byte) 5
|
|
|
|
[7] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) ← (byte) 6
|
2020-03-29 19:00:25 +00:00
|
|
|
[8] *((const nomodify byte*) main::SCREEN) ← *((byte*)(const struct Point*) points)
|
|
|
|
[9] *((const nomodify byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y)
|
|
|
|
[10] *((const nomodify byte*) main::SCREEN+(byte) 3) ← *((byte*)(const struct Point*) points+(byte) 1*(const byte) SIZEOF_STRUCT_POINT)
|
|
|
|
[11] *((const nomodify byte*) main::SCREEN+(byte) 4) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y+(byte) 1*(const byte) SIZEOF_STRUCT_POINT)
|
2019-06-10 19:24:33 +00:00
|
|
|
to:main::@return
|
|
|
|
main::@return: scope:[main] from main
|
|
|
|
[12] return
|
|
|
|
to:@return
|
|
|
|
|
|
|
|
|
|
|
|
VARIABLE REGISTER WEIGHTS
|
2019-11-03 19:11:06 +00:00
|
|
|
(byte) Point::x
|
|
|
|
(byte) Point::y
|
2019-06-10 19:24:33 +00:00
|
|
|
(void()) main()
|
|
|
|
|
|
|
|
Initial phi equivalence classes
|
|
|
|
Complete equivalence classes
|
|
|
|
|
|
|
|
INITIAL ASM
|
2019-09-08 00:29:17 +00:00
|
|
|
Target platform is c64basic / MOS6502X
|
2019-07-08 14:43:09 +00:00
|
|
|
// File Comments
|
2019-06-10 19:24:33 +00:00
|
|
|
// Minimal struct - direct (constant) array access
|
2019-07-25 15:06:17 +00:00
|
|
|
// Upstart
|
2019-06-10 19:24:33 +00:00
|
|
|
.pc = $801 "Basic"
|
2020-05-11 00:36:37 +00:00
|
|
|
:BasicUpstart(main)
|
2019-06-10 19:24:33 +00:00
|
|
|
.pc = $80d "Program"
|
2019-07-08 14:43:09 +00:00
|
|
|
// Global Constants & labels
|
2019-06-10 19:24:33 +00:00
|
|
|
.const SIZEOF_STRUCT_POINT = 2
|
|
|
|
.const OFFSET_STRUCT_POINT_Y = 1
|
2019-07-08 14:43:09 +00:00
|
|
|
// @begin
|
2019-09-29 21:13:37 +00:00
|
|
|
__bbegin:
|
2019-07-08 14:43:09 +00:00
|
|
|
// [1] phi from @begin to @1 [phi:@begin->@1]
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1_from___bbegin:
|
|
|
|
jmp __b1
|
2019-07-08 14:43:09 +00:00
|
|
|
// @1
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1:
|
2019-07-08 14:43:09 +00:00
|
|
|
// [2] call main
|
2019-06-10 19:24:33 +00:00
|
|
|
jsr main
|
2019-07-08 14:43:09 +00:00
|
|
|
// [3] phi from @1 to @end [phi:@1->@end]
|
2019-09-29 21:13:37 +00:00
|
|
|
__bend_from___b1:
|
|
|
|
jmp __bend
|
2019-07-08 14:43:09 +00:00
|
|
|
// @end
|
2019-09-29 21:13:37 +00:00
|
|
|
__bend:
|
2019-07-08 14:43:09 +00:00
|
|
|
// main
|
2019-06-10 19:24:33 +00:00
|
|
|
main: {
|
|
|
|
.label SCREEN = $400
|
2019-11-18 21:02:29 +00:00
|
|
|
// [4] *((byte*)(const struct Point*) points) ← (byte) 2 -- _deref_pbuc1=vbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda #2
|
|
|
|
sta points
|
2019-11-18 21:02:29 +00:00
|
|
|
// [5] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte) 3 -- _deref_pbuc1=vbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda #3
|
|
|
|
sta points+OFFSET_STRUCT_POINT_Y
|
2019-11-18 21:02:29 +00:00
|
|
|
// [6] *((byte*)(const struct Point*) points+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) ← (byte) 5 -- _deref_pbuc1=vbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda #5
|
|
|
|
sta points+1*SIZEOF_STRUCT_POINT
|
2019-11-18 21:02:29 +00:00
|
|
|
// [7] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) ← (byte) 6 -- _deref_pbuc1=vbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda #6
|
|
|
|
sta points+OFFSET_STRUCT_POINT_Y+1*SIZEOF_STRUCT_POINT
|
2020-03-29 19:00:25 +00:00
|
|
|
// [8] *((const nomodify byte*) main::SCREEN) ← *((byte*)(const struct Point*) points) -- _deref_pbuc1=_deref_pbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda points
|
|
|
|
sta SCREEN
|
2020-03-29 19:00:25 +00:00
|
|
|
// [9] *((const nomodify byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) -- _deref_pbuc1=_deref_pbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda points+OFFSET_STRUCT_POINT_Y
|
|
|
|
sta SCREEN+1
|
2020-03-29 19:00:25 +00:00
|
|
|
// [10] *((const nomodify byte*) main::SCREEN+(byte) 3) ← *((byte*)(const struct Point*) points+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) -- _deref_pbuc1=_deref_pbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda points+1*SIZEOF_STRUCT_POINT
|
|
|
|
sta SCREEN+3
|
2020-03-29 19:00:25 +00:00
|
|
|
// [11] *((const nomodify byte*) main::SCREEN+(byte) 4) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) -- _deref_pbuc1=_deref_pbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda points+OFFSET_STRUCT_POINT_Y+1*SIZEOF_STRUCT_POINT
|
|
|
|
sta SCREEN+4
|
2019-09-29 21:13:37 +00:00
|
|
|
jmp __breturn
|
2019-07-08 14:43:09 +00:00
|
|
|
// main::@return
|
2019-09-29 21:13:37 +00:00
|
|
|
__breturn:
|
2019-07-08 14:43:09 +00:00
|
|
|
// [12] return
|
2019-06-10 19:24:33 +00:00
|
|
|
rts
|
|
|
|
}
|
2019-07-08 14:43:09 +00:00
|
|
|
// File Data
|
2019-06-10 19:24:33 +00:00
|
|
|
points: .fill 2*2, 0
|
|
|
|
|
|
|
|
REGISTER UPLIFT POTENTIAL REGISTERS
|
2020-03-22 23:10:07 +00:00
|
|
|
Statement [4] *((byte*)(const struct Point*) points) ← (byte) 2 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
|
|
|
|
Statement [5] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
|
|
|
|
Statement [6] *((byte*)(const struct Point*) points+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) ← (byte) 5 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
|
|
|
|
Statement [7] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) ← (byte) 6 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
|
2020-03-29 19:00:25 +00:00
|
|
|
Statement [8] *((const nomodify byte*) main::SCREEN) ← *((byte*)(const struct Point*) points) [ ] ( main:2 [ ] { } ) always clobbers reg byte a
|
|
|
|
Statement [9] *((const nomodify byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) [ ] ( main:2 [ ] { } ) always clobbers reg byte a
|
|
|
|
Statement [10] *((const nomodify byte*) main::SCREEN+(byte) 3) ← *((byte*)(const struct Point*) points+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) [ ] ( main:2 [ ] { } ) always clobbers reg byte a
|
|
|
|
Statement [11] *((const nomodify byte*) main::SCREEN+(byte) 4) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) [ ] ( main:2 [ ] { } ) always clobbers reg byte a
|
2019-06-10 19:24:33 +00:00
|
|
|
|
|
|
|
REGISTER UPLIFT SCOPES
|
|
|
|
Uplift Scope [Point]
|
|
|
|
Uplift Scope [main]
|
|
|
|
Uplift Scope []
|
|
|
|
|
|
|
|
Uplifting [Point] best 77 combination
|
|
|
|
Uplifting [main] best 77 combination
|
|
|
|
Uplifting [] best 77 combination
|
|
|
|
|
|
|
|
ASSEMBLER BEFORE OPTIMIZATION
|
2019-07-08 14:43:09 +00:00
|
|
|
// File Comments
|
2019-06-10 19:24:33 +00:00
|
|
|
// Minimal struct - direct (constant) array access
|
2019-07-25 15:06:17 +00:00
|
|
|
// Upstart
|
2019-06-10 19:24:33 +00:00
|
|
|
.pc = $801 "Basic"
|
2020-05-11 00:36:37 +00:00
|
|
|
:BasicUpstart(main)
|
2019-06-10 19:24:33 +00:00
|
|
|
.pc = $80d "Program"
|
2019-07-08 14:43:09 +00:00
|
|
|
// Global Constants & labels
|
2019-06-10 19:24:33 +00:00
|
|
|
.const SIZEOF_STRUCT_POINT = 2
|
|
|
|
.const OFFSET_STRUCT_POINT_Y = 1
|
2019-07-08 14:43:09 +00:00
|
|
|
// @begin
|
2019-09-29 21:13:37 +00:00
|
|
|
__bbegin:
|
2019-07-08 14:43:09 +00:00
|
|
|
// [1] phi from @begin to @1 [phi:@begin->@1]
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1_from___bbegin:
|
|
|
|
jmp __b1
|
2019-07-08 14:43:09 +00:00
|
|
|
// @1
|
2019-09-29 21:13:37 +00:00
|
|
|
__b1:
|
2019-07-08 14:43:09 +00:00
|
|
|
// [2] call main
|
2019-06-10 19:24:33 +00:00
|
|
|
jsr main
|
2019-07-08 14:43:09 +00:00
|
|
|
// [3] phi from @1 to @end [phi:@1->@end]
|
2019-09-29 21:13:37 +00:00
|
|
|
__bend_from___b1:
|
|
|
|
jmp __bend
|
2019-07-08 14:43:09 +00:00
|
|
|
// @end
|
2019-09-29 21:13:37 +00:00
|
|
|
__bend:
|
2019-07-08 14:43:09 +00:00
|
|
|
// main
|
2019-06-10 19:24:33 +00:00
|
|
|
main: {
|
|
|
|
.label SCREEN = $400
|
2019-11-18 21:02:29 +00:00
|
|
|
// [4] *((byte*)(const struct Point*) points) ← (byte) 2 -- _deref_pbuc1=vbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda #2
|
|
|
|
sta points
|
2019-11-18 21:02:29 +00:00
|
|
|
// [5] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte) 3 -- _deref_pbuc1=vbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda #3
|
|
|
|
sta points+OFFSET_STRUCT_POINT_Y
|
2019-11-18 21:02:29 +00:00
|
|
|
// [6] *((byte*)(const struct Point*) points+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) ← (byte) 5 -- _deref_pbuc1=vbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda #5
|
|
|
|
sta points+1*SIZEOF_STRUCT_POINT
|
2019-11-18 21:02:29 +00:00
|
|
|
// [7] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) ← (byte) 6 -- _deref_pbuc1=vbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda #6
|
|
|
|
sta points+OFFSET_STRUCT_POINT_Y+1*SIZEOF_STRUCT_POINT
|
2020-03-29 19:00:25 +00:00
|
|
|
// [8] *((const nomodify byte*) main::SCREEN) ← *((byte*)(const struct Point*) points) -- _deref_pbuc1=_deref_pbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda points
|
|
|
|
sta SCREEN
|
2020-03-29 19:00:25 +00:00
|
|
|
// [9] *((const nomodify byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) -- _deref_pbuc1=_deref_pbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda points+OFFSET_STRUCT_POINT_Y
|
|
|
|
sta SCREEN+1
|
2020-03-29 19:00:25 +00:00
|
|
|
// [10] *((const nomodify byte*) main::SCREEN+(byte) 3) ← *((byte*)(const struct Point*) points+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) -- _deref_pbuc1=_deref_pbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda points+1*SIZEOF_STRUCT_POINT
|
|
|
|
sta SCREEN+3
|
2020-03-29 19:00:25 +00:00
|
|
|
// [11] *((const nomodify byte*) main::SCREEN+(byte) 4) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) -- _deref_pbuc1=_deref_pbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda points+OFFSET_STRUCT_POINT_Y+1*SIZEOF_STRUCT_POINT
|
|
|
|
sta SCREEN+4
|
2019-09-29 21:13:37 +00:00
|
|
|
jmp __breturn
|
2019-07-08 14:43:09 +00:00
|
|
|
// main::@return
|
2019-09-29 21:13:37 +00:00
|
|
|
__breturn:
|
2019-07-08 14:43:09 +00:00
|
|
|
// [12] return
|
2019-06-10 19:24:33 +00:00
|
|
|
rts
|
|
|
|
}
|
2019-07-08 14:43:09 +00:00
|
|
|
// File Data
|
2019-06-10 19:24:33 +00:00
|
|
|
points: .fill 2*2, 0
|
|
|
|
|
|
|
|
ASSEMBLER OPTIMIZATIONS
|
2019-09-29 21:13:37 +00:00
|
|
|
Removing instruction jmp __b1
|
|
|
|
Removing instruction jmp __bend
|
|
|
|
Removing instruction jmp __breturn
|
2019-06-10 19:24:33 +00:00
|
|
|
Succesful ASM optimization Pass5NextJumpElimination
|
2019-09-29 21:13:37 +00:00
|
|
|
Removing instruction __b1_from___bbegin:
|
2020-03-03 07:58:31 +00:00
|
|
|
Removing instruction __b1:
|
2019-09-29 21:13:37 +00:00
|
|
|
Removing instruction __bend_from___b1:
|
2019-06-10 19:24:33 +00:00
|
|
|
Succesful ASM optimization Pass5RedundantLabelElimination
|
2020-05-11 00:36:37 +00:00
|
|
|
Removing instruction __bbegin:
|
2019-09-29 21:13:37 +00:00
|
|
|
Removing instruction __bend:
|
|
|
|
Removing instruction __breturn:
|
2019-06-10 19:24:33 +00:00
|
|
|
Succesful ASM optimization Pass5UnusedLabelElimination
|
|
|
|
Removing instruction jsr main
|
|
|
|
Succesful ASM optimization Pass5SkipBegin
|
|
|
|
|
|
|
|
FINAL SYMBOL TABLE
|
|
|
|
(label) @1
|
|
|
|
(label) @begin
|
|
|
|
(label) @end
|
2019-10-13 22:51:15 +00:00
|
|
|
(const byte) OFFSET_STRUCT_POINT_Y = (byte) 1
|
2019-11-03 19:11:06 +00:00
|
|
|
(byte) Point::x
|
|
|
|
(byte) Point::y
|
2019-10-13 22:51:15 +00:00
|
|
|
(const byte) SIZEOF_STRUCT_POINT = (byte) 2
|
2019-06-10 19:24:33 +00:00
|
|
|
(void()) main()
|
|
|
|
(label) main::@return
|
2020-03-29 19:00:25 +00:00
|
|
|
(const nomodify byte*) main::SCREEN = (byte*) 1024
|
2019-12-21 09:38:44 +00:00
|
|
|
(const struct Point*) points[(number) 2] = { fill( 2, 0) }
|
2019-06-10 19:24:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FINAL ASSEMBLER
|
|
|
|
Score: 62
|
|
|
|
|
2019-07-08 14:43:09 +00:00
|
|
|
// File Comments
|
2019-06-10 19:24:33 +00:00
|
|
|
// Minimal struct - direct (constant) array access
|
2019-07-25 15:06:17 +00:00
|
|
|
// Upstart
|
2019-06-10 19:24:33 +00:00
|
|
|
.pc = $801 "Basic"
|
|
|
|
:BasicUpstart(main)
|
|
|
|
.pc = $80d "Program"
|
2019-07-08 14:43:09 +00:00
|
|
|
// Global Constants & labels
|
2019-06-10 19:24:33 +00:00
|
|
|
.const SIZEOF_STRUCT_POINT = 2
|
|
|
|
.const OFFSET_STRUCT_POINT_Y = 1
|
2019-07-08 14:43:09 +00:00
|
|
|
// @begin
|
|
|
|
// [1] phi from @begin to @1 [phi:@begin->@1]
|
|
|
|
// @1
|
|
|
|
// [2] call main
|
|
|
|
// [3] phi from @1 to @end [phi:@1->@end]
|
|
|
|
// @end
|
|
|
|
// main
|
2019-06-10 19:24:33 +00:00
|
|
|
main: {
|
|
|
|
.label SCREEN = $400
|
2019-07-08 14:43:09 +00:00
|
|
|
// points[0].x = 2
|
2019-11-18 21:02:29 +00:00
|
|
|
// [4] *((byte*)(const struct Point*) points) ← (byte) 2 -- _deref_pbuc1=vbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda #2
|
|
|
|
sta points
|
2019-07-08 14:43:09 +00:00
|
|
|
// points[0].y = 3
|
2019-11-18 21:02:29 +00:00
|
|
|
// [5] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) ← (byte) 3 -- _deref_pbuc1=vbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda #3
|
|
|
|
sta points+OFFSET_STRUCT_POINT_Y
|
2019-07-08 14:43:09 +00:00
|
|
|
// points[1].x = 5
|
2019-11-18 21:02:29 +00:00
|
|
|
// [6] *((byte*)(const struct Point*) points+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) ← (byte) 5 -- _deref_pbuc1=vbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda #5
|
|
|
|
sta points+1*SIZEOF_STRUCT_POINT
|
2019-07-08 14:43:09 +00:00
|
|
|
// points[1].y = 6
|
2019-11-18 21:02:29 +00:00
|
|
|
// [7] *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) ← (byte) 6 -- _deref_pbuc1=vbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda #6
|
|
|
|
sta points+OFFSET_STRUCT_POINT_Y+1*SIZEOF_STRUCT_POINT
|
2019-07-08 14:43:09 +00:00
|
|
|
// SCREEN[0] = points[0].x
|
2020-03-29 19:00:25 +00:00
|
|
|
// [8] *((const nomodify byte*) main::SCREEN) ← *((byte*)(const struct Point*) points) -- _deref_pbuc1=_deref_pbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda points
|
|
|
|
sta SCREEN
|
2019-07-08 14:43:09 +00:00
|
|
|
// SCREEN[1] = points[0].y
|
2020-03-29 19:00:25 +00:00
|
|
|
// [9] *((const nomodify byte*) main::SCREEN+(byte) 1) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y) -- _deref_pbuc1=_deref_pbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda points+OFFSET_STRUCT_POINT_Y
|
|
|
|
sta SCREEN+1
|
2019-07-08 14:43:09 +00:00
|
|
|
// SCREEN[3] = points[1].x
|
2020-03-29 19:00:25 +00:00
|
|
|
// [10] *((const nomodify byte*) main::SCREEN+(byte) 3) ← *((byte*)(const struct Point*) points+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) -- _deref_pbuc1=_deref_pbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda points+1*SIZEOF_STRUCT_POINT
|
|
|
|
sta SCREEN+3
|
2019-07-08 14:43:09 +00:00
|
|
|
// SCREEN[4] = points[1].y
|
2020-03-29 19:00:25 +00:00
|
|
|
// [11] *((const nomodify byte*) main::SCREEN+(byte) 4) ← *((byte*)(const struct Point*) points+(const byte) OFFSET_STRUCT_POINT_Y+(byte) 1*(const byte) SIZEOF_STRUCT_POINT) -- _deref_pbuc1=_deref_pbuc2
|
2019-06-10 19:24:33 +00:00
|
|
|
lda points+OFFSET_STRUCT_POINT_Y+1*SIZEOF_STRUCT_POINT
|
|
|
|
sta SCREEN+4
|
2019-07-08 14:43:09 +00:00
|
|
|
// main::@return
|
|
|
|
// }
|
|
|
|
// [12] return
|
2019-06-10 19:24:33 +00:00
|
|
|
rts
|
|
|
|
}
|
2019-07-08 14:43:09 +00:00
|
|
|
// File Data
|
2019-06-10 19:24:33 +00:00
|
|
|
points: .fill 2*2, 0
|
|
|
|
|