Commit e64dbac6 authored by nr@eecs.harvard.edu's avatar nr@eecs.harvard.edu
Browse files

tidying cmm/CmmLiveZ.hs

parent 855444fb
......@@ -11,13 +11,14 @@ import Cmm
import CmmExpr
import CmmTx
import DFMonad
import Maybes
import PprCmm()
import PprCmmZ()
import UniqSet
import ZipDataflow
import ZipCfgCmmRep
import Maybes
import UniqSet
-----------------------------------------------------------------------------
-- Calculating what variables are live on entry to a basic block
-----------------------------------------------------------------------------
......@@ -40,10 +41,8 @@ type BlockEntryLiveness = BlockEnv CmmLive
-----------------------------------------------------------------------------
cmmLivenessZ :: CmmGraph -> BlockEntryLiveness
cmmLivenessZ g = env
where env = runDFA liveLattice $
do run_b_anal transfer g
allFacts
transfer = BComp "liveness analysis" exit last middle first
where env = runDFA liveLattice $ do { run_b_anal transfer g; allFacts }
transfer = BComp "liveness analysis" exit last middle first
exit = emptyUniqSet
first live _ = live
middle = flip middleLiveness
......@@ -63,7 +62,7 @@ middleLiveness m = middle m
middle (MidStore addr rval) = gen addr . gen rval
middle (MidUnsafeCall tgt ress args) = gen tgt . gen args . kill ress
middle (CopyIn _ formals _) = kill formals
middle (CopyOut _ formals) = gen formals
middle (CopyOut _ actuals) = gen actuals
lastLiveness :: Last -> (BlockId -> CmmLive) -> CmmLive
lastLiveness l env = last l
......
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