X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmSpillReload.hs;h=7d4f42c7a6dcfd5342c112f88efece2655e8b3df;hb=1241c26f3552a2037263769e5ef7fa68d9f3be36;hp=00372e59ad1d16241e8dccccce245a5725b5aef1;hpb=9633cb085005b99caffec973272bff2901d683ab;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmSpillReload.hs b/compiler/cmm/CmmSpillReload.hs index 00372e5..7d4f42c 100644 --- a/compiler/cmm/CmmSpillReload.hs +++ b/compiler/cmm/CmmSpillReload.hs @@ -1,4 +1,3 @@ -{-# OPTIONS -Wall -fno-warn-name-shadowing #-} module CmmSpillReload ( ExtendWithSpills(..) @@ -25,7 +24,7 @@ import Panic import PprCmm() import UniqSet import ZipCfg -import ZipCfgCmm +import ZipCfgCmmRep import ZipDataflow -- The point of this module is to insert spills and reloads to @@ -114,16 +113,16 @@ middleDualLiveness live (NotSpillOrReload m) = changeRegs (middleLiveness m) liv lastDualLiveness :: (BlockId -> DualLive) -> Last -> DualLive lastDualLiveness env l = last l - where last (LastReturn ress) = changeRegs (gen ress) empty - last (LastJump e args) = changeRegs (gen e . gen args) empty - last (LastBranch id args) = changeRegs (gen args) $ env id - last (LastCall tgt args Nothing) = changeRegs (gen tgt. gen args) empty - last (LastCall tgt args (Just k)) = + where last (LastReturn ress) = changeRegs (gen ress) empty + last (LastJump e args) = changeRegs (gen e . gen args) empty + last (LastBranch id args) = changeRegs (gen args) $ env id + last (LastCall tgt Nothing) = changeRegs (gen tgt) empty + last (LastCall tgt (Just k)) = -- nothing can be live in registers at this point -- only 'formals' can be in regs at this point let live = env k in if isEmptyUniqSet (in_regs live) then - DualLive (on_stack live) (gen tgt $ gen args emptyRegSet) + DualLive (on_stack live) (gen tgt emptyRegSet) else panic "live values in registers at call continuation" last (LastCondBranch e t f) = changeRegs (gen e) $ dualUnion (env t) (env f) @@ -265,7 +264,7 @@ middleAvail (NotSpillOrReload m) = middle m middle (CopyOut {}) = id lastAvail :: AvailRegs -> Last -> LastOutFacts AvailRegs -lastAvail _ (LastCall _ _ (Just k)) = LastOutFacts [(k, AvailRegs emptyRegSet)] +lastAvail _ (LastCall _ (Just k)) = LastOutFacts [(k, AvailRegs emptyRegSet)] lastAvail avail l = LastOutFacts $ map (\id -> (id, avail)) $ succs l