X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmProcPoint.hs;h=df408c666f829f7a4cfe45c21edeafbeb5e66496;hb=48fb2b521898998a17873ad6cf30610aa5ab6db3;hp=5a159a65651c2a0f064252d95ba5876215807f9c;hpb=81285ec475e94ef93d2ac59386d48cb333da2c96;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmProcPoint.hs b/compiler/cmm/CmmProcPoint.hs index 5a159a6..df408c6 100644 --- a/compiler/cmm/CmmProcPoint.hs +++ b/compiler/cmm/CmmProcPoint.hs @@ -46,7 +46,7 @@ calculateProcPoints blocks = always_proc_point BrokenBlock { brokenBlockEntry = FunctionEntry _ _ _ } = True always_proc_point BrokenBlock { - brokenBlockEntry = ContinuationEntry _ _ } = True + brokenBlockEntry = ContinuationEntry _ _ _ } = True always_proc_point _ = False calculateProcPoints' :: UniqSet BlockId -> [BrokenBlock] -> UniqSet BlockId @@ -79,8 +79,12 @@ calculateNewProcPoints owners block = where parent_owners = lookupWithDefaultUFM owners emptyUniqSet parent_id child_owners = lookupWithDefaultUFM owners emptyUniqSet child_id - needs_proc_point = not $ isEmptyUniqSet $ - child_owners `minusUniqSet` parent_owners + needs_proc_point = + -- only if parent isn't dead + (not $ isEmptyUniqSet parent_owners) && + -- and only if child has more owners than parent + (not $ isEmptyUniqSet $ + child_owners `minusUniqSet` parent_owners) calculateOwnership :: BlockEnv BrokenBlock -> UniqSet BlockId @@ -113,4 +117,4 @@ calculateOwnership blocks_ufm proc_points blocks = new = old `unionUniqSets` lookupWithDefaultUFM owners emptyUniqSet cause' - unknown_block = panic "unknown BlockId in selectStackFormat" + unknown_block = panic "unknown BlockId in calculateOwnership"