conflict-split-site ( bundle conflict -- site/f )


Vocabulary
compiler.cfg.register-allocation.backtracking

Inputs
bundlean object
conflictan object


Outputs
site/fan object


Definition


:: conflict-split-site ( bundle conflict -- site/f )
bundle bundle-split-sites :> sites sites empty?
[ f ] [
sites [ conflict < ] filter
:> prefix-sites prefix-sites empty?
[ sites first ] [
prefix-sites last :> best! bundle best
bundle-site-weights + :> cost! prefix-sites [| site
|
bundle site bundle-site-weights
:> ( before after ) before after +
:> candidate before after = not candidate cost <
and [ site best! candidate cost! ] when
] each best prefix-sites last =
[ ] [ backtracking-cluster-splits inc ] if best
] if
] if ;