[Git][ghc/ghc][wip/simplifier-tweaks] Try making postInlineUnconditionally a bit more aggressive

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Thu Jul 6 15:58:31 UTC 2023



Simon Peyton Jones pushed to branch wip/simplifier-tweaks at Glasgow Haskell Compiler / GHC


Commits:
12266b01 by Simon Peyton Jones at 2023-07-06T16:58:08+01:00
Try making postInlineUnconditionally a bit more aggressive

In particular, inline if n_br == 1

- - - - -


1 changed file:

- compiler/GHC/Core/Opt/Simplify/Utils.hs


Changes:

=====================================
compiler/GHC/Core/Opt/Simplify/Utils.hs
=====================================
@@ -1544,7 +1544,7 @@ postInlineUnconditionally env bind_cxt old_bndr bndr rhs
 
         -> n_br < 100  -- See Note [Suppress exponential blowup]
 
-           && (smallEnoughToInline uf_opts unfolding)     -- Small enough to dup
+           && (smallEnoughToInline uf_opts unfolding || (in_lam == NotInsideLam && n_br == 1))     -- Small enough to dup
                         -- ToDo: consider discount on smallEnoughToInline if int_cxt is true
                         --
                         -- NB: Do NOT inline arbitrarily big things, even if occ_n_br=1



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/12266b011a02812d95483429ea02c036b34f7af9

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/12266b011a02812d95483429ea02c036b34f7af9
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/20230706/d6496843/attachment.html>


More information about the ghc-commits mailing list