summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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