diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2021-06-15 21:08:52 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-06-19 12:26:01 -0400 |
commit | fc8ad5f35a8ec314c801b226a9165b5354363a72 (patch) | |
tree | 5585c79dabfde83d87e47a2887d3ff24e6405253 /compiler/GHC/Builtin | |
parent | 1c79ddc8c566a23cf1a77a6a68c65e508fe8ee4d (diff) | |
download | haskell-fc8ad5f35a8ec314c801b226a9165b5354363a72.tar.gz |
Fix type and strictness signature of fork#
When working eta-expansion and reduction, I found that fork# had a
weaker strictness signature than it should have (#19992). In
particular, it didn't record that it applies its argument exactly
once. To this I needed to give it a proper type (its first argument is
always a function, which in turn entailed a small change to the call
in GHC.Conc.Sync
This patch fixes it.
Diffstat (limited to 'compiler/GHC/Builtin')
-rw-r--r-- | compiler/GHC/Builtin/primops.txt.pp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/GHC/Builtin/primops.txt.pp b/compiler/GHC/Builtin/primops.txt.pp index 77869cab20..672b831ac7 100644 --- a/compiler/GHC/Builtin/primops.txt.pp +++ b/compiler/GHC/Builtin/primops.txt.pp @@ -2774,10 +2774,13 @@ primtype ThreadId# other operations can be omitted.)} primop ForkOp "fork#" GenPrimOp - a -> State# RealWorld -> (# State# RealWorld, ThreadId# #) + (State# RealWorld -> (# State# RealWorld, a #)) + -> State# RealWorld -> (# State# RealWorld, ThreadId# #) with has_side_effects = True out_of_line = True + strictness = { \ _arity -> mkClosedDmdSig [ lazyApply1Dmd + , topDmd ] topDiv } primop ForkOnOp "forkOn#" GenPrimOp Int# -> a -> State# RealWorld -> (# State# RealWorld, ThreadId# #) |