X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmBuildInfoTables.hs;h=1a4a591d683f4282dfdf7408550dcebd401ffcba;hb=2bb3a439c106935d97fae7f7a0b60c21493d1bef;hp=fa2c009740a4222d37c8e9bc4d42e2a7a49f559d;hpb=31a9d04804d9cacda35695c5397590516b964964;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmBuildInfoTables.hs b/compiler/cmm/CmmBuildInfoTables.hs index fa2c009..1a4a591 100644 --- a/compiler/cmm/CmmBuildInfoTables.hs +++ b/compiler/cmm/CmmBuildInfoTables.hs @@ -18,7 +18,6 @@ import BlockId import Bitmap import CLabel import Cmm hiding (blockId) -import CmmExpr import CmmInfo import CmmProcPointZ import CmmStackLayout @@ -28,14 +27,13 @@ import FastString import FiniteMap import ForeignCall import IdInfo -import List (sortBy) +import Data.List import Maybes import MkZipCfg import MkZipCfgCmm hiding (CmmAGraph, CmmBlock, CmmTopZ, CmmZ, CmmGraph) -import Monad +import Control.Monad import Name import Outputable -import Panic import SMRep import StgCmmClosure import StgCmmForeign @@ -165,15 +163,15 @@ cafLattice = DataflowLattice "live cafs" emptyFM add False cafTransfers :: BackwardTransfers Middle Last CAFSet cafTransfers = BackwardTransfers first middle last - where first _ live = live - middle m live = foldExpDeepMiddle addCaf m live - last l env = foldExpDeepLast addCaf l (joinOuts cafLattice env l) - addCaf e set = case e of - CmmLit (CmmLabel c) -> add c set - CmmLit (CmmLabelOff c _) -> add c set - CmmLit (CmmLabelDiffOff c1 c2 _) -> add c1 $ add c2 set - _ -> set - add l s = if hasCAF l then addToFM s (cvtToClosureLbl l) () else s + where first _ live = live + middle m live = foldExpDeepMiddle addCaf m live + last l env = foldExpDeepLast addCaf l (joinOuts cafLattice env l) + addCaf e set = case e of + CmmLit (CmmLabel c) -> add c set + CmmLit (CmmLabelOff c _) -> add c set + CmmLit (CmmLabelDiffOff c1 c2 _) -> add c1 $ add c2 set + _ -> set + add l s = if hasCAF l then addToFM s (cvtToClosureLbl l) () else s type CafFix a = FuelMonad (BackwardFixedPoint Middle Last CAFSet a) cafAnal :: LGraph Middle Last -> FuelMonad CAFEnv