[Git][ghc/ghc][wip/spj-unf-size] Comments

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Tue Oct 24 16:38:48 UTC 2023



Simon Peyton Jones pushed to branch wip/spj-unf-size at Glasgow Haskell Compiler / GHC


Commits:
c6fe0842 by Simon Peyton Jones at 2023-10-24T17:38:35+01:00
Comments

- - - - -


1 changed file:

- compiler/GHC/Core/Unfold.hs


Changes:

=====================================
compiler/GHC/Core/Unfold.hs
=====================================
@@ -560,7 +560,11 @@ exprTree opts args expr
     -----------------------------
     -- size_up_app is used when there's ONE OR MORE value args
     go_app :: ETVars -> CoreExpr -> [CoreExpr] -> Int -> ExprTree
-                   -- args are the value args
+        -- args:  all the value args
+        -- voids: counts the zero-bit arguments; don't charge for these
+        --        This makes a difference in ST-heavy code which does
+        --        does a lot of state passing, and which can be in an
+        --        inner loop.
     go_app vs (App fun arg) args voids
                   | isTypeArg arg      = go_app vs fun args voids
                   | isZeroBitArg arg   = go_app vs fun (arg:args) (voids+1)
@@ -745,7 +749,7 @@ funSize opts (avs,_) fun n_val_args voids
                        , et_cases = cases
                        , et_ret   = res_discount }
   where
-    size | n_val_args == 0 = 0
+    size | n_val_args == 0 = 0    -- Naked variable counts zero
          | otherwise       = vanillaCallSize n_val_args voids
 
     -- Discount if this is an interesting variable, and is applied



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c6fe0842f50a31ac9045264469503b5b5b6f8dd4

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c6fe0842f50a31ac9045264469503b5b5b6f8dd4
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/20231024/3028ea5e/attachment-0001.html>


More information about the ghc-commits mailing list