diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2020-12-16 12:48:52 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-12-19 02:14:42 -0500 |
commit | 173112cad82630b02eb91acb1f5fb91a96fa02b9 (patch) | |
tree | c9a154eb05c3189bc53ecf6569b869db6fdce342 /compiler/GHC/CoreToStg/Prep.hs | |
parent | c2430398481f5aab12fd94e6549c7b9bbd1e43fe (diff) | |
download | haskell-173112cad82630b02eb91acb1f5fb91a96fa02b9.tar.gz |
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
Diffstat (limited to 'compiler/GHC/CoreToStg/Prep.hs')
-rw-r--r-- | compiler/GHC/CoreToStg/Prep.hs | 3 |
1 files changed, 3 insertions, 0 deletions
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 |