X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCmmProcPoint.hs;h=451a15343b5529e2eee081c5d01f0e1737a88bfd;hb=2f12b0ddeac0b1ac924dea52aef1ab5815802c78;hp=36c02ff810f02fc3ce1a863aad38f735d3afad60;hpb=a2d5d3c9677a740ace920a976d03dfbd82f7697b;p=ghc-hetmet.git diff --git a/compiler/cmm/CmmProcPoint.hs b/compiler/cmm/CmmProcPoint.hs index 36c02ff..451a153 100644 --- a/compiler/cmm/CmmProcPoint.hs +++ b/compiler/cmm/CmmProcPoint.hs @@ -1,3 +1,10 @@ +{-# 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/Commentary/CodingStyle#Warnings +-- for details + module CmmProcPoint ( calculateProcPoints ) where @@ -79,8 +86,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 +124,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"