X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2FnativeGen%2FRegAlloc%2FGraph%2FSpillCost.hs;fp=compiler%2FnativeGen%2FRegAlloc%2FGraph%2FSpillCost.hs;h=5932d3100d55f849388b5da563ca97363e19ff7d;hb=85981a6fc4bb94af433b0b3655c26c5ec4dda1bd;hp=58e9580338243d806e2ef1190aaa5851d1261856;hpb=37802abf7457723624097d8b78d5ec53a68d7f09;p=ghc-hetmet.git diff --git a/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs b/compiler/nativeGen/RegAlloc/Graph/SpillCost.hs index 58e9580..5932d31 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