diff options
| author | Ben.Lippmeier@anu.edu.au <unknown> | 2009-09-17 06:03:32 +0000 |
|---|---|---|
| committer | Ben.Lippmeier@anu.edu.au <unknown> | 2009-09-17 06:03:32 +0000 |
| commit | 85981a6fc4bb94af433b0b3655c26c5ec4dda1bd (patch) | |
| tree | 5130455c641534c3f2f321b8401b0ef77403967d /compiler/nativeGen/RegAlloc/Graph/SpillCost.hs | |
| parent | 37802abf7457723624097d8b78d5ec53a68d7f09 (diff) | |
| download | haskell-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.hs | 10 |
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 |
