Simon Peyton Jones pushed to branch wip/T26989 at Glasgow Haskell Compiler / GHC Commits: 9f85f034 by Duncan Coutts at 2026-04-30T04:52:42-04:00 Make cmm 'import "package" name;' syntax use consistent label types There is a little-used syntactic form in cmm imports: import "package" foo; Which means to import foo from the given package (unit id, specified as a string). This syntax is somewhat reminiscent of GHC's package import extension. This syntax form is not used in the rts cmm code, nor any of the boot libraries. It may not be used at all. Unclear. Change the kind of CLabel this syntax generates to be consistent with the others. The other cmm imports use ForeignLabel with ForeignLabelInExternalPackage. For some reason this form was using CmmLabel. Change that to also be ForeignLabel but with ForeignLabelInPackage. This specifies a specific package, rather than an unnamed external package. - - - - - a811f68f by Duncan Coutts at 2026-04-30T04:52:42-04:00 Change default cmm import statements to be internal Previously a cmm statement like: import foo; meant to expect the symbol from a different shared library than the current one. Now it means to expect the symbol from the same shared library as the current one. We'll add explicit syntax to indicate that it's a foreign import. Most existing uses are in fact intenal (rts to rts), so few imports will need to be annotated foreign. Examples would include cmm code in libraries (other than the rts) that need to access RTS APIs. In practice, this makes no difference whatsoever at the moment on any platform other than windows (where building Haskell libs as shared libs does not fully work yet), since the 'labelDynamic' treats all such labels as foreign, irrespective of the foreign label source. - - - - - 17fe5d1d by Duncan Coutts at 2026-04-30T04:52:42-04:00 Add cmm import syntax 'import DATA foo;' as better name for CLOSURE The existing syntax is: import CLOSURE foo; The new syntax is import DATA foo; This means to interpret the symbol foo as refering to data (i.e. a global constant or variable) rather than to code (a function). The historical syntax for this uses CLOSURE, which is rather misleading. Presumably this was done to avoid introducing new reserved words. Be less squemish about new reserved words and add DATA and use that. Keep the existing CLOSURE syntax as an alias for compatibility. - - - - - 3a530d68 by Duncan Coutts at 2026-04-30T04:52:42-04:00 Add cmm 'import extern name;' syntax Since the default for cmm imports is now for symbols within the same shared object, we need a way to indicate we want a symbol from an external shared object: import extern foo; -- for a function import extern DATA foo; -- for data This adds a new reserved word 'extern'. We don't expect to have to use this much. Most cmm imports are intra-DSO. This makes no difference currently on ELF and MachO platforms, but does make a difference to the linking conventions on PE (Windows). In future it's plausible we could take make distinctions on ELF or MachO, so it's worth trying to get it right. Windows can be the guinea pig. - - - - - 2b8e44c7 by Duncan Coutts at 2026-04-30T04:52:42-04:00 Add cmm syntax 'import "package" DATA foo;' for completeness We already have: import DATA foo; -- for data imports import "package" foo; -- for imports from a given unitid There's no reason not to have both at once: import "package" DATA foo; So add that. - - - - - ee05e5cc by Duncan Coutts at 2026-04-30T04:52:42-04:00 Improve the commentary for the cmm import grammar. AFAIK, this is the only place where GHC-style Cmm syntax is documented. - - - - - b35946ad by Duncan Coutts at 2026-04-30T04:52:42-04:00 Add a changelog.d entry for the .cmm import syntax changes - - - - - d59b7c71 by Wolfgang Jeltsch at 2026-04-30T04:53:25-04:00 Move code that uses `GHC.Internal.Text.Read` into `base` This contribution serves to remove all dependencies on `GHC.Internal.Text.Read` from within `ghc-internal`, so that the implementation of `Text.Read` and ultimately more reading-related code can be moved to `base` as well. The following things are moved from `ghc-internal` to `base`: * I/O-related `Read` instances * Most of the `Numeric` implementation * The instance `Read ByteOrder` * The `parseVersion` operation * The `readConstr` operation Metric Increase: LinkableUsage01 T9198 T12425 T13035 T13820 T18140 - - - - - 5bd6a964 by Rodrigo Mesquita at 2026-04-30T04:54:08-04:00 New rts Message to {set,unset} TSO flags This commit introduces stg_MSG_SET_TSO_FLAG_info and stg_MSG_UNSET_TSO_FLAG_info, which allows setting flags of a TSO other than yourself. This is especially useful/necessary to set breakpoints and toggle breakpoints of different threads, which is needed to safely implement features like pausing, toggling step-out, toggling step-in per thread, etc. Fixes #27131 ------------------------- Metric Decrease: T3294 ------------------------- - - - - - ce97fd3e by Rodrigo Mesquita at 2026-04-30T04:54:08-04:00 test: Add test setting another TSO's flags Introduces a test that runs on two capabilities. The main thread running on Capability 0 sets the flags on a TSO running on Capability 1. The TSO from Capability 1 itself checks whether its flags were set and reports that back. This validates that the RTS messages for setting TSO flags work, even if it doesn't test a harsher scenario with race conditions to exercise why the message passing is necessary for safely setting another TSO's flags. Part of #27131 - - - - - a4ff6315 by David Eichmann at 2026-04-30T04:54:51-04:00 Hadrian: withResponseFile outputs response file when verbodity is Verbose At the Verbose verbosity, shake will display full commandlines. With the use of response files, the full command is hidden. That makes it hard to run the command manually. This commit outputs the contents of the response file so that that full command can be recreated and also hints at the use of the --keep-response-files hadrian flag. - - - - - cd732ee3 by Duncan Coutts at 2026-04-30T04:54:51-04:00 Use response files for hadrian linking with ghc (support long command lines) In future support for windows dynamic linking, we expect long command lines for linking dll files with ghc. Experiments with dynamic linking the ghc-internal library yielded a link command well over 32kb. We did not encounter this before for static libs, since we already use ar's @file feature (if available, which it is for the llvm toolchain). Co-authored-by: David Eichmann <davide@well-typed.com> - - - - - 3d41368f by Andreas Klebinger at 2026-04-30T04:55:32-04:00 Split GHC.Driver.Main.hs up into multiple components. This commit splits GHC.Driver.Main into four components: * GHC.Driver.Main.Compile * GHC.Driver.Main.Hsc * GHC.Driver.Main.Interactive * GHC.Driver.Main.Passes We might improve that separation further in the future but this should hopefully make it easier to reason about and work with this part of the code. - - - - - 2128ba85 by Cheng Shao at 2026-04-30T04:56:14-04:00 compiler: avoid unique OccNames for internal Names in bytecode objects This patch improves bytecode object serialization logic by avoiding the construction of unique `OccName`s when serializing/deserializing internal `Name`s. Closes #27213. ------------------------- Metric Decrease: LinkableUsage01 ------------------------- - - - - - e16854c3 by Vladislav Zavialov at 2026-04-30T04:56:57-04:00 Replace GHC 9.16 references with GHC 10.0 - - - - - 458eeebc by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 Improve knownCon Eliminate simplInVar Just a refactoring to simplify the code - - - - - d2e0278c by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 Wibbles [skip ci] - - - - - 39ae9478 by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 Getting there [skip ci] - - - - - b3c65597 by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 Wibbles [skip ci] - - - - - 722979f8 by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 More wibbles This now works - - - - - c287d3b2 by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 Wibble - - - - - 3ce47814 by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 Wibbles Better management of casts - - - - - 39d5345c by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 Wibbles - - - - - 481205d5 by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 More small wibbles The important change here is in preInlineUnconditionally - - - - - 520d19ab by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 Wibble [skip ci] - - - - - 45a6c8a4 by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 wibbles - - - - - f7940c62 by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 Refactor the Simplifier's handling of DupFlag ...and how it deals with re-simplification of argumnets - - - - - bddaf15c by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 Update stderr tests ...mainly as a result of printing names for dead lambda binders (A debug-output change only.) - - - - - 9bd69cc2 by Simon Peyton Jones at 2026-04-30T17:32:44+01:00 Add MOutCoercion to ApplyToVal Nicer... but lets see what CI says - - - - - c9c16c21 by Simon Peyton Jones at 2026-04-30T17:32:45+01:00 Wibbles - - - - - 84e032ab by Simon Peyton Jones at 2026-04-30T17:32:45+01:00 Do not use mkCast during typechecking This commit fixes #27219. The problem was that the typechecker was using `mkCast`, whose assertion checks legitimately fail when applied to types that contain unification variables. - - - - - 550e3e9f by Simon Peyton Jones at 2026-04-30T17:32:45+01:00 More improvements * pushCoValArg and pushCoTyArg return tyL, which is helpful for the caller * Don't optimise coercions if the type-substitution is empty. See Note [Optimising coercions] - - - - - 5bdc28fa by Simon Peyton Jones at 2026-04-30T17:32:45+01:00 Wibbles - - - - - 65507023 by Simon Peyton Jones at 2026-04-30T17:32:45+01:00 Use the same float-binds type in lookupRule and exprIsConApp_maybe ...refactor only - - - - - 74684885 by Simon Peyton Jones at 2026-04-30T17:44:53+01:00 Wibbles - - - - - 112 changed files: - + changelog.d/T27131 - + changelog.d/cmm-import-syntax-changes - compiler/GHC/ByteCode/Binary.hs - compiler/GHC/Cmm/Lexer.x - compiler/GHC/Cmm/Parser.y - compiler/GHC/Core.hs - compiler/GHC/Core/Coercion.hs - compiler/GHC/Core/Coercion/Opt.hs - compiler/GHC/Core/Lint.hs - compiler/GHC/Core/Make.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/FloatIn.hs - compiler/GHC/Core/Opt/FloatOut.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/Simplify/Env.hs - compiler/GHC/Core/Opt/Simplify/Iteration.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/Opt/SpecConstr.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Ppr.hs - compiler/GHC/Core/Rules.hs - compiler/GHC/Core/SimpleOpt.hs - compiler/GHC/Core/TyCo/Subst.hs - compiler/GHC/Driver/Backpack.hs - compiler/GHC/Driver/Config/Core/Lint.hs - compiler/GHC/Driver/Env/Types.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Driver/Main.hs - + compiler/GHC/Driver/Main/Compile.hs - compiler/GHC/Driver/Main.hs-boot → compiler/GHC/Driver/Main/Compile.hs-boot - + compiler/GHC/Driver/Main/Hsc.hs - + compiler/GHC/Driver/Main/Interactive.hs - + compiler/GHC/Driver/Main/Passes.hs - + compiler/GHC/Driver/Main/Passes.hs-boot - compiler/GHC/HsToCore/Pmc/Solver.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Tidy.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Tc/Types/Evidence.hs - compiler/GHC/Types/Error.hs - compiler/GHC/Types/Error.hs-boot - compiler/ghc.cabal.in - docs/users_guide/debug-info.rst - docs/users_guide/exts/explicit_namespaces.rst - docs/users_guide/exts/linear_types.rst - docs/users_guide/exts/modifiers.rst - docs/users_guide/exts/qualified_strings.rst - docs/users_guide/exts/required_type_arguments.rst - docs/users_guide/using-warnings.rst - docs/users_guide/using.rst - hadrian/src/Builder.hs - hadrian/src/Hadrian/Builder.hs - hadrian/src/Hadrian/Utilities.hs - hadrian/src/Settings/Builders/Ghc.hs - libraries/base/src/Data/Data.hs - libraries/base/src/Data/Version.hs - libraries/base/src/GHC/ByteOrder.hs - libraries/base/src/Numeric.hs - libraries/base/src/System/IO.hs - libraries/base/src/Text/Printf.hs - libraries/ghc-internal/src/GHC/Internal/Data/Data.hs - libraries/ghc-internal/src/GHC/Internal/Data/Version.hs - libraries/ghc-internal/src/GHC/Internal/IO/Device.hs - libraries/ghc-internal/src/GHC/Internal/IO/Handle/Types.hs - libraries/ghc-internal/src/GHC/Internal/IO/IOMode.hs - libraries/ghc-internal/src/GHC/Internal/Numeric.hs - libraries/ghc-internal/src/GHC/Internal/Read.hs - rts/Interpreter.c - rts/Messages.c - rts/StgMiscClosures.cmm - rts/Threads.c - rts/Threads.h - rts/include/rts/storage/Closures.h - rts/include/stg/MiscClosures.h - testsuite/tests/codeGen/should_compile/T25177.stderr - testsuite/tests/deSugar/should_compile/T13208.stdout - testsuite/tests/interface-stability/base-exports.stdout - testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs - testsuite/tests/interface-stability/base-exports.stdout-mingw32 - testsuite/tests/interface-stability/base-exports.stdout-ws-32 - testsuite/tests/linters/notes.stdout - testsuite/tests/numeric/should_compile/T15547.stderr - testsuite/tests/numeric/should_compile/T20347.stderr - testsuite/tests/numeric/should_compile/T20374.stderr - testsuite/tests/numeric/should_compile/T20376.stderr - testsuite/tests/plugins/plugins09.stdout - testsuite/tests/plugins/plugins10.stdout - testsuite/tests/plugins/plugins11.stdout - testsuite/tests/plugins/static-plugins.stdout - testsuite/tests/printer/T18052a.stderr - + testsuite/tests/rts/T27131.hs - + testsuite/tests/rts/T27131.stdout - + testsuite/tests/rts/T27131_c.c - testsuite/tests/rts/all.T - testsuite/tests/simplCore/should_compile/DsSpecPragmas.stderr - testsuite/tests/simplCore/should_compile/RewriteHigherOrderPatterns.stderr - testsuite/tests/simplCore/should_compile/T18668.stderr - testsuite/tests/simplCore/should_compile/T19246.stderr - testsuite/tests/simplCore/should_compile/T19599.stderr - testsuite/tests/simplCore/should_compile/T19599a.stderr - testsuite/tests/simplCore/should_compile/T21917.stderr - testsuite/tests/simplCore/should_compile/T23074.stderr - testsuite/tests/simplCore/should_compile/T24359a.stderr - testsuite/tests/simplCore/should_compile/T25160.stderr - testsuite/tests/simplCore/should_compile/T25718c.stderr-ws-64 - testsuite/tests/simplCore/should_compile/T26051.stderr - testsuite/tests/simplCore/should_compile/T26116.stderr - testsuite/tests/simplCore/should_compile/T8331.stderr - testsuite/tests/simplCore/should_compile/T8848a.stderr - testsuite/tests/simplCore/should_compile/spec004.stderr - testsuite/tests/typecheck/should_compile/T13032.stderr - testsuite/tests/typecheck/should_fail/all.T The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d0a0080193fe161e911b379370cc66f... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d0a0080193fe161e911b379370cc66f... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Simon Peyton Jones (@simonpj)