[Git][ghc/ghc][wip/backports-9.14] 20 commits: testsuite: fix T3586 for non-SSE3 platforms
Ben Gamari pushed to branch wip/backports-9.14 at Glasgow Haskell Compiler / GHC Commits: ffd03d32 by Cheng Shao at 2025-10-25T16:12:45-04:00 testsuite: fix T3586 for non-SSE3 platforms `T3586.hs` contains `-fvia-C -optc-msse3` which I think is a best-effort basis to harvest the C compiler's auto vectorization optimizations via the C backend back when the test was added. The `-fvia-C` part is now a deprecated no-op because GHC can't fall back to the C backend on a non-unregisterised build, and `-optc-msse3` might actually cause the test to fail on non x86/x64 platforms, e.g. recent builds of wasi-sdk would report `wasm32-wasi-clang: error: unsupported option '-msse3' for target 'wasm32-unknown-wasi'`. So this patch cleans up this historical cruft. `-fvia-C` is removed, and `-optc-msse3` is only passed when cpuid contains `pni` (which indicates support of SSE3). (cherry picked from commit 70ee825a516bcf7aac762bfedb4a017d35f8dcf3) - - - - - 0a01bea2 by Ben Gamari at 2025-10-25T16:12:45-04:00 rts/nonmoving: Fix comment spelling (cherry picked from commit 14281a22eb27498886def8e5d17797c9ce62f3ad) - - - - - 836511fe by Ben Gamari at 2025-10-25T16:12:45-04:00 rts/nonmoving: Use atomic operations to update bd->flags (cherry picked from commit bedd38b01d6b113cb3bd10b5d784c16b32efb5bb) - - - - - 5a50298b by Ben Gamari at 2025-10-25T16:12:45-04:00 nonmoving: Use get_itbl instead of explicit loads This is cleaner and also fixes unnecessary (and unsound) use of `volatile`. (cherry picked from commit 215d68414020dc4ed0636508c9eecd9f44f62168) - - - - - 1cfaf40a by Ben Gamari at 2025-10-25T16:12:45-04:00 rts/Scav: Handle WHITEHOLEs in scavenge_one `scavenge_one`, used to scavenge mutable list entries, may encounter `WHITEHOLE`s when the non-moving GC is in use via two paths: 1. when an MVAR is being marked concurrently 2. when the object belongs to a chain of selectors being short-cutted. Fixes #26204. (cherry picked from commit 2c94aa3aa87c14b1ff5c4355c9a90efedd5d10f4) - - - - - d4db67c0 by Ben Gamari at 2025-10-25T16:12:45-04:00 gitlab-ci: Make RELEASE_JOB an input Rather than an undocumented variable. (cherry picked from commit f9790ca81deb8b14ff2eabf701aecbcfd6501963) - - - - - e3ca15f7 by Julian Ospald at 2025-10-25T16:12:45-04:00 ghc-toolchain: Drop `ld.gold` from merge object command It's deprecated. Also see #25716 (cherry picked from commit c58f9a615f05e9d43629f6e846ae22cad2a6163d) - - - - - 5c820b10 by Ben Gamari at 2025-10-25T16:12:45-04:00 rts/posix: Enforce iteration limit on heap reservation logic Previously we could loop indefinitely when attempting to get an address space reservation for our heap. Limit the logic to 8 iterations to ensure we instead issue a reasonable error message. Addresses #26151. (cherry picked from commit ff1650c96c61af02e193854312a9ccd303968e47) - - - - - 1fb72cf5 by Ben Gamari at 2025-10-25T16:12:45-04:00 rts/posix: Hold on to low reservations when reserving heap Previously when the OS gave us an address space reservation in low memory we would immediately release it and try again. However, on some platforms this meant that we would get the same allocation again in the next iteration (since mmap's `hint` argument is just that, a hint). Instead we now hold on to low reservations until we have found a suitable heap reservation. Fixes #26151. (cherry picked from commit 0184455728f841a699648f879fdb29128081fc6b) - - - - - 10bda05d by Luite Stegeman at 2025-10-25T16:12:45-04:00 rts: Fix lost wakeups in threadPaused for threads blocked on black holes The lazy blackholing code in threadPaused could overwrite closures that were already eagerly blackholed, and as such wouldn't have a marked update frame. If the black hole was overwritten by its original owner, this would lead to an undetected collision, and the contents of any existing blocking queue being lost. This adds a check for eagerly blackholed closures and avoids overwriting their contents. Fixes #26324 (cherry picked from commit a1de535f762bc23d4cf23a5b1853591dda12cdc9) - - - - - a62540e4 by Luite Stegeman at 2025-10-25T16:12:45-04:00 rts: push the correct update frame in stg_AP_STACK The frame contains an eager black hole (__stg_EAGER_BLACKHOLE_info) so we should push an stg_bh_upd_frame_info instead of an stg_upd_frame_info. (cherry picked from commit b7e21e498d39e0ee764e3237544b4c39ddf98467) - - - - - d44e8dbe by sheaf at 2025-10-25T16:12:45-04:00 Improve deep subsumption This commit improves the DeepSubsumption sub-typing implementation in GHC.Tc.Utils.Unify.tc_sub_type_deep by being less eager to fall back to unification. For example, we now are properly able to prove the subtyping relationship ((∀ a. a->a) -> Int) -> Bool <= β[tau] Bool for an unfilled metavariable β. In this case (with an AppTy on the right), we used to fall back to unification. No longer: now, given that the LHS is a FunTy and that the RHS is a deep rho type (does not need any instantiation), we try to make the RHS into a FunTy, viz. β := (->) γ We can then continue using covariance & contravariance of the function arrow, which allows us to prove the subtyping relationship, instead of trying to unify which would cause us to error out with: Couldn't match expected type ‘β’ with actual type ‘(->) ((∀ a. a -> a) -> Int) See Note [FunTy vs non-FunTy case in tc_sub_type_deep] in GHC.Tc.Utils.Unify. The other main improvement in this patch concerns type inference. The main subsumption logic happens (before & after this patch) in GHC.Tc.Gen.App.checkResultTy. However, before this patch, all of the DeepSubsumption logic only kicked in in 'check' mode, not in 'infer' mode. This patch adds deep instantiation in the 'infer' mode of checkResultTy when we are doing deep subsumption, which allows us to accept programs such as: f :: Int -> (forall a. a->a) g :: Int -> Bool -> Bool test1 b = case b of True -> f False -> g test2 b = case b of True -> g False -> f See Note [Deeply instantiate in checkResultTy when inferring]. Finally, we add representation-polymorphism checks to ensure that the lambda abstractions we introduce when doing subsumption obey the representation polymorphism invariants of Note [Representation polymorphism invariants] in GHC.Core. See Note [FunTy vs FunTy case in tc_sub_type_deep]. This is accompanied by a courtesy change to `(<.>) :: HsWrapper -> HsWrapper -> HsWrapper`, adding the equation: WpCast c1 <.> WpCast c2 = WpCast (c1 `mkTransCo` c2) This is useful because mkWpFun does not introduce an eta-expansion when both of the argument & result wrappers are casts; so this change allows us to avoid introducing lambda abstractions when casts suffice. Fixes #26225 (cherry picked from commit 56b32c5a2d5d7cad89a12f4d74dc940e086069d1) - - - - - 9b42551e by Simon Peyton Jones at 2025-10-25T16:12:46-04:00 Fix deep subsumption again This commit fixed #26255: commit 56b32c5a2d5d7cad89a12f4d74dc940e086069d1 Author: sheaf <sam.derbyshire@gmail.com> Date: Mon Aug 11 15:50:47 2025 +0200 Improve deep subsumption This commit improves the DeepSubsumption sub-typing implementation in GHC.Tc.Utils.Unify.tc_sub_type_deep by being less eager to fall back to unification. But alas it still wasn't quite right for view patterns: #26331 This MR does a generalisation to fix it. A bit of a sledgehammer to crack a nut, but nice. * Add a field `ir_inst :: InferInstFlag` to `InferResult`, where ``` data InferInstFlag = IIF_Sigma | IIF_ShallowRho | IIF_DeepRho ``` * The flag says exactly how much `fillInferResult` should instantiate before filling the hole. * We can also use this to replace the previous very ad-hoc `tcInferSigma` that was used to implement GHCi's `:type` command. (cherry picked from commit 716274a5b6c35d963091f563c98d07e72ee4d755) - - - - - 6c0409bc by sheaf at 2025-10-25T16:12:46-04:00 Use tcMkScaledFunTys in matchExpectedFunTys We should use tcMkScaledFunTys rather than mkScaledFunTys in GHC.Tc.Utils.Unify.matchExpectedFunTys, as the latter crashes when the kind of the result type is a bare metavariable. We know the result is always Type-like, so we don't need scaledFunTys to try to rediscover that from the kind. Fixes #26277 (cherry picked from commit 624afa4a65caa8ec23f85e70574dfb606f90c173) - - - - - 1e5a7d25 by sheaf at 2025-10-25T16:12:46-04:00 Deep subsumption: unify mults without tcEqMult As seen in #26332, we may well end up with a non-reflexive multiplicity coercion when doing deep subsumption. We should do the same thing that we do without deep subsumption: unify the multiplicities normally, without requiring that the coercion is reflexive (which is what 'tcEqMult' was doing). Fixes #26332 (cherry picked from commit dc79593d4606e5cea93e742a9f2def53705bc773) - - - - - 7ddb64c2 by Teo Camarasu at 2025-10-25T16:12:46-04:00 ghc-internal: invert dependency of GHC.Internal.TH.Syntax on Data.Data This means that Data.Data no longer blocks building TH.Syntax, which allows greater parallelism in our builds. We move the Data.Data.Data instances to Data.Data. Quasi depends on Data.Data for one of its methods, so, we split the Quasi/Q, etc definition out of GHC.Internal.TH.Syntax into its own module. This has the added benefit of splitting up this quite large module. Previously TH.Syntax was a bottleneck when compiling ghc-internal. Now it is less of a bottle-neck and is also slightly quicker to compile (since it no longer contains these instances) at the cost of making Data.Data slightly more expensive to compile. TH.Lift which depends on TH.Syntax can also compile quicker and no longer blocks ghc-internal finishing to compile. Resolves #26217 ------------------------- Metric Decrease: MultiLayerModulesTH_OneShot T13253 T21839c T24471 Metric Increase: T12227 ------------------------- - - - - - 6477204c by Teo Camarasu at 2025-10-25T16:12:46-04:00 Add submodules for template-haskell-lift and template-haskell-quasiquoter These two new boot libraries expose stable subsets of the template-haskell interface. This is an implemenation of the GHC proposal https://github.com/ghc-proposals/ghc-proposals/pull/696 Work towards #25262 (cherry picked from commit 4be32153febff94f9c89f7f74971da3721d19c87) - - - - - 0ee3398e by Ben Gamari at 2025-10-25T16:12:46-04:00 testsuite: Accept new template-haskell-exports output - - - - - 4686a8b2 by Ben Gamari at 2025-10-25T16:12:46-04:00 testsuite: Accept new base-exports output - - - - - 387872bd by Ben Gamari at 2025-10-25T16:12:46-04:00 template-haskell: Accept T15321 - - - - - 92 changed files: - .gitlab-ci.yml - .gitmodules - compiler/GHC/Builtin/Names/TH.hs - compiler/GHC/Builtin/PrimOps/Ids.hs - compiler/GHC/Cmm/Parser.y - compiler/GHC/Hs/Expr.hs - compiler/GHC/HsToCore.hs - compiler/GHC/Rename/Splice.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Expr.hs-boot - compiler/GHC/Tc/Gen/Head.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Gen/Pat.hs - compiler/GHC/Tc/Gen/Splice.hs - compiler/GHC/Tc/Gen/Splice.hs-boot - compiler/GHC/Tc/Module.hs - compiler/GHC/Tc/Types/Evidence.hs - compiler/GHC/Tc/Types/Origin.hs - compiler/GHC/Tc/Types/TH.hs - compiler/GHC/Tc/Utils/Concrete.hs - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Tc/Utils/TcType.hs - compiler/GHC/Tc/Utils/Unify.hs - compiler/GHC/Types/Id/Make.hs - hadrian/src/Packages.hs - hadrian/src/Settings/Default.hs - libraries/base/src/Data/Array/Byte.hs - libraries/base/src/Data/Fixed.hs - + libraries/ghc-boot-th/GHC/Boot/TH/Monad.hs - libraries/ghc-boot-th/ghc-boot-th.cabal.in - libraries/ghc-internal/ghc-internal.cabal.in - libraries/ghc-internal/src/GHC/Internal/Data/Data.hs - libraries/ghc-internal/src/GHC/Internal/TH/Lib.hs - libraries/ghc-internal/src/GHC/Internal/TH/Lift.hs - + libraries/ghc-internal/src/GHC/Internal/TH/Monad.hs - libraries/ghc-internal/src/GHC/Internal/TH/Quote.hs - libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs - libraries/ghci/GHCi/Message.hs - libraries/ghci/GHCi/TH.hs - + libraries/template-haskell-lift - + libraries/template-haskell-quasiquoter - libraries/template-haskell/Language/Haskell/TH/Quote.hs - libraries/template-haskell/Language/Haskell/TH/Syntax.hs - rts/Apply.cmm - rts/ThreadPaused.c - rts/include/rts/storage/Block.h - rts/posix/OSMem.c - rts/sm/NonMoving.c - rts/sm/NonMovingMark.c - rts/sm/Scav.c - testsuite/driver/cpu_features.py - testsuite/tests/corelint/LintEtaExpand.stderr - testsuite/tests/deriving/should_compile/T14682.stderr - testsuite/tests/deriving/should_compile/drv-empty-data.stderr - testsuite/tests/indexed-types/should_fail/T5439.stderr - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - testsuite/tests/interface-stability/template-haskell-exports.stdout - + testsuite/tests/linear/should_compile/T26332.hs - testsuite/tests/linear/should_compile/all.T - testsuite/tests/partial-sigs/should_compile/T10403.stderr - testsuite/tests/partial-sigs/should_fail/T10615.stderr - + testsuite/tests/patsyn/should_compile/T26331.hs - + testsuite/tests/patsyn/should_compile/T26331a.hs - testsuite/tests/patsyn/should_compile/all.T - testsuite/tests/perf/should_run/T3586.hs - testsuite/tests/perf/should_run/all.T - testsuite/tests/plugins/plugins10.stdout - + testsuite/tests/rep-poly/NoEtaRequired.hs - testsuite/tests/rep-poly/T21906.stderr - testsuite/tests/rep-poly/all.T - testsuite/tests/splice-imports/SI29.stderr - testsuite/tests/th/T11452.stderr - testsuite/tests/th/T15321.stderr - testsuite/tests/th/T7276.stderr - testsuite/tests/th/TH_NestedSplicesFail3.stderr - testsuite/tests/th/TH_NestedSplicesFail4.stderr - + testsuite/tests/typecheck/should_compile/T26225.hs - + testsuite/tests/typecheck/should_compile/T26225b.hs - + testsuite/tests/typecheck/should_compile/T26277.hs - testsuite/tests/typecheck/should_compile/all.T - − testsuite/tests/typecheck/should_fail/T12563.stderr - testsuite/tests/typecheck/should_fail/T14618.stderr - testsuite/tests/typecheck/should_fail/T6022.stderr - testsuite/tests/typecheck/should_fail/T8883.stderr - testsuite/tests/typecheck/should_fail/all.T - testsuite/tests/typecheck/should_fail/tcfail140.stderr - utils/ghc-toolchain/src/GHC/Toolchain/Tools/MergeObjs.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e86b75973070d173cdb4a7dc54a58bc... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e86b75973070d173cdb4a7dc54a58bc... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Ben Gamari (@bgamari)