From 7dbb73e8bd8dacbaa36555eac67b0ab0a3f5207c Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Thu, 29 Jul 2021 21:13:39 +0200 Subject: [PATCH] Added support for silent truncation from int/long to char. Closes #684 --- .../model/types/SymbolTypeConversion.java | 12 + .../kickc/test/TestProgramsFast.java | 13 +- src/test/kc/cast-not-needed-4.c | 12 + .../kc/{typemismatch.c => type-truncate.c} | 2 +- src/test/ref/cast-not-needed-4.asm | 52 ++ src/test/ref/cast-not-needed-4.cfg | 19 + src/test/ref/cast-not-needed-4.log | 320 ++++++++ src/test/ref/cast-not-needed-4.sym | 13 + src/test/ref/int-literals.asm | 4 + src/test/ref/int-literals.cfg | 28 +- src/test/ref/int-literals.log | 686 ++++++++++-------- src/test/ref/int-literals.sym | 14 +- src/test/ref/typemismatch.asm | 14 +- 13 files changed, 848 insertions(+), 341 deletions(-) create mode 100644 src/test/kc/cast-not-needed-4.c rename src/test/kc/{typemismatch.c => type-truncate.c} (62%) create mode 100644 src/test/ref/cast-not-needed-4.asm create mode 100644 src/test/ref/cast-not-needed-4.cfg create mode 100644 src/test/ref/cast-not-needed-4.log create mode 100644 src/test/ref/cast-not-needed-4.sym diff --git a/src/main/java/dk/camelot64/kickc/model/types/SymbolTypeConversion.java b/src/main/java/dk/camelot64/kickc/model/types/SymbolTypeConversion.java index 50af31515..7540d2800 100644 --- a/src/main/java/dk/camelot64/kickc/model/types/SymbolTypeConversion.java +++ b/src/main/java/dk/camelot64/kickc/model/types/SymbolTypeConversion.java @@ -190,6 +190,18 @@ public class SymbolTypeConversion { return true; if(lValueType.equals(rValueType)) return true; + if(SymbolType.BYTE.equals(lValueType) && SymbolType.WORD.equals(rValueType)) + return true; + if(SymbolType.BYTE.equals(lValueType) && SymbolType.SWORD.equals(rValueType)) + return true; + if(SymbolType.BYTE.equals(lValueType) && SymbolType.DWORD.equals(rValueType)) + return true; + if(SymbolType.BYTE.equals(lValueType) && SymbolType.SDWORD.equals(rValueType)) + return true; + if(SymbolType.SBYTE.equals(lValueType) && SymbolType.SWORD.equals(rValueType)) + return true; + if(SymbolType.SBYTE.equals(lValueType) && SymbolType.SDWORD.equals(rValueType)) + return true; if(SymbolType.WORD.equals(lValueType) && SymbolType.BYTE.equals(rValueType)) return true; if(SymbolType.DWORD.equals(lValueType) && SymbolType.BYTE.equals(rValueType)) diff --git a/src/test/java/dk/camelot64/kickc/test/TestProgramsFast.java b/src/test/java/dk/camelot64/kickc/test/TestProgramsFast.java index 390f2297b..7c723f880 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestProgramsFast.java +++ b/src/test/java/dk/camelot64/kickc/test/TestProgramsFast.java @@ -3481,8 +3481,8 @@ public class TestProgramsFast extends TestPrograms { } @Test - public void testCastNotNeeded2() throws IOException { - compileAndCompare("cast-not-needed-2.c"); + public void testCastNotNeeded4() throws IOException { + compileAndCompare("cast-not-needed-4.c"); } @Test @@ -3490,6 +3490,11 @@ public class TestProgramsFast extends TestPrograms { compileAndCompare("cast-not-needed-3.c"); } + @Test + public void testCastNotNeeded2() throws IOException { + compileAndCompare("cast-not-needed-2.c"); + } + @Test public void testCastNotNeeded() throws IOException { compileAndCompare("cast-not-needed.c"); @@ -4663,8 +4668,8 @@ public class TestProgramsFast extends TestPrograms { } @Test - public void testTypeMismatch() throws IOException { - assertError("typemismatch.c", "Type mismatch (byte) cannot be assigned from (word)"); + public void testTypeTruncate() throws IOException { + compileAndCompare("type-truncate.c"); } @Test diff --git a/src/test/kc/cast-not-needed-4.c b/src/test/kc/cast-not-needed-4.c new file mode 100644 index 000000000..cf690a383 --- /dev/null +++ b/src/test/kc/cast-not-needed-4.c @@ -0,0 +1,12 @@ +// Tests a cast that is not needed +// When assigning a char from an integer + + +void main() { + char * screen = (char*)0x0400; + for(int i=-1000;i<1000;i++) { + char c = i; + *(screen++) = c; + } + +} diff --git a/src/test/kc/typemismatch.c b/src/test/kc/type-truncate.c similarity index 62% rename from src/test/kc/typemismatch.c rename to src/test/kc/type-truncate.c index 3920996bc..7a3d1e616 100644 --- a/src/test/kc/typemismatch.c +++ b/src/test/kc/type-truncate.c @@ -1,4 +1,4 @@ -// Type mismatch - should fail gracefully +// Type match bytes can be assigned from integers without issue void main() { word w = 5000; byte b = w; diff --git a/src/test/ref/cast-not-needed-4.asm b/src/test/ref/cast-not-needed-4.asm new file mode 100644 index 000000000..e4c3f17b7 --- /dev/null +++ b/src/test/ref/cast-not-needed-4.asm @@ -0,0 +1,52 @@ +// Tests a cast that is not needed +// When assigning a char from an integer + // Commodore 64 PRG executable file +.file [name="cast-not-needed-4.prg", type="prg", segments="Program"] +.segmentdef Program [segments="Basic, Code, Data"] +.segmentdef Basic [start=$0801] +.segmentdef Code [start=$80d] +.segmentdef Data [startAfter="Code"] +.segment Basic +:BasicUpstart(main) +.segment Code +main: { + .label screen = 4 + .label i = 2 + lda #<$400 + sta.z screen + lda #>$400 + sta.z screen+1 + lda #<-$3e8 + sta.z i + lda #>-$3e8 + sta.z i+1 + __b1: + // for(int i=-1000;i<1000;i++) + lda.z i + cmp #<$3e8 + lda.z i+1 + sbc #>$3e8 + bvc !+ + eor #$80 + !: + bmi __b2 + // } + rts + __b2: + // char c = i + lda.z i + // *(screen++) = c + ldy #0 + sta (screen),y + // *(screen++) = c; + inc.z screen + bne !+ + inc.z screen+1 + !: + // for(int i=-1000;i<1000;i++) + inc.z i + bne !+ + inc.z i+1 + !: + jmp __b1 +} diff --git a/src/test/ref/cast-not-needed-4.cfg b/src/test/ref/cast-not-needed-4.cfg new file mode 100644 index 000000000..10b439d04 --- /dev/null +++ b/src/test/ref/cast-not-needed-4.cfg @@ -0,0 +1,19 @@ + +void main() +main: scope:[main] from + [0] phi() + to:main::@1 +main::@1: scope:[main] from main main::@2 + [1] main::screen#2 = phi( main/(byte*) 1024, main::@2/main::screen#1 ) + [1] main::i#2 = phi( main/-$3e8, main::@2/main::i#1 ) + [2] if(main::i#2<$3e8) goto main::@2 + to:main::@return +main::@return: scope:[main] from main::@1 + [3] return + to:@return +main::@2: scope:[main] from main::@1 + [4] main::c#0 = (byte)main::i#2 + [5] *main::screen#2 = main::c#0 + [6] main::screen#1 = ++ main::screen#2 + [7] main::i#1 = ++ main::i#2 + to:main::@1 diff --git a/src/test/ref/cast-not-needed-4.log b/src/test/ref/cast-not-needed-4.log new file mode 100644 index 000000000..b43c04af9 --- /dev/null +++ b/src/test/ref/cast-not-needed-4.log @@ -0,0 +1,320 @@ + +CONTROL FLOW GRAPH SSA + +void main() +main: scope:[main] from __start + main::screen#0 = (byte*)$400 + main::i#0 = -$3e8 + to:main::@1 +main::@1: scope:[main] from main main::@2 + main::screen#3 = phi( main/main::screen#0, main::@2/main::screen#1 ) + main::i#2 = phi( main/main::i#0, main::@2/main::i#1 ) + main::$0 = main::i#2 < $3e8 + if(main::$0) goto main::@2 + to:main::@return +main::@2: scope:[main] from main::@1 + main::screen#2 = phi( main::@1/main::screen#3 ) + main::i#3 = phi( main::@1/main::i#2 ) + main::c#0 = (byte)main::i#3 + *main::screen#2 = main::c#0 + main::screen#1 = ++ main::screen#2 + main::i#1 = ++ main::i#3 + to:main::@1 +main::@return: scope:[main] from main::@1 + return + to:@return + +void __start() +__start: scope:[__start] from + call main + to:__start::@1 +__start::@1: scope:[__start] from __start + to:__start::@return +__start::@return: scope:[__start] from __start::@1 + return + to:@return + +SYMBOL TABLE SSA +void __start() +void main() +bool~ main::$0 +byte main::c +byte main::c#0 +signed word main::i +signed word main::i#0 +signed word main::i#1 +signed word main::i#2 +signed word main::i#3 +byte* main::screen +byte* main::screen#0 +byte* main::screen#1 +byte* main::screen#2 +byte* main::screen#3 + +Adding number conversion cast (snumber) $3e8 in main::$0 = main::i#2 < $3e8 +Successful SSA optimization PassNAddNumberTypeConversions +Simplifying constant pointer cast (byte*) 1024 +Simplifying constant integer cast $3e8 +Successful SSA optimization PassNCastSimplification +Finalized signed number type (signed word) $3e8 +Successful SSA optimization PassNFinalizeNumberTypeConversions +Alias main::i#2 = main::i#3 +Alias main::screen#2 = main::screen#3 +Successful SSA optimization Pass2AliasElimination +Simple Condition main::$0 [4] if(main::i#2<$3e8) goto main::@2 +Successful SSA optimization Pass2ConditionalJumpSimplification +Constant main::screen#0 = (byte*) 1024 +Constant main::i#0 = -$3e8 +Successful SSA optimization Pass2ConstantIdentification +Removing unused procedure __start +Removing unused procedure block __start +Removing unused procedure block __start::@1 +Removing unused procedure block __start::@return +Successful SSA optimization PassNEliminateEmptyStart +Inlining constant with var siblings main::screen#0 +Inlining constant with var siblings main::i#0 +Constant inlined main::screen#0 = (byte*) 1024 +Constant inlined main::i#0 = -$3e8 +Successful SSA optimization Pass2ConstantInlining +Adding NOP phi() at start of main +CALL GRAPH + +Created 2 initial phi equivalence classes +Coalesced [8] main::i#4 = main::i#1 +Coalesced [9] main::screen#4 = main::screen#1 +Coalesced down to 2 phi equivalence classes +Adding NOP phi() at start of main + +FINAL CONTROL FLOW GRAPH + +void main() +main: scope:[main] from + [0] phi() + to:main::@1 +main::@1: scope:[main] from main main::@2 + [1] main::screen#2 = phi( main/(byte*) 1024, main::@2/main::screen#1 ) + [1] main::i#2 = phi( main/-$3e8, main::@2/main::i#1 ) + [2] if(main::i#2<$3e8) goto main::@2 + to:main::@return +main::@return: scope:[main] from main::@1 + [3] return + to:@return +main::@2: scope:[main] from main::@1 + [4] main::c#0 = (byte)main::i#2 + [5] *main::screen#2 = main::c#0 + [6] main::screen#1 = ++ main::screen#2 + [7] main::i#1 = ++ main::i#2 + to:main::@1 + + +VARIABLE REGISTER WEIGHTS +void main() +byte main::c +byte main::c#0 22.0 +signed word main::i +signed word main::i#1 22.0 +signed word main::i#2 6.6000000000000005 +byte* main::screen +byte* main::screen#1 11.0 +byte* main::screen#2 8.25 + +Initial phi equivalence classes +[ main::i#2 main::i#1 ] +[ main::screen#2 main::screen#1 ] +Added variable main::c#0 to live range equivalence class [ main::c#0 ] +Complete equivalence classes +[ main::i#2 main::i#1 ] +[ main::screen#2 main::screen#1 ] +[ main::c#0 ] +Allocated zp[2]:2 [ main::i#2 main::i#1 ] +Allocated zp[2]:4 [ main::screen#2 main::screen#1 ] +Allocated zp[1]:6 [ main::c#0 ] +REGISTER UPLIFT POTENTIAL REGISTERS +Statement [2] if(main::i#2<$3e8) goto main::@2 [ main::i#2 main::screen#2 ] ( [ main::i#2 main::screen#2 ] { } ) always clobbers reg byte a +Statement [4] main::c#0 = (byte)main::i#2 [ main::i#2 main::screen#2 main::c#0 ] ( [ main::i#2 main::screen#2 main::c#0 ] { } ) always clobbers reg byte a +Statement [5] *main::screen#2 = main::c#0 [ main::i#2 main::screen#2 ] ( [ main::i#2 main::screen#2 ] { } ) always clobbers reg byte y +Potential registers zp[2]:2 [ main::i#2 main::i#1 ] : zp[2]:2 , +Potential registers zp[2]:4 [ main::screen#2 main::screen#1 ] : zp[2]:4 , +Potential registers zp[1]:6 [ main::c#0 ] : zp[1]:6 , reg byte a , reg byte x , reg byte y , + +REGISTER UPLIFT SCOPES +Uplift Scope [main] 28.6: zp[2]:2 [ main::i#2 main::i#1 ] 22: zp[1]:6 [ main::c#0 ] 19.25: zp[2]:4 [ main::screen#2 main::screen#1 ] +Uplift Scope [] + +Uplifting [main] best 826 combination zp[2]:2 [ main::i#2 main::i#1 ] reg byte a [ main::c#0 ] zp[2]:4 [ main::screen#2 main::screen#1 ] +Uplifting [] best 826 combination + +ASSEMBLER BEFORE OPTIMIZATION + // File Comments +// Tests a cast that is not needed +// When assigning a char from an integer + // Upstart + // Commodore 64 PRG executable file +.file [name="cast-not-needed-4.prg", type="prg", segments="Program"] +.segmentdef Program [segments="Basic, Code, Data"] +.segmentdef Basic [start=$0801] +.segmentdef Code [start=$80d] +.segmentdef Data [startAfter="Code"] +.segment Basic +:BasicUpstart(main) + // Global Constants & labels +.segment Code + // main +main: { + .label screen = 4 + .label i = 2 + // [1] phi from main to main::@1 [phi:main->main::@1] + __b1_from_main: + // [1] phi main::screen#2 = (byte*) 1024 [phi:main->main::@1#0] -- pbuz1=pbuc1 + lda #<$400 + sta.z screen + lda #>$400 + sta.z screen+1 + // [1] phi main::i#2 = -$3e8 [phi:main->main::@1#1] -- vwsz1=vwsc1 + lda #<-$3e8 + sta.z i + lda #>-$3e8 + sta.z i+1 + jmp __b1 + // main::@1 + __b1: + // [2] if(main::i#2<$3e8) goto main::@2 -- vwsz1_lt_vwsc1_then_la1 + lda.z i + cmp #<$3e8 + lda.z i+1 + sbc #>$3e8 + bvc !+ + eor #$80 + !: + bmi __b2 + jmp __breturn + // main::@return + __breturn: + // [3] return + rts + // main::@2 + __b2: + // [4] main::c#0 = (byte)main::i#2 -- vbuaa=_byte_vwsz1 + lda.z i + // [5] *main::screen#2 = main::c#0 -- _deref_pbuz1=vbuaa + ldy #0 + sta (screen),y + // [6] main::screen#1 = ++ main::screen#2 -- pbuz1=_inc_pbuz1 + inc.z screen + bne !+ + inc.z screen+1 + !: + // [7] main::i#1 = ++ main::i#2 -- vwsz1=_inc_vwsz1 + inc.z i + bne !+ + inc.z i+1 + !: + // [1] phi from main::@2 to main::@1 [phi:main::@2->main::@1] + __b1_from___b2: + // [1] phi main::screen#2 = main::screen#1 [phi:main::@2->main::@1#0] -- register_copy + // [1] phi main::i#2 = main::i#1 [phi:main::@2->main::@1#1] -- register_copy + jmp __b1 +} + // File Data + +ASSEMBLER OPTIMIZATIONS +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Succesful ASM optimization Pass5NextJumpElimination +Removing instruction __b1_from_main: +Removing instruction __breturn: +Removing instruction __b1_from___b2: +Succesful ASM optimization Pass5UnusedLabelElimination + +FINAL SYMBOL TABLE +void main() +byte main::c +byte main::c#0 reg byte a 22.0 +signed word main::i +signed word main::i#1 i zp[2]:2 22.0 +signed word main::i#2 i zp[2]:2 6.6000000000000005 +byte* main::screen +byte* main::screen#1 screen zp[2]:4 11.0 +byte* main::screen#2 screen zp[2]:4 8.25 + +zp[2]:2 [ main::i#2 main::i#1 ] +zp[2]:4 [ main::screen#2 main::screen#1 ] +reg byte a [ main::c#0 ] + + +FINAL ASSEMBLER +Score: 766 + + // File Comments +// Tests a cast that is not needed +// When assigning a char from an integer + // Upstart + // Commodore 64 PRG executable file +.file [name="cast-not-needed-4.prg", type="prg", segments="Program"] +.segmentdef Program [segments="Basic, Code, Data"] +.segmentdef Basic [start=$0801] +.segmentdef Code [start=$80d] +.segmentdef Data [startAfter="Code"] +.segment Basic +:BasicUpstart(main) + // Global Constants & labels +.segment Code + // main +main: { + .label screen = 4 + .label i = 2 + // [1] phi from main to main::@1 [phi:main->main::@1] + // [1] phi main::screen#2 = (byte*) 1024 [phi:main->main::@1#0] -- pbuz1=pbuc1 + lda #<$400 + sta.z screen + lda #>$400 + sta.z screen+1 + // [1] phi main::i#2 = -$3e8 [phi:main->main::@1#1] -- vwsz1=vwsc1 + lda #<-$3e8 + sta.z i + lda #>-$3e8 + sta.z i+1 + // main::@1 + __b1: + // for(int i=-1000;i<1000;i++) + // [2] if(main::i#2<$3e8) goto main::@2 -- vwsz1_lt_vwsc1_then_la1 + lda.z i + cmp #<$3e8 + lda.z i+1 + sbc #>$3e8 + bvc !+ + eor #$80 + !: + bmi __b2 + // main::@return + // } + // [3] return + rts + // main::@2 + __b2: + // char c = i + // [4] main::c#0 = (byte)main::i#2 -- vbuaa=_byte_vwsz1 + lda.z i + // *(screen++) = c + // [5] *main::screen#2 = main::c#0 -- _deref_pbuz1=vbuaa + ldy #0 + sta (screen),y + // *(screen++) = c; + // [6] main::screen#1 = ++ main::screen#2 -- pbuz1=_inc_pbuz1 + inc.z screen + bne !+ + inc.z screen+1 + !: + // for(int i=-1000;i<1000;i++) + // [7] main::i#1 = ++ main::i#2 -- vwsz1=_inc_vwsz1 + inc.z i + bne !+ + inc.z i+1 + !: + // [1] phi from main::@2 to main::@1 [phi:main::@2->main::@1] + // [1] phi main::screen#2 = main::screen#1 [phi:main::@2->main::@1#0] -- register_copy + // [1] phi main::i#2 = main::i#1 [phi:main::@2->main::@1#1] -- register_copy + jmp __b1 +} + // File Data + diff --git a/src/test/ref/cast-not-needed-4.sym b/src/test/ref/cast-not-needed-4.sym new file mode 100644 index 000000000..4bfd0c925 --- /dev/null +++ b/src/test/ref/cast-not-needed-4.sym @@ -0,0 +1,13 @@ +void main() +byte main::c +byte main::c#0 reg byte a 22.0 +signed word main::i +signed word main::i#1 i zp[2]:2 22.0 +signed word main::i#2 i zp[2]:2 6.6000000000000005 +byte* main::screen +byte* main::screen#1 screen zp[2]:4 11.0 +byte* main::screen#2 screen zp[2]:4 8.25 + +zp[2]:2 [ main::i#2 main::i#1 ] +zp[2]:4 [ main::screen#2 main::screen#1 ] +reg byte a [ main::c#0 ] diff --git a/src/test/ref/int-literals.asm b/src/test/ref/int-literals.asm index 0c03af4f9..dbb4c06d6 100644 --- a/src/test/ref/int-literals.asm +++ b/src/test/ref/int-literals.asm @@ -115,6 +115,10 @@ testSimpleTypes: { ldy #TYPEID_SIGNED_DWORD ldx #TYPEID_SIGNED_DWORD jsr assertType + // assertType(typeid(12u), typeid(unsigned word)) + ldy #TYPEID_WORD + ldx #TYPEID_WORD + jsr assertType // } rts } diff --git a/src/test/ref/int-literals.cfg b/src/test/ref/int-literals.cfg index 3133c8661..716310dcb 100644 --- a/src/test/ref/int-literals.cfg +++ b/src/test/ref/int-literals.cfg @@ -79,28 +79,32 @@ testSimpleTypes::@13: scope:[testSimpleTypes] from testSimpleTypes::@12 testSimpleTypes::@14: scope:[testSimpleTypes] from testSimpleTypes::@13 [36] phi() [37] call assertType + to:testSimpleTypes::@15 +testSimpleTypes::@15: scope:[testSimpleTypes] from testSimpleTypes::@14 + [38] phi() + [39] call assertType to:testSimpleTypes::@return -testSimpleTypes::@return: scope:[testSimpleTypes] from testSimpleTypes::@14 - [38] return +testSimpleTypes::@return: scope:[testSimpleTypes] from testSimpleTypes::@15 + [40] return to:@return void assertType(byte assertType::t1 , byte assertType::t2) -assertType: scope:[assertType] from testSimpleTypes testSimpleTypes::@1 testSimpleTypes::@10 testSimpleTypes::@11 testSimpleTypes::@12 testSimpleTypes::@13 testSimpleTypes::@14 testSimpleTypes::@2 testSimpleTypes::@3 testSimpleTypes::@4 testSimpleTypes::@5 testSimpleTypes::@6 testSimpleTypes::@7 testSimpleTypes::@8 testSimpleTypes::@9 - [39] idx#42 = phi( testSimpleTypes/0, testSimpleTypes::@1/idx#19, testSimpleTypes::@10/idx#19, testSimpleTypes::@11/idx#19, testSimpleTypes::@12/idx#19, testSimpleTypes::@13/idx#19, testSimpleTypes::@14/idx#19, testSimpleTypes::@2/idx#19, testSimpleTypes::@3/idx#19, testSimpleTypes::@4/idx#19, testSimpleTypes::@5/idx#19, testSimpleTypes::@6/idx#19, testSimpleTypes::@7/idx#19, testSimpleTypes::@8/idx#19, testSimpleTypes::@9/idx#19 ) - [39] assertType::t2#15 = phi( testSimpleTypes/TYPEID_BYTE, testSimpleTypes::@1/TYPEID_BYTE, testSimpleTypes::@10/TYPEID_DWORD, testSimpleTypes::@11/TYPEID_DWORD, testSimpleTypes::@12/TYPEID_SIGNED_DWORD, testSimpleTypes::@13/TYPEID_SIGNED_DWORD, testSimpleTypes::@14/TYPEID_SIGNED_DWORD, testSimpleTypes::@2/TYPEID_SIGNED_BYTE, testSimpleTypes::@3/TYPEID_SIGNED_BYTE, testSimpleTypes::@4/TYPEID_WORD, testSimpleTypes::@5/TYPEID_WORD, testSimpleTypes::@6/TYPEID_WORD, testSimpleTypes::@7/TYPEID_SIGNED_WORD, testSimpleTypes::@8/TYPEID_SIGNED_WORD, testSimpleTypes::@9/TYPEID_SIGNED_WORD ) - [39] assertType::t1#15 = phi( testSimpleTypes/TYPEID_BYTE, testSimpleTypes::@1/TYPEID_BYTE, testSimpleTypes::@10/TYPEID_DWORD, testSimpleTypes::@11/TYPEID_DWORD, testSimpleTypes::@12/TYPEID_SIGNED_DWORD, testSimpleTypes::@13/TYPEID_SIGNED_DWORD, testSimpleTypes::@14/TYPEID_SIGNED_DWORD, testSimpleTypes::@2/TYPEID_SIGNED_BYTE, testSimpleTypes::@3/TYPEID_SIGNED_BYTE, testSimpleTypes::@4/TYPEID_WORD, testSimpleTypes::@5/TYPEID_WORD, testSimpleTypes::@6/TYPEID_WORD, testSimpleTypes::@7/TYPEID_SIGNED_WORD, testSimpleTypes::@8/TYPEID_SIGNED_WORD, testSimpleTypes::@9/TYPEID_SIGNED_WORD ) - [40] if(assertType::t1#15==assertType::t2#15) goto assertType::@1 +assertType: scope:[assertType] from testSimpleTypes testSimpleTypes::@1 testSimpleTypes::@10 testSimpleTypes::@11 testSimpleTypes::@12 testSimpleTypes::@13 testSimpleTypes::@14 testSimpleTypes::@15 testSimpleTypes::@2 testSimpleTypes::@3 testSimpleTypes::@4 testSimpleTypes::@5 testSimpleTypes::@6 testSimpleTypes::@7 testSimpleTypes::@8 testSimpleTypes::@9 + [41] idx#44 = phi( testSimpleTypes/0, testSimpleTypes::@1/idx#20, testSimpleTypes::@10/idx#20, testSimpleTypes::@11/idx#20, testSimpleTypes::@12/idx#20, testSimpleTypes::@13/idx#20, testSimpleTypes::@14/idx#20, testSimpleTypes::@15/idx#20, testSimpleTypes::@2/idx#20, testSimpleTypes::@3/idx#20, testSimpleTypes::@4/idx#20, testSimpleTypes::@5/idx#20, testSimpleTypes::@6/idx#20, testSimpleTypes::@7/idx#20, testSimpleTypes::@8/idx#20, testSimpleTypes::@9/idx#20 ) + [41] assertType::t2#16 = phi( testSimpleTypes/TYPEID_BYTE, testSimpleTypes::@1/TYPEID_BYTE, testSimpleTypes::@10/TYPEID_DWORD, testSimpleTypes::@11/TYPEID_DWORD, testSimpleTypes::@12/TYPEID_SIGNED_DWORD, testSimpleTypes::@13/TYPEID_SIGNED_DWORD, testSimpleTypes::@14/TYPEID_SIGNED_DWORD, testSimpleTypes::@15/TYPEID_WORD, testSimpleTypes::@2/TYPEID_SIGNED_BYTE, testSimpleTypes::@3/TYPEID_SIGNED_BYTE, testSimpleTypes::@4/TYPEID_WORD, testSimpleTypes::@5/TYPEID_WORD, testSimpleTypes::@6/TYPEID_WORD, testSimpleTypes::@7/TYPEID_SIGNED_WORD, testSimpleTypes::@8/TYPEID_SIGNED_WORD, testSimpleTypes::@9/TYPEID_SIGNED_WORD ) + [41] assertType::t1#16 = phi( testSimpleTypes/TYPEID_BYTE, testSimpleTypes::@1/TYPEID_BYTE, testSimpleTypes::@10/TYPEID_DWORD, testSimpleTypes::@11/TYPEID_DWORD, testSimpleTypes::@12/TYPEID_SIGNED_DWORD, testSimpleTypes::@13/TYPEID_SIGNED_DWORD, testSimpleTypes::@14/TYPEID_SIGNED_DWORD, testSimpleTypes::@15/TYPEID_WORD, testSimpleTypes::@2/TYPEID_SIGNED_BYTE, testSimpleTypes::@3/TYPEID_SIGNED_BYTE, testSimpleTypes::@4/TYPEID_WORD, testSimpleTypes::@5/TYPEID_WORD, testSimpleTypes::@6/TYPEID_WORD, testSimpleTypes::@7/TYPEID_SIGNED_WORD, testSimpleTypes::@8/TYPEID_SIGNED_WORD, testSimpleTypes::@9/TYPEID_SIGNED_WORD ) + [42] if(assertType::t1#16==assertType::t2#16) goto assertType::@1 to:assertType::@3 assertType::@3: scope:[assertType] from assertType - [41] COLS[idx#42] = RED + [43] COLS[idx#44] = RED to:assertType::@2 assertType::@2: scope:[assertType] from assertType::@1 assertType::@3 - [42] SCREEN[idx#42] = assertType::t1#15 - [43] idx#19 = ++ idx#42 + [44] SCREEN[idx#44] = assertType::t1#16 + [45] idx#20 = ++ idx#44 to:assertType::@return assertType::@return: scope:[assertType] from assertType::@2 - [44] return + [46] return to:@return assertType::@1: scope:[assertType] from assertType - [45] COLS[idx#42] = GREEN + [47] COLS[idx#44] = GREEN to:assertType::@2 diff --git a/src/test/ref/int-literals.log b/src/test/ref/int-literals.log index ee4f4a2a9..2a36b7f0a 100644 --- a/src/test/ref/int-literals.log +++ b/src/test/ref/int-literals.log @@ -13,38 +13,39 @@ Resolving typeid() testSimpleTypes::$22 = typeid $c Resolving typeid() testSimpleTypes::$24 = typeid $c Resolving typeid() testSimpleTypes::$26 = typeid $c Resolving typeid() testSimpleTypes::$28 = typeid $c +Resolving typeid() testSimpleTypes::$30 = typeid $c Inlined call call __init CONTROL FLOW GRAPH SSA void main() main: scope:[main] from __start::@1 - idx#52 = phi( __start::@1/idx#50 ) + idx#54 = phi( __start::@1/idx#52 ) main::s#0 = SCREEN to:main::@1 main::@1: scope:[main] from main main::@2 - idx#51 = phi( main/idx#52, main::@2/idx#53 ) + idx#53 = phi( main/idx#54, main::@2/idx#55 ) main::s#2 = phi( main/main::s#0, main::@2/main::s#1 ) main::$1 = main::s#2 < SCREEN+$3e8 if(main::$1) goto main::@2 to:main::@3 main::@2: scope:[main] from main::@1 - idx#53 = phi( main::@1/idx#51 ) + idx#55 = phi( main::@1/idx#53 ) main::s#3 = phi( main::@1/main::s#2 ) *main::s#3 = ' ' main::s#1 = ++ main::s#3 to:main::@1 main::@3: scope:[main] from main::@1 - idx#48 = phi( main::@1/idx#51 ) + idx#50 = phi( main::@1/idx#53 ) call testSimpleTypes to:main::@4 main::@4: scope:[main] from main::@3 - idx#24 = phi( main::@3/idx#18 ) - idx#0 = idx#24 + idx#25 = phi( main::@3/idx#19 ) + idx#0 = idx#25 to:main::@return main::@return: scope:[main] from main::@4 - idx#25 = phi( main::@4/idx#0 ) - idx#1 = idx#25 + idx#26 = phi( main::@4/idx#0 ) + idx#1 = idx#26 return to:@return @@ -57,154 +58,162 @@ testSimpleTypes: scope:[testSimpleTypes] from main::@3 call assertType to:testSimpleTypes::@1 testSimpleTypes::@1: scope:[testSimpleTypes] from testSimpleTypes - idx#26 = phi( testSimpleTypes/idx#20 ) - idx#3 = idx#26 + idx#27 = phi( testSimpleTypes/idx#21 ) + idx#3 = idx#27 testSimpleTypes::$2 = TYPEID_BYTE assertType::t1#1 = testSimpleTypes::$2 assertType::t2#1 = TYPEID_BYTE call assertType to:testSimpleTypes::@2 testSimpleTypes::@2: scope:[testSimpleTypes] from testSimpleTypes::@1 - idx#27 = phi( testSimpleTypes::@1/idx#20 ) - idx#4 = idx#27 + idx#28 = phi( testSimpleTypes::@1/idx#21 ) + idx#4 = idx#28 testSimpleTypes::$4 = TYPEID_SIGNED_BYTE assertType::t1#2 = testSimpleTypes::$4 assertType::t2#2 = TYPEID_SIGNED_BYTE call assertType to:testSimpleTypes::@3 testSimpleTypes::@3: scope:[testSimpleTypes] from testSimpleTypes::@2 - idx#28 = phi( testSimpleTypes::@2/idx#20 ) - idx#5 = idx#28 + idx#29 = phi( testSimpleTypes::@2/idx#21 ) + idx#5 = idx#29 testSimpleTypes::$6 = TYPEID_SIGNED_BYTE assertType::t1#3 = testSimpleTypes::$6 assertType::t2#3 = TYPEID_SIGNED_BYTE call assertType to:testSimpleTypes::@4 testSimpleTypes::@4: scope:[testSimpleTypes] from testSimpleTypes::@3 - idx#29 = phi( testSimpleTypes::@3/idx#20 ) - idx#6 = idx#29 + idx#30 = phi( testSimpleTypes::@3/idx#21 ) + idx#6 = idx#30 testSimpleTypes::$8 = TYPEID_WORD assertType::t1#4 = testSimpleTypes::$8 assertType::t2#4 = TYPEID_WORD call assertType to:testSimpleTypes::@5 testSimpleTypes::@5: scope:[testSimpleTypes] from testSimpleTypes::@4 - idx#30 = phi( testSimpleTypes::@4/idx#20 ) - idx#7 = idx#30 + idx#31 = phi( testSimpleTypes::@4/idx#21 ) + idx#7 = idx#31 testSimpleTypes::$10 = TYPEID_WORD assertType::t1#5 = testSimpleTypes::$10 assertType::t2#5 = TYPEID_WORD call assertType to:testSimpleTypes::@6 testSimpleTypes::@6: scope:[testSimpleTypes] from testSimpleTypes::@5 - idx#31 = phi( testSimpleTypes::@5/idx#20 ) - idx#8 = idx#31 + idx#32 = phi( testSimpleTypes::@5/idx#21 ) + idx#8 = idx#32 testSimpleTypes::$12 = TYPEID_WORD assertType::t1#6 = testSimpleTypes::$12 assertType::t2#6 = TYPEID_WORD call assertType to:testSimpleTypes::@7 testSimpleTypes::@7: scope:[testSimpleTypes] from testSimpleTypes::@6 - idx#32 = phi( testSimpleTypes::@6/idx#20 ) - idx#9 = idx#32 + idx#33 = phi( testSimpleTypes::@6/idx#21 ) + idx#9 = idx#33 testSimpleTypes::$14 = TYPEID_SIGNED_WORD assertType::t1#7 = testSimpleTypes::$14 assertType::t2#7 = TYPEID_SIGNED_WORD call assertType to:testSimpleTypes::@8 testSimpleTypes::@8: scope:[testSimpleTypes] from testSimpleTypes::@7 - idx#33 = phi( testSimpleTypes::@7/idx#20 ) - idx#10 = idx#33 + idx#34 = phi( testSimpleTypes::@7/idx#21 ) + idx#10 = idx#34 testSimpleTypes::$16 = TYPEID_SIGNED_WORD assertType::t1#8 = testSimpleTypes::$16 assertType::t2#8 = TYPEID_SIGNED_WORD call assertType to:testSimpleTypes::@9 testSimpleTypes::@9: scope:[testSimpleTypes] from testSimpleTypes::@8 - idx#34 = phi( testSimpleTypes::@8/idx#20 ) - idx#11 = idx#34 + idx#35 = phi( testSimpleTypes::@8/idx#21 ) + idx#11 = idx#35 testSimpleTypes::$18 = TYPEID_SIGNED_WORD assertType::t1#9 = testSimpleTypes::$18 assertType::t2#9 = TYPEID_SIGNED_WORD call assertType to:testSimpleTypes::@10 testSimpleTypes::@10: scope:[testSimpleTypes] from testSimpleTypes::@9 - idx#35 = phi( testSimpleTypes::@9/idx#20 ) - idx#12 = idx#35 + idx#36 = phi( testSimpleTypes::@9/idx#21 ) + idx#12 = idx#36 testSimpleTypes::$20 = TYPEID_DWORD assertType::t1#10 = testSimpleTypes::$20 assertType::t2#10 = TYPEID_DWORD call assertType to:testSimpleTypes::@11 testSimpleTypes::@11: scope:[testSimpleTypes] from testSimpleTypes::@10 - idx#36 = phi( testSimpleTypes::@10/idx#20 ) - idx#13 = idx#36 + idx#37 = phi( testSimpleTypes::@10/idx#21 ) + idx#13 = idx#37 testSimpleTypes::$22 = TYPEID_DWORD assertType::t1#11 = testSimpleTypes::$22 assertType::t2#11 = TYPEID_DWORD call assertType to:testSimpleTypes::@12 testSimpleTypes::@12: scope:[testSimpleTypes] from testSimpleTypes::@11 - idx#37 = phi( testSimpleTypes::@11/idx#20 ) - idx#14 = idx#37 + idx#38 = phi( testSimpleTypes::@11/idx#21 ) + idx#14 = idx#38 testSimpleTypes::$24 = TYPEID_SIGNED_DWORD assertType::t1#12 = testSimpleTypes::$24 assertType::t2#12 = TYPEID_SIGNED_DWORD call assertType to:testSimpleTypes::@13 testSimpleTypes::@13: scope:[testSimpleTypes] from testSimpleTypes::@12 - idx#38 = phi( testSimpleTypes::@12/idx#20 ) - idx#15 = idx#38 + idx#39 = phi( testSimpleTypes::@12/idx#21 ) + idx#15 = idx#39 testSimpleTypes::$26 = TYPEID_SIGNED_DWORD assertType::t1#13 = testSimpleTypes::$26 assertType::t2#13 = TYPEID_SIGNED_DWORD call assertType to:testSimpleTypes::@14 testSimpleTypes::@14: scope:[testSimpleTypes] from testSimpleTypes::@13 - idx#39 = phi( testSimpleTypes::@13/idx#20 ) - idx#16 = idx#39 + idx#40 = phi( testSimpleTypes::@13/idx#21 ) + idx#16 = idx#40 testSimpleTypes::$28 = TYPEID_SIGNED_DWORD assertType::t1#14 = testSimpleTypes::$28 assertType::t2#14 = TYPEID_SIGNED_DWORD call assertType to:testSimpleTypes::@15 testSimpleTypes::@15: scope:[testSimpleTypes] from testSimpleTypes::@14 - idx#40 = phi( testSimpleTypes::@14/idx#20 ) - idx#17 = idx#40 + idx#41 = phi( testSimpleTypes::@14/idx#21 ) + idx#17 = idx#41 + testSimpleTypes::$30 = TYPEID_WORD + assertType::t1#15 = testSimpleTypes::$30 + assertType::t2#15 = TYPEID_WORD + call assertType + to:testSimpleTypes::@16 +testSimpleTypes::@16: scope:[testSimpleTypes] from testSimpleTypes::@15 + idx#42 = phi( testSimpleTypes::@15/idx#21 ) + idx#18 = idx#42 to:testSimpleTypes::@return -testSimpleTypes::@return: scope:[testSimpleTypes] from testSimpleTypes::@15 - idx#41 = phi( testSimpleTypes::@15/idx#17 ) - idx#18 = idx#41 +testSimpleTypes::@return: scope:[testSimpleTypes] from testSimpleTypes::@16 + idx#43 = phi( testSimpleTypes::@16/idx#18 ) + idx#19 = idx#43 return to:@return void assertType(byte assertType::t1 , byte assertType::t2) -assertType: scope:[assertType] from testSimpleTypes testSimpleTypes::@1 testSimpleTypes::@10 testSimpleTypes::@11 testSimpleTypes::@12 testSimpleTypes::@13 testSimpleTypes::@14 testSimpleTypes::@2 testSimpleTypes::@3 testSimpleTypes::@4 testSimpleTypes::@5 testSimpleTypes::@6 testSimpleTypes::@7 testSimpleTypes::@8 testSimpleTypes::@9 - idx#49 = phi( testSimpleTypes/idx#2, testSimpleTypes::@1/idx#3, testSimpleTypes::@10/idx#12, testSimpleTypes::@11/idx#13, testSimpleTypes::@12/idx#14, testSimpleTypes::@13/idx#15, testSimpleTypes::@14/idx#16, testSimpleTypes::@2/idx#4, testSimpleTypes::@3/idx#5, testSimpleTypes::@4/idx#6, testSimpleTypes::@5/idx#7, testSimpleTypes::@6/idx#8, testSimpleTypes::@7/idx#9, testSimpleTypes::@8/idx#10, testSimpleTypes::@9/idx#11 ) - assertType::t2#15 = phi( testSimpleTypes/assertType::t2#0, testSimpleTypes::@1/assertType::t2#1, testSimpleTypes::@10/assertType::t2#10, testSimpleTypes::@11/assertType::t2#11, testSimpleTypes::@12/assertType::t2#12, testSimpleTypes::@13/assertType::t2#13, testSimpleTypes::@14/assertType::t2#14, testSimpleTypes::@2/assertType::t2#2, testSimpleTypes::@3/assertType::t2#3, testSimpleTypes::@4/assertType::t2#4, testSimpleTypes::@5/assertType::t2#5, testSimpleTypes::@6/assertType::t2#6, testSimpleTypes::@7/assertType::t2#7, testSimpleTypes::@8/assertType::t2#8, testSimpleTypes::@9/assertType::t2#9 ) - assertType::t1#15 = phi( testSimpleTypes/assertType::t1#0, testSimpleTypes::@1/assertType::t1#1, testSimpleTypes::@10/assertType::t1#10, testSimpleTypes::@11/assertType::t1#11, testSimpleTypes::@12/assertType::t1#12, testSimpleTypes::@13/assertType::t1#13, testSimpleTypes::@14/assertType::t1#14, testSimpleTypes::@2/assertType::t1#2, testSimpleTypes::@3/assertType::t1#3, testSimpleTypes::@4/assertType::t1#4, testSimpleTypes::@5/assertType::t1#5, testSimpleTypes::@6/assertType::t1#6, testSimpleTypes::@7/assertType::t1#7, testSimpleTypes::@8/assertType::t1#8, testSimpleTypes::@9/assertType::t1#9 ) - assertType::$0 = assertType::t1#15 == assertType::t2#15 +assertType: scope:[assertType] from testSimpleTypes testSimpleTypes::@1 testSimpleTypes::@10 testSimpleTypes::@11 testSimpleTypes::@12 testSimpleTypes::@13 testSimpleTypes::@14 testSimpleTypes::@15 testSimpleTypes::@2 testSimpleTypes::@3 testSimpleTypes::@4 testSimpleTypes::@5 testSimpleTypes::@6 testSimpleTypes::@7 testSimpleTypes::@8 testSimpleTypes::@9 + idx#51 = phi( testSimpleTypes/idx#2, testSimpleTypes::@1/idx#3, testSimpleTypes::@10/idx#12, testSimpleTypes::@11/idx#13, testSimpleTypes::@12/idx#14, testSimpleTypes::@13/idx#15, testSimpleTypes::@14/idx#16, testSimpleTypes::@15/idx#17, testSimpleTypes::@2/idx#4, testSimpleTypes::@3/idx#5, testSimpleTypes::@4/idx#6, testSimpleTypes::@5/idx#7, testSimpleTypes::@6/idx#8, testSimpleTypes::@7/idx#9, testSimpleTypes::@8/idx#10, testSimpleTypes::@9/idx#11 ) + assertType::t2#16 = phi( testSimpleTypes/assertType::t2#0, testSimpleTypes::@1/assertType::t2#1, testSimpleTypes::@10/assertType::t2#10, testSimpleTypes::@11/assertType::t2#11, testSimpleTypes::@12/assertType::t2#12, testSimpleTypes::@13/assertType::t2#13, testSimpleTypes::@14/assertType::t2#14, testSimpleTypes::@15/assertType::t2#15, testSimpleTypes::@2/assertType::t2#2, testSimpleTypes::@3/assertType::t2#3, testSimpleTypes::@4/assertType::t2#4, testSimpleTypes::@5/assertType::t2#5, testSimpleTypes::@6/assertType::t2#6, testSimpleTypes::@7/assertType::t2#7, testSimpleTypes::@8/assertType::t2#8, testSimpleTypes::@9/assertType::t2#9 ) + assertType::t1#16 = phi( testSimpleTypes/assertType::t1#0, testSimpleTypes::@1/assertType::t1#1, testSimpleTypes::@10/assertType::t1#10, testSimpleTypes::@11/assertType::t1#11, testSimpleTypes::@12/assertType::t1#12, testSimpleTypes::@13/assertType::t1#13, testSimpleTypes::@14/assertType::t1#14, testSimpleTypes::@15/assertType::t1#15, testSimpleTypes::@2/assertType::t1#2, testSimpleTypes::@3/assertType::t1#3, testSimpleTypes::@4/assertType::t1#4, testSimpleTypes::@5/assertType::t1#5, testSimpleTypes::@6/assertType::t1#6, testSimpleTypes::@7/assertType::t1#7, testSimpleTypes::@8/assertType::t1#8, testSimpleTypes::@9/assertType::t1#9 ) + assertType::$0 = assertType::t1#16 == assertType::t2#16 if(assertType::$0) goto assertType::@1 to:assertType::@3 assertType::@1: scope:[assertType] from assertType - assertType::t1#17 = phi( assertType/assertType::t1#15 ) - idx#42 = phi( assertType/idx#49 ) - COLS[idx#42] = GREEN + assertType::t1#18 = phi( assertType/assertType::t1#16 ) + idx#44 = phi( assertType/idx#51 ) + COLS[idx#44] = GREEN to:assertType::@2 assertType::@3: scope:[assertType] from assertType - assertType::t1#18 = phi( assertType/assertType::t1#15 ) - idx#43 = phi( assertType/idx#49 ) - COLS[idx#43] = RED + assertType::t1#19 = phi( assertType/assertType::t1#16 ) + idx#45 = phi( assertType/idx#51 ) + COLS[idx#45] = RED to:assertType::@2 assertType::@2: scope:[assertType] from assertType::@1 assertType::@3 - idx#44 = phi( assertType::@1/idx#42, assertType::@3/idx#43 ) - assertType::t1#16 = phi( assertType::@1/assertType::t1#17, assertType::@3/assertType::t1#18 ) - SCREEN[idx#44] = assertType::t1#16 - idx#19 = ++ idx#44 + idx#46 = phi( assertType::@1/idx#44, assertType::@3/idx#45 ) + assertType::t1#17 = phi( assertType::@1/assertType::t1#18, assertType::@3/assertType::t1#19 ) + SCREEN[idx#46] = assertType::t1#17 + idx#20 = ++ idx#46 to:assertType::@return assertType::@return: scope:[assertType] from assertType::@2 - idx#45 = phi( assertType::@2/idx#19 ) - idx#20 = idx#45 + idx#47 = phi( assertType::@2/idx#20 ) + idx#21 = idx#47 return to:@return @@ -212,19 +221,19 @@ void __start() __start: scope:[__start] from to:__start::__init1 __start::__init1: scope:[__start] from __start - idx#21 = 0 + idx#22 = 0 to:__start::@1 __start::@1: scope:[__start] from __start::__init1 - idx#50 = phi( __start::__init1/idx#21 ) + idx#52 = phi( __start::__init1/idx#22 ) call main to:__start::@2 __start::@2: scope:[__start] from __start::@1 - idx#46 = phi( __start::@1/idx#1 ) - idx#22 = idx#46 + idx#48 = phi( __start::@1/idx#1 ) + idx#23 = idx#48 to:__start::@return __start::@return: scope:[__start] from __start::@2 - idx#47 = phi( __start::@2/idx#22 ) - idx#23 = idx#47 + idx#49 = phi( __start::@2/idx#23 ) + idx#24 = idx#49 return to:@return @@ -254,6 +263,7 @@ byte assertType::t1#15 byte assertType::t1#16 byte assertType::t1#17 byte assertType::t1#18 +byte assertType::t1#19 byte assertType::t1#2 byte assertType::t1#3 byte assertType::t1#4 @@ -271,6 +281,7 @@ byte assertType::t2#12 byte assertType::t2#13 byte assertType::t2#14 byte assertType::t2#15 +byte assertType::t2#16 byte assertType::t2#2 byte assertType::t2#3 byte assertType::t2#4 @@ -330,6 +341,8 @@ byte idx#50 byte idx#51 byte idx#52 byte idx#53 +byte idx#54 +byte idx#55 byte idx#6 byte idx#7 byte idx#8 @@ -354,74 +367,78 @@ byte~ testSimpleTypes::$22 byte~ testSimpleTypes::$24 byte~ testSimpleTypes::$26 byte~ testSimpleTypes::$28 +byte~ testSimpleTypes::$30 byte~ testSimpleTypes::$4 byte~ testSimpleTypes::$6 byte~ testSimpleTypes::$8 Alias main::s#2 = main::s#3 -Alias idx#48 = idx#53 idx#51 -Alias idx#0 = idx#24 idx#25 idx#1 +Alias idx#50 = idx#55 idx#53 +Alias idx#0 = idx#25 idx#26 idx#1 Alias assertType::t1#0 = testSimpleTypes::$0 -Alias idx#26 = idx#3 +Alias idx#27 = idx#3 Alias assertType::t1#1 = testSimpleTypes::$2 -Alias idx#27 = idx#4 +Alias idx#28 = idx#4 Alias assertType::t1#2 = testSimpleTypes::$4 -Alias idx#28 = idx#5 +Alias idx#29 = idx#5 Alias assertType::t1#3 = testSimpleTypes::$6 -Alias idx#29 = idx#6 +Alias idx#30 = idx#6 Alias assertType::t1#4 = testSimpleTypes::$8 -Alias idx#30 = idx#7 +Alias idx#31 = idx#7 Alias assertType::t1#5 = testSimpleTypes::$10 -Alias idx#31 = idx#8 +Alias idx#32 = idx#8 Alias assertType::t1#6 = testSimpleTypes::$12 -Alias idx#32 = idx#9 +Alias idx#33 = idx#9 Alias assertType::t1#7 = testSimpleTypes::$14 -Alias idx#10 = idx#33 +Alias idx#10 = idx#34 Alias assertType::t1#8 = testSimpleTypes::$16 -Alias idx#11 = idx#34 +Alias idx#11 = idx#35 Alias assertType::t1#9 = testSimpleTypes::$18 -Alias idx#12 = idx#35 +Alias idx#12 = idx#36 Alias assertType::t1#10 = testSimpleTypes::$20 -Alias idx#13 = idx#36 +Alias idx#13 = idx#37 Alias assertType::t1#11 = testSimpleTypes::$22 -Alias idx#14 = idx#37 +Alias idx#14 = idx#38 Alias assertType::t1#12 = testSimpleTypes::$24 -Alias idx#15 = idx#38 +Alias idx#15 = idx#39 Alias assertType::t1#13 = testSimpleTypes::$26 -Alias idx#16 = idx#39 +Alias idx#16 = idx#40 Alias assertType::t1#14 = testSimpleTypes::$28 -Alias idx#17 = idx#40 idx#41 idx#18 -Alias idx#42 = idx#49 idx#43 -Alias assertType::t1#15 = assertType::t1#17 assertType::t1#18 -Alias idx#19 = idx#45 idx#20 -Alias idx#21 = idx#50 -Alias idx#22 = idx#46 idx#47 idx#23 +Alias idx#17 = idx#41 +Alias assertType::t1#15 = testSimpleTypes::$30 +Alias idx#18 = idx#42 idx#43 idx#19 +Alias idx#44 = idx#51 idx#45 +Alias assertType::t1#16 = assertType::t1#18 assertType::t1#19 +Alias idx#20 = idx#47 idx#21 +Alias idx#22 = idx#52 +Alias idx#23 = idx#48 idx#49 idx#24 Successful SSA optimization Pass2AliasElimination -Alias assertType::t1#15 = assertType::t1#16 -Alias idx#42 = idx#44 +Alias assertType::t1#16 = assertType::t1#17 +Alias idx#44 = idx#46 Successful SSA optimization Pass2AliasElimination -Identical Phi Values idx#52 idx#21 -Identical Phi Values idx#48 idx#52 -Identical Phi Values idx#0 idx#17 -Identical Phi Values idx#26 idx#19 -Identical Phi Values idx#27 idx#19 -Identical Phi Values idx#28 idx#19 -Identical Phi Values idx#29 idx#19 -Identical Phi Values idx#30 idx#19 -Identical Phi Values idx#31 idx#19 -Identical Phi Values idx#32 idx#19 -Identical Phi Values idx#10 idx#19 -Identical Phi Values idx#11 idx#19 -Identical Phi Values idx#12 idx#19 -Identical Phi Values idx#13 idx#19 -Identical Phi Values idx#14 idx#19 -Identical Phi Values idx#15 idx#19 -Identical Phi Values idx#16 idx#19 -Identical Phi Values idx#17 idx#19 -Identical Phi Values idx#22 idx#0 +Identical Phi Values idx#54 idx#22 +Identical Phi Values idx#50 idx#54 +Identical Phi Values idx#0 idx#18 +Identical Phi Values idx#27 idx#20 +Identical Phi Values idx#28 idx#20 +Identical Phi Values idx#29 idx#20 +Identical Phi Values idx#30 idx#20 +Identical Phi Values idx#31 idx#20 +Identical Phi Values idx#32 idx#20 +Identical Phi Values idx#33 idx#20 +Identical Phi Values idx#10 idx#20 +Identical Phi Values idx#11 idx#20 +Identical Phi Values idx#12 idx#20 +Identical Phi Values idx#13 idx#20 +Identical Phi Values idx#14 idx#20 +Identical Phi Values idx#15 idx#20 +Identical Phi Values idx#16 idx#20 +Identical Phi Values idx#17 idx#20 +Identical Phi Values idx#18 idx#20 +Identical Phi Values idx#23 idx#0 Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition main::$1 [4] if(main::s#2assertType] + // [41] phi from testSimpleTypes to assertType [phi:testSimpleTypes->assertType] assertType_from_testSimpleTypes: - // [39] phi idx#42 = 0 [phi:testSimpleTypes->assertType#0] -- vbuz1=vbuc1 + // [41] phi idx#44 = 0 [phi:testSimpleTypes->assertType#0] -- vbuz1=vbuc1 lda #0 sta.z idx - // [39] phi assertType::t2#15 = TYPEID_BYTE [phi:testSimpleTypes->assertType#1] -- vbuyy=vbuc1 + // [41] phi assertType::t2#16 = TYPEID_BYTE [phi:testSimpleTypes->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_BYTE - // [39] phi assertType::t1#15 = TYPEID_BYTE [phi:testSimpleTypes->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_BYTE [phi:testSimpleTypes->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_BYTE jsr assertType // [10] phi from testSimpleTypes to testSimpleTypes::@1 [phi:testSimpleTypes->testSimpleTypes::@1] @@ -851,12 +880,12 @@ testSimpleTypes: { // testSimpleTypes::@1 __b1: // [11] call assertType - // [39] phi from testSimpleTypes::@1 to assertType [phi:testSimpleTypes::@1->assertType] + // [41] phi from testSimpleTypes::@1 to assertType [phi:testSimpleTypes::@1->assertType] assertType_from___b1: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@1->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_BYTE [phi:testSimpleTypes::@1->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@1->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_BYTE [phi:testSimpleTypes::@1->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_BYTE - // [39] phi assertType::t1#15 = TYPEID_BYTE [phi:testSimpleTypes::@1->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_BYTE [phi:testSimpleTypes::@1->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_BYTE jsr assertType // [12] phi from testSimpleTypes::@1 to testSimpleTypes::@2 [phi:testSimpleTypes::@1->testSimpleTypes::@2] @@ -865,12 +894,12 @@ testSimpleTypes: { // testSimpleTypes::@2 __b2: // [13] call assertType - // [39] phi from testSimpleTypes::@2 to assertType [phi:testSimpleTypes::@2->assertType] + // [41] phi from testSimpleTypes::@2 to assertType [phi:testSimpleTypes::@2->assertType] assertType_from___b2: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@2->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@2->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@2->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@2->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_BYTE - // [39] phi assertType::t1#15 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@2->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@2->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_BYTE jsr assertType // [14] phi from testSimpleTypes::@2 to testSimpleTypes::@3 [phi:testSimpleTypes::@2->testSimpleTypes::@3] @@ -879,12 +908,12 @@ testSimpleTypes: { // testSimpleTypes::@3 __b3: // [15] call assertType - // [39] phi from testSimpleTypes::@3 to assertType [phi:testSimpleTypes::@3->assertType] + // [41] phi from testSimpleTypes::@3 to assertType [phi:testSimpleTypes::@3->assertType] assertType_from___b3: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@3->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@3->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@3->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@3->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_BYTE - // [39] phi assertType::t1#15 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@3->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@3->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_BYTE jsr assertType // [16] phi from testSimpleTypes::@3 to testSimpleTypes::@4 [phi:testSimpleTypes::@3->testSimpleTypes::@4] @@ -893,12 +922,12 @@ testSimpleTypes: { // testSimpleTypes::@4 __b4: // [17] call assertType - // [39] phi from testSimpleTypes::@4 to assertType [phi:testSimpleTypes::@4->assertType] + // [41] phi from testSimpleTypes::@4 to assertType [phi:testSimpleTypes::@4->assertType] assertType_from___b4: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@4->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_WORD [phi:testSimpleTypes::@4->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@4->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_WORD [phi:testSimpleTypes::@4->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_WORD - // [39] phi assertType::t1#15 = TYPEID_WORD [phi:testSimpleTypes::@4->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_WORD [phi:testSimpleTypes::@4->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_WORD jsr assertType // [18] phi from testSimpleTypes::@4 to testSimpleTypes::@5 [phi:testSimpleTypes::@4->testSimpleTypes::@5] @@ -907,12 +936,12 @@ testSimpleTypes: { // testSimpleTypes::@5 __b5: // [19] call assertType - // [39] phi from testSimpleTypes::@5 to assertType [phi:testSimpleTypes::@5->assertType] + // [41] phi from testSimpleTypes::@5 to assertType [phi:testSimpleTypes::@5->assertType] assertType_from___b5: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@5->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_WORD [phi:testSimpleTypes::@5->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@5->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_WORD [phi:testSimpleTypes::@5->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_WORD - // [39] phi assertType::t1#15 = TYPEID_WORD [phi:testSimpleTypes::@5->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_WORD [phi:testSimpleTypes::@5->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_WORD jsr assertType // [20] phi from testSimpleTypes::@5 to testSimpleTypes::@6 [phi:testSimpleTypes::@5->testSimpleTypes::@6] @@ -921,12 +950,12 @@ testSimpleTypes: { // testSimpleTypes::@6 __b6: // [21] call assertType - // [39] phi from testSimpleTypes::@6 to assertType [phi:testSimpleTypes::@6->assertType] + // [41] phi from testSimpleTypes::@6 to assertType [phi:testSimpleTypes::@6->assertType] assertType_from___b6: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@6->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_WORD [phi:testSimpleTypes::@6->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@6->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_WORD [phi:testSimpleTypes::@6->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_WORD - // [39] phi assertType::t1#15 = TYPEID_WORD [phi:testSimpleTypes::@6->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_WORD [phi:testSimpleTypes::@6->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_WORD jsr assertType // [22] phi from testSimpleTypes::@6 to testSimpleTypes::@7 [phi:testSimpleTypes::@6->testSimpleTypes::@7] @@ -935,12 +964,12 @@ testSimpleTypes: { // testSimpleTypes::@7 __b7: // [23] call assertType - // [39] phi from testSimpleTypes::@7 to assertType [phi:testSimpleTypes::@7->assertType] + // [41] phi from testSimpleTypes::@7 to assertType [phi:testSimpleTypes::@7->assertType] assertType_from___b7: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@7->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@7->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@7->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@7->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_WORD - // [39] phi assertType::t1#15 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@7->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@7->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_WORD jsr assertType // [24] phi from testSimpleTypes::@7 to testSimpleTypes::@8 [phi:testSimpleTypes::@7->testSimpleTypes::@8] @@ -949,12 +978,12 @@ testSimpleTypes: { // testSimpleTypes::@8 __b8: // [25] call assertType - // [39] phi from testSimpleTypes::@8 to assertType [phi:testSimpleTypes::@8->assertType] + // [41] phi from testSimpleTypes::@8 to assertType [phi:testSimpleTypes::@8->assertType] assertType_from___b8: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@8->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@8->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@8->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@8->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_WORD - // [39] phi assertType::t1#15 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@8->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@8->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_WORD jsr assertType // [26] phi from testSimpleTypes::@8 to testSimpleTypes::@9 [phi:testSimpleTypes::@8->testSimpleTypes::@9] @@ -963,12 +992,12 @@ testSimpleTypes: { // testSimpleTypes::@9 __b9: // [27] call assertType - // [39] phi from testSimpleTypes::@9 to assertType [phi:testSimpleTypes::@9->assertType] + // [41] phi from testSimpleTypes::@9 to assertType [phi:testSimpleTypes::@9->assertType] assertType_from___b9: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@9->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@9->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@9->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@9->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_WORD - // [39] phi assertType::t1#15 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@9->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@9->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_WORD jsr assertType // [28] phi from testSimpleTypes::@9 to testSimpleTypes::@10 [phi:testSimpleTypes::@9->testSimpleTypes::@10] @@ -977,12 +1006,12 @@ testSimpleTypes: { // testSimpleTypes::@10 __b10: // [29] call assertType - // [39] phi from testSimpleTypes::@10 to assertType [phi:testSimpleTypes::@10->assertType] + // [41] phi from testSimpleTypes::@10 to assertType [phi:testSimpleTypes::@10->assertType] assertType_from___b10: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@10->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_DWORD [phi:testSimpleTypes::@10->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@10->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_DWORD [phi:testSimpleTypes::@10->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_DWORD - // [39] phi assertType::t1#15 = TYPEID_DWORD [phi:testSimpleTypes::@10->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_DWORD [phi:testSimpleTypes::@10->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_DWORD jsr assertType // [30] phi from testSimpleTypes::@10 to testSimpleTypes::@11 [phi:testSimpleTypes::@10->testSimpleTypes::@11] @@ -991,12 +1020,12 @@ testSimpleTypes: { // testSimpleTypes::@11 __b11: // [31] call assertType - // [39] phi from testSimpleTypes::@11 to assertType [phi:testSimpleTypes::@11->assertType] + // [41] phi from testSimpleTypes::@11 to assertType [phi:testSimpleTypes::@11->assertType] assertType_from___b11: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@11->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_DWORD [phi:testSimpleTypes::@11->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@11->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_DWORD [phi:testSimpleTypes::@11->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_DWORD - // [39] phi assertType::t1#15 = TYPEID_DWORD [phi:testSimpleTypes::@11->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_DWORD [phi:testSimpleTypes::@11->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_DWORD jsr assertType // [32] phi from testSimpleTypes::@11 to testSimpleTypes::@12 [phi:testSimpleTypes::@11->testSimpleTypes::@12] @@ -1005,12 +1034,12 @@ testSimpleTypes: { // testSimpleTypes::@12 __b12: // [33] call assertType - // [39] phi from testSimpleTypes::@12 to assertType [phi:testSimpleTypes::@12->assertType] + // [41] phi from testSimpleTypes::@12 to assertType [phi:testSimpleTypes::@12->assertType] assertType_from___b12: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@12->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@12->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@12->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@12->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_DWORD - // [39] phi assertType::t1#15 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@12->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@12->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_DWORD jsr assertType // [34] phi from testSimpleTypes::@12 to testSimpleTypes::@13 [phi:testSimpleTypes::@12->testSimpleTypes::@13] @@ -1019,12 +1048,12 @@ testSimpleTypes: { // testSimpleTypes::@13 __b13: // [35] call assertType - // [39] phi from testSimpleTypes::@13 to assertType [phi:testSimpleTypes::@13->assertType] + // [41] phi from testSimpleTypes::@13 to assertType [phi:testSimpleTypes::@13->assertType] assertType_from___b13: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@13->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@13->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@13->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@13->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_DWORD - // [39] phi assertType::t1#15 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@13->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@13->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_DWORD jsr assertType // [36] phi from testSimpleTypes::@13 to testSimpleTypes::@14 [phi:testSimpleTypes::@13->testSimpleTypes::@14] @@ -1033,18 +1062,32 @@ testSimpleTypes: { // testSimpleTypes::@14 __b14: // [37] call assertType - // [39] phi from testSimpleTypes::@14 to assertType [phi:testSimpleTypes::@14->assertType] + // [41] phi from testSimpleTypes::@14 to assertType [phi:testSimpleTypes::@14->assertType] assertType_from___b14: - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@14->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@14->assertType#1] -- vbuyy=vbuc1 + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@14->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@14->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_DWORD - // [39] phi assertType::t1#15 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@14->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@14->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_DWORD jsr assertType + // [38] phi from testSimpleTypes::@14 to testSimpleTypes::@15 [phi:testSimpleTypes::@14->testSimpleTypes::@15] + __b15_from___b14: + jmp __b15 + // testSimpleTypes::@15 + __b15: + // [39] call assertType + // [41] phi from testSimpleTypes::@15 to assertType [phi:testSimpleTypes::@15->assertType] + assertType_from___b15: + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@15->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_WORD [phi:testSimpleTypes::@15->assertType#1] -- vbuyy=vbuc1 + ldy #TYPEID_WORD + // [41] phi assertType::t1#16 = TYPEID_WORD [phi:testSimpleTypes::@15->assertType#2] -- vbuxx=vbuc1 + ldx #TYPEID_WORD + jsr assertType jmp __breturn // testSimpleTypes::@return __breturn: - // [38] return + // [40] return rts } // assertType @@ -1053,34 +1096,34 @@ testSimpleTypes: { // If they are equal the letter is green - if not it is red. // assertType(byte register(X) t1, byte register(Y) t2) assertType: { - // [40] if(assertType::t1#15==assertType::t2#15) goto assertType::@1 -- vbuxx_eq_vbuyy_then_la1 + // [42] if(assertType::t1#16==assertType::t2#16) goto assertType::@1 -- vbuxx_eq_vbuyy_then_la1 sty.z $ff cpx.z $ff beq __b1 jmp __b3 // assertType::@3 __b3: - // [41] COLS[idx#42] = RED -- pbuc1_derefidx_vbuz1=vbuc2 + // [43] COLS[idx#44] = RED -- pbuc1_derefidx_vbuz1=vbuc2 lda #RED ldy.z idx sta COLS,y jmp __b2 // assertType::@2 __b2: - // [42] SCREEN[idx#42] = assertType::t1#15 -- pbuc1_derefidx_vbuz1=vbuxx + // [44] SCREEN[idx#44] = assertType::t1#16 -- pbuc1_derefidx_vbuz1=vbuxx ldy.z idx txa sta SCREEN,y - // [43] idx#19 = ++ idx#42 -- vbuz1=_inc_vbuz1 + // [45] idx#20 = ++ idx#44 -- vbuz1=_inc_vbuz1 inc.z idx jmp __breturn // assertType::@return __breturn: - // [44] return + // [46] return rts // assertType::@1 __b1: - // [45] COLS[idx#42] = GREEN -- pbuc1_derefidx_vbuz1=vbuc2 + // [47] COLS[idx#44] = GREEN -- pbuc1_derefidx_vbuz1=vbuc2 lda #GREEN ldy.z idx sta COLS,y @@ -1106,6 +1149,7 @@ Removing instruction jmp __b11 Removing instruction jmp __b12 Removing instruction jmp __b13 Removing instruction jmp __b14 +Removing instruction jmp __b15 Removing instruction jmp __breturn Removing instruction jmp __b3 Removing instruction jmp __b2 @@ -1141,6 +1185,8 @@ Removing instruction __b13_from___b12: Removing instruction assertType_from___b13: Removing instruction __b14_from___b13: Removing instruction assertType_from___b14: +Removing instruction __b15_from___b14: +Removing instruction assertType_from___b15: Succesful ASM optimization Pass5RedundantLabelElimination Removing instruction __b1_from_main: Removing instruction __b3: @@ -1161,6 +1207,7 @@ Removing instruction __b11: Removing instruction __b12: Removing instruction __b13: Removing instruction __b14: +Removing instruction __b15: Removing instruction __breturn: Removing instruction __b3: Removing instruction __breturn: @@ -1179,12 +1226,12 @@ constant byte TYPEID_SIGNED_WORD = 4 constant byte TYPEID_WORD = 3 void assertType(byte assertType::t1 , byte assertType::t2) byte assertType::t1 -byte assertType::t1#15 reg byte x 50.5 +byte assertType::t1#16 reg byte x 50.5 byte assertType::t2 -byte assertType::t2#15 reg byte y 101.0 +byte assertType::t2#16 reg byte y 101.0 byte idx -byte idx#19 idx zp[1]:4 8.499999999999998 -byte idx#42 idx zp[1]:4 111.6 +byte idx#20 idx zp[1]:4 8.3125 +byte idx#44 idx zp[1]:4 113.8 void main() byte* main::s byte* main::s#1 s zp[2]:2 22.0 @@ -1192,13 +1239,13 @@ byte* main::s#2 s zp[2]:2 14.666666666666666 void testSimpleTypes() zp[2]:2 [ main::s#2 main::s#1 ] -reg byte x [ assertType::t1#15 ] -reg byte y [ assertType::t2#15 ] -zp[1]:4 [ idx#42 idx#19 ] +reg byte x [ assertType::t1#16 ] +reg byte y [ assertType::t2#16 ] +zp[1]:4 [ idx#44 idx#20 ] FINAL ASSEMBLER -Score: 755 +Score: 765 // File Comments // Tests different integer literal types @@ -1277,172 +1324,183 @@ testSimpleTypes: { // assertType(typeid(12ub), typeid(unsigned byte)) // [9] call assertType // Simple types - // [39] phi from testSimpleTypes to assertType [phi:testSimpleTypes->assertType] - // [39] phi idx#42 = 0 [phi:testSimpleTypes->assertType#0] -- vbuz1=vbuc1 + // [41] phi from testSimpleTypes to assertType [phi:testSimpleTypes->assertType] + // [41] phi idx#44 = 0 [phi:testSimpleTypes->assertType#0] -- vbuz1=vbuc1 lda #0 sta.z idx - // [39] phi assertType::t2#15 = TYPEID_BYTE [phi:testSimpleTypes->assertType#1] -- vbuyy=vbuc1 + // [41] phi assertType::t2#16 = TYPEID_BYTE [phi:testSimpleTypes->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_BYTE - // [39] phi assertType::t1#15 = TYPEID_BYTE [phi:testSimpleTypes->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_BYTE [phi:testSimpleTypes->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_BYTE jsr assertType // [10] phi from testSimpleTypes to testSimpleTypes::@1 [phi:testSimpleTypes->testSimpleTypes::@1] // testSimpleTypes::@1 // assertType(typeid(12uc), typeid(unsigned byte)) // [11] call assertType - // [39] phi from testSimpleTypes::@1 to assertType [phi:testSimpleTypes::@1->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@1->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_BYTE [phi:testSimpleTypes::@1->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@1 to assertType [phi:testSimpleTypes::@1->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@1->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_BYTE [phi:testSimpleTypes::@1->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_BYTE - // [39] phi assertType::t1#15 = TYPEID_BYTE [phi:testSimpleTypes::@1->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_BYTE [phi:testSimpleTypes::@1->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_BYTE jsr assertType // [12] phi from testSimpleTypes::@1 to testSimpleTypes::@2 [phi:testSimpleTypes::@1->testSimpleTypes::@2] // testSimpleTypes::@2 // assertType(typeid(12sb), typeid(signed byte)) // [13] call assertType - // [39] phi from testSimpleTypes::@2 to assertType [phi:testSimpleTypes::@2->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@2->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@2->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@2 to assertType [phi:testSimpleTypes::@2->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@2->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@2->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_BYTE - // [39] phi assertType::t1#15 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@2->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@2->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_BYTE jsr assertType // [14] phi from testSimpleTypes::@2 to testSimpleTypes::@3 [phi:testSimpleTypes::@2->testSimpleTypes::@3] // testSimpleTypes::@3 // assertType(typeid(12sc), typeid(signed byte)) // [15] call assertType - // [39] phi from testSimpleTypes::@3 to assertType [phi:testSimpleTypes::@3->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@3->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@3->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@3 to assertType [phi:testSimpleTypes::@3->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@3->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@3->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_BYTE - // [39] phi assertType::t1#15 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@3->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_BYTE [phi:testSimpleTypes::@3->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_BYTE jsr assertType // [16] phi from testSimpleTypes::@3 to testSimpleTypes::@4 [phi:testSimpleTypes::@3->testSimpleTypes::@4] // testSimpleTypes::@4 // assertType(typeid(12uw), typeid(unsigned word)) // [17] call assertType - // [39] phi from testSimpleTypes::@4 to assertType [phi:testSimpleTypes::@4->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@4->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_WORD [phi:testSimpleTypes::@4->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@4 to assertType [phi:testSimpleTypes::@4->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@4->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_WORD [phi:testSimpleTypes::@4->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_WORD - // [39] phi assertType::t1#15 = TYPEID_WORD [phi:testSimpleTypes::@4->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_WORD [phi:testSimpleTypes::@4->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_WORD jsr assertType // [18] phi from testSimpleTypes::@4 to testSimpleTypes::@5 [phi:testSimpleTypes::@4->testSimpleTypes::@5] // testSimpleTypes::@5 // assertType(typeid(12ui), typeid(unsigned word)) // [19] call assertType - // [39] phi from testSimpleTypes::@5 to assertType [phi:testSimpleTypes::@5->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@5->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_WORD [phi:testSimpleTypes::@5->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@5 to assertType [phi:testSimpleTypes::@5->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@5->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_WORD [phi:testSimpleTypes::@5->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_WORD - // [39] phi assertType::t1#15 = TYPEID_WORD [phi:testSimpleTypes::@5->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_WORD [phi:testSimpleTypes::@5->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_WORD jsr assertType // [20] phi from testSimpleTypes::@5 to testSimpleTypes::@6 [phi:testSimpleTypes::@5->testSimpleTypes::@6] // testSimpleTypes::@6 // assertType(typeid(12us), typeid(unsigned word)) // [21] call assertType - // [39] phi from testSimpleTypes::@6 to assertType [phi:testSimpleTypes::@6->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@6->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_WORD [phi:testSimpleTypes::@6->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@6 to assertType [phi:testSimpleTypes::@6->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@6->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_WORD [phi:testSimpleTypes::@6->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_WORD - // [39] phi assertType::t1#15 = TYPEID_WORD [phi:testSimpleTypes::@6->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_WORD [phi:testSimpleTypes::@6->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_WORD jsr assertType // [22] phi from testSimpleTypes::@6 to testSimpleTypes::@7 [phi:testSimpleTypes::@6->testSimpleTypes::@7] // testSimpleTypes::@7 // assertType(typeid(12sw), typeid(signed word)) // [23] call assertType - // [39] phi from testSimpleTypes::@7 to assertType [phi:testSimpleTypes::@7->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@7->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@7->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@7 to assertType [phi:testSimpleTypes::@7->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@7->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@7->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_WORD - // [39] phi assertType::t1#15 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@7->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@7->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_WORD jsr assertType // [24] phi from testSimpleTypes::@7 to testSimpleTypes::@8 [phi:testSimpleTypes::@7->testSimpleTypes::@8] // testSimpleTypes::@8 // assertType(typeid(12si), typeid(signed word)) // [25] call assertType - // [39] phi from testSimpleTypes::@8 to assertType [phi:testSimpleTypes::@8->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@8->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@8->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@8 to assertType [phi:testSimpleTypes::@8->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@8->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@8->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_WORD - // [39] phi assertType::t1#15 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@8->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@8->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_WORD jsr assertType // [26] phi from testSimpleTypes::@8 to testSimpleTypes::@9 [phi:testSimpleTypes::@8->testSimpleTypes::@9] // testSimpleTypes::@9 // assertType(typeid(12ss), typeid(signed word)) // [27] call assertType - // [39] phi from testSimpleTypes::@9 to assertType [phi:testSimpleTypes::@9->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@9->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@9->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@9 to assertType [phi:testSimpleTypes::@9->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@9->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@9->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_WORD - // [39] phi assertType::t1#15 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@9->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_WORD [phi:testSimpleTypes::@9->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_WORD jsr assertType // [28] phi from testSimpleTypes::@9 to testSimpleTypes::@10 [phi:testSimpleTypes::@9->testSimpleTypes::@10] // testSimpleTypes::@10 // assertType(typeid(12ud), typeid(unsigned dword)) // [29] call assertType - // [39] phi from testSimpleTypes::@10 to assertType [phi:testSimpleTypes::@10->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@10->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_DWORD [phi:testSimpleTypes::@10->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@10 to assertType [phi:testSimpleTypes::@10->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@10->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_DWORD [phi:testSimpleTypes::@10->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_DWORD - // [39] phi assertType::t1#15 = TYPEID_DWORD [phi:testSimpleTypes::@10->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_DWORD [phi:testSimpleTypes::@10->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_DWORD jsr assertType // [30] phi from testSimpleTypes::@10 to testSimpleTypes::@11 [phi:testSimpleTypes::@10->testSimpleTypes::@11] // testSimpleTypes::@11 // assertType(typeid(12ul), typeid(unsigned dword)) // [31] call assertType - // [39] phi from testSimpleTypes::@11 to assertType [phi:testSimpleTypes::@11->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@11->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_DWORD [phi:testSimpleTypes::@11->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@11 to assertType [phi:testSimpleTypes::@11->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@11->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_DWORD [phi:testSimpleTypes::@11->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_DWORD - // [39] phi assertType::t1#15 = TYPEID_DWORD [phi:testSimpleTypes::@11->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_DWORD [phi:testSimpleTypes::@11->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_DWORD jsr assertType // [32] phi from testSimpleTypes::@11 to testSimpleTypes::@12 [phi:testSimpleTypes::@11->testSimpleTypes::@12] // testSimpleTypes::@12 // assertType(typeid(12sd), typeid(signed dword)) // [33] call assertType - // [39] phi from testSimpleTypes::@12 to assertType [phi:testSimpleTypes::@12->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@12->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@12->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@12 to assertType [phi:testSimpleTypes::@12->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@12->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@12->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_DWORD - // [39] phi assertType::t1#15 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@12->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@12->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_DWORD jsr assertType // [34] phi from testSimpleTypes::@12 to testSimpleTypes::@13 [phi:testSimpleTypes::@12->testSimpleTypes::@13] // testSimpleTypes::@13 // assertType(typeid(12sl), typeid(signed dword)) // [35] call assertType - // [39] phi from testSimpleTypes::@13 to assertType [phi:testSimpleTypes::@13->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@13->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@13->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@13 to assertType [phi:testSimpleTypes::@13->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@13->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@13->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_DWORD - // [39] phi assertType::t1#15 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@13->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@13->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_DWORD jsr assertType // [36] phi from testSimpleTypes::@13 to testSimpleTypes::@14 [phi:testSimpleTypes::@13->testSimpleTypes::@14] // testSimpleTypes::@14 // assertType(typeid(12l), typeid(signed dword)) // [37] call assertType - // [39] phi from testSimpleTypes::@14 to assertType [phi:testSimpleTypes::@14->assertType] - // [39] phi idx#42 = idx#19 [phi:testSimpleTypes::@14->assertType#0] -- register_copy - // [39] phi assertType::t2#15 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@14->assertType#1] -- vbuyy=vbuc1 + // [41] phi from testSimpleTypes::@14 to assertType [phi:testSimpleTypes::@14->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@14->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@14->assertType#1] -- vbuyy=vbuc1 ldy #TYPEID_SIGNED_DWORD - // [39] phi assertType::t1#15 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@14->assertType#2] -- vbuxx=vbuc1 + // [41] phi assertType::t1#16 = TYPEID_SIGNED_DWORD [phi:testSimpleTypes::@14->assertType#2] -- vbuxx=vbuc1 ldx #TYPEID_SIGNED_DWORD jsr assertType + // [38] phi from testSimpleTypes::@14 to testSimpleTypes::@15 [phi:testSimpleTypes::@14->testSimpleTypes::@15] + // testSimpleTypes::@15 + // assertType(typeid(12u), typeid(unsigned word)) + // [39] call assertType + // [41] phi from testSimpleTypes::@15 to assertType [phi:testSimpleTypes::@15->assertType] + // [41] phi idx#44 = idx#20 [phi:testSimpleTypes::@15->assertType#0] -- register_copy + // [41] phi assertType::t2#16 = TYPEID_WORD [phi:testSimpleTypes::@15->assertType#1] -- vbuyy=vbuc1 + ldy #TYPEID_WORD + // [41] phi assertType::t1#16 = TYPEID_WORD [phi:testSimpleTypes::@15->assertType#2] -- vbuxx=vbuc1 + ldx #TYPEID_WORD + jsr assertType // testSimpleTypes::@return // } - // [38] return + // [40] return rts } // assertType @@ -1452,34 +1510,34 @@ testSimpleTypes: { // assertType(byte register(X) t1, byte register(Y) t2) assertType: { // if(t1==t2) - // [40] if(assertType::t1#15==assertType::t2#15) goto assertType::@1 -- vbuxx_eq_vbuyy_then_la1 + // [42] if(assertType::t1#16==assertType::t2#16) goto assertType::@1 -- vbuxx_eq_vbuyy_then_la1 sty.z $ff cpx.z $ff beq __b1 // assertType::@3 // COLS[idx] = RED - // [41] COLS[idx#42] = RED -- pbuc1_derefidx_vbuz1=vbuc2 + // [43] COLS[idx#44] = RED -- pbuc1_derefidx_vbuz1=vbuc2 lda #RED ldy.z idx sta COLS,y // assertType::@2 __b2: // SCREEN[idx++] = t1 - // [42] SCREEN[idx#42] = assertType::t1#15 -- pbuc1_derefidx_vbuz1=vbuxx + // [44] SCREEN[idx#44] = assertType::t1#16 -- pbuc1_derefidx_vbuz1=vbuxx ldy.z idx txa sta SCREEN,y // SCREEN[idx++] = t1; - // [43] idx#19 = ++ idx#42 -- vbuz1=_inc_vbuz1 + // [45] idx#20 = ++ idx#44 -- vbuz1=_inc_vbuz1 inc.z idx // assertType::@return // } - // [44] return + // [46] return rts // assertType::@1 __b1: // COLS[idx] = GREEN - // [45] COLS[idx#42] = GREEN -- pbuc1_derefidx_vbuz1=vbuc2 + // [47] COLS[idx#44] = GREEN -- pbuc1_derefidx_vbuz1=vbuc2 lda #GREEN ldy.z idx sta COLS,y diff --git a/src/test/ref/int-literals.sym b/src/test/ref/int-literals.sym index 7f7f6a558..83b2c1164 100644 --- a/src/test/ref/int-literals.sym +++ b/src/test/ref/int-literals.sym @@ -10,12 +10,12 @@ constant byte TYPEID_SIGNED_WORD = 4 constant byte TYPEID_WORD = 3 void assertType(byte assertType::t1 , byte assertType::t2) byte assertType::t1 -byte assertType::t1#15 reg byte x 50.5 +byte assertType::t1#16 reg byte x 50.5 byte assertType::t2 -byte assertType::t2#15 reg byte y 101.0 +byte assertType::t2#16 reg byte y 101.0 byte idx -byte idx#19 idx zp[1]:4 8.499999999999998 -byte idx#42 idx zp[1]:4 111.6 +byte idx#20 idx zp[1]:4 8.3125 +byte idx#44 idx zp[1]:4 113.8 void main() byte* main::s byte* main::s#1 s zp[2]:2 22.0 @@ -23,6 +23,6 @@ byte* main::s#2 s zp[2]:2 14.666666666666666 void testSimpleTypes() zp[2]:2 [ main::s#2 main::s#1 ] -reg byte x [ assertType::t1#15 ] -reg byte y [ assertType::t2#15 ] -zp[1]:4 [ idx#42 idx#19 ] +reg byte x [ assertType::t1#16 ] +reg byte y [ assertType::t2#16 ] +zp[1]:4 [ idx#44 idx#20 ] diff --git a/src/test/ref/typemismatch.asm b/src/test/ref/typemismatch.asm index 7afa44f0f..512c436c4 100644 --- a/src/test/ref/typemismatch.asm +++ b/src/test/ref/typemismatch.asm @@ -1,12 +1,20 @@ // Type mismatch - should fail gracefully -.pc = $801 "Basic" + // Commodore 64 PRG executable file +.file [name="typemismatch.prg", type="prg", segments="Program"] +.segmentdef Program [segments="Basic, Code, Data"] +.segmentdef Basic [start=$0801] +.segmentdef Code [start=$80d] +.segmentdef Data [startAfter="Code"] +.segment Basic :BasicUpstart(main) -.pc = $80d "Program" +.segment Code main: { - .label screen = $400 .const w = $1388 .const b = $ff&w + .label screen = $400 + // screen[0] = b lda #b sta screen + // } rts }