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

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Tue Oct 31 17:37:45 UTC 2023



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


Commits:
22ebbcb3 by Simon Peyton Jones at 2023-10-31T17:37:31+00:00
Wibble

- - - - -


1 changed file:

- compiler/GHC/Core/Unfold.hs


Changes:

=====================================
compiler/GHC/Core/Unfold.hs
=====================================
@@ -634,13 +634,13 @@ exprTree opts args expr
 
     -- Don't record a CaseOf
     go_case rcd vs scrut b alts    -- alts is non-empty
-      = caseSize scrut alts     `metAddN`   -- A bit odd that this is only in one branch
-        (altSize * length alts) `metAddN`
-        go rcd vs scrut `et_add` go_alts (rcd-1) vs b alts
+      = caseSize scrut alts  `metAddN`   -- A bit odd that this is only in one branch
+        go rcd vs scrut      `et_add`
+        go_alts (rcd-1) vs b alts
 
     go_alts :: Int -> ETVars -> Id -> [CoreAlt] -> Maybe ExprTree
     -- Add up the sizes of all RHSs.
-    -- IMPORTANT: charge `altSize` for each alternative, else we
+    -- IMPORTANT: include a charge `altSize` for each alternative, else we
     -- find that giant case nests are treated as practically free
     -- A good example is Foreign.C.Error.errnoToIOError
     go_alts rcd vs b alts = foldr1 et_add_alt (map alt_expr_tree alts)



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/22ebbcb3c8fb9f49a76493e4c7272769e66d9c3f
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/20231031/fc528b2b/attachment-0001.html>


More information about the ghc-commits mailing list