Handbook
Glossary
<validation-diamond> ( width seed -- graph )
Vocabulary
compiler
.
cfg
.
register-allocation
.
validation
Inputs
width
an
object
seed
an
object
Outputs
graph
an
object
Definition
USING:
arrays
compiler.cfg.comparisons
compiler.cfg.instructions
compiler.cfg.registers
compiler.cfg.utilities
layouts
make
math
sequences
;
IN:
compiler.cfg.register-allocation.validation
::
<validation-diamond>
( width seed -- graph )
init-validation-representations
[
##prologue,
0
D:
0
##peek,
1 0
##tagged>integer,
width
<iota>
[|
i | 10 i
+
1 seed 1
+
i 1
+
*
tag-fixnum
##add-imm,
]
each
1 0
cc>
##compare-integer-imm-branch,
]
{
}
make
0
insns>block
:>
entry
[
width
<iota>
[|
i |
40 i
+
10 i
+
seed 3
+
i 1
+
*
tag-fixnum
##add-imm,
]
each
##branch,
]
{
}
make
1
insns>block
:>
left
[
width
<iota>
[|
i |
70 i
+
10 i
+
seed 2
+
i 1
+
*
tag-fixnum
##sub-imm,
]
each
##branch,
]
{
}
make
2
insns>block
:>
right
[
width
<iota>
[|
i |
100 i
+
left 40 i
+
2array
right 70 i
+
2array
2array
##phi,
]
each
width
<iota>
[
100
+
]
map
emit-validation-sum
D:
0
##replace,
##epilogue,
##return,
]
{
}
make
3
insns>block
:>
join entry left
connect-bbs
entry right
connect-bbs
left join
connect-bbs
right join
connect-bbs
entry
block>cfg
;