Handbook
Glossary
global-split-plan ( interval -- plan/f )
Vocabulary
compiler
.
cfg
.
register-allocation
.
greedy
Inputs
interval
an
object
Outputs
plan/f
an
object
Definition
USING:
accessors
arrays
compiler.cfg.register-allocation.greedy.regions
compiler.cfg.register-allocation.occupancy
kernel
math
sequences
;
IN:
compiler.cfg.register-allocation.greedy
::
global-split-plan
( interval -- plan/f )
interval
interval-region-blocks
:>
blocks
f
:>
best! blocks
length
1
>
blocks
length
128
<=
and
[
blocks
region-network-edges
:>
edges interval
allocation-order
[|
reg |
blocks
[|
block |
block
uses>>
length
block
frequency>>
*
2
*
block
ranges>>
interval reg
register-index
occupancy-conflicts
empty?
not
2array
]
map
:>
nodes nodes edges
solve-residency
:>
placement placement
resident>>
[
]
any?
placement
resident>>
[
not
]
any?
and
[
nodes
[
first
]
map-sum
placement
cost>>
-
:>
benefit benefit 0
>
best
[
benefit best
benefit>>
>
]
[
t
]
if
and
[
reg blocks placement
resident>>
placement
cost>>
benefit
greedy-region-plan
boa
best!
]
when
]
when
]
each
]
when
best
;