[Git][ghc/ghc][wip/andreask/exprSizeBangs] Make sizeExpr strict in the size threshold to facilitate WW.

Andreas Klebinger gitlab at gitlab.haskell.org
Tue Jul 14 14:16:12 UTC 2020



Andreas Klebinger pushed to branch wip/andreask/exprSizeBangs at Glasgow Haskell Compiler / GHC


Commits:
d1dae72e by Andreas Klebinger at 2020-07-14T16:15:54+02:00
Make sizeExpr strict in the size threshold to facilitate WW.

- - - - -


1 changed file:

- compiler/GHC/Core/Unfold.hs


Changes:

=====================================
compiler/GHC/Core/Unfold.hs
=====================================
@@ -16,6 +16,7 @@ find, unsurprisingly, a Core expression.
 -}
 
 {-# LANGUAGE CPP #-}
+{-# LANGUAGE BangPatterns #-}
 
 {-# OPTIONS_GHC -Wno-incomplete-record-updates #-}
 
@@ -612,7 +613,9 @@ sizeExpr :: DynFlags
 
 -- Note [Computing the size of an expression]
 
-sizeExpr dflags bOMB_OUT_SIZE top_args expr
+-- Forcing bOMB_OUT_SIZE early prevents repeated
+-- unboxing of the Int argument.
+sizeExpr dflags !bOMB_OUT_SIZE top_args expr
   = size_up expr
   where
     size_up (Cast e _) = size_up e



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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d1dae72ee1b62054d8056d32578d222550f047b7
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/20200714/7f880478/attachment-0001.html>


More information about the ghc-commits mailing list