diff options
author | Andreas Klebinger <klebinger.andreas@gmx.at> | 2020-07-09 12:24:44 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2020-09-21 09:23:59 -0400 |
commit | 913c91c37daf16c4b2491dc3bfaf217e9c05006a (patch) | |
tree | c71c3d4a65e2fab190e9988e88cdf0d4df500430 | |
parent | 057db94ce038970b14df1599fe83097c284b9c1f (diff) | |
download | haskell-wip/andreask/exprSizeBangs.tar.gz |
Make sizeExpr strict in the size threshold to facilitate WW.wip/andreask/exprSizeBangs
-rw-r--r-- | compiler/GHC/Core/Unfold.hs | 5 |
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 |