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

Sebastian Graf gitlab at gitlab.haskell.org
Thu May 28 09:03:00 UTC 2020



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


Commits:
8790dbc7 by Sebastian Graf at 2020-05-28T11:02:52+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
=====================================
@@ -25,7 +25,7 @@ import GHC.Types.Basic
 import GHC.Core.DataCon
 import GHC.Types.Id
 import GHC.Types.Id.Info
-import GHC.Core.Utils   ( exprIsHNF, dumpIdInfoOfProgram )
+import GHC.Core.Utils   ( dumpIdInfoOfProgram )
 import GHC.Core.TyCon
 import GHC.Core.Type
 import GHC.Core.FamInstEnv
@@ -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/8790dbc7d084d91f2bcbf9297e5ec3c2cf1ccf02

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/8790dbc7d084d91f2bcbf9297e5ec3c2cf1ccf02
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/20200528/813228ca/attachment.html>


More information about the ghc-commits mailing list