mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-06-29 09:29:31 +00:00
150 lines
3.4 KiB
Plaintext
150 lines
3.4 KiB
Plaintext
|
|
CONTROL FLOW GRAPH SSA
|
|
|
|
void main()
|
|
main: scope:[main] from __start
|
|
*main::SCREEN = main::letter
|
|
to:main::@return
|
|
main::@return: scope:[main] from main
|
|
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
|
|
constant byte B = 'b'
|
|
constant byte Letter::A = 'a'
|
|
constant byte Letter::B = 'b'
|
|
constant byte Letter::C = 'b'+1
|
|
void __start()
|
|
void main()
|
|
constant byte* const main::SCREEN = (byte*)$400
|
|
constant byte main::letter = B
|
|
|
|
Simplifying constant pointer cast (byte*) 1024
|
|
Successful SSA optimization PassNCastSimplification
|
|
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
|
|
Constant inlined main::letter = B
|
|
Successful SSA optimization Pass2ConstantInlining
|
|
CALL GRAPH
|
|
|
|
Created 0 initial phi equivalence classes
|
|
Coalesced down to 0 phi equivalence classes
|
|
|
|
FINAL CONTROL FLOW GRAPH
|
|
|
|
void main()
|
|
main: scope:[main] from
|
|
[0] *main::SCREEN = B
|
|
to:main::@return
|
|
main::@return: scope:[main] from main
|
|
[1] return
|
|
to:@return
|
|
|
|
|
|
VARIABLE REGISTER WEIGHTS
|
|
void main()
|
|
|
|
Initial phi equivalence classes
|
|
Complete equivalence classes
|
|
REGISTER UPLIFT POTENTIAL REGISTERS
|
|
Statement [0] *main::SCREEN = B [ ] ( [ ] { } ) always clobbers reg byte a
|
|
|
|
REGISTER UPLIFT SCOPES
|
|
Uplift Scope [Letter]
|
|
Uplift Scope [main]
|
|
Uplift Scope []
|
|
|
|
Uplifting [Letter] best 15 combination
|
|
Uplifting [main] best 15 combination
|
|
Uplifting [] best 15 combination
|
|
|
|
ASSEMBLER BEFORE OPTIMIZATION
|
|
// File Comments
|
|
// Test of simple enum - char values with increment
|
|
// Upstart
|
|
// Commodore 64 PRG executable file
|
|
.file [name="enum-2.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
|
|
.const B = 'b'
|
|
.segment Code
|
|
// main
|
|
main: {
|
|
.label SCREEN = $400
|
|
// [0] *main::SCREEN = B -- _deref_pbuc1=vbuc2
|
|
lda #B
|
|
sta SCREEN
|
|
jmp __breturn
|
|
// main::@return
|
|
__breturn:
|
|
// [1] return
|
|
rts
|
|
}
|
|
// File Data
|
|
|
|
ASSEMBLER OPTIMIZATIONS
|
|
Removing instruction jmp __breturn
|
|
Succesful ASM optimization Pass5NextJumpElimination
|
|
Removing instruction __breturn:
|
|
Succesful ASM optimization Pass5UnusedLabelElimination
|
|
|
|
FINAL SYMBOL TABLE
|
|
constant byte B = 'b'
|
|
constant byte Letter::A = 'a'
|
|
constant byte Letter::B = 'b'
|
|
constant byte Letter::C = 'b'+1
|
|
void main()
|
|
constant byte* const main::SCREEN = (byte*) 1024
|
|
|
|
|
|
|
|
FINAL ASSEMBLER
|
|
Score: 12
|
|
|
|
// File Comments
|
|
// Test of simple enum - char values with increment
|
|
// Upstart
|
|
// Commodore 64 PRG executable file
|
|
.file [name="enum-2.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
|
|
.const B = 'b'
|
|
.segment Code
|
|
// main
|
|
main: {
|
|
.label SCREEN = $400
|
|
// *SCREEN = letter
|
|
// [0] *main::SCREEN = B -- _deref_pbuc1=vbuc2
|
|
lda #B
|
|
sta SCREEN
|
|
// main::@return
|
|
// }
|
|
// [1] return
|
|
rts
|
|
}
|
|
// File Data
|
|
|