Handbook
Glossary
prepare-spill-sites ( cfg -- )
Vocabulary
compiler
.
cfg
.
register-allocation
.
spill-sites
Inputs
cfg
an
object
Outputs
None
Definition
USING:
accessors
assocs
compiler.cfg.instructions
compiler.cfg.linearization
compiler.cfg.loop-detection
kernel
math.functions
math.order
namespaces
sequences
;
IN:
compiler.cfg.register-allocation.spill-sites
::
prepare-spill-sites
( cfg -- )
0
loop-spill-site-count
set
0
cold-spill-store-count
set
f
cold-spill-safe?
set
f
cold-definition-sites
set
backtracking-loop-spills?
get
[
H{
}
clone
cold-definition-sites
set
cfg
needs-loops
cfg
cfg>insns
[
gc-map-insn?
]
any?
not
cold-spill-safe?
set
H{
}
clone
:>
weights cfg
linearization-order
[|
bb |
8 bb
loop-nesting-at
3
min
^
:>
weight bb
instructions>>
[
insn#>>
weight
swap
weights
set-at
]
each
weight 1
=
[
bb
instructions>>
but-last
[
insn#>>
t
swap
cold-definition-sites
get
set-at
]
each
]
when
]
each
weights
]
[
f
]
if
spill-site-weights
set
;