summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Graf <sebastian.graf@kit.edu>2020-11-03 18:28:49 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-11-20 02:09:51 -0500
commit321d1bd8a79ab39c3c9e8697fffb0107c43f83cf (patch)
treeee3b1476f7bffafd318607a3963a79ee47f4e9f7
parentb57845c3d80f5bed8f498f27fb7a318f2b2f8b2c (diff)
downloadhaskell-321d1bd8a79ab39c3c9e8697fffb0107c43f83cf.tar.gz
Fix strictness signatures of `prefetchValue*#` primops
Their strictness signatures said the primops are strict in their first argument, which is wrong: Handing it a thunk will prefetch the pointer to the thunk, but not evaluate it. Hence not strict. The regression test `T8256` actually tests for laziness in the first argument, so GHC apparently never exploited the strictness signature. See also https://gitlab.haskell.org/ghc/ghc/-/issues/8256#note_310867, where this came up.
-rw-r--r--compiler/GHC/Builtin/primops.txt.pp12
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/GHC/Builtin/primops.txt.pp b/compiler/GHC/Builtin/primops.txt.pp
index acee822b0c..74abca2927 100644
--- a/compiler/GHC/Builtin/primops.txt.pp
+++ b/compiler/GHC/Builtin/primops.txt.pp
@@ -3519,8 +3519,7 @@ primop PrefetchAddrOp3 "prefetchAddr3#" GenPrimOp
primop PrefetchValueOp3 "prefetchValue3#" GenPrimOp
a -> State# s -> State# s
- with strictness = { \ _arity -> mkClosedStrictSig [botDmd, topDmd] topDiv }
- has_side_effects = True
+ with has_side_effects = True
----
primop PrefetchByteArrayOp2 "prefetchByteArray2#" GenPrimOp
@@ -3537,8 +3536,7 @@ primop PrefetchAddrOp2 "prefetchAddr2#" GenPrimOp
primop PrefetchValueOp2 "prefetchValue2#" GenPrimOp
a -> State# s -> State# s
- with strictness = { \ _arity -> mkClosedStrictSig [botDmd, topDmd] topDiv }
- has_side_effects = True
+ with has_side_effects = True
----
primop PrefetchByteArrayOp1 "prefetchByteArray1#" GenPrimOp
@@ -3555,8 +3553,7 @@ primop PrefetchAddrOp1 "prefetchAddr1#" GenPrimOp
primop PrefetchValueOp1 "prefetchValue1#" GenPrimOp
a -> State# s -> State# s
- with strictness = { \ _arity -> mkClosedStrictSig [botDmd, topDmd] topDiv }
- has_side_effects = True
+ with has_side_effects = True
----
primop PrefetchByteArrayOp0 "prefetchByteArray0#" GenPrimOp
@@ -3573,8 +3570,7 @@ primop PrefetchAddrOp0 "prefetchAddr0#" GenPrimOp
primop PrefetchValueOp0 "prefetchValue0#" GenPrimOp
a -> State# s -> State# s
- with strictness = { \ _arity -> mkClosedStrictSig [botDmd, topDmd] topDiv }
- has_side_effects = True
+ with has_side_effects = True
------------------------------------------------------------------------
--- ---