diff options
-rw-r--r-- | compiler/GHC/CmmToAsm/CFG.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/CmmToAsm/Reg/Graph/Base.hs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/CmmToAsm/CFG.hs b/compiler/GHC/CmmToAsm/CFG.hs index 8f8b71b1f7..99df21c46b 100644 --- a/compiler/GHC/CmmToAsm/CFG.hs +++ b/compiler/GHC/CmmToAsm/CFG.hs @@ -1350,7 +1350,7 @@ calcFreqs graph backEdges loops revPostOrder = runST $ do vcat (map (\(k,m) -> ppr (k,m :: IM.IntMap Double)) $ IM.toList g) ) - nodeCount = IM.foldl' (\count toMap -> IM.foldlWithKey' countTargets count toMap) (IM.size graph) graph + nodeCount = IM.foldl' (\count toMap -> IM.foldlWithKey' countTargets (count + 1) toMap) 0 graph where countTargets = (\count k _ -> countNode k + count ) countNode n = if IM.member n graph then 0 else 1 diff --git a/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs b/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs index 32b49a61e8..7756030ed8 100644 --- a/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs +++ b/compiler/GHC/CmmToAsm/Reg/Graph/Base.hs @@ -104,7 +104,7 @@ worst regsOfClass regAlias neighbors classN classC regsC = regsOfClass classC -- all the possible subsets of c which have size < m - regsS = filter (\s -> sizeUniqSet s >= 1 + regsS = filter (\s -> not (isEmptyUniqSet s) && sizeUniqSet s <= neighbors) $ powersetLS regsC |