Commit b7a8f31c authored by Simon Marlow's avatar Simon Marlow

take the analyses out of the FuelUniqSM monad

parent 0dba52a5
......@@ -107,7 +107,7 @@ cafTransfers platform = mkBTransfer3 first middle last
add l s = if hasCAF l then Set.insert (toClosureLbl platform l) s
else s
cafAnal :: Platform -> CmmGraph -> FuelUniqSM CAFEnv
cafAnal :: Platform -> CmmGraph -> CAFEnv
cafAnal platform g
= dataflowAnalBwd g [] $ analBwd cafLattice (cafTransfers platform)
......
......@@ -44,9 +44,9 @@ type BlockEntryLiveness = BlockEnv CmmLive
-- | Calculated liveness info for a CmmGraph
-----------------------------------------------------------------------------
cmmLiveness :: CmmGraph -> FuelUniqSM BlockEntryLiveness
cmmLiveness :: CmmGraph -> BlockEntryLiveness
cmmLiveness graph =
liftM check $ dataflowAnalBwd graph [] $ analBwd liveLattice xferLive
check $ dataflowAnalBwd graph [] $ analBwd liveLattice xferLive
where entry = g_entry graph
check facts = noLiveOnEntry entry
(expectJust "check" $ mapLookup entry facts) facts
......
......@@ -130,7 +130,7 @@ cpsTop hsc_env (CmmProc h@(TopInfo {stack_info=StackInfo {arg_space=entry_off}})
dumps Opt_D_dump_cmmz_split "Post splitting" gs
------------- More CAFs ------------------------------
cafEnv <- {-# SCC "cafAnal" #-} run $ cafAnal platform g
let cafEnv = {-# SCC "cafAnal" #-} cafAnal platform g
let localCAFs = catMaybes $ map (localCAFInfo platform cafEnv) gs
mbpprTrace "localCAFs" (pprPlatform platform localCAFs) $ return ()
......
......@@ -477,11 +477,9 @@ dataflowPassFwd (CmmGraph {g_entry=entry, g_graph=graph}) facts fwd = do
dataflowAnalFwd :: NonLocal n =>
GenCmmGraph n -> [(BlockId, f)]
-> FwdPass FuelUniqSM n f
-> FuelUniqSM (BlockEnv f)
dataflowAnalFwd (CmmGraph {g_entry=entry, g_graph=graph}) facts fwd = do
-- (graph, facts, NothingO) <- analyzeAndRewriteFwd fwd (JustC [entry]) graph (mkFactBase (fp_lattice fwd) facts)
-- return facts
return (analyzeFwd fwd (JustC [entry]) graph (mkFactBase (fp_lattice fwd) facts))
-> BlockEnv f
dataflowAnalFwd (CmmGraph {g_entry=entry, g_graph=graph}) facts fwd =
analyzeFwd fwd (JustC [entry]) graph (mkFactBase (fp_lattice fwd) facts)
dataflowAnalFwdBlocks :: NonLocal n =>
GenCmmGraph n -> [(BlockId, f)]
......@@ -495,11 +493,9 @@ dataflowAnalFwdBlocks (CmmGraph {g_entry=entry, g_graph=graph}) facts fwd = do
dataflowAnalBwd :: NonLocal n =>
GenCmmGraph n -> [(BlockId, f)]
-> BwdPass FuelUniqSM n f
-> FuelUniqSM (BlockEnv f)
dataflowAnalBwd (CmmGraph {g_entry=entry, g_graph=graph}) facts bwd = do
-- (graph, facts, NothingO) <- analyzeAndRewriteBwd fwd (JustC [entry]) graph (mkFactBase (fp_lattice fwd) facts)
-- return facts
return (analyzeBwd bwd (JustC [entry]) graph (mkFactBase (bp_lattice bwd) facts))
-> BlockEnv f
dataflowAnalBwd (CmmGraph {g_entry=entry, g_graph=graph}) facts bwd =
analyzeBwd bwd (JustC [entry]) graph (mkFactBase (bp_lattice bwd) facts)
dataflowPassBwd :: NonLocal n =>
GenCmmGraph n -> [(BlockId, f)]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment