[Git][ghc/ghc][wip/spj-unf-size] More adjustments
Simon Peyton Jones (@simonpj)
gitlab at gitlab.haskell.org
Fri Dec 8 11:58:58 UTC 2023
Simon Peyton Jones pushed to branch wip/spj-unf-size at Glasgow Haskell Compiler / GHC
Commits:
57023cff by Simon Peyton Jones at 2023-12-08T11:58:13+00:00
More adjustments
* Revert un-force jumpSize change
* Try making lambdas free
- - - - -
1 changed file:
- compiler/GHC/Core/Unfold.hs
Changes:
=====================================
compiler/GHC/Core/Unfold.hs
=====================================
@@ -823,9 +823,9 @@ vanillaCallSize n_val_args voids = 10 * (1 + n_val_args - voids)
-- | The size of a jump to a join point
jumpSize :: Int -> Int -> Size
-jumpSize n_val_args voids = 10 * (n_val_args - voids)
- -- Not so much smaller than an ordinary call;
- -- Trying the effect of not charging for the function head itself
+jumpSize n_val_args voids = 2 * (1 + n_val_args - voids)
+ -- A jump isn't so much smaller than a function call, but it's definitely
+ -- a known, exactly saturated call, so we make it very cheap
-- A jump is 20% the size of a function call. Making jumps free reopens
-- bug #6048, but making them any more expensive loses a 21% improvement in
-- spectral/puzzle. TODO Perhaps adjusting the default threshold would be a
@@ -875,9 +875,12 @@ funSize opts (avs,_) fun n_val_args voids
lamSize :: UnfoldingOpts -> ExprTree
-- Does not include the size of the body, just the lambda itself
+lamSize _ = etZero -- Lambdas themselves cost nothing
+{-
lamSize opts = ExprTree { et_size = 10, et_wc_tot = 10
, et_cases = emptyBag
, et_ret = unfoldingFunAppDiscount opts }
+-}
conSize :: DataCon -> Int -> ExprTree
-- Does not need to include the size of the arguments themselves
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/57023cffea75df13cbccb0f74596a2a9a8de7883
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/57023cffea75df13cbccb0f74596a2a9a8de7883
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/20231208/a08a2c7c/attachment-0001.html>
More information about the ghc-commits
mailing list