summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2021-05-29 22:51:16 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-28 13:19:06 -0400
commitd43a90295a0e90daf23edd30324c2e5834e8bab2 (patch)
tree10bbc820a48ae71ac6668cff72f945f53f61442a
parenta57e4a972ac45c8214acd29e9511cc8bea841914 (diff)
downloadhaskell-d43a90295a0e90daf23edd30324c2e5834e8bab2.tar.gz
Fix smallEnoughToInline
I noticed that smallEnoughToInline said "no" to UnfWhen guidance, which seems quite wrong -- those functions are particularly small.
-rw-r--r--compiler/GHC/Core/Unfold.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/GHC/Core/Unfold.hs b/compiler/GHC/Core/Unfold.hs
index 4e054ea709..4e895b8b09 100644
--- a/compiler/GHC/Core/Unfold.hs
+++ b/compiler/GHC/Core/Unfold.hs
@@ -954,8 +954,11 @@ couldBeSmallEnoughToInline opts threshold rhs
----------------
smallEnoughToInline :: UnfoldingOpts -> Unfolding -> Bool
-smallEnoughToInline opts (CoreUnfolding {uf_guidance = UnfIfGoodArgs {ug_size = size}})
- = size <= unfoldingUseThreshold opts
+smallEnoughToInline opts (CoreUnfolding {uf_guidance = guidance})
+ = case guidance of
+ UnfIfGoodArgs {ug_size = size} -> size <= unfoldingUseThreshold opts
+ UnfWhen {} -> True
+ UnfNever -> False
smallEnoughToInline _ _
= False