[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 2 commits: Clarify Note [GlobalId/LocalId] after CorePrep (#23797)

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri Sep 1 15:29:14 UTC 2023



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
30f46280 by Sebastian Graf at 2023-09-01T11:29:04-04:00
Clarify Note [GlobalId/LocalId] after CorePrep (#23797)

Fixes #23797.

- - - - -
265c16de by Sylvain Henry at 2023-09-01T11:29:07-04:00
Fix warning with UNPACK on sum type (#23921)

- - - - -


2 changed files:

- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Types/Var.hs


Changes:

=====================================
compiler/GHC/Core/TyCon.hs
=====================================
@@ -1,4 +1,4 @@
-
+{-# LANGUAGE CPP  #-}
 {-# LANGUAGE FlexibleInstances  #-}
 {-# LANGUAGE LambdaCase         #-}
 {-# LANGUAGE DeriveDataTypeable #-}
@@ -1531,13 +1531,19 @@ See Note [RuntimeRep and PrimRep] in GHC.Types.RepType.
 
 -}
 
+
 -- | A 'PrimRep' is an abstraction of a type.  It contains information that
 -- the code generator needs in order to pass arguments, return results,
 -- and store values of this type. See also Note [RuntimeRep and PrimRep] in
 -- "GHC.Types.RepType" and Note [VoidRep] in "GHC.Types.RepType".
 data PrimRep
   = VoidRep
+-- Unpacking of sum types is only supported since 9.6.1
+#if MIN_VERSION_GLASGOW_HASKELL(9,6,0,0)
   | BoxedRep {-# UNPACK #-} !(Maybe Levity) -- ^ Boxed, heap value
+#else
+  | BoxedRep                !(Maybe Levity) -- ^ Boxed, heap value
+#endif
   | Int8Rep       -- ^ Signed, 8-bit value
   | Int16Rep      -- ^ Signed, 16-bit value
   | Int32Rep      -- ^ Signed, 32-bit value


=====================================
compiler/GHC/Types/Var.hs
=====================================
@@ -322,7 +322,10 @@ A LocalId is
   * or defined at top level in the module being compiled
   * always treated as a candidate by the free-variable finder
 
-After CoreTidy, top-level LocalIds are turned into GlobalIds
+In the output of CoreTidy, top level Ids are all GlobalIds, which are then
+serialised into interface files. Do note however that CorePrep may introduce new
+LocalIds for local floats (even at the top level). These will be visible in STG
+and end up in generated code.
 
 Note [Multiplicity of let binders]
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/187a6f022c34a2b419b8d38f9972ca99e52eca59...265c16de7271734bd183016f87ddedaad900872b

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/187a6f022c34a2b419b8d38f9972ca99e52eca59...265c16de7271734bd183016f87ddedaad900872b
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230901/f835b8a9/attachment-0001.html>


More information about the ghc-commits mailing list