[commit: ghc] wip/T10918: Ticket #10918: Inline singly used things even more aggressively (b730b4e)

git at git.haskell.org git at git.haskell.org
Fri Nov 6 14:51:51 UTC 2015


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

On branch  : wip/T10918
Link       : http://ghc.haskell.org/trac/ghc/changeset/b730b4e5672442ed7afedf24f5a67fb203b738db/ghc

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

commit b730b4e5672442ed7afedf24f5a67fb203b738db
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Wed Oct 7 16:45:39 2015 +0200

    Ticket #10918: Inline singly used things even more aggressively


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

b730b4e5672442ed7afedf24f5a67fb203b738db
 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 aa82ea4..e3a737e 100644
--- a/compiler/simplCore/SimplUtils.hs
+++ b/compiler/simplCore/SimplUtils.hs
@@ -1038,8 +1038,9 @@ preInlineUnconditionally dflags env top_lvl bndr rhs
              -- See Note [pre/postInlineUnconditionally in gentle mode]
     act = idInlineActivation bndr
     try_once in_lam int_cxt     -- There's one textual occurrence
+        | isSingleUsed (idDemandInfo bndr) = isNotTopLevel top_lvl
         | not in_lam = isNotTopLevel top_lvl || early_phase
-        | otherwise  = (int_cxt && canInlineInLam rhs) || isSingleUsed (idDemandInfo bndr)
+        | otherwise  = int_cxt && canInlineInLam rhs
 
 -- Be very careful before inlining inside a lambda, because (a) we must not
 -- invalidate occurrence information, and (b) we want to avoid pushing a



More information about the ghc-commits mailing list