X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FGraphOps.hs;h=a711df9f5051f2113d6106a2a5b964c447199424;hb=29897cfe9c9cf1363b89f4eb177c85329a8ca1e5;hp=ad5e18f3c07e6f755ad0ff14fa26efed47c7815e;hpb=1116b8749571c660d446258481e4e74798bbb864;p=ghc-hetmet.git diff --git a/compiler/utils/GraphOps.hs b/compiler/utils/GraphOps.hs index ad5e18f..a711df9 100644 --- a/compiler/utils/GraphOps.hs +++ b/compiler/utils/GraphOps.hs @@ -1,7 +1,5 @@ -- | Basic operations on graphs. -- --- TODO: refine coalescing crieteria - {-# OPTIONS -fno-warn-missing-signatures #-} module GraphOps ( @@ -273,7 +271,9 @@ coalesceGraph -- less colorable (aggressive coalescing) -> Triv k cls color -> Graph k cls color - -> (Graph k cls color, [(k, k)]) + -> ( Graph k cls color + , [(k, k)]) -- pairs of nodes that were coalesced, in the order that the + -- coalescing was applied. coalesceGraph aggressive triv graph = coalesceGraph' aggressive triv graph [] @@ -301,8 +301,8 @@ coalesceGraph' aggressive triv graph kkPairsAcc -- keep running until there are no more coalesces can be found in case catMaybes mPairs of - [] -> (graph', kkPairsAcc) - pairs -> coalesceGraph' aggressive triv graph' (pairs ++ kkPairsAcc) + [] -> (graph', reverse kkPairsAcc) + pairs -> coalesceGraph' aggressive triv graph' (reverse pairs ++ kkPairsAcc) -- | Coalesce this pair of nodes unconditionally / agressively.