summaryrefslogtreecommitdiff
path: root/compiler/GHC/Stg/InferTags.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Stg/InferTags.hs')
-rw-r--r--compiler/GHC/Stg/InferTags.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/Stg/InferTags.hs b/compiler/GHC/Stg/InferTags.hs
index 2a42b4c7de..79acaa14f5 100644
--- a/compiler/GHC/Stg/InferTags.hs
+++ b/compiler/GHC/Stg/InferTags.hs
@@ -82,6 +82,8 @@ and will be tagged with `001` or `010` respectively.
It will never point to a thunk, nor will it be tagged `000` (meaning "might be a thunk").
NB: Note that the proper tag for some objects is indeed `000`. Currently this is the case for PAPs.
+This works analogous to how `StrictWorkerId`s work. See also Note [Strict Worker Ids].
+
Why do we care? Because if we have code like:
case strictPair of
@@ -119,6 +121,8 @@ evaluated will allocate the constructor.
So we do our best to establish that `x` is already tagged (which it almost always is)
to avoid this cost. In my benchmarks I haven't seen any cases where this causes regressions.
+Note that there are similar constraints around Note [Strict Worker Ids].
+
Note [How untagged pointers can end up in strict fields]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider