[Git][ghc/ghc][wip/T16806] Clarify disjoint in closureGrowth

Simon Jakobi gitlab at gitlab.haskell.org
Tue Mar 31 16:27:56 UTC 2020



Simon Jakobi pushed to branch wip/T16806 at Glasgow Haskell Compiler / GHC


Commits:
7a880b6c by Simon Jakobi at 2020-03-31T18:27:00+02:00
Clarify disjoint in closureGrowth

- - - - -


2 changed files:

- compiler/GHC/Stg/Lift/Analysis.hs
- compiler/GHC/Types/Var/Set.hs


Changes:

=====================================
compiler/GHC/Stg/Lift/Analysis.hs
=====================================
@@ -533,7 +533,7 @@ closureGrowth expander sizer group abs_ids = go
     go (ClosureSk _ clo_fvs rhs)
       -- If no binder of the @group@ occurs free in the closure, the lifting
       -- won't have any effect on it and we can omit the recursive call.
-      | dVarSetDisjointVarSet clo_fvs' group = 0
+      | group `varSetDisjointDVarSet` clo_fvs' = 0
       -- Otherwise, we account the cost of allocating the closure and add it to
       -- the closure growth of its RHS.
       | otherwise   = mkIntWithInf cost + go rhs


=====================================
compiler/GHC/Types/Var/Set.hs
=====================================
@@ -34,7 +34,7 @@ module GHC.Types.Var.Set (
         elemDVarSet, dVarSetElems, subDVarSet,
         unionDVarSet, unionDVarSets, mapUnionDVarSet,
         intersectDVarSet, dVarSetIntersectVarSet,
-        intersectsDVarSet, disjointDVarSet, dVarSetDisjointVarSet,
+        intersectsDVarSet, disjointDVarSet, varSetDisjointDVarSet,
         isEmptyDVarSet, delDVarSet, delDVarSetList,
         minusDVarSet, foldDVarSet, filterDVarSet, mapDVarSet,
         dVarSetMinusVarSet, anyDVarSet, allDVarSet,
@@ -274,8 +274,8 @@ dVarSetIntersectVarSet = uniqDSetIntersectUniqSet
 disjointDVarSet :: DVarSet -> DVarSet -> Bool
 disjointDVarSet s1 s2 = disjointUDFM (getUniqDSet s1) (getUniqDSet s2)
 
-dVarSetDisjointVarSet :: DVarSet -> VarSet -> Bool
-dVarSetDisjointVarSet = uniqDSetDisjointUniqSet
+varSetDisjointDVarSet :: VarSet -> DVarSet -> Bool
+varSetDisjointDVarSet vs dvs = uniqDSetDisjointUniqSet dvs vs
 
 -- | True if non-empty intersection
 intersectsDVarSet :: DVarSet -> DVarSet -> Bool



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7a880b6c6b85d2c23c2adef1068c23d475bc235e

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7a880b6c6b85d2c23c2adef1068c23d475bc235e
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200331/051a4d45/attachment-0001.html>


More information about the ghc-commits mailing list