[Git][ghc/ghc][wip/nested-cpr-2019] Regard all arity 0 bindings (incl. DataCon apps) as thunks

Sebastian Graf gitlab at gitlab.haskell.org
Wed May 27 19:25:04 UTC 2020



Sebastian Graf pushed to branch wip/nested-cpr-2019 at Glasgow Haskell Compiler / GHC


Commits:
a98c6510 by Sebastian Graf at 2020-05-27T21:24:56+02:00
Regard all arity 0 bindings (incl. DataCon apps) as thunks

- - - - -


1 changed file:

- compiler/GHC/Core/Opt/CprAnal.hs


Changes:

=====================================
compiler/GHC/Core/Opt/CprAnal.hs
=====================================
@@ -357,7 +357,7 @@ cprAnalBind top_lvl env widening args id rhs
 
     -- See Note [CPR for thunks]
     stays_thunk = is_thunk && not_strict
-    is_thunk    = not (exprIsHNF rhs) && not (isJoinId id)
+    is_thunk    = idArity id == 0 && not (isJoinId id)
     not_strict  = not (isStrictDmd (idDemandInfo id))
     -- See Note [CPR for sum types]
     (_, ret_ty) = splitPiTys (idType id)



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a98c6510929219df22abe30f686e653040133e75
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/20200527/bd606d57/attachment.html>


More information about the ghc-commits mailing list