mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-09-08 17:54:40 +00:00
Fixed tests
This commit is contained in:
parent
bebf020364
commit
d7e0a638f2
@ -101,13 +101,13 @@ public class Compiler {
|
||||
Pass3BlockSequencePlanner pass3BlockSequencePlanner = new Pass3BlockSequencePlanner(program, log);
|
||||
pass3BlockSequencePlanner.plan();
|
||||
|
||||
Pass3PhiLifting pass3PhiLifting = new Pass3PhiLifting(program, log);
|
||||
pass3PhiLifting.perform();
|
||||
pass3BlockSequencePlanner.plan();
|
||||
//Pass3PhiLifting pass3PhiLifting = new Pass3PhiLifting(program, log);
|
||||
//pass3PhiLifting.perform();
|
||||
//pass3BlockSequencePlanner.plan();
|
||||
|
||||
log.append("CONTROL FLOW GRAPH - PHI LIFTED");
|
||||
log.append(program.getGraph().toString(program.getScope()));
|
||||
pass2AssertSSA(program, log);
|
||||
//log.append("CONTROL FLOW GRAPH - PHI LIFTED");
|
||||
//log.append(program.getGraph().toString(program.getScope()));
|
||||
//pass2AssertSSA(program, log);
|
||||
|
||||
Pass3IdentifyAliveRanges pass3IdentifyAliveRanges = new Pass3IdentifyAliveRanges(program, log);
|
||||
pass3IdentifyAliveRanges.findLiveRanges();
|
||||
|
@ -844,33 +844,6 @@ Multiple usages for variable. Not optimizing sub-constant (byte*) cursor#1
|
||||
Multiple usages for variable. Not optimizing sub-constant (byte) y#2
|
||||
Multiple usages for variable. Not optimizing sub-constant (byte*) cursor#1
|
||||
Block Sequence Planned @BEGIN @1 @3 @END @2
|
||||
CONTROL FLOW GRAPH - PHI LIFTED
|
||||
@BEGIN: from
|
||||
to:@1
|
||||
@1: from @3 @BEGIN
|
||||
(byte) y#2 ← phi( @3/(byte) y#4 @BEGIN/(byte) 0 )
|
||||
(byte) e#3 ← phi( @3/(byte) e#5 @BEGIN/(byte) 12 )
|
||||
(byte) x#2 ← phi( @3/(byte) x#1 @BEGIN/(byte) 0 )
|
||||
(byte*) cursor#3 ← phi( @3/(byte*) cursor#5 @BEGIN/(word) 1024 )
|
||||
*((byte*) cursor#3) ← (byte) 81
|
||||
(byte) x#1 ← (byte) x#2 + (byte) 1
|
||||
(byte*) cursor#1 ← (byte*) cursor#3 + (byte) 1
|
||||
(byte) e#1 ← (byte) e#3 + (byte) 24
|
||||
if((byte) 39<(byte) e#1) goto @2
|
||||
to:@3
|
||||
@3: from @1 @2
|
||||
(byte) y#4 ← phi( @1/(byte) y#2 @2/(byte) y#1 )
|
||||
(byte) e#5 ← phi( @1/(byte) e#1 @2/(byte) e#2 )
|
||||
(byte*) cursor#5 ← phi( @1/(byte*) cursor#1 @2/(byte*) cursor#2 )
|
||||
if((byte) x#1<(byte) 40) goto @1
|
||||
to:@END
|
||||
@END: from @3
|
||||
@2: from @1
|
||||
(byte) y#1 ← (byte) y#2 + (byte) 1
|
||||
(byte*) cursor#2 ← (byte*) cursor#1 + (byte) 40
|
||||
(byte) e#2 ← (byte) e#1 - (byte) 39
|
||||
to:@3
|
||||
|
||||
Propagating live ranges...
|
||||
Propagating live ranges...
|
||||
Propagating live ranges...
|
||||
@ -904,38 +877,6 @@ CONTROL FLOW GRAPH - LIVE RANGES
|
||||
[10] (byte) e#2 ← (byte) e#1 - (byte) 39 [ x#1 cursor#2 e#2 y#1 ]
|
||||
to:@3
|
||||
|
||||
SYMBOLS - LIVE RANGES
|
||||
(label) @1
|
||||
(label) @2
|
||||
(label) @3
|
||||
(label) @BEGIN
|
||||
(label) @END
|
||||
(byte[1000]) SCREEN
|
||||
(byte) STAR
|
||||
(byte*) cursor
|
||||
(byte*) cursor#1
|
||||
(byte*) cursor#2
|
||||
(byte*) cursor#3
|
||||
(byte*) cursor#5
|
||||
(byte) e
|
||||
(byte) e#1
|
||||
(byte) e#2
|
||||
(byte) e#3
|
||||
(byte) e#5
|
||||
(byte) x
|
||||
(byte) x#1
|
||||
(byte) x#2
|
||||
(byte) x0
|
||||
(byte) x1
|
||||
(byte) xd
|
||||
(byte) y
|
||||
(byte) y#1
|
||||
(byte) y#2
|
||||
(byte) y#4
|
||||
(byte) y0
|
||||
(byte) y1
|
||||
(byte) yd
|
||||
|
||||
INITIAL ASM
|
||||
BBEGIN:
|
||||
B1_from_BBEGIN:
|
||||
|
@ -17,7 +17,7 @@ main__B3:
|
||||
main__B4:
|
||||
lda 53266
|
||||
cmp #255
|
||||
bne main__main__B4
|
||||
bne main__B4
|
||||
main__B6:
|
||||
dex
|
||||
cpx #0
|
||||
|
@ -3310,108 +3310,6 @@ Multiple usages for variable. Not optimizing sub-constant (byte) flip::i#2
|
||||
Multiple usages for variable. Not optimizing sub-constant (byte) flip::i#2
|
||||
Multiple usages for variable. Not optimizing sub-constant (byte) plot::i#2
|
||||
Block Sequence Planned @BEGIN @END main main::@3 main::@4 main::@6 main::@7 main::@10 main::@11 main::@return plot plot::@1 plot::@2 plot::@3 plot::@return flip flip::@1 flip::@2 flip::@4 flip::@3 flip::@return prepare prepare::@1 prepare::@return
|
||||
CONTROL FLOW GRAPH - PHI LIFTED
|
||||
@BEGIN: from
|
||||
call main param-assignment
|
||||
to:@END
|
||||
@END: from @BEGIN
|
||||
main: from @BEGIN
|
||||
call prepare param-assignment
|
||||
to:main::@3
|
||||
main::@3: from main main::@11 main::@3 main::@6
|
||||
(byte) main::c#2 ← phi( main/(byte) 25 main::@6/(byte) main::c#1 main::@11/(byte) 25 )
|
||||
(byte~) main::$1 ← * (word) 53266
|
||||
if((byte~) main::$1!=(byte) 254) goto main::@3
|
||||
to:main::@4
|
||||
main::@4: from main::@3 main::@4
|
||||
(byte~) main::$3 ← * (word) 53266
|
||||
if((byte~) main::$3!=(byte) 255) goto main::@4
|
||||
to:main::@6
|
||||
main::@6: from main::@4
|
||||
(byte) main::c#1 ← -- (byte) main::c#2
|
||||
if((byte) main::c#1!=(byte) 0) goto main::@3
|
||||
to:main::@7
|
||||
main::@7: from main::@6
|
||||
call flip param-assignment
|
||||
to:main::@10
|
||||
main::@10: from main::@7
|
||||
call plot param-assignment
|
||||
to:main::@11
|
||||
main::@11: from main::@10
|
||||
if(true) goto main::@3
|
||||
to:main::@return
|
||||
main::@return: from main::@11
|
||||
return
|
||||
to:@RETURN
|
||||
plot: from main::@10
|
||||
to:plot::@1
|
||||
plot::@1: from plot plot::@3
|
||||
(byte) plot::y#2 ← phi( plot/(byte) 16 plot::@3/(byte) plot::y#1 )
|
||||
(byte*) plot::line#2 ← phi( plot/(word) 1236 plot::@3/(byte*) plot::line#1 )
|
||||
(byte) plot::i#3 ← phi( plot/(byte) 0 plot::@3/(byte) plot::i#1 )
|
||||
to:plot::@2
|
||||
plot::@2: from plot::@1 plot::@2
|
||||
(byte) plot::x#2 ← phi( plot::@1/(byte) 0 plot::@2/(byte) plot::x#1 )
|
||||
(byte) plot::i#2 ← phi( plot::@1/(byte) plot::i#3 plot::@2/(byte) plot::i#1 )
|
||||
(byte~) plot::$3 ← (word) 4096 *idx (byte) plot::i#2
|
||||
*((byte*) plot::line#2 + (byte) plot::x#2) ← (byte~) plot::$3
|
||||
(byte) plot::i#1 ← ++ (byte) plot::i#2
|
||||
(byte) plot::x#1 ← ++ (byte) plot::x#2
|
||||
if((byte) plot::x#1<(byte) 16) goto plot::@2
|
||||
to:plot::@3
|
||||
plot::@3: from plot::@2
|
||||
(byte*) plot::line#1 ← (byte*) plot::line#2 + (byte) 40
|
||||
(byte) plot::y#1 ← -- (byte) plot::y#2
|
||||
if((byte) plot::y#1!=(byte) 0) goto plot::@1
|
||||
to:plot::@return
|
||||
plot::@return: from plot::@3
|
||||
return
|
||||
to:@RETURN
|
||||
flip: from main::@7
|
||||
to:flip::@1
|
||||
flip::@1: from flip flip::@4
|
||||
(byte) flip::r#2 ← phi( flip/(byte) 16 flip::@4/(byte) flip::r#1 )
|
||||
(byte) flip::dstIdx#5 ← phi( flip/(byte) 15 flip::@4/(byte) flip::dstIdx#2 )
|
||||
(byte) flip::srcIdx#3 ← phi( flip/(byte) 0 flip::@4/(byte) flip::srcIdx#1 )
|
||||
to:flip::@2
|
||||
flip::@2: from flip::@1 flip::@2
|
||||
(byte) flip::c#2 ← phi( flip::@1/(byte) 16 flip::@2/(byte) flip::c#1 )
|
||||
(byte) flip::dstIdx#3 ← phi( flip::@1/(byte) flip::dstIdx#5 flip::@2/(byte) flip::dstIdx#1 )
|
||||
(byte) flip::srcIdx#2 ← phi( flip::@1/(byte) flip::srcIdx#3 flip::@2/(byte) flip::srcIdx#1 )
|
||||
(byte~) flip::$0 ← (word) 4096 *idx (byte) flip::srcIdx#2
|
||||
*((word) 4352 + (byte) flip::dstIdx#3) ← (byte~) flip::$0
|
||||
(byte) flip::srcIdx#1 ← ++ (byte) flip::srcIdx#2
|
||||
(byte) flip::dstIdx#1 ← (byte) flip::dstIdx#3 + (byte) 16
|
||||
(byte) flip::c#1 ← -- (byte) flip::c#2
|
||||
if((byte) flip::c#1!=(byte) 0) goto flip::@2
|
||||
to:flip::@4
|
||||
flip::@4: from flip::@2
|
||||
(byte) flip::dstIdx#2 ← -- (byte) flip::dstIdx#1
|
||||
(byte) flip::r#1 ← -- (byte) flip::r#2
|
||||
if((byte) flip::r#1!=(byte) 0) goto flip::@1
|
||||
to:flip::@3
|
||||
flip::@3: from flip::@3 flip::@4
|
||||
(byte) flip::i#2 ← phi( flip::@3/(byte) flip::i#1 flip::@4/(byte) 0 )
|
||||
(byte~) flip::$4 ← (word) 4352 *idx (byte) flip::i#2
|
||||
*((word) 4096 + (byte) flip::i#2) ← (byte~) flip::$4
|
||||
(byte) flip::i#1 ← ++ (byte) flip::i#2
|
||||
if((byte) flip::i#1!=(byte) 0) goto flip::@3
|
||||
to:flip::@return
|
||||
flip::@return: from flip::@3
|
||||
return
|
||||
to:@RETURN
|
||||
prepare: from main
|
||||
to:prepare::@1
|
||||
prepare::@1: from prepare prepare::@1
|
||||
(byte) prepare::i#2 ← phi( prepare/(byte) 0 prepare::@1/(byte) prepare::i#1 )
|
||||
*((word) 4096 + (byte) prepare::i#2) ← (byte) prepare::i#2
|
||||
(byte) prepare::i#1 ← ++ (byte) prepare::i#2
|
||||
if((byte) prepare::i#1!=(byte) 0) goto prepare::@1
|
||||
to:prepare::@return
|
||||
prepare::@return: from prepare::@1
|
||||
return
|
||||
to:@RETURN
|
||||
|
||||
Propagating live ranges...
|
||||
Propagating live ranges...
|
||||
Propagating live ranges...
|
||||
@ -3523,82 +3421,6 @@ prepare::@return: from prepare::@1
|
||||
[45] return [ ]
|
||||
to:@RETURN
|
||||
|
||||
SYMBOLS - LIVE RANGES
|
||||
(label) @BEGIN
|
||||
(label) @END
|
||||
(byte*) RASTER
|
||||
(byte[1000]) SCREEN
|
||||
(byte[256]) buffer1
|
||||
(byte[256]) buffer2
|
||||
(void()) flip()
|
||||
(byte~) flip::$0
|
||||
(byte~) flip::$4
|
||||
(label) flip::@1
|
||||
(label) flip::@2
|
||||
(label) flip::@3
|
||||
(label) flip::@4
|
||||
(label) flip::@return
|
||||
(byte) flip::c
|
||||
(byte) flip::c#1
|
||||
(byte) flip::c#2
|
||||
(byte) flip::dstIdx
|
||||
(byte) flip::dstIdx#1
|
||||
(byte) flip::dstIdx#2
|
||||
(byte) flip::dstIdx#3
|
||||
(byte) flip::dstIdx#5
|
||||
(byte) flip::i
|
||||
(byte) flip::i#1
|
||||
(byte) flip::i#2
|
||||
(byte) flip::r
|
||||
(byte) flip::r#1
|
||||
(byte) flip::r#2
|
||||
(byte) flip::srcIdx
|
||||
(byte) flip::srcIdx#1
|
||||
(byte) flip::srcIdx#2
|
||||
(byte) flip::srcIdx#3
|
||||
|
||||
(void()) main()
|
||||
(byte~) main::$1
|
||||
(byte~) main::$3
|
||||
(label) main::@10
|
||||
(label) main::@11
|
||||
(label) main::@3
|
||||
(label) main::@4
|
||||
(label) main::@6
|
||||
(label) main::@7
|
||||
(label) main::@return
|
||||
(byte) main::c
|
||||
(byte) main::c#1
|
||||
(byte) main::c#2
|
||||
|
||||
(void()) plot()
|
||||
(byte~) plot::$3
|
||||
(label) plot::@1
|
||||
(label) plot::@2
|
||||
(label) plot::@3
|
||||
(label) plot::@return
|
||||
(byte) plot::i
|
||||
(byte) plot::i#1
|
||||
(byte) plot::i#2
|
||||
(byte) plot::i#3
|
||||
(byte*) plot::line
|
||||
(byte*) plot::line#1
|
||||
(byte*) plot::line#2
|
||||
(byte) plot::x
|
||||
(byte) plot::x#1
|
||||
(byte) plot::x#2
|
||||
(byte) plot::y
|
||||
(byte) plot::y#1
|
||||
(byte) plot::y#2
|
||||
|
||||
(void()) prepare()
|
||||
(label) prepare::@1
|
||||
(label) prepare::@return
|
||||
(byte) prepare::i
|
||||
(byte) prepare::i#1
|
||||
(byte) prepare::i#2
|
||||
|
||||
|
||||
INITIAL ASM
|
||||
BBEGIN:
|
||||
jsr main
|
||||
@ -3631,7 +3453,7 @@ main__B4:
|
||||
lda 53266
|
||||
// [6] if((byte~) main::$3!=(byte) 255) goto main::@4 [ main::c#2 ] // aby_neq_coby1_then_la1
|
||||
cmp #255
|
||||
bne main__main__B4
|
||||
bne main__B4
|
||||
jmp main__B6
|
||||
main__B6:
|
||||
// [7] (byte) main::c#1 ← -- (byte) main::c#2 [ main::c#1 ] // xby=_dec_xby
|
||||
@ -3854,7 +3676,7 @@ main__B4:
|
||||
lda 53266
|
||||
// [6] if((byte~) main::$3!=(byte) 255) goto main::@4 [ main::c#2 ] // aby_neq_coby1_then_la1
|
||||
cmp #255
|
||||
bne main__main__B4
|
||||
bne main__B4
|
||||
main__B6:
|
||||
// [7] (byte) main::c#1 ← -- (byte) main::c#2 [ main::c#1 ] // xby=_dec_xby
|
||||
dex
|
||||
@ -4048,7 +3870,7 @@ main__B4:
|
||||
lda 53266
|
||||
// [6] if((byte~) main::$3!=(byte) 255) goto main::@4 [ main::c#2 ] // aby_neq_coby1_then_la1
|
||||
cmp #255
|
||||
bne main__main__B4
|
||||
bne main__B4
|
||||
main__B6:
|
||||
// [7] (byte) main::c#1 ← -- (byte) main::c#2 [ main::c#1 ] // xby=_dec_xby
|
||||
dex
|
||||
@ -4229,7 +4051,7 @@ main__B4:
|
||||
lda 53266
|
||||
// [6] if((byte~) main::$3!=(byte) 255) goto main::@4 [ main::c#2 ] // aby_neq_coby1_then_la1
|
||||
cmp #255
|
||||
bne main__main__B4
|
||||
bne main__B4
|
||||
main__B6:
|
||||
// [7] (byte) main::c#1 ← -- (byte) main::c#2 [ main::c#1 ] // xby=_dec_xby
|
||||
dex
|
||||
@ -4484,7 +4306,7 @@ main__B4:
|
||||
lda 53266
|
||||
// [6] if((byte~) main::$3!=(byte) 255) goto main::@4 [ main::c#2 ] // aby_neq_coby1_then_la1
|
||||
cmp #255
|
||||
bne main__main__B4
|
||||
bne main__B4
|
||||
main__B6:
|
||||
// [7] (byte) main::c#1 ← -- (byte) main::c#2 [ main::c#1 ] // xby=_dec_xby
|
||||
dex
|
||||
|
@ -252,24 +252,6 @@ CONTROL FLOW GRAPH
|
||||
@END: from @3
|
||||
|
||||
Block Sequence Planned @BEGIN @1 @3 @END @2
|
||||
CONTROL FLOW GRAPH - PHI LIFTED
|
||||
@BEGIN: from
|
||||
to:@1
|
||||
@1: from @3 @BEGIN
|
||||
(byte) s#2 ← phi( @3/(byte) s#4 @BEGIN/(byte) 0 )
|
||||
(byte) i#2 ← phi( @3/(byte) i#1 @BEGIN/(byte) 10 )
|
||||
if((byte) i#2>(byte) 5) goto @2
|
||||
to:@3
|
||||
@3: from @1 @2
|
||||
(byte) s#4 ← phi( @1/(byte) s#2 @2/(byte) s#1 )
|
||||
(byte) i#1 ← -- (byte) i#2
|
||||
if((byte) i#1>(byte) 0) goto @1
|
||||
to:@END
|
||||
@END: from @3
|
||||
@2: from @1
|
||||
(byte) s#1 ← (byte) s#2 + (byte) i#2
|
||||
to:@3
|
||||
|
||||
Propagating live ranges...
|
||||
Propagating live ranges...
|
||||
Propagating live ranges...
|
||||
@ -291,20 +273,6 @@ CONTROL FLOW GRAPH - LIVE RANGES
|
||||
[5] (byte) s#1 ← (byte) s#2 + (byte) i#2 [ i#2 s#1 ]
|
||||
to:@3
|
||||
|
||||
SYMBOLS - LIVE RANGES
|
||||
(label) @1
|
||||
(label) @2
|
||||
(label) @3
|
||||
(label) @BEGIN
|
||||
(label) @END
|
||||
(byte) i
|
||||
(byte) i#1
|
||||
(byte) i#2
|
||||
(byte) s
|
||||
(byte) s#1
|
||||
(byte) s#2
|
||||
(byte) s#4
|
||||
|
||||
INITIAL ASM
|
||||
BBEGIN:
|
||||
B1_from_BBEGIN:
|
||||
|
@ -207,19 +207,6 @@ Multiple usages for variable. Not optimizing sub-constant (byte) i#2
|
||||
Multiple usages for variable. Not optimizing sub-constant (byte) i#2
|
||||
Multiple usages for variable. Not optimizing sub-constant (byte) i#2
|
||||
Block Sequence Planned @BEGIN @1 @END
|
||||
CONTROL FLOW GRAPH - PHI LIFTED
|
||||
@BEGIN: from
|
||||
to:@1
|
||||
@1: from @1 @BEGIN
|
||||
(byte) i#2 ← phi( @1/(byte) i#1 @BEGIN/(byte) 5 )
|
||||
(byte~) $0 ← (byte) 2 + (byte) i#2
|
||||
(byte~) $1 ← (byte~) $0 + (byte) 2
|
||||
*((word) 4352 + (byte) i#2) ← (byte~) $1
|
||||
(byte) i#1 ← (byte) i#2 + (byte) 1
|
||||
if((byte) i#1<(byte) 10) goto @1
|
||||
to:@END
|
||||
@END: from @1
|
||||
|
||||
Propagating live ranges...
|
||||
Propagating live ranges...
|
||||
CONTROL FLOW GRAPH - LIVE RANGES
|
||||
@ -235,17 +222,6 @@ CONTROL FLOW GRAPH - LIVE RANGES
|
||||
to:@END
|
||||
@END: from @1
|
||||
|
||||
SYMBOLS - LIVE RANGES
|
||||
(byte~) $0
|
||||
(byte~) $1
|
||||
(label) @1
|
||||
(label) @BEGIN
|
||||
(label) @END
|
||||
(byte) i
|
||||
(byte) i#1
|
||||
(byte) i#2
|
||||
(byte[16]) p
|
||||
|
||||
INITIAL ASM
|
||||
BBEGIN:
|
||||
B1_from_BBEGIN:
|
||||
|
@ -241,23 +241,6 @@ sum::@return: from sum
|
||||
@END: from @2
|
||||
|
||||
Block Sequence Planned @BEGIN @2 @END sum sum::@return
|
||||
CONTROL FLOW GRAPH - PHI LIFTED
|
||||
@BEGIN: from
|
||||
call sum param-assignment
|
||||
to:@2
|
||||
@2: from @BEGIN
|
||||
call sum param-assignment
|
||||
to:@END
|
||||
@END: from @2
|
||||
sum: from @2 @BEGIN
|
||||
(byte) sum::b#2 ← phi( @2/(byte) 13 @BEGIN/(byte) 2 )
|
||||
(byte) sum::a#2 ← phi( @2/(byte) 9 @BEGIN/(byte) 1 )
|
||||
(byte) s1#0 ← (byte) sum::a#2 + (byte) sum::b#2
|
||||
to:sum::@return
|
||||
sum::@return: from sum
|
||||
return (byte) s1#0
|
||||
to:@RETURN
|
||||
|
||||
Propagating live ranges...
|
||||
CONTROL FLOW GRAPH - LIVE RANGES
|
||||
@BEGIN: from
|
||||
@ -276,22 +259,6 @@ sum::@return: from sum
|
||||
[4] return (byte) s1#0 [ ]
|
||||
to:@RETURN
|
||||
|
||||
SYMBOLS - LIVE RANGES
|
||||
(label) @2
|
||||
(label) @BEGIN
|
||||
(label) @END
|
||||
(byte) s1
|
||||
(byte) s1#0
|
||||
(byte) s2
|
||||
(byte()) sum((byte) sum::a , (byte) sum::b)
|
||||
(label) sum::@return
|
||||
(byte) sum::a
|
||||
(byte) sum::a#2
|
||||
(byte) sum::b
|
||||
(byte) sum::b#2
|
||||
(byte) sum::return
|
||||
|
||||
|
||||
INITIAL ASM
|
||||
BBEGIN:
|
||||
sum_from_BBEGIN:
|
||||
|
Loading…
Reference in New Issue
Block a user