1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-27 19:50:10 +00:00

Fixed test

This commit is contained in:
jespergravgaard 2018-10-17 23:23:54 +02:00
parent fabc107cd1
commit 8adbdd59e4

View File

@ -122,139 +122,9 @@ SYMBOL TABLE SSA
Culled Empty Block (label) @2
Successful SSA optimization Pass2CullEmptyBlocks
CONTROL FLOW GRAPH
@begin: scope:[] from
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
to:@1
main: scope:[main] from @1
(byte*) SCREEN#7 ← phi( @1/(byte*) SCREEN#8 )
(byte) main::min#0 ← (byte/word/signed word/dword/signed dword) 255
(byte) main::max#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::pos#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::@1
main::@1: scope:[main] from main main::@5
(byte*) SCREEN#6 ← phi( main/(byte*) SCREEN#7 main::@5/(byte*) SCREEN#1 )
(byte) main::max#6 ← phi( main/(byte) main::max#0 main::@5/(byte) main::max#3 )
(byte) main::min#4 ← phi( main/(byte) main::min#0 main::@5/(byte) main::min#3 )
(byte) main::pos#7 ← phi( main/(byte) main::pos#0 main::@5/(byte) main::pos#5 )
if(true) goto main::@2
to:main::@return
main::@2: scope:[main] from main::@1
(byte*) SCREEN#4 ← phi( main::@1/(byte*) SCREEN#6 )
(byte) main::max#4 ← phi( main::@1/(byte) main::max#6 )
(byte) main::min#2 ← phi( main::@1/(byte) main::min#4 )
(byte) main::pos#2 ← phi( main::@1/(byte) main::pos#7 )
(byte) main::pos#1 ← ++ (byte) main::pos#2
(bool~) main::$0 ← (byte) main::pos#1 < (byte) main::min#2
(bool~) main::$1 ← ! (bool~) main::$0
if((bool~) main::$1) goto main::@4
to:main::@8
main::@4: scope:[main] from main::@2 main::@8
(byte*) SCREEN#2 ← phi( main::@2/(byte*) SCREEN#4 main::@8/(byte*) SCREEN#5 )
(byte) main::min#5 ← phi( main::@2/(byte) main::min#2 main::@8/(byte) main::min#1 )
(byte) main::max#2 ← phi( main::@2/(byte) main::max#4 main::@8/(byte) main::max#5 )
(byte) main::pos#3 ← phi( main::@2/(byte) main::pos#1 main::@8/(byte) main::pos#4 )
(bool~) main::$2 ← (byte) main::pos#3 > (byte) main::max#2
(bool~) main::$3 ← ! (bool~) main::$2
if((bool~) main::$3) goto main::@5
to:main::@9
main::@8: scope:[main] from main::@2
(byte*) SCREEN#5 ← phi( main::@2/(byte*) SCREEN#4 )
(byte) main::max#5 ← phi( main::@2/(byte) main::max#4 )
(byte) main::pos#4 ← phi( main::@2/(byte) main::pos#1 )
(byte) main::min#1 ← (byte) main::pos#4
to:main::@4
main::@5: scope:[main] from main::@4 main::@9
(byte) main::pos#5 ← phi( main::@4/(byte) main::pos#3 main::@9/(byte) main::pos#6 )
(byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::max#1 )
(byte*) SCREEN#1 ← phi( main::@4/(byte*) SCREEN#2 main::@9/(byte*) SCREEN#3 )
(byte) main::min#3 ← phi( main::@4/(byte) main::min#5 main::@9/(byte) main::min#6 )
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#5
to:main::@1
main::@9: scope:[main] from main::@4
(byte*) SCREEN#3 ← phi( main::@4/(byte*) SCREEN#2 )
(byte) main::min#6 ← phi( main::@4/(byte) main::min#5 )
(byte) main::pos#6 ← phi( main::@4/(byte) main::pos#3 )
(byte) main::max#1 ← (byte) main::pos#6
to:main::@5
main::@return: scope:[main] from main::@1
return
to:@return
@1: scope:[] from @begin
(byte*) SCREEN#8 ← phi( @begin/(byte*) SCREEN#0 )
call main
to:@end
@end: scope:[] from @1
Inversing boolean not (bool~) main::$1 ← (byte) main::pos#1 >= (byte) main::min#2 from (bool~) main::$0 ← (byte) main::pos#1 < (byte) main::min#2
Inversing boolean not (bool~) main::$3 ← (byte) main::pos#3 <= (byte) main::max#2 from (bool~) main::$2 ← (byte) main::pos#3 > (byte) main::max#2
Successful SSA optimization Pass2UnaryNotSimplification
CONTROL FLOW GRAPH
@begin: scope:[] from
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
to:@1
main: scope:[main] from @1
(byte*) SCREEN#7 ← phi( @1/(byte*) SCREEN#8 )
(byte) main::min#0 ← (byte/word/signed word/dword/signed dword) 255
(byte) main::max#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::pos#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::@1
main::@1: scope:[main] from main main::@5
(byte*) SCREEN#6 ← phi( main/(byte*) SCREEN#7 main::@5/(byte*) SCREEN#1 )
(byte) main::max#6 ← phi( main/(byte) main::max#0 main::@5/(byte) main::max#3 )
(byte) main::min#4 ← phi( main/(byte) main::min#0 main::@5/(byte) main::min#3 )
(byte) main::pos#7 ← phi( main/(byte) main::pos#0 main::@5/(byte) main::pos#5 )
if(true) goto main::@2
to:main::@return
main::@2: scope:[main] from main::@1
(byte*) SCREEN#4 ← phi( main::@1/(byte*) SCREEN#6 )
(byte) main::max#4 ← phi( main::@1/(byte) main::max#6 )
(byte) main::min#2 ← phi( main::@1/(byte) main::min#4 )
(byte) main::pos#2 ← phi( main::@1/(byte) main::pos#7 )
(byte) main::pos#1 ← ++ (byte) main::pos#2
(bool~) main::$1 ← (byte) main::pos#1 >= (byte) main::min#2
if((bool~) main::$1) goto main::@4
to:main::@8
main::@4: scope:[main] from main::@2 main::@8
(byte*) SCREEN#2 ← phi( main::@2/(byte*) SCREEN#4 main::@8/(byte*) SCREEN#5 )
(byte) main::min#5 ← phi( main::@2/(byte) main::min#2 main::@8/(byte) main::min#1 )
(byte) main::max#2 ← phi( main::@2/(byte) main::max#4 main::@8/(byte) main::max#5 )
(byte) main::pos#3 ← phi( main::@2/(byte) main::pos#1 main::@8/(byte) main::pos#4 )
(bool~) main::$3 ← (byte) main::pos#3 <= (byte) main::max#2
if((bool~) main::$3) goto main::@5
to:main::@9
main::@8: scope:[main] from main::@2
(byte*) SCREEN#5 ← phi( main::@2/(byte*) SCREEN#4 )
(byte) main::max#5 ← phi( main::@2/(byte) main::max#4 )
(byte) main::pos#4 ← phi( main::@2/(byte) main::pos#1 )
(byte) main::min#1 ← (byte) main::pos#4
to:main::@4
main::@5: scope:[main] from main::@4 main::@9
(byte) main::pos#5 ← phi( main::@4/(byte) main::pos#3 main::@9/(byte) main::pos#6 )
(byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::max#1 )
(byte*) SCREEN#1 ← phi( main::@4/(byte*) SCREEN#2 main::@9/(byte*) SCREEN#3 )
(byte) main::min#3 ← phi( main::@4/(byte) main::min#5 main::@9/(byte) main::min#6 )
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#5
to:main::@1
main::@9: scope:[main] from main::@4
(byte*) SCREEN#3 ← phi( main::@4/(byte*) SCREEN#2 )
(byte) main::min#6 ← phi( main::@4/(byte) main::min#5 )
(byte) main::pos#6 ← phi( main::@4/(byte) main::pos#3 )
(byte) main::max#1 ← (byte) main::pos#6
to:main::@5
main::@return: scope:[main] from main::@1
return
to:@return
@1: scope:[] from @begin
(byte*) SCREEN#8 ← phi( @begin/(byte*) SCREEN#0 )
call main
to:@end
@end: scope:[] from @1
Alias (byte) main::pos#2 = (byte) main::pos#7
Alias (byte) main::min#2 = (byte) main::min#4
Alias (byte) main::max#4 = (byte) main::max#6 (byte) main::max#5
@ -265,406 +135,36 @@ Alias (byte) main::min#5 = (byte) main::min#6
Alias (byte*) SCREEN#2 = (byte*) SCREEN#3
Alias (byte*) SCREEN#0 = (byte*) SCREEN#8
Successful SSA optimization Pass2AliasElimination
CONTROL FLOW GRAPH
@begin: scope:[] from
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
to:@1
main: scope:[main] from @1
(byte*) SCREEN#7 ← phi( @1/(byte*) SCREEN#0 )
(byte) main::min#0 ← (byte/word/signed word/dword/signed dword) 255
(byte) main::max#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::pos#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::@1
main::@1: scope:[main] from main main::@5
(byte*) SCREEN#4 ← phi( main/(byte*) SCREEN#7 main::@5/(byte*) SCREEN#1 )
(byte) main::max#4 ← phi( main/(byte) main::max#0 main::@5/(byte) main::max#3 )
(byte) main::min#2 ← phi( main/(byte) main::min#0 main::@5/(byte) main::min#3 )
(byte) main::pos#2 ← phi( main/(byte) main::pos#0 main::@5/(byte) main::pos#5 )
if(true) goto main::@2
to:main::@return
main::@2: scope:[main] from main::@1
(byte) main::pos#1 ← ++ (byte) main::pos#2
(bool~) main::$1 ← (byte) main::pos#1 >= (byte) main::min#2
if((bool~) main::$1) goto main::@4
to:main::@8
main::@4: scope:[main] from main::@2 main::@8
(byte*) SCREEN#2 ← phi( main::@2/(byte*) SCREEN#4 main::@8/(byte*) SCREEN#4 )
(byte) main::min#5 ← phi( main::@2/(byte) main::min#2 main::@8/(byte) main::pos#1 )
(byte) main::max#2 ← phi( main::@2/(byte) main::max#4 main::@8/(byte) main::max#4 )
(byte) main::pos#3 ← phi( main::@2/(byte) main::pos#1 main::@8/(byte) main::pos#1 )
(bool~) main::$3 ← (byte) main::pos#3 <= (byte) main::max#2
if((bool~) main::$3) goto main::@5
to:main::@9
main::@8: scope:[main] from main::@2
to:main::@4
main::@5: scope:[main] from main::@4 main::@9
(byte) main::pos#5 ← phi( main::@4/(byte) main::pos#3 main::@9/(byte) main::pos#3 )
(byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::pos#3 )
(byte*) SCREEN#1 ← phi( main::@4/(byte*) SCREEN#2 main::@9/(byte*) SCREEN#2 )
(byte) main::min#3 ← phi( main::@4/(byte) main::min#5 main::@9/(byte) main::min#5 )
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#5
to:main::@1
main::@9: scope:[main] from main::@4
to:main::@5
main::@return: scope:[main] from main::@1
return
to:@return
@1: scope:[] from @begin
call main
to:@end
@end: scope:[] from @1
Alias candidate removed (byte) main::pos#1
Alias (byte) main::pos#3 = (byte) main::pos#5
Alias (byte) main::max#2 = (byte) main::max#4
Alias (byte*) SCREEN#1 = (byte*) SCREEN#2 (byte*) SCREEN#4
Alias (byte) main::min#3 = (byte) main::min#5
Successful SSA optimization Pass2AliasElimination
CONTROL FLOW GRAPH
@begin: scope:[] from
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
to:@1
main: scope:[main] from @1
(byte*) SCREEN#7 ← phi( @1/(byte*) SCREEN#0 )
(byte) main::min#0 ← (byte/word/signed word/dword/signed dword) 255
(byte) main::max#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::pos#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::@1
main::@1: scope:[main] from main main::@5
(byte*) SCREEN#1 ← phi( main/(byte*) SCREEN#7 main::@5/(byte*) SCREEN#1 )
(byte) main::max#2 ← phi( main/(byte) main::max#0 main::@5/(byte) main::max#3 )
(byte) main::min#2 ← phi( main/(byte) main::min#0 main::@5/(byte) main::min#3 )
(byte) main::pos#2 ← phi( main/(byte) main::pos#0 main::@5/(byte) main::pos#3 )
if(true) goto main::@2
to:main::@return
main::@2: scope:[main] from main::@1
(byte) main::pos#1 ← ++ (byte) main::pos#2
(bool~) main::$1 ← (byte) main::pos#1 >= (byte) main::min#2
if((bool~) main::$1) goto main::@4
to:main::@8
main::@4: scope:[main] from main::@2 main::@8
(byte) main::min#3 ← phi( main::@2/(byte) main::min#2 main::@8/(byte) main::pos#1 )
(byte) main::pos#3 ← phi( main::@2/(byte) main::pos#1 main::@8/(byte) main::pos#1 )
(bool~) main::$3 ← (byte) main::pos#3 <= (byte) main::max#2
if((bool~) main::$3) goto main::@5
to:main::@9
main::@8: scope:[main] from main::@2
to:main::@4
main::@5: scope:[main] from main::@4 main::@9
(byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::pos#3 )
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#3
to:main::@1
main::@9: scope:[main] from main::@4
to:main::@5
main::@return: scope:[main] from main::@1
return
to:@return
@1: scope:[] from @begin
call main
to:@end
@end: scope:[] from @1
Alias candidate removed (byte) main::pos#1
Alias candidate removed (byte) main::pos#3 =
Self Phi Eliminated (byte*) SCREEN#1
Successful SSA optimization Pass2SelfPhiElimination
CONTROL FLOW GRAPH
@begin: scope:[] from
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
to:@1
main: scope:[main] from @1
(byte*) SCREEN#7 ← phi( @1/(byte*) SCREEN#0 )
(byte) main::min#0 ← (byte/word/signed word/dword/signed dword) 255
(byte) main::max#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::pos#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::@1
main::@1: scope:[main] from main main::@5
(byte*) SCREEN#1 ← phi( main/(byte*) SCREEN#7 )
(byte) main::max#2 ← phi( main/(byte) main::max#0 main::@5/(byte) main::max#3 )
(byte) main::min#2 ← phi( main/(byte) main::min#0 main::@5/(byte) main::min#3 )
(byte) main::pos#2 ← phi( main/(byte) main::pos#0 main::@5/(byte) main::pos#3 )
if(true) goto main::@2
to:main::@return
main::@2: scope:[main] from main::@1
(byte) main::pos#1 ← ++ (byte) main::pos#2
(bool~) main::$1 ← (byte) main::pos#1 >= (byte) main::min#2
if((bool~) main::$1) goto main::@4
to:main::@8
main::@4: scope:[main] from main::@2 main::@8
(byte) main::min#3 ← phi( main::@2/(byte) main::min#2 main::@8/(byte) main::pos#1 )
(byte) main::pos#3 ← phi( main::@2/(byte) main::pos#1 main::@8/(byte) main::pos#1 )
(bool~) main::$3 ← (byte) main::pos#3 <= (byte) main::max#2
if((bool~) main::$3) goto main::@5
to:main::@9
main::@8: scope:[main] from main::@2
to:main::@4
main::@5: scope:[main] from main::@4 main::@9
(byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::pos#3 )
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3
*((byte*) SCREEN#1 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#3
to:main::@1
main::@9: scope:[main] from main::@4
to:main::@5
main::@return: scope:[main] from main::@1
return
to:@return
@1: scope:[] from @begin
call main
to:@end
@end: scope:[] from @1
Redundant Phi (byte*) SCREEN#7 (byte*) SCREEN#0
Redundant Phi (byte*) SCREEN#1 (byte*) SCREEN#7
Redundant Phi (byte) main::pos#3 (byte) main::pos#1
Successful SSA optimization Pass2RedundantPhiElimination
CONTROL FLOW GRAPH
@begin: scope:[] from
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
to:@1
main: scope:[main] from @1
(byte) main::min#0 ← (byte/word/signed word/dword/signed dword) 255
(byte) main::max#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::pos#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::@1
main::@1: scope:[main] from main main::@5
(byte) main::max#2 ← phi( main/(byte) main::max#0 main::@5/(byte) main::max#3 )
(byte) main::min#2 ← phi( main/(byte) main::min#0 main::@5/(byte) main::min#3 )
(byte) main::pos#2 ← phi( main/(byte) main::pos#0 main::@5/(byte) main::pos#1 )
if(true) goto main::@2
to:main::@return
main::@2: scope:[main] from main::@1
(byte) main::pos#1 ← ++ (byte) main::pos#2
(bool~) main::$1 ← (byte) main::pos#1 >= (byte) main::min#2
if((bool~) main::$1) goto main::@4
to:main::@8
main::@4: scope:[main] from main::@2 main::@8
(byte) main::min#3 ← phi( main::@2/(byte) main::min#2 main::@8/(byte) main::pos#1 )
(bool~) main::$3 ← (byte) main::pos#1 <= (byte) main::max#2
if((bool~) main::$3) goto main::@5
to:main::@9
main::@8: scope:[main] from main::@2
to:main::@4
main::@5: scope:[main] from main::@4 main::@9
(byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::pos#1 )
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#1
to:main::@1
main::@9: scope:[main] from main::@4
to:main::@5
main::@return: scope:[main] from main::@1
return
to:@return
@1: scope:[] from @begin
call main
to:@end
@end: scope:[] from @1
Simple Condition (bool~) main::$1 if((byte) main::pos#1>=(byte) main::min#2) goto main::@4
Simple Condition (bool~) main::$3 if((byte) main::pos#1<=(byte) main::max#2) goto main::@5
Successful SSA optimization Pass2ConditionalJumpSimplification
CONTROL FLOW GRAPH
@begin: scope:[] from
(byte*) SCREEN#0 ← ((byte*)) (word/signed word/dword/signed dword) 1024
to:@1
main: scope:[main] from @1
(byte) main::min#0 ← (byte/word/signed word/dword/signed dword) 255
(byte) main::max#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
(byte) main::pos#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0
to:main::@1
main::@1: scope:[main] from main main::@5
(byte) main::max#2 ← phi( main/(byte) main::max#0 main::@5/(byte) main::max#3 )
(byte) main::min#2 ← phi( main/(byte) main::min#0 main::@5/(byte) main::min#3 )
(byte) main::pos#2 ← phi( main/(byte) main::pos#0 main::@5/(byte) main::pos#1 )
if(true) goto main::@2
to:main::@return
main::@2: scope:[main] from main::@1
(byte) main::pos#1 ← ++ (byte) main::pos#2
if((byte) main::pos#1>=(byte) main::min#2) goto main::@4
to:main::@8
main::@4: scope:[main] from main::@2 main::@8
(byte) main::min#3 ← phi( main::@2/(byte) main::min#2 main::@8/(byte) main::pos#1 )
if((byte) main::pos#1<=(byte) main::max#2) goto main::@5
to:main::@9
main::@8: scope:[main] from main::@2
to:main::@4
main::@5: scope:[main] from main::@4 main::@9
(byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::pos#1 )
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3
*((byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#1
to:main::@1
main::@9: scope:[main] from main::@4
to:main::@5
main::@return: scope:[main] from main::@1
return
to:@return
@1: scope:[] from @begin
call main
to:@end
@end: scope:[] from @1
Constant (const byte*) SCREEN#0 = ((byte*))1024
Constant (const byte) main::min#0 = 255
Constant (const byte) main::max#0 = 0
Constant (const byte) main::pos#0 = 0
Successful SSA optimization Pass2ConstantIdentification
CONTROL FLOW GRAPH
@begin: scope:[] from
to:@1
main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@5
(byte) main::max#2 ← phi( main/(const byte) main::max#0 main::@5/(byte) main::max#3 )
(byte) main::min#2 ← phi( main/(const byte) main::min#0 main::@5/(byte) main::min#3 )
(byte) main::pos#2 ← phi( main/(const byte) main::pos#0 main::@5/(byte) main::pos#1 )
if(true) goto main::@2
to:main::@return
main::@2: scope:[main] from main::@1
(byte) main::pos#1 ← ++ (byte) main::pos#2
if((byte) main::pos#1>=(byte) main::min#2) goto main::@4
to:main::@8
main::@4: scope:[main] from main::@2 main::@8
(byte) main::min#3 ← phi( main::@2/(byte) main::min#2 main::@8/(byte) main::pos#1 )
if((byte) main::pos#1<=(byte) main::max#2) goto main::@5
to:main::@9
main::@8: scope:[main] from main::@2
to:main::@4
main::@5: scope:[main] from main::@4 main::@9
(byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::pos#1 )
*((const byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3
*((const byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3
*((const byte*) SCREEN#0 + (byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#1
to:main::@1
main::@9: scope:[main] from main::@4
to:main::@5
main::@return: scope:[main] from main::@1
return
to:@return
@1: scope:[] from @begin
call main
to:@end
@end: scope:[] from @1
Consolidated array index constant in *(SCREEN#0+0)
Consolidated array index constant in *(SCREEN#0+1)
Consolidated array index constant in *(SCREEN#0+2)
Successful SSA optimization Pass2ConstantAdditionElimination
CONTROL FLOW GRAPH
@begin: scope:[] from
to:@1
main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@5
(byte) main::max#2 ← phi( main/(const byte) main::max#0 main::@5/(byte) main::max#3 )
(byte) main::min#2 ← phi( main/(const byte) main::min#0 main::@5/(byte) main::min#3 )
(byte) main::pos#2 ← phi( main/(const byte) main::pos#0 main::@5/(byte) main::pos#1 )
if(true) goto main::@2
to:main::@return
main::@2: scope:[main] from main::@1
(byte) main::pos#1 ← ++ (byte) main::pos#2
if((byte) main::pos#1>=(byte) main::min#2) goto main::@4
to:main::@8
main::@4: scope:[main] from main::@2 main::@8
(byte) main::min#3 ← phi( main::@2/(byte) main::min#2 main::@8/(byte) main::pos#1 )
if((byte) main::pos#1<=(byte) main::max#2) goto main::@5
to:main::@9
main::@8: scope:[main] from main::@2
to:main::@4
main::@5: scope:[main] from main::@4 main::@9
(byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::pos#1 )
*((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3
*((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3
*((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#1
to:main::@1
main::@9: scope:[main] from main::@4
to:main::@5
main::@return: scope:[main] from main::@1
return
to:@return
@1: scope:[] from @begin
call main
to:@end
@end: scope:[] from @1
if() condition always true - replacing block destination if(true) goto main::@2
Successful SSA optimization Pass2ConstantIfs
CONTROL FLOW GRAPH
@begin: scope:[] from
to:@1
main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@5
(byte) main::max#2 ← phi( main/(const byte) main::max#0 main::@5/(byte) main::max#3 )
(byte) main::min#2 ← phi( main/(const byte) main::min#0 main::@5/(byte) main::min#3 )
(byte) main::pos#2 ← phi( main/(const byte) main::pos#0 main::@5/(byte) main::pos#1 )
to:main::@2
main::@2: scope:[main] from main::@1
(byte) main::pos#1 ← ++ (byte) main::pos#2
if((byte) main::pos#1>=(byte) main::min#2) goto main::@4
to:main::@8
main::@4: scope:[main] from main::@2 main::@8
(byte) main::min#3 ← phi( main::@2/(byte) main::min#2 main::@8/(byte) main::pos#1 )
if((byte) main::pos#1<=(byte) main::max#2) goto main::@5
to:main::@9
main::@8: scope:[main] from main::@2
to:main::@4
main::@5: scope:[main] from main::@4 main::@9
(byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::pos#1 )
*((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3
*((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3
*((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#1
to:main::@1
main::@9: scope:[main] from main::@4
to:main::@5
main::@return: scope:[main] from
return
to:@return
@1: scope:[] from @begin
call main
to:@end
@end: scope:[] from @1
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
CONTROL FLOW GRAPH
@begin: scope:[] from
to:@1
main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@5
(byte) main::max#2 ← phi( main/(const byte) main::max#0 main::@5/(byte) main::max#3 )
(byte) main::min#2 ← phi( main/(const byte) main::min#0 main::@5/(byte) main::min#3 )
(byte) main::pos#2 ← phi( main/(const byte) main::pos#0 main::@5/(byte) main::pos#1 )
to:main::@2
main::@2: scope:[main] from main::@1
(byte) main::pos#1 ← ++ (byte) main::pos#2
if((byte) main::pos#1>=(byte) main::min#2) goto main::@4
to:main::@8
main::@4: scope:[main] from main::@2 main::@8
(byte) main::min#3 ← phi( main::@2/(byte) main::min#2 main::@8/(byte) main::pos#1 )
if((byte) main::pos#1<=(byte) main::max#2) goto main::@5
to:main::@9
main::@8: scope:[main] from main::@2
to:main::@4
main::@5: scope:[main] from main::@4 main::@9
(byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::pos#1 )
*((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3
*((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3
*((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#1
to:main::@1
main::@9: scope:[main] from main::@4
to:main::@5
@1: scope:[] from @begin
call main
to:@end
@end: scope:[] from @1
Inlining constant with var siblings (const byte) main::min#0
Inlining constant with var siblings (const byte) main::max#0
Inlining constant with var siblings (const byte) main::pos#0
@ -672,39 +172,6 @@ Constant inlined main::min#0 = (byte/word/signed word/dword/signed dword) 255
Constant inlined main::max#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Constant inlined main::pos#0 = (byte/signed byte/word/signed word/dword/signed dword) 0
Successful SSA optimization Pass2ConstantInlining
CONTROL FLOW GRAPH
@begin: scope:[] from
to:@1
main: scope:[main] from @1
to:main::@1
main::@1: scope:[main] from main main::@5
[0] (byte) main::max#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@5/(byte) main::max#3 )
[0] (byte) main::min#2 ← phi( main/(byte/word/signed word/dword/signed dword) 255 main::@5/(byte) main::min#3 )
[0] (byte) main::pos#2 ← phi( main/(byte/signed byte/word/signed word/dword/signed dword) 0 main::@5/(byte) main::pos#1 )
to:main::@2
main::@2: scope:[main] from main::@1
[1] (byte) main::pos#1 ← ++ (byte) main::pos#2
[2] if((byte) main::pos#1>=(byte) main::min#2) goto main::@4
to:main::@8
main::@4: scope:[main] from main::@2 main::@8
[3] (byte) main::min#3 ← phi( main::@2/(byte) main::min#2 main::@8/(byte) main::pos#1 )
[4] if((byte) main::pos#1<=(byte) main::max#2) goto main::@5
to:main::@9
main::@8: scope:[main] from main::@2
to:main::@4
main::@5: scope:[main] from main::@4 main::@9
[5] (byte) main::max#3 ← phi( main::@4/(byte) main::max#2 main::@9/(byte) main::pos#1 )
[6] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 0) ← (byte) main::min#3
[7] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 1) ← (byte) main::max#3
[8] *((const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) 2) ← (byte) main::pos#1
to:main::@1
main::@9: scope:[main] from main::@4
to:main::@5
@1: scope:[] from @begin
[9] call main
to:@end
@end: scope:[] from @1
Simplifying constant plus zero SCREEN#0+0
Added new block during phi lifting main::@11(between main::@2 and main::@4)
Added new block during phi lifting main::@12(between main::@4 and main::@5)