summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
diff options
context:
space:
mode:
authorBen.Lippmeier@anu.edu.au <unknown>2009-09-17 06:03:32 +0000
committerBen.Lippmeier@anu.edu.au <unknown>2009-09-17 06:03:32 +0000
commit85981a6fc4bb94af433b0b3655c26c5ec4dda1bd (patch)
tree5130455c641534c3f2f321b8401b0ef77403967d /compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
parent37802abf7457723624097d8b78d5ec53a68d7f09 (diff)
downloadhaskell-85981a6fc4bb94af433b0b3655c26c5ec4dda1bd.tar.gz
NCG: Refactor LiveCmmTop to hold a list of SCCs instead of abusing ListGraph
Diffstat (limited to 'compiler/nativeGen/RegAlloc/Graph/SpillCost.hs')
-rw-r--r--compiler/nativeGen/RegAlloc/Graph/SpillCost.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs b/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
index 58e9580338..5932d3100d 100644
--- a/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
+++ b/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
@@ -23,11 +23,11 @@ import Reg
import GraphBase
-
import BlockId
import Cmm
import UniqFM
import UniqSet
+import Digraph (flattenSCCs)
import Outputable
import State
@@ -71,11 +71,9 @@ slurpSpillCostInfo cmm
= execState (countCmm cmm) zeroSpillCostInfo
where
countCmm CmmData{} = return ()
- countCmm (CmmProc info _ _ (ListGraph blocks))
- = mapM_ (countComp info) blocks
-
- countComp info (BasicBlock _ blocks)
- = mapM_ (countBlock info) blocks
+ countCmm (CmmProc info _ _ sccs)
+ = mapM_ (countBlock info)
+ $ flattenSCCs sccs
-- lookup the regs that are live on entry to this block in
-- the info table from the CmmProc