Cheng Shao pushed to branch wip/binary-array-no-list at Glasgow Haskell Compiler / GHC Commits: cc9cc6d5 by Cheng Shao at 2026-04-23T09:40:46+00:00 configure: bump LlvmMaxVersion to 23 This patch bumps `LlvmMaxVersion` to 23 to support LLVM 22.x releases. - - - - - 2ea7ef8e by Cheng Shao at 2026-04-23T09:46:26+00:00 changelog: add llvm 22.x support - - - - - efac42c7 by Cheng Shao at 2026-04-24T10:06:11+00:00 ci: bump freebsd boot ghc to 9.10.3 This commit bumps freebsd boot ghc to 9.10.3 to align with other platforms and prevent outdated boot libs in boot ghc to block the freebsd job. - - - - - 2c58e2c2 by Cheng Shao at 2026-04-24T10:06:26+00:00 compiler: improve Binary instance of Array This patch improves the `Binary` instance of `Array`: - We no longer allocate intermediate lists. When serializing an `Array`, we iterate over the elements directly; when deserializing it, we allocate the result `Array` and fill it in a loop. - Now we only serialize the array bounds tuple; the length field is not needed. Closes #27109. - - - - - 6 changed files: - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - + changelog.d/binary-array-no-list - + changelog.d/llvm-22 - compiler/GHC/Utils/Binary.hs - configure.ac Changes: ===================================== .gitlab/generate-ci/gen_ci.hs ===================================== @@ -445,7 +445,7 @@ opsysVariables _ FreeBSD14 = mconcat -- Prefer to use the system's clang-based toolchain and not gcc , "CC" =: "cc" , "CXX" =: "c++" - , "FETCH_GHC_VERSION" =: "9.10.1" + , "FETCH_GHC_VERSION" =: "9.10.3" , "CABAL_INSTALL_VERSION" =: "3.14.2.0" ] opsysVariables arch (Linux distro) = distroVariables arch distro ===================================== .gitlab/jobs.yaml ===================================== @@ -1721,7 +1721,7 @@ "CC": "cc", "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check", "CXX": "c++", - "FETCH_GHC_VERSION": "9.10.1", + "FETCH_GHC_VERSION": "9.10.3", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", "TEST_ENV": "x86_64-freebsd14-validate", @@ -4543,7 +4543,7 @@ "CC": "cc", "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check", "CXX": "c++", - "FETCH_GHC_VERSION": "9.10.1", + "FETCH_GHC_VERSION": "9.10.3", "IGNORE_PERF_FAILURES": "all", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", @@ -5643,7 +5643,7 @@ "CC": "cc", "CONFIGURE_ARGS": "--with-iconv-includes=/usr/local/include --with-iconv-libraries=/usr/local/lib --with-system-libffi --with-ffi-includes=/usr/local/include --with-ffi-libraries=/usr/local/lib --with-gmp-includes=/usr/local/include --with-gmp-libraries=/usr/local/lib --enable-strict-ghc-toolchain-check", "CXX": "c++", - "FETCH_GHC_VERSION": "9.10.1", + "FETCH_GHC_VERSION": "9.10.3", "INSTALL_CONFIGURE_ARGS": "--enable-strict-ghc-toolchain-check", "RUNTEST_ARGS": "", "TEST_ENV": "x86_64-freebsd14-validate" ===================================== changelog.d/binary-array-no-list ===================================== @@ -0,0 +1,13 @@ +section: compiler +synopsis: Reduce allocations when (de)serialising `Array` in the `ghc` library. +issues: #27109 +mrs: !15805 + +description: { + The `ghc` library's `Binary` instance for `Array` was changed to + avoid allocating an intermediate list and to omit a redundant length + field during (de)serialisation. + + This should only affect the `ghc` library's (de)serialisation code paths, + primarily when parsing HIE files and bytecode objects. +} ===================================== changelog.d/llvm-22 ===================================== @@ -0,0 +1,4 @@ +section: llvm-backend +synopsis: Bump LlvmMaxVersion to support LLVM 22.x releases. +issues: #26813 +mrs: !15405 ===================================== compiler/GHC/Utils/Binary.hs ===================================== @@ -142,6 +142,8 @@ import Control.DeepSeq import Control.Monad ( when, (<$!>), unless, forM_, void ) import Foreign hiding (bit, setBit, clearBit, shiftL, shiftR, void) import Data.Array +import Data.Array.Base (unsafeFreezeIOArray) +import Data.Array.IArray (traverseArray_) import Data.Array.IO import Data.Array.Unsafe import qualified Data.Binary as Binary @@ -970,11 +972,12 @@ instance Binary a => Binary (NonEmpty a) where instance (Ix a, Binary a, Binary b) => Binary (Array a b) where put_ bh arr = do put_ bh $ bounds arr - put_ bh $ elems arr + traverseArray_ (put_ bh) arr + get bh = do - bounds <- get bh - xs <- get bh - return $ listArray bounds xs + (l, u) <- get bh + marr <- newGenArray (l, u) $ \_ -> get bh + unsafeFreezeIOArray marr instance Binary a => Binary (SmallArray a) where put_ bh sa = do ===================================== configure.ac ===================================== @@ -547,7 +547,7 @@ AC_SUBST(InstallNameToolCmd) # versions of LLVM simultaneously, but that stopped working around # 3.5/3.6 release of LLVM. LlvmMinVersion=13 # inclusive -LlvmMaxVersion=22 # not inclusive +LlvmMaxVersion=23 # not inclusive AC_SUBST([LlvmMinVersion]) AC_SUBST([LlvmMaxVersion]) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4aa9b4460d6a0ab8df2f3cd4b47fd7c... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4aa9b4460d6a0ab8df2f3cd4b47fd7c... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Cheng Shao (@TerrorJack)