[Git][ghc/ghc][wip/T23109] Inline more, sooner
Simon Peyton Jones (@simonpj)
gitlab at gitlab.haskell.org
Tue Jun 20 23:42:12 UTC 2023
Simon Peyton Jones pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC
Commits:
e3730ab1 by Simon Peyton Jones at 2023-06-21T00:41:51+01:00
Inline more, sooner
- - - - -
1 changed file:
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
Changes:
=====================================
compiler/GHC/Core/Opt/Simplify/Iteration.hs
=====================================
@@ -424,6 +424,9 @@ simplAuxBind env bndr new_rhs
-- This is safe because it's only used for auxiliary bindings, which
-- have no NOLINE pragmas, nor RULEs
| exprIsTrivial new_rhs -- Short-cut for let x = y in ...
+ || case (idOccInfo bndr) of
+ OneOcc{ occ_n_br = 1, occ_in_lam = NotInsideLam } -> True
+ _ -> False
= return ( emptyFloats env
, case new_rhs of
Coercion co -> extendCvSubst env bndr co
@@ -2148,7 +2151,8 @@ simplCall :: SimplEnv -> OutId -> SimplCont -> SimplM (SimplFloats, OutExpr)
simplCall env var cont
| ClassOpId clas idx _ <- idDetails var
, Just (env', arg', cont') <- classOpDictApp_maybe env clas idx cont
- = simplExprF env' arg' cont'
+ = -- pprTrace "simplCall:classop" (ppr var $$ ppr arg') $
+ simplExprF env' arg' cont'
| otherwise
= do { rule_base <- getSimplRules
@@ -3570,7 +3574,7 @@ knownCon env scrut dc_floats dc dc_ty_args dc_args bndr bs rhs cont
-- Nevertheless we must keep it if the case-binder is alive,
-- because it may be used in the con_app. See Note [knownCon occ info]
; (floats1, env2) <- simplAuxBind env' b' arg -- arg satisfies let-can-float invariant
- ; (floats2, env3) <- bind_args env2 bs' args
+ ; (floats2, env3) <- bind_args env2 bs' args
; return (floats1 `addFloats` floats2, env3) }
bind_args _ _ _ =
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3730ab130971689ecf18669899b2d6fa2b91cba
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e3730ab130971689ecf18669899b2d6fa2b91cba
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/20230620/fa57c220/attachment-0001.html>
More information about the ghc-commits
mailing list