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

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


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

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

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

commit 5d3221aeefd3fab8c7ded74110997571805ab2ec
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


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

5d3221aeefd3fab8c7ded74110997571805ab2ec
 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