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

Marge Bot gitlab at gitlab.haskell.org
Sat Sep 26 01:10:25 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
5b727189 by Andreas Klebinger at 2020-09-25T21:10:20-04: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 #-}
 
@@ -394,7 +395,9 @@ sizeExpr :: UnfoldingOpts
 
 -- Note [Computing the size of an expression]
 
-sizeExpr opts bOMB_OUT_SIZE top_args expr
+-- Forcing bOMB_OUT_SIZE early prevents repeated
+-- unboxing of the Int argument.
+sizeExpr opts !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/5b72718953c289b6827e877e14d9f0f3f5c64267

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5b72718953c289b6827e877e14d9f0f3f5c64267
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/20200925/124a6c43/attachment.html>


More information about the ghc-commits mailing list