summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-09-25 17:26:56 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-11-01 15:48:37 -0400
commitdab12c8780fe1e6e3c2adb1c9565e2a43aa207db (patch)
tree4bdae9fbd47df81e03fbbd54c67d3bcf8880f278
parentc751082ca0946f8686453fa2a775809fd027c9c7 (diff)
downloadhaskell-dab12c8780fe1e6e3c2adb1c9565e2a43aa207db.tar.gz
Describe optimisation of demand analysis of noinline
As described in #16588.
-rw-r--r--compiler/basicTypes/MkId.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/basicTypes/MkId.hs b/compiler/basicTypes/MkId.hs
index bc7d0f57c9..d9d23b1235 100644
--- a/compiler/basicTypes/MkId.hs
+++ b/compiler/basicTypes/MkId.hs
@@ -1595,6 +1595,14 @@ running the simplifier.
when we serialize an expression to the interface format. See
Note [Inlining and hs-boot files] in ToIface
+Note that noinline as currently implemented can hide some simplifications since
+it hides strictness from the demand analyser. Specifically, the demand analyser
+will treat 'noinline f x' as lazy in 'x', even if the demand signature of 'f'
+specifies that it is strict in its argument. We considered fixing this this by adding a
+special case to the demand analyser to address #16588. However, the special
+case seemed like a large and expensive hammer to address a rare case and
+consequently we rather opted to use a more minimal solution.
+
Note [The oneShot function]
~~~~~~~~~~~~~~~~~~~~~~~~~~~
In the context of making left-folds fuse somewhat okish (see ticket #7994