import Bitmap
import CLabel
import Cmm hiding (blockId)
-import CmmExpr
import CmmInfo
import CmmProcPointZ
import CmmStackLayout
import CmmTx
import DFMonad
+import Module
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
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
new_base <- newTemp (cmmRegType (CmmGlobal BaseReg))
let (caller_save, caller_load) = callerSaveVolatileRegs
load_tso <- newTemp gcWord -- TODO FIXME NOW
- let suspendThread = CmmLit (CmmLabel (mkRtsCodeLabel (sLit "suspendThread")))
- resumeThread = CmmLit (CmmLabel (mkRtsCodeLabel (sLit "resumeThread")))
+ let suspendThread = CmmLit (CmmLabel (mkCmmCodeLabel rtsPackageId (fsLit "suspendThread")))
+ resumeThread = CmmLit (CmmLabel (mkCmmCodeLabel rtsPackageId (fsLit "resumeThread")))
suspend = mkStore (CmmReg spReg) (CmmLit (CmmBlock infotable)) <*>
saveThreadState <*>
caller_save <*>