diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-04-24 17:22:44 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-29 01:39:55 -0400 |
commit | 277c2f26e6966e0cfaa1ddcd297af44766f37958 (patch) | |
tree | fab5159ddfdf399e43a7660938c974b8d12c8eb1 /compiler/GHC/CoreToStg | |
parent | 46720997a0b1fa2971a884adf43de096ce130a7e (diff) | |
download | haskell-277c2f26e6966e0cfaa1ddcd297af44766f37958.tar.gz |
Eta expand un-saturated primops
Now since we no longer try to predict CAFfyness we have no need for the
solution to #16846. Eta expanding unsaturated primop applications is
conceptually simpler, especially in the presence of levity polymorphism.
This essentially reverts cac8dc9f51e31e4c0a6cd9bc302f7e1bc7c03beb,
as suggested in #18079.
Closes #18079.
Diffstat (limited to 'compiler/GHC/CoreToStg')
-rw-r--r-- | compiler/GHC/CoreToStg/Prep.hs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/GHC/CoreToStg/Prep.hs b/compiler/GHC/CoreToStg/Prep.hs index ac74dd6723..9b4690e016 100644 --- a/compiler/GHC/CoreToStg/Prep.hs +++ b/compiler/GHC/CoreToStg/Prep.hs @@ -71,7 +71,7 @@ import qualified Data.Set as S The goal of this pass is to prepare for code generation. -1. Saturate constructor applications. +1. Saturate constructor and primop applications. 2. Convert to A-normal form; that is, function arguments are always variables. @@ -1151,15 +1151,11 @@ maybeSaturate deals with eta expanding to saturate things that can't deal with unsaturated applications (identified by 'hasNoBinding', currently just foreign calls and unboxed tuple/sum constructors). -Note that eta expansion in CorePrep is very fragile due to the "prediction" of -CAFfyness made during tidying (see Note [CAFfyness inconsistencies due to eta -expansion in CorePrep] in GHC.Iface.Tidy for details. We previously saturated primop +Historical Note: Note that eta expansion in CorePrep used to be very fragile +due to the "prediction" of CAFfyness that we used to make during tidying. +We previously saturated primop applications here as well but due to this fragility (see #16846) we now deal with this another way, as described in Note [Primop wrappers] in GHC.Builtin.PrimOps. - -It's quite likely that eta expansion of constructor applications will -eventually break in a similar way to how primops did. We really should -eliminate this case as well. -} maybeSaturate :: Id -> CpeApp -> Int -> UniqSM CpeRhs |