[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 13 commits: typo
Marge Bot (@marge-bot)
gitlab at gitlab.haskell.org
Tue Aug 16 13:34:23 UTC 2022
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
ffc9116e by Eric Lindblad at 2022-08-16T09:01:26-04:00
typo
- - - - -
cd6f5bfd by Ben Gamari at 2022-08-16T09:02:02-04:00
CmmToLlvm: Don't aliasify builtin LLVM variables
Our aliasification logic would previously turn builtin LLVM variables
into aliases, which apparently confuses LLVM. This manifested in
initializers failing to be emitted, resulting in many profiling failures
with the LLVM backend.
Fixes #22019.
- - - - -
dc7da356 by Bryan Richter at 2022-08-16T09:02:38-04:00
run_ci: remove monoidal-containers
Fixes #21492
MonoidalMap is inlined and used to implement Variables, as before.
The top-level value "jobs" is reimplemented as a regular Map, since it
doesn't use the monoidal union anyway.
- - - - -
64110544 by Cheng Shao at 2022-08-16T09:03:15-04:00
CmmToAsm/AArch64: correct a typo
- - - - -
f2cd6512 by Andreas Klebinger at 2022-08-16T09:34:03-04:00
Fix #21979 - compact-share failing with -O
I don't have good reason to believe the optimization level should affect
if sharing works or not here. So limit the test to the normal way.
- - - - -
bbf06355 by Ben Gamari at 2022-08-16T09:34:04-04:00
users-guide: Fix reference to dead llvm-version substitution
Fixes #22052.
- - - - -
614f5478 by Ben Gamari at 2022-08-16T09:34:04-04:00
users-guide: Fix incorrect reference to `:extension: role
- - - - -
d1890fa9 by Ben Gamari at 2022-08-16T09:34:04-04:00
users-guide: Add :ghc-flag: reference
- - - - -
7e771e21 by Ben Gamari at 2022-08-16T09:34:04-04:00
hadrian: Place manpage in docroot
This relocates it from docs/ to doc/
- - - - -
0552dd15 by Ben Gamari at 2022-08-16T09:34:04-04:00
Bump haddock submodule
Includes merge of `main` into `ghc-head` as well as some Haddock users
guide fixes.
- - - - -
984380ea by Ben Gamari at 2022-08-16T09:34:04-04:00
base: Add changelog entries from ghc-9.2
Closes #21922.
- - - - -
aa3687c9 by Ben Gamari at 2022-08-16T09:34:04-04:00
relnotes: Add "included libraries" section
As noted in #21988, some users rely on this.
- - - - -
e1993fd7 by Ben Gamari at 2022-08-16T09:34:04-04:00
users-guide: Rephrase the rewrite rule documentation
Previously the wording was a tad unclear. Fix this.
Closes #21114.
- - - - -
12 changed files:
- .gitlab/gen_ci.hs
- compiler/GHC/CmmToAsm/AArch64.hs
- compiler/GHC/CmmToLlvm/Base.hs
- docs/users_guide/9.6.1-notes.rst
- docs/users_guide/exts/gadt_syntax.rst
- docs/users_guide/exts/rewrite_rules.rst
- docs/users_guide/phases.rst
- hadrian/src/Rules/Documentation.hs
- libraries/base/changelog.md
- libraries/ghc-compact/tests/all.T
- rts/Interpreter.c
- utils/haddock
Changes:
=====================================
.gitlab/gen_ci.hs
=====================================
@@ -2,13 +2,16 @@
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{- cabal:
-build-depends: base, monoidal-containers, aeson >= 1.8.1, containers, bytestring
+build-depends: base, aeson >= 1.8.1, containers, bytestring
-}
+import Data.Coerce
import Data.String (String)
import Data.Aeson as A
-import qualified Data.Map.Monoidal as M
+import qualified Data.Map as Map
+import Data.Map (Map)
import qualified Data.ByteString.Lazy as B hiding (putStrLn)
import qualified Data.ByteString.Lazy.Char8 as B
import Data.List (intercalate)
@@ -307,10 +310,22 @@ dockerImage _ _ = Nothing
-- The "proper" solution would be to use a dependent monoidal map where each key specifies
-- the combination behaviour of it's values. Ie, whether setting it multiple times is an error
-- or they should be combined.
-type Variables = M.MonoidalMap String [String]
+newtype MonoidalMap k v = MonoidalMap (Map k v)
+ deriving (Eq, Show, Functor, ToJSON)
+
+instance (Ord k, Semigroup v) => Semigroup (MonoidalMap k v) where
+ (MonoidalMap a) <> (MonoidalMap b) = MonoidalMap (Map.unionWith (<>) a b)
+
+instance (Ord k, Semigroup v) => Monoid (MonoidalMap k v) where
+ mempty = MonoidalMap (Map.empty)
+
+mminsertWith :: Ord k => (a -> a -> a) -> k -> a -> MonoidalMap k a -> MonoidalMap k a
+mminsertWith f k v (MonoidalMap m) = MonoidalMap (Map.insertWith f k v m)
+
+type Variables = MonoidalMap String [String]
(=:) :: String -> String -> Variables
-a =: b = M.singleton a [b]
+a =: b = MonoidalMap (Map.singleton a [b])
opsysVariables :: Arch -> Opsys -> Variables
opsysVariables _ FreeBSD13 = mconcat
@@ -566,7 +581,7 @@ instance ToJSON Job where
, "allow_failure" A..= jobAllowFailure
-- Joining up variables like this may well be the wrong thing to do but
-- at least it doesn't lose information silently by overriding.
- , "variables" A..= (M.map (intercalate " ") jobVariables)
+ , "variables" A..= fmap (intercalate " ") jobVariables
, "artifacts" A..= jobArtifacts
, "cache" A..= jobCache
, "after_script" A..= jobAfterScript
@@ -621,9 +636,9 @@ job arch opsys buildConfig = (jobName, Job {..})
, "BUILD_FLAVOUR" =: flavourString jobFlavour
, "BIGNUM_BACKEND" =: bignumString (bignumBackend buildConfig)
, "CONFIGURE_ARGS" =: configureArgsStr buildConfig
- , maybe M.empty ("CROSS_TARGET" =:) (crossTarget buildConfig)
- , maybe M.empty ("CROSS_EMULATOR" =:) (crossEmulator buildConfig)
- , if withNuma buildConfig then "ENABLE_NUMA" =: "1" else M.empty
+ , maybe mempty ("CROSS_TARGET" =:) (crossTarget buildConfig)
+ , maybe mempty ("CROSS_EMULATOR" =:) (crossEmulator buildConfig)
+ , if withNuma buildConfig then "ENABLE_NUMA" =: "1" else mempty
]
jobArtifacts = Artifacts
@@ -669,7 +684,7 @@ addJobRule :: Rule -> Job -> Job
addJobRule r j = j { jobRules = enableRule r (jobRules j) }
addVariable :: String -> String -> Job -> Job
-addVariable k v j = j { jobVariables = M.insertWith (++) k [v] (jobVariables j) }
+addVariable k v j = j { jobVariables = mminsertWith (++) k [v] (jobVariables j) }
-- Building the standard jobs
--
@@ -765,8 +780,8 @@ flattenJobGroup (ValidateOnly a b) = [a, b]
-- | Specification for all the jobs we want to build.
-jobs :: M.MonoidalMap String Job
-jobs = M.fromList $ concatMap flattenJobGroup $
+jobs :: Map String Job
+jobs = Map.fromList $ concatMap flattenJobGroup $
[ disableValidate (standardBuilds Amd64 (Linux Debian10))
, (standardBuildsWithConfig Amd64 (Linux Debian10) dwarf)
, (validateBuilds Amd64 (Linux Debian10) nativeInt)
=====================================
compiler/GHC/CmmToAsm/AArch64.hs
=====================================
@@ -1,6 +1,6 @@
{-# OPTIONS_GHC -fno-warn-orphans #-}
--- | Native code generator for x86 and x86-64 architectures
+-- | Native code generator for AArch64 architectures
module GHC.CmmToAsm.AArch64
( ncgAArch64 )
where
=====================================
compiler/GHC/CmmToLlvm/Base.hs
=====================================
@@ -58,7 +58,7 @@ import GHC.Utils.Logger
import Data.Maybe (fromJust)
import Control.Monad (ap)
-import Data.List (sortBy, groupBy)
+import Data.List (sortBy, groupBy, isPrefixOf)
import Data.Ord (comparing)
-- ----------------------------------------------------------------------------
@@ -504,6 +504,12 @@ generateExternDecls = do
modifyEnv $ \env -> env { envAliases = emptyUniqSet }
return (concat defss, [])
+-- | Is a variable one of the special @$llvm@ globals?
+isBuiltinLlvmVar :: LlvmVar -> Bool
+isBuiltinLlvmVar (LMGlobalVar lbl _ _ _ _ _) =
+ "$llvm" `isPrefixOf` unpackFS lbl
+isBuiltinLlvmVar _ = False
+
-- | Here we take a global variable definition, rename it with a
-- @$def@ suffix, and generate the appropriate alias.
aliasify :: LMGlobal -> LlvmM [LMGlobal]
@@ -511,8 +517,9 @@ aliasify :: LMGlobal -> LlvmM [LMGlobal]
-- Here we obtain the indirectee's precise type and introduce
-- fresh aliases to both the precise typed label (lbl$def) and the i8*
-- typed (regular) label of it with the matching new names.
-aliasify (LMGlobal (LMGlobalVar lbl ty at LMAlias{} link sect align Alias)
- (Just orig)) = do
+aliasify (LMGlobal var@(LMGlobalVar lbl ty at LMAlias{} link sect align Alias)
+ (Just orig))
+ | not $ isBuiltinLlvmVar var = do
let defLbl = llvmDefLabel lbl
LMStaticPointer (LMGlobalVar origLbl _ oLnk Nothing Nothing Alias) = orig
defOrigLbl = llvmDefLabel origLbl
@@ -525,7 +532,8 @@ aliasify (LMGlobal (LMGlobalVar lbl ty at LMAlias{} link sect align Alias)
pure [ LMGlobal (LMGlobalVar defLbl ty link sect align Alias) (Just defOrig)
, LMGlobal (LMGlobalVar lbl i8Ptr link sect align Alias) (Just orig')
]
-aliasify (LMGlobal var val) = do
+aliasify (LMGlobal var val)
+ | not $ isBuiltinLlvmVar var = do
let LMGlobalVar lbl ty link sect align const = var
defLbl = llvmDefLabel lbl
@@ -543,6 +551,7 @@ aliasify (LMGlobal var val) = do
return [ LMGlobal defVar val
, LMGlobal aliasVar (Just aliasVal)
]
+aliasify global = pure [global]
-- Note [Llvm Forward References]
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -601,3 +610,6 @@ aliasify (LMGlobal var val) = do
-- away with casting the alias to the desired type in @getSymbolPtr@
-- and instead just emit a reference to the definition symbol directly.
-- This is the @Just@ case in @getSymbolPtr at .
+--
+-- Note that we must take care not to turn LLVM's builtin variables into
+-- aliases (e.g. $llvm.global_ctors) since this confuses LLVM.
=====================================
docs/users_guide/9.6.1-notes.rst
=====================================
@@ -87,3 +87,50 @@ Compiler
``ghc-heap`` library
~~~~~~~~~~~~~~~~~~~~
+
+
+Included libraries
+------------------
+
+The package database provided with this distribution also contains a number of
+packages other than GHC itself. See the changelogs provided with these packages
+for further change information.
+
+.. ghc-package-list::
+
+ libraries/array/array.cabal: Dependency of ``ghc`` library
+ libraries/base/base.cabal: Core library
+ libraries/binary/binary.cabal: Dependency of ``ghc`` library
+ libraries/bytestring/bytestring.cabal: Dependency of ``ghc`` library
+ libraries/Cabal/Cabal/Cabal.cabal: Dependency of ``ghc-pkg`` utility
+ libraries/Cabal/Cabal-syntax/Cabal-syntax.cabal: Dependency of ``ghc-pkg`` utility
+ libraries/containers/containers/containers.cabal: Dependency of ``ghc`` library
+ libraries/deepseq/deepseq.cabal: Dependency of ``ghc`` library
+ libraries/directory/directory.cabal: Dependency of ``ghc`` library
+ libraries/exceptions/exceptions.cabal: Dependency of ``ghc`` and ``haskeline`` library
+ libraries/filepath/filepath.cabal: Dependency of ``ghc`` library
+ compiler/ghc.cabal: The compiler itself
+ libraries/ghci/ghci.cabal: The REPL interface
+ libraries/ghc-boot/ghc-boot.cabal: Internal compiler library
+ libraries/ghc-boot-th/ghc-boot-th.cabal: Internal compiler library
+ libraries/ghc-compact/ghc-compact.cabal: Core library
+ libraries/ghc-heap/ghc-heap.cabal: GHC heap-walking library
+ libraries/ghc-prim/ghc-prim.cabal: Core library
+ libraries/haskeline/haskeline.cabal: Dependency of ``ghci`` executable
+ libraries/hpc/hpc.cabal: Dependency of ``hpc`` executable
+ libraries/integer-gmp/integer-gmp.cabal: Core library
+ libraries/libiserv/libiserv.cabal: Internal compiler library
+ libraries/mtl/mtl.cabal: Dependency of ``Cabal`` library
+ libraries/parsec/parsec.cabal: Dependency of ``Cabal`` library
+ libraries/pretty/pretty.cabal: Dependency of ``ghc`` library
+ libraries/process/process.cabal: Dependency of ``ghc`` library
+ libraries/stm/stm.cabal: Dependency of ``haskeline`` library
+ libraries/template-haskell/template-haskell.cabal: Core library
+ libraries/terminfo/terminfo.cabal: Dependency of ``haskeline`` library
+ libraries/text/text.cabal: Dependency of ``Cabal`` library
+ libraries/time/time.cabal: Dependency of ``ghc`` library
+ libraries/transformers/transformers.cabal: Dependency of ``ghc`` library
+ libraries/unix/unix.cabal: Dependency of ``ghc`` library
+ libraries/Win32/Win32.cabal: Dependency of ``ghc`` library
+ libraries/xhtml/xhtml.cabal: Dependency of ``haddock`` executable
+
=====================================
docs/users_guide/exts/gadt_syntax.rst
=====================================
@@ -6,7 +6,7 @@ Declaring data types with explicit constructor signatures
.. extension:: GADTSyntax
:shortdesc: Enable generalised algebraic data type syntax.
- :implied by: :extensions:`GADTs`
+ :implied by: :extension:`GADTs`
:since: 7.2.1
:status: Included in :extension:`GHC2021`
=====================================
docs/users_guide/exts/rewrite_rules.rst
=====================================
@@ -438,8 +438,8 @@ earlier versions of GHC. For example, suppose that: ::
where ``intLookup`` is an implementation of ``genericLookup`` that works
very fast for keys of type ``Int``. You might wish to tell GHC to use
``intLookup`` instead of ``genericLookup`` whenever the latter was
-called with type ``Table Int b -> Int -> b``. It used to be possible to
-write ::
+called with type ``Table Int b -> Int -> b``. It used to be possible to write a
+:pragma:`SPECIALIZE` pragma with a right-hand-side: ::
{-# SPECIALIZE genericLookup :: Table Int b -> Int -> b = intLookup #-}
=====================================
docs/users_guide/phases.rst
=====================================
@@ -467,7 +467,7 @@ defined by your local GHC installation, the following trick is useful:
.. index::
single: __GLASGOW_HASKELL_LLVM__
- Only defined when ``-fllvm`` is specified. When GHC is using version
+ Only defined when `:ghc-flag:`-fllvm` is specified. When GHC is using version
``x.y.z`` of LLVM, the value of ``__GLASGOW_HASKELL_LLVM__`` is the
integer ⟨xyy⟩ (if ⟨y⟩ is a single digit, then a leading zero
is added, so for example when using version 3.7 of LLVM,
@@ -614,8 +614,8 @@ Options affecting code generation
.. note::
- Note that this GHC release expects an LLVM version in the |llvm-version|
- release series.
+ Note that this GHC release expects an LLVM version between |llvm-version-min|
+ and |llvm-version-max|.
.. ghc-flag:: -fno-code
:shortdesc: Omit code generation
=====================================
hadrian/src/Rules/Documentation.hs
=====================================
@@ -41,7 +41,7 @@ archiveRoot :: FilePath
archiveRoot = docRoot -/- "archives"
manPageBuildPath :: FilePath
-manPageBuildPath = "docs/users_guide/build-man/ghc.1"
+manPageBuildPath = docRoot -/- "users_guide/build-man/ghc.1"
-- TODO: Get rid of this hack.
docContext :: Context
=====================================
libraries/base/changelog.md
=====================================
@@ -22,7 +22,7 @@
* `GHC.Conc.Sync.threadLabel` was added, allowing the user to query the label
of a given `ThreadId`.
-## 4.17.0.0 *TBA*
+## 4.17.0.0 *August 2022*
* Add explicitly bidirectional `pattern TypeRep` to `Type.Reflection`.
@@ -66,14 +66,55 @@
A [migration guide](https://github.com/haskell/core-libraries-committee/blob/main/guides/no-monadfail-st-inst.md)
is available.
- * Add functions `traceWith`, `traceShowWith`, `traceEventWith` to
- `Debug.Trace`, per
- [CLC #36](https://github.com/haskell/core-libraries-committee/issues/36).
-
* Re-export `augment` and `build` function from `GHC.List`
* Re-export the `IsList` typeclass from the new `GHC.IsList` module.
+ * There's a new special function ``withDict`` in ``GHC.Exts``: ::
+
+ withDict :: forall {rr :: RuntimeRep} cls meth (r :: TYPE rr). WithDict cls meth => meth -> (cls => r) -> r
+
+ where ``cls`` must be a class containing exactly one method, whose type
+ must be ``meth``.
+
+ This function converts ``meth`` to a type class dictionary.
+ It removes the need for ``unsafeCoerce`` in implementation of reflection
+ libraries. It should be used with care, because it can introduce
+ incoherent instances.
+
+ For example, the ``withTypeable`` function from the
+ ``Type.Reflection`` module can now be defined as: ::
+
+ withTypeable :: forall k (a :: k) rep (r :: TYPE rep). ()
+ => TypeRep a -> (Typeable a => r) -> r
+ withTypeable rep k = withDict @(Typeable a) rep k
+
+ Note that the explicit type application is required, as the call to
+ ``withDict`` would be ambiguous otherwise.
+
+ This replaces the old ``GHC.Exts.magicDict``, which required
+ an intermediate data type and was less reliable.
+
+ * `Data.Word.Word64` and `Data.Int.Int64` are now always represented by
+ `Word64#` and `Int64#`, respectively. Previously on 32-bit platforms these
+ were rather represented by `Word#` and `Int#`. See GHC #11953.
+
+## 4.16.3.0 *May 2022*
+
+ * Shipped with GHC 9.2.4
+
+ * winio: make consoleReadNonBlocking not wait for any events at all.
+
+ * winio: Add support to console handles to handleToHANDLE
+
+## 4.16.2.0 *May 2022*
+
+ * Shipped with GHC 9.2.2
+
+ * Export GHC.Event.Internal on Windows (#21245)
+
+ # Documentation Fixes
+
## 4.16.1.0 *Feb 2022*
* Shipped with GHC 9.2.2
@@ -498,7 +539,7 @@
in constant space when applied to lists. (#10830)
* `mkFunTy`, `mkAppTy`, and `mkTyConApp` from `Data.Typeable` no longer exist.
- This functionality is superseded by the interfaces provided by
+ This functionality is superceded by the interfaces provided by
`Type.Reflection`.
* `mkTyCon3` is no longer exported by `Data.Typeable`. This function is
=====================================
libraries/ghc-compact/tests/all.T
=====================================
@@ -16,8 +16,8 @@ test('compact_pinned', exit_code(1), compile_and_run, [''])
test('compact_gc', [fragile_for(17253, ['ghci']), ignore_stdout], compile_and_run, [''])
# this test computes closure sizes and those are affected
# by the ghci and prof ways, because of BCOs and profiling headers.
-test('compact_share', omit_ways(['ghci', 'profasm', 'profthreaded']),
- compile_and_run, [''])
+# Optimization levels slightly change what is/isn't shared so only run in normal mode
+test('compact_share', only_ways(['normal']), compile_and_run, [''])
test('compact_bench', [ ignore_stdout, extra_run_opts('100') ],
compile_and_run, [''])
test('T17044', normal, compile_and_run, [''])
=====================================
rts/Interpreter.c
=====================================
@@ -1875,7 +1875,7 @@ run_BCO:
int flags = BCO_NEXT;
bool interruptible = flags & 0x1;
bool unsafe_call = flags & 0x2;
- void(*marshall_fn)(void*) = (void (*)(void*))BCO_LIT(o_itbl);
+ void(*marshal_fn)(void*) = (void (*)(void*))BCO_LIT(o_itbl);
/* the stack looks like this:
@@ -1902,7 +1902,7 @@ run_BCO:
#define ROUND_UP_WDS(p) ((((StgWord)(p)) + sizeof(W_)-1)/sizeof(W_))
- ffi_cif *cif = (ffi_cif *)marshall_fn;
+ ffi_cif *cif = (ffi_cif *)marshal_fn;
uint32_t nargs = cif->nargs;
uint32_t ret_size;
uint32_t i;
=====================================
utils/haddock
=====================================
@@ -1 +1 @@
-Subproject commit 4f8a875dec5db8795286a557779f3eb684718be6
+Subproject commit a9a312991e55ab99a8dee36a6747f4fc5d5b7c67
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dc62f24ecd1c2b8f3a127845ffdfb8159257fc8c...e1993fd7c296a0b43946a18bd98b8457815c5548
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dc62f24ecd1c2b8f3a127845ffdfb8159257fc8c...e1993fd7c296a0b43946a18bd98b8457815c5548
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/20220816/b89f78d1/attachment-0001.html>
More information about the ghc-commits
mailing list