X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FnativeGen%2FGraphColor.hs;h=307803a988109660ca35c224bb2f1b1c7e4436c5;hb=86f1f4e0748ba1146cf74786af38a68a88164e2f;hp=6956c8d5b58565ed9f2da766f932269f94a228c6;hpb=12d0b38821771fd9820d655ed73b29c688cb7b59;p=ghc-hetmet.git diff --git a/compiler/nativeGen/GraphColor.hs b/compiler/nativeGen/GraphColor.hs index 6956c8d..307803a 100644 --- a/compiler/nativeGen/GraphColor.hs +++ b/compiler/nativeGen/GraphColor.hs @@ -67,8 +67,12 @@ colorGraph iterative colors triv spill graph0 -- 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 @@ -150,7 +154,10 @@ colorScan_spin iterative triv spill graph $ 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 @@ -200,8 +207,8 @@ colorScan_spin iterative triv spill graph 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