mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-09-29 03:56:15 +00:00
195 lines
5.2 KiB
Plaintext
195 lines
5.2 KiB
Plaintext
|
|
CONTROL FLOW GRAPH SSA
|
|
|
|
(void()) main()
|
|
main: scope:[main] from _start
|
|
*((const nomodify byte*) BODY1) ← (byte) '*'
|
|
*((const nomodify byte*) BODY2) ← (byte) '*'
|
|
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
|
|
(const nomodify byte*) BODY1 = (const nomodify byte*) SCREEN+(const nomodify byte) MARGIN_TOP*(const nomodify byte) LINE_LEN+(const nomodify byte) MARGIN_LEFT
|
|
(const nomodify byte*) BODY2 = (const nomodify byte*) SCREEN+(const nomodify word) OFFSET
|
|
(const nomodify byte) LINE_LEN = (byte) $28
|
|
(const nomodify byte) MARGIN_LEFT = (byte) 4
|
|
(const nomodify byte) MARGIN_TOP = (byte) 4
|
|
(const nomodify word) OFFSET = (word)(number) $28*(number) 5+(number) 5
|
|
(const nomodify byte*) SCREEN = (byte*)(number) $400
|
|
(void()) _start()
|
|
(label) _start::@1
|
|
(label) _start::@return
|
|
(void()) main()
|
|
(label) main::@return
|
|
|
|
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
|
|
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] *((const nomodify byte*) BODY1) ← (byte) '*'
|
|
[1] *((const nomodify byte*) BODY2) ← (byte) '*'
|
|
to:main::@return
|
|
main::@return: scope:[main] from main
|
|
[2] return
|
|
to:@return
|
|
|
|
|
|
VARIABLE REGISTER WEIGHTS
|
|
(void()) main()
|
|
|
|
Initial phi equivalence classes
|
|
Complete equivalence classes
|
|
|
|
INITIAL ASM
|
|
Target platform is c64basic / MOS6502X
|
|
// File Comments
|
|
// Tests a number of constant declarations
|
|
// Upstart
|
|
.pc = $801 "Basic"
|
|
:BasicUpstart(main)
|
|
.pc = $80d "Program"
|
|
// Global Constants & labels
|
|
.const LINE_LEN = $28
|
|
.const MARGIN_TOP = 4
|
|
.const MARGIN_LEFT = 4
|
|
.const OFFSET = $28*5+5
|
|
.label SCREEN = $400
|
|
.label BODY1 = SCREEN+MARGIN_TOP*LINE_LEN+MARGIN_LEFT
|
|
.label BODY2 = SCREEN+OFFSET
|
|
// main
|
|
main: {
|
|
// [0] *((const nomodify byte*) BODY1) ← (byte) '*' -- _deref_pbuc1=vbuc2
|
|
lda #'*'
|
|
sta BODY1
|
|
// [1] *((const nomodify byte*) BODY2) ← (byte) '*' -- _deref_pbuc1=vbuc2
|
|
lda #'*'
|
|
sta BODY2
|
|
jmp __breturn
|
|
// main::@return
|
|
__breturn:
|
|
// [2] return
|
|
rts
|
|
}
|
|
// File Data
|
|
|
|
REGISTER UPLIFT POTENTIAL REGISTERS
|
|
Statement [0] *((const nomodify byte*) BODY1) ← (byte) '*' [ ] ( [ ] { } ) always clobbers reg byte a
|
|
Statement [1] *((const nomodify byte*) BODY2) ← (byte) '*' [ ] ( [ ] { } ) always clobbers reg byte a
|
|
|
|
REGISTER UPLIFT SCOPES
|
|
Uplift Scope [main]
|
|
Uplift Scope []
|
|
|
|
Uplifting [main] best 21 combination
|
|
Uplifting [] best 21 combination
|
|
|
|
ASSEMBLER BEFORE OPTIMIZATION
|
|
// File Comments
|
|
// Tests a number of constant declarations
|
|
// Upstart
|
|
.pc = $801 "Basic"
|
|
:BasicUpstart(main)
|
|
.pc = $80d "Program"
|
|
// Global Constants & labels
|
|
.const LINE_LEN = $28
|
|
.const MARGIN_TOP = 4
|
|
.const MARGIN_LEFT = 4
|
|
.const OFFSET = $28*5+5
|
|
.label SCREEN = $400
|
|
.label BODY1 = SCREEN+MARGIN_TOP*LINE_LEN+MARGIN_LEFT
|
|
.label BODY2 = SCREEN+OFFSET
|
|
// main
|
|
main: {
|
|
// [0] *((const nomodify byte*) BODY1) ← (byte) '*' -- _deref_pbuc1=vbuc2
|
|
lda #'*'
|
|
sta BODY1
|
|
// [1] *((const nomodify byte*) BODY2) ← (byte) '*' -- _deref_pbuc1=vbuc2
|
|
lda #'*'
|
|
sta BODY2
|
|
jmp __breturn
|
|
// main::@return
|
|
__breturn:
|
|
// [2] return
|
|
rts
|
|
}
|
|
// File Data
|
|
|
|
ASSEMBLER OPTIMIZATIONS
|
|
Removing instruction jmp __breturn
|
|
Succesful ASM optimization Pass5NextJumpElimination
|
|
Removing instruction lda #'*'
|
|
Succesful ASM optimization Pass5UnnecesaryLoadElimination
|
|
Removing instruction __breturn:
|
|
Succesful ASM optimization Pass5UnusedLabelElimination
|
|
|
|
FINAL SYMBOL TABLE
|
|
(const nomodify byte*) BODY1 = (const nomodify byte*) SCREEN+(const nomodify byte) MARGIN_TOP*(const nomodify byte) LINE_LEN+(const nomodify byte) MARGIN_LEFT
|
|
(const nomodify byte*) BODY2 = (const nomodify byte*) SCREEN+(const nomodify word) OFFSET
|
|
(const nomodify byte) LINE_LEN = (byte) $28
|
|
(const nomodify byte) MARGIN_LEFT = (byte) 4
|
|
(const nomodify byte) MARGIN_TOP = (byte) 4
|
|
(const nomodify word) OFFSET = (word)(number) $28*(number) 5+(number) 5
|
|
(const nomodify byte*) SCREEN = (byte*) 1024
|
|
(void()) main()
|
|
(label) main::@return
|
|
|
|
|
|
|
|
FINAL ASSEMBLER
|
|
Score: 16
|
|
|
|
// File Comments
|
|
// Tests a number of constant declarations
|
|
// Upstart
|
|
.pc = $801 "Basic"
|
|
:BasicUpstart(main)
|
|
.pc = $80d "Program"
|
|
// Global Constants & labels
|
|
.const LINE_LEN = $28
|
|
.const MARGIN_TOP = 4
|
|
.const MARGIN_LEFT = 4
|
|
.const OFFSET = $28*5+5
|
|
.label SCREEN = $400
|
|
.label BODY1 = SCREEN+MARGIN_TOP*LINE_LEN+MARGIN_LEFT
|
|
.label BODY2 = SCREEN+OFFSET
|
|
// main
|
|
main: {
|
|
// *BODY1 = '*'
|
|
// [0] *((const nomodify byte*) BODY1) ← (byte) '*' -- _deref_pbuc1=vbuc2
|
|
lda #'*'
|
|
sta BODY1
|
|
// *BODY2 = '*'
|
|
// [1] *((const nomodify byte*) BODY2) ← (byte) '*' -- _deref_pbuc1=vbuc2
|
|
sta BODY2
|
|
// main::@return
|
|
// }
|
|
// [2] return
|
|
rts
|
|
}
|
|
// File Data
|
|
|