[commit: ghc] wip/T14137: Inline join points with a single occurrence even into joinrecs (62644b0)

git at git.haskell.org git at git.haskell.org
Sat Aug 19 11:04:12 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T14137
Link       : http://ghc.haskell.org/trac/ghc/changeset/62644b0071c3be0f295d7c1271d12cdc38ef25c9/ghc

>---------------------------------------------------------------

commit 62644b0071c3be0f295d7c1271d12cdc38ef25c9
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Sat Aug 19 13:02:43 2017 +0200

    Inline join points with a single occurrence even into joinrecs
    
    as proposed by SPJ in https://ghc.haskell.org/trac/ghc/ticket/14137#comment:8.
    
    (explanatory Note pending)


>---------------------------------------------------------------

62644b0071c3be0f295d7c1271d12cdc38ef25c9
 compiler/simplCore/SimplUtils.hs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/compiler/simplCore/SimplUtils.hs b/compiler/simplCore/SimplUtils.hs
index b01955c..5977353 100644
--- a/compiler/simplCore/SimplUtils.hs
+++ b/compiler/simplCore/SimplUtils.hs
@@ -1068,7 +1068,8 @@ preInlineUnconditionally dflags env top_lvl bndr rhs
   | otherwise = case idOccInfo bndr of
                   IAmDead                    -> True -- Happens in ((\x.1) v)
                   occ at OneOcc { occ_one_br = True }
-                                             -> try_once (occ_in_lam occ)
+                             | isJoinId bndr -> True
+                             | otherwise     -> try_once (occ_in_lam occ)
                                                          (occ_int_cxt occ)
                   _                          -> False
   where



More information about the ghc-commits mailing list