[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 7 commits: Make PmLit be in Ord, and use it in Map
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: c12fa73e by Simon Peyton Jones at 2025-11-19T02:55:01-05:00 Make PmLit be in Ord, and use it in Map This MR addresses #26514, by changing from data PmAltConSet = PACS !(UniqDSet ConLike) ![PmLit] to data PmAltConSet = PACS !(UniqDSet ConLike) !(Map PmLit PmLit) This matters when doing pattern-match overlap checking, when there is a very large set of patterns. For most programs it makes no difference at all. For the N=5000 case of the repro case in #26514, compiler mutator time (with `-fno-code`) goes from 1.9s to 0.43s. All for the price for an Ord instance for PmLit - - - - - 41b84f40 by sheaf at 2025-11-19T02:55:52-05:00 Add passing tests for #26311 and #26072 This commit adds two tests cases that now pass since landing the changes to typechecking of data constructors in b33284c7. Fixes #26072 #26311 - - - - - 1faa758a by sheaf at 2025-11-19T02:55:52-05:00 mkCast: weaken bad cast warning for multiplicity This commit weakens the warning message emitted when constructing a bad cast in mkCast to ignore multiplicity. Justification: since b33284c7, GHC uses sub-multiplicity coercions to typecheck data constructors. The coercion optimiser is free to discard these coercions, both for performance reasons, and because GHC's Core simplifier does not (yet) preserve linearity. We thus weaken 'mkCast' to use 'eqTypeIgnoringMultiplicity' instead of 'eqType', to avoid getting many spurious warnings about mismatched multiplicities. - - - - - 903b9f29 by Julian Ospald at 2025-11-19T07:33:54-05:00 Support statically linking executables properly Fixes #26434 In detail, this does a number of things: * Makes GHC aware of 'extra-libraries-static' (this changes the package database format). * Adds a switch '-static-external' that will honour 'extra-libraries-static' to link external system dependencies statically. * Adds a new field to settings/targets: "ld supports verbatim namespace". This field is used by '-static-external' to conditionally use '-l:foo.a' syntax during linking, which is more robust than trying to find the absolute path to an archive on our own. * Adds a switch '-fully-static' that is meant as a high-level interface for e.g. cabal. This also honours 'extra-libraries-static'. This also attempts to clean up the confusion around library search directories. At the moment, we have 3 types of directories in the package database format: * library-dirs * library-dirs-static * dynamic-library-dirs However, we only have two types of linking: dynamic or static. Given the existing logic in 'mungeDynLibFields', this patch assumes that 'library-dirs' is really just nothing but a fallback and always prefers the more specific variants if they exist and are non-empty. Conceptually, we should be ok with even just one search dirs variant. Haskell libraries are named differently depending on whether they're static or dynamic, so GHC can conveniently pick the right one depending on the linking needs. That means we don't really need to play tricks with search paths to convince the compiler to do linking as we want it. For system C libraries, the convention has been anyway to place static and dynamic libs next to each other, so we need to deal with that issue anyway and it is outside of our control. But this is out of the scope of this patch. This patch is backwards compatible with cabal. Cabal should however be patched to use the new '-fully-static' switch. - - - - - 0dcb8314 by Julian Ospald at 2025-11-19T07:33:54-05:00 Warn when "-dynamic" is mixed with "-staticlib" - - - - - 795f3d8c by Julian Ospald at 2025-11-19T07:33:55-05:00 Move wasm "ways" constraints to 'makeDynFlagsConsistent' - - - - - 107ac2ce by Rodrigo Mesquita at 2025-11-19T07:33:55-05:00 Add tests for #23973 and #26565 These were fixed by 4af4f0f070f83f948e49ad5d7835fd91b8d3f0e6 in !10417 - - - - - 67 changed files: - compiler/GHC/Core/Utils.hs - compiler/GHC/Driver/Backpack.hs - compiler/GHC/Driver/Downsweep.hs - compiler/GHC/Driver/DynFlags.hs - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs - compiler/GHC/Linker/Dynamic.hs - compiler/GHC/Linker/ExtraObj.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Linker/Static.hs - compiler/GHC/Linker/Unit.hs - compiler/GHC/Settings.hs - compiler/GHC/Settings/IO.hs - compiler/GHC/StgToJS/Linker/Utils.hs - compiler/GHC/Types/SourceText.hs - compiler/GHC/Unit/Info.hs - compiler/GHC/Unit/State.hs - configure.ac - distrib/configure.ac.in - docs/users_guide/phases.rst - ghc/Main.hs - hadrian/cfg/default.host.target.in - hadrian/cfg/default.target.in - hadrian/src/Settings/Builders/Cabal.hs - libraries/ghc-boot/GHC/Unit/Database.hs - libraries/ghc-internal/ghc-internal.buildinfo.in - libraries/ghc-internal/ghc-internal.cabal.in - + m4/fp_linker_supports_verbatim.m4 - m4/prep_target_file.m4 - mk/system-cxx-std-lib-1.0.conf.in - rts/configure.ac - rts/rts.buildinfo.in - rts/rts.cabal - + testsuite/driver/_elffile.py - testsuite/driver/testglobals.py - testsuite/driver/testlib.py - testsuite/ghc-config/ghc-config.hs - + testsuite/tests/bytecode/T23973.hs - + testsuite/tests/bytecode/T23973.script - + testsuite/tests/bytecode/T23973.stdout - + testsuite/tests/bytecode/T26565.hs - + testsuite/tests/bytecode/T26565.script - + testsuite/tests/bytecode/T26565.stdout - testsuite/tests/bytecode/all.T - + testsuite/tests/driver/fully-static/Hello.hs - + testsuite/tests/driver/fully-static/Makefile - + testsuite/tests/driver/fully-static/all.T - + testsuite/tests/driver/fully-static/fully-static.stdout - + testsuite/tests/driver/fully-static/test/Test.hs - + testsuite/tests/driver/fully-static/test/test.pkg - + testsuite/tests/driver/mostly-static/Hello.hs - + testsuite/tests/driver/mostly-static/Makefile - + testsuite/tests/driver/mostly-static/all.T - + testsuite/tests/driver/mostly-static/mostly-static.stdout - + testsuite/tests/driver/mostly-static/test/test.c - + testsuite/tests/driver/mostly-static/test/test.h - + testsuite/tests/driver/mostly-static/test/test.pkg - + testsuite/tests/linear/should_run/T26311.hs - + testsuite/tests/linear/should_run/T26311.stdout - testsuite/tests/linear/should_run/all.T - testsuite/tests/pmcheck/should_compile/pmcOrPats.stderr - + testsuite/tests/rep-poly/T26072b.hs - testsuite/tests/rep-poly/all.T - utils/ghc-pkg/Main.hs - utils/ghc-toolchain/exe/Main.hs - utils/ghc-toolchain/src/GHC/Toolchain/Tools/Link.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d3a65832ab01c09c570521bf7562d59... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d3a65832ab01c09c570521bf7562d59... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)