
Simon Peyton Jones pushed to branch wip/T23109a at Glasgow Haskell Compiler / GHC Commits: ef3ab33f by Simon Peyton Jones at 2025-04-21T22:38:03+01:00 Wibble to postInlineUnconditionally - - - - - 1 changed file: - compiler/GHC/Core/Opt/Simplify/Utils.hs Changes: ===================================== compiler/GHC/Core/Opt/Simplify/Utils.hs ===================================== @@ -1632,7 +1632,8 @@ postInlineUnconditionally env bind_cxt old_bndr bndr rhs is_demanded = isStrUsedDmd (idDemandInfo bndr) occ_info = idOccInfo old_bndr unfolding = idUnfolding bndr - is_cheap = isCheapUnfolding unfolding + arity = idArity bndr +-- is_cheap = isCheapUnfolding unfolding uf_opts = seUnfoldingOpts env phase = sePhase env active = isActive phase (idInlineActivation bndr) @@ -1650,10 +1651,10 @@ postInlineUnconditionally env bind_cxt old_bndr bndr rhs check_one_occ NotInsideLam NotInteresting n_br = not is_top_lvl && code_dup_ok n_br check_one_occ NotInsideLam IsInteresting n_br = code_dup_ok n_br check_one_occ IsInsideLam NotInteresting _ = False - check_one_occ IsInsideLam IsInteresting n_br = is_cheap && code_dup_ok n_br + check_one_occ IsInsideLam IsInteresting n_br = arity > 0 && code_dup_ok n_br -- IsInteresting: inlining inside a lambda only with good reason -- See the notes on int_cxt in preInlineUnconditionally - -- is_cheap: check for acceptable work duplication, using isCheapUnfolding + -- arity>0: do not inline data strutures under lambdas, only functions --------------- -- A wrong bit of code, left here in case you are tempted to do this View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ef3ab33f9059ffd999e8adea458586a0... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ef3ab33f9059ffd999e8adea458586a0... You're receiving this email because of your account on gitlab.haskell.org.