diff options
author | Andreas Klebinger <klebinger.andreas@gmx.at> | 2022-02-28 12:16:12 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-03-07 23:48:56 -0500 |
commit | 6ce6c2504c33eb0faa9c160dc1773735d858504c (patch) | |
tree | 6140ee3bbade212e478b75be040b9b5fcdbdd8d9 /compiler/GHC/Stg | |
parent | 7a02aeb8785d5741f36287c89ffba7b50d29e853 (diff) | |
download | haskell-6ce6c2504c33eb0faa9c160dc1773735d858504c.tar.gz |
Expand and improve the Note [Strict Worker Ids].
I've added an explicit mention of the invariants surrounding those. As well as adding
more direct cross references to the Strict Field Invariant.
Diffstat (limited to 'compiler/GHC/Stg')
-rw-r--r-- | compiler/GHC/Stg/InferTags.hs | 4 |
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 |