X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmLiveZ.hs;h=8a5d36c65850a282523a2cdb70e9295e2f15bac4;hb=1241c26f3552a2037263769e5ef7fa68d9f3be36;hp=87f6c385f341553a60eaa0238e5275ec2aea3362;hpb=8b7eaa404043294bd4cb4a0322ac1f7115bad6a0;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmLiveZ.hs b/compiler/cmm/CmmLiveZ.hs index 87f6c38..8a5d36c 100644 --- a/compiler/cmm/CmmLiveZ.hs +++ b/compiler/cmm/CmmLiveZ.hs @@ -1,4 +1,4 @@ -{-# OPTIONS -Wall -fno-warn-name-shadowing #-} + module CmmLiveZ ( CmmLive , cmmLivenessZ @@ -16,7 +16,7 @@ import PprCmm() import PprCmmZ() import UniqSet import ZipDataflow -import ZipCfgCmm +import ZipCfgCmmRep ----------------------------------------------------------------------------- -- Calculating what variables are live on entry to a basic block @@ -36,7 +36,7 @@ liveLattice = DataflowLattice "live LocalReg's" emptyUniqSet add False type BlockEntryLiveness = BlockEnv CmmLive ----------------------------------------------------------------------------- --- | Calculated liveness info for a list of 'CmmBasicBlock' +-- | Calculated liveness info for a CmmGraph ----------------------------------------------------------------------------- cmmLivenessZ :: CmmGraph -> BlockEntryLiveness cmmLivenessZ g = env @@ -67,10 +67,10 @@ middleLiveness m = middle m lastLiveness :: Last -> (BlockId -> CmmLive) -> CmmLive lastLiveness l env = last l - where last (LastReturn ress) = gen ress emptyUniqSet - last (LastJump e args) = gen e $ gen args emptyUniqSet - last (LastBranch id args) = gen args $ env id - last (LastCall tgt args (Just k)) = gen tgt $ gen args $ env k - last (LastCall tgt args Nothing) = gen tgt $ gen args $ emptyUniqSet - last (LastCondBranch e t f) = gen e $ unionUniqSets (env t) (env f) + where last (LastReturn ress) = gen ress emptyUniqSet + last (LastJump e args) = gen e $ gen args emptyUniqSet + last (LastBranch id args) = gen args $ env id + last (LastCall tgt (Just k)) = gen tgt $ env k + last (LastCall tgt Nothing) = gen tgt $ emptyUniqSet + last (LastCondBranch e t f) = gen e $ unionUniqSets (env t) (env f) last (LastSwitch e tbl) = gen e $ unionManyUniqSets $ map env (catMaybes tbl)