summaryrefslogtreecommitdiff
path: root/compiler/GHC/CoreToStg.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2021-05-04 23:41:48 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-11 23:00:27 -0400
commitc77179492032f4d8752481ad3e0d65d7eacb74f9 (patch)
tree2991defee20b9ce1e13d0f3650a97ed830303f7b /compiler/GHC/CoreToStg.hs
parent5daf1aa9dd5c03ec782c72f06b4704e31d92ec32 (diff)
downloadhaskell-c77179492032f4d8752481ad3e0d65d7eacb74f9.tar.gz
Fix strictness and arity info in SpecConstr
In GHC.Core.Opt.SpecConstr.spec_one we were giving join-points an incorrect join-arity -- this was fallout from commit c71b220491a6ae46924cc5011b80182bcc773a58 Author: Simon Peyton Jones <simonpj@microsoft.com> Date: Thu Apr 8 23:36:24 2021 +0100 Improvements in SpecConstr * Allow under-saturated calls to specialise See Note [SpecConstr call patterns] This just allows a bit more specialisation to take place. and showed up in #19780. I refactored the code to make the new function calcSpecInfo which treats join points separately. In doing this I discovered two other small bugs: * In the Var case of argToPat we were treating UnkOcc as uninteresting, but (by omission) NoOcc as interesting. As a result we were generating SpecConstr specialisations for functions with unused arguments. But the absence anlyser does that much better; doing it here just generates more code. Easily fixed. * The lifted/unlifted test in GHC.Core.Opt.WorkWrap.Utils.mkWorkerArgs was back to front (#19794). Easily fixed. * In the same function, mkWorkerArgs, we were adding an extra argument nullary join points, which isn't necessary. I added a test for this. That in turn meant I had to remove an ASSERT in CoreToStg.mkStgRhs for nullary join points, which was always bogus but now trips; I added a comment to explain.
Diffstat (limited to 'compiler/GHC/CoreToStg.hs')
-rw-r--r--compiler/GHC/CoreToStg.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/GHC/CoreToStg.hs b/compiler/GHC/CoreToStg.hs
index 9452015ab4..af8c8ae25b 100644
--- a/compiler/GHC/CoreToStg.hs
+++ b/compiler/GHC/CoreToStg.hs
@@ -771,8 +771,10 @@ mkStgRhs bndr (PreStgRhs bndrs rhs)
-- After this point we know that `bndrs` is empty,
-- so this is not a function binding
- | isJoinId bndr -- must be a nullary join point
- = ASSERT(idJoinArity bndr == 0)
+
+ | isJoinId bndr -- Must be a nullary join point
+ = -- It might have /type/ arguments (T18328),
+ -- so its JoinArity might be >0
StgRhsClosure noExtFieldSilent
currentCCS
ReEntrant -- ignored for LNE