From 6a606980b40df7e084a7f79ecf2f6eab7a135aeb Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Wed, 25 Sep 2019 17:26:56 -0400 Subject: Describe optimisation of demand analysis of noinline As described in #16588. --- compiler/basicTypes/MkId.hs | 8 ++++++++ 1 file changed, 8 insertions(+) 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 -- cgit v1.2.1