X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmProcPoint.hs;h=de8cfa378b3e5d6379e3317a485cd69b28dec3b9;hb=8a9eb3cd35117c62ac9758d118c6f4109b7330cb;hp=9c8dda8ded37142c5ffc226ae76fe25147e55235;hpb=ad94d40948668032189ad22a0ad741ac1f645f50;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmProcPoint.hs b/compiler/cmm/CmmProcPoint.hs index 9c8dda8..de8cfa3 100644 --- a/compiler/cmm/CmmProcPoint.hs +++ b/compiler/cmm/CmmProcPoint.hs @@ -1,22 +1,14 @@ -{-# OPTIONS -w #-} --- The above warning supression flag is a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/CodingStyle#Warnings --- for details - module CmmProcPoint ( calculateProcPoints ) where #include "HsVersions.h" -import Cmm +import BlockId import CmmBrokenBlock import Dataflow import UniqSet -import UniqFM import Panic -- Determine the proc points for a set of basic blocks. @@ -84,8 +76,8 @@ calculateNewProcPoints owners block = then unitUniqSet child_id else emptyUniqSet where - parent_owners = lookupWithDefaultUFM owners emptyUniqSet parent_id - child_owners = lookupWithDefaultUFM owners emptyUniqSet child_id + parent_owners = lookupWithDefaultBEnv owners emptyUniqSet parent_id + child_owners = lookupWithDefaultBEnv owners emptyUniqSet child_id needs_proc_point = -- only if parent isn't dead (not $ isEmptyUniqSet parent_owners) && @@ -98,11 +90,11 @@ calculateOwnership :: BlockEnv BrokenBlock -> [BrokenBlock] -> BlockEnv (UniqSet BlockId) calculateOwnership blocks_ufm proc_points blocks = - fixedpoint dependants update (map brokenBlockId blocks) emptyUFM + fixedpoint dependants update (map brokenBlockId blocks) emptyBlockEnv where dependants :: BlockId -> [BlockId] dependants ident = - brokenBlockTargets $ lookupWithDefaultUFM + brokenBlockTargets $ lookupWithDefaultBEnv blocks_ufm unknown_block ident update :: BlockId @@ -112,16 +104,16 @@ calculateOwnership blocks_ufm proc_points blocks = update ident cause owners = case (cause, ident `elementOfUniqSet` proc_points) of (Nothing, True) -> - Just $ addToUFM owners ident (unitUniqSet ident) + Just $ extendBlockEnv owners ident (unitUniqSet ident) (Nothing, False) -> Nothing - (Just cause', True) -> Nothing + (Just _, True) -> Nothing (Just cause', False) -> if (sizeUniqSet old) == (sizeUniqSet new) then Nothing - else Just $ addToUFM owners ident new + else Just $ extendBlockEnv owners ident new where - old = lookupWithDefaultUFM owners emptyUniqSet ident + old = lookupWithDefaultBEnv owners emptyUniqSet ident new = old `unionUniqSets` - lookupWithDefaultUFM owners emptyUniqSet cause' + lookupWithDefaultBEnv owners emptyUniqSet cause' unknown_block = panic "unknown BlockId in calculateOwnership"