From 173112cad82630b02eb91acb1f5fb91a96fa02b9 Mon Sep 17 00:00:00 2001 From: Simon Peyton Jones Date: Wed, 16 Dec 2020 12:48:52 +0000 Subject: Make noinline more reliable This patch makes the desugarer rewrite noinline (f d) --> noinline f d This makes 'noinline' much more reliable: see #18995 It's explained in the improved Note [noinlineId magic] in GHC.Types.Id.Make --- compiler/GHC/CoreToStg/Prep.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/GHC/CoreToStg/Prep.hs') diff --git a/compiler/GHC/CoreToStg/Prep.hs b/compiler/GHC/CoreToStg/Prep.hs index 460f8ad9ea..f8955ae977 100644 --- a/compiler/GHC/CoreToStg/Prep.hs +++ b/compiler/GHC/CoreToStg/Prep.hs @@ -768,7 +768,10 @@ cpeApp top_env expr -> UniqSM (Floats, CpeRhs) cpe_app env (Var f) (CpeApp Type{} : CpeApp arg : args) depth | f `hasKey` lazyIdKey -- Replace (lazy a) with a, and + -- See Note [lazyId magic] in GHC.Types.Id.Make || f `hasKey` noinlineIdKey -- Replace (noinline a) with a + -- See Note [noinlineId magic] in GHC.Types.Id.Make + -- Consider the code: -- -- lazy (f x) y -- cgit v1.2.1