[Git][ghc/ghc][wip/simplifier-tweaks] Two small things
Simon Peyton Jones (@simonpj)
gitlab at gitlab.haskell.org
Thu Feb 15 17:17:43 UTC 2024
Simon Peyton Jones pushed to branch wip/simplifier-tweaks at Glasgow Haskell Compiler / GHC
Commits:
d29435b5 by Simon Peyton Jones at 2024-02-15T17:16:25+00:00
Two small things
* isConLikeUnfolding is false for OtherCon
* Evaluated args look like NonTrivArg not ValueArg
See GHC log 15 Feb
- - - - -
2 changed files:
- compiler/GHC/Core.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
Changes:
=====================================
compiler/GHC/Core.hs
=====================================
@@ -1556,7 +1556,7 @@ isEvaldUnfolding _ = False
-- | @True@ if the unfolding is a constructor application, the application
-- of a CONLIKE function or 'OtherCon'
isConLikeUnfolding :: Unfolding -> Bool
-isConLikeUnfolding (OtherCon _) = True
+-- isConLikeUnfolding (OtherCon _) = True
isConLikeUnfolding (CoreUnfolding { uf_cache = cache }) = uf_is_conlike cache
isConLikeUnfolding _ = False
=====================================
compiler/GHC/Core/Opt/Simplify/Utils.hs
=====================================
@@ -1007,9 +1007,12 @@ interestingArg env e = go env 0 e
| n > 0 = NonTrivArg -- Saturated or unknown call
| conlike_unfolding = ValueArg -- n==0; look for an interesting unfolding
-- See Note [Conlike is interesting]
+ | evald_unfolding = NonTrivArg
| otherwise = TrivArg -- n==0, no useful unfolding
where
- conlike_unfolding = isConLikeUnfolding (idUnfolding v)
+ unf = idUnfolding v
+ conlike_unfolding = isConLikeUnfolding unf
+ evald_unfolding = isEvaldUnfolding unf
{-
************************************************************************
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d29435b5c97e38a1b2f639c76a74841b3f775764
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d29435b5c97e38a1b2f639c76a74841b3f775764
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/20240215/f2e9a905/attachment-0001.html>
More information about the ghc-commits
mailing list