-- If iterative coalescing is enabled, the scanner will coalesce the graph as does its business.
-- We need to apply all the coalescences found by the scanner to the original
-- graph before doing assignColors.
+ --
+ -- Because we've got the whole, non-pruned graph here we turn on aggressive coalecing
+ -- to force all the (conservative) coalescences found during scanning.
+ --
(graph_scan_coalesced, _)
- = mapAccumL (coalesceNodes False triv) graph_coalesced kksCoalesce2
+ = mapAccumL (coalesceNodes True triv) graph_coalesced kksCoalesce2
-- color the trivially colorable nodes
-- during scanning, keys of triv nodes were added to the front of the list as they were found
$ graph
, ksTrivFound <- map nodeId nsTrivFound
- , graph3 <- foldr delNode graph ksTrivFound
+ , graph3 <- foldr (\k g -> let Just g' = delNode k g
+ in g')
+ graph ksTrivFound
+
= colorScan_spin iterative triv spill graph3
(ksTrivFound ++ ksTriv)
ksSpill
colorScan_spill iterative triv spill graph
ksTriv ksSpill kksCoalesce
- = let kSpill = spill graph
- graph' = delNode kSpill graph
+ = let kSpill = spill graph
+ Just graph' = delNode kSpill graph
in colorScan_spin iterative triv spill graph'
ksTriv (kSpill : ksSpill) kksCoalesce