summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2020-07-09 12:24:44 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-25 21:10:20 -0400
commit5b72718953c289b6827e877e14d9f0f3f5c64267 (patch)
treee1be2d1d258b1c6d5f363d7422221892a844e8e2
parent007940d2fa1ac4f8046989d4af1d088914612a78 (diff)
downloadhaskell-5b72718953c289b6827e877e14d9f0f3f5c64267.tar.gz
Make sizeExpr strict in the size threshold to facilitate WW.
-rw-r--r--compiler/GHC/Core/Unfold.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/GHC/Core/Unfold.hs b/compiler/GHC/Core/Unfold.hs
index 414d5184f4..2e1b1f6d61 100644
--- a/compiler/GHC/Core/Unfold.hs
+++ b/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