chordal-allocation-with-registers ( cfg available -- )


Vocabulary
compiler.cfg.register-allocation.chordal

Inputs
cfgan object
availablean object


Outputs
None

Definition


:: chordal-allocation-with-registers ( cfg available -- )
f leader-map set cfg construct-ssa-bases
cfg compute-ssa-live-sets
cfg available spill-ssa :> ( fixed statistics ) statistics
chordal-statistics set representations get keys
[ dup ] H{ } map>assoc leader-map set
available registers set
cfg compute-ssa-live-sets-preserving-gc
cfg linearization-order 0
[ instructions>> [ number-instruction ] each ] reduce drop
chordal-witness? get [
available [ length ] assoc-map
"register-capacities" statistics set-at cfg cfg>insns
[ ##spill? ] count
"source-stores-before-color" statistics set-at
cfg cfg>insns [ ##reload? ] count
"source-reloads-before-color" statistics set-at
fixed assoc-size "fixed-memory-values" statistics set-at
] when cfg fixed compute-phase-ssa-intervals-with-locations
[ live-interval-state? ] filter
:> intervals intervals cfg available assign-certified-colors
check-allocation? get
[ intervals available check-allocated-intervals ] when
cfg intervals fixed
assign-phase-ssa-registers-with-locations
cfg resolve-ssa-data-flow cfg check-numbering ;