Simon Peyton Jones pushed to branch wip/T26548 at Glasgow Haskell Compiler / GHC Commits: 6df6e234 by Simon Peyton Jones at 2025-11-27T11:33:06+00:00 Revert making Reduction stricter It makes things slightly worse I think. - - - - - 7b21eaef by Simon Peyton Jones at 2025-11-27T11:33:35+00:00 Make inlining a tiny bit more eager In particular x = mkSymMCo mco where mco is evaluated. We want that to inline, especially if the let is strict. Makes a significant difference in Rewrite.hs, Test case T9872b - - - - - 3 changed files: - compiler/GHC/Core/Opt/Simplify/Inline.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/Reduction.hs Changes: ===================================== compiler/GHC/Core/Opt/Simplify/Inline.hs ===================================== @@ -390,7 +390,7 @@ tryUnfolding env logger id lone_variable arg_infos -- be *something* interesting about some argument, or the -- result context, to make it worth inlining calc_some_benefit :: Arity -> Bool -> Bool -- The Arity is the number of args - -- expected by the unfolding + -- expected by the unfolding calc_some_benefit uf_arity is_inline | not saturated = interesting_args -- Under-saturated -- Note [Unsaturated applications] ===================================== compiler/GHC/Core/Opt/Simplify/Utils.hs ===================================== @@ -910,7 +910,7 @@ interestingCallContext env cont -- in GHC.Core.Unfold interesting (StrictArg { sc_fun = fun }) = strictArgContext fun - interesting (StrictBind {}) = BoringCtxt + interesting (StrictBind {}) = RhsCtxt NonRecursive interesting (Stop _ cci _) = cci interesting (TickIt _ k) = interesting k interesting (ApplyToTy { sc_cont = k }) = interesting k @@ -1032,7 +1032,7 @@ interestingArg env e = go env 0 e | n > 0 = NonTrivArg -- Saturated or unknown call | otherwise -- n==0, no value arguments; look for an interesting unfolding = case idUnfolding v of - OtherCon [] -> TrivArg -- It's evaluated, but that's all we know +-- OtherCon [] -> NonTrivArg -- It's evaluated, but that's all we know OtherCon _ -> NonTrivArg -- Evaluated and we know it isn't these constructors -- See Note [OtherCon and interestingArg] DFunUnfolding {} -> ValueArg -- We konw that idArity=0 ===================================== compiler/GHC/Core/Reduction.hs ===================================== @@ -94,7 +94,7 @@ but in fact `reductionOriginalType` is very seldom used, so it's not worth it. -- See Note [The Reduction type]. data Reduction = Reduction - { reductionCoercion :: !Coercion + { reductionCoercion :: Coercion , reductionReducedType :: !Type } -- N.B. the 'Coercion' field must be lazy: see for instance GHC.Tc.Solver.Rewrite.rewrite_tyvar2 View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/57dcbdf7cf9f0b443d5dd97c1603517... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/57dcbdf7cf9f0b443d5dd97c1603517... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Peyton Jones (@simonpj)