[Git][ghc/ghc][wip/T26548] OtherCon [] arguments aren't interesting
Simon Peyton Jones pushed to branch wip/T26548 at Glasgow Haskell Compiler / GHC Commits: d519d2bc by Simon Peyton Jones at 2025-12-23T16:08:44+00:00 OtherCon [] arguments aren't interesting - - - - - 1 changed file: - compiler/GHC/Core/Opt/Simplify/Utils.hs Changes: ===================================== compiler/GHC/Core/Opt/Simplify/Utils.hs ===================================== @@ -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 [] -> NonTrivArg -- It's evaluated, but that's all we know + OtherCon [] -> TrivArg -- 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 @@ -1046,13 +1046,16 @@ interestingArg env e = go env 0 e {- Note [OtherCon and interestingArg] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ interstingArg returns - (a) NonTrivArg for an arg with an OtherCon [] unfolding - (b) ValueArg for an arg with an OtherCon [c1,c2..] unfolding. + (a) TrivArg for an arg with an OtherCon [] unfolding + (b) NonTrivArg for an arg with an OtherCon [c1,c2..] unfolding. -Reason for (a): I found (in the GHC.Internal.Bignum.Integer module) that I was -inlining a pretty big function when all we knew was that its arguments -were evaluated, nothing more. That in turn make the enclosing function -too big to inline elsewhere. +Reason for (a): + I found (in the GHC.Internal.Bignum.Integer module) that I was + inlining a pretty big function when all we knew was that its arguments + were evaluated, nothing more. That in turn make the enclosing function + too big to inline elsewhere. + + Reason for (b): we want to inline integerCompare here integerLt# :: Integer -> Integer -> Bool# View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d519d2bc8ac77c0e3bd53ffc8d54c5ab... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d519d2bc8ac77c0e3bd53ffc8d54c5ab... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Peyton Jones (@simonpj)