
Simon Peyton Jones pushed to branch wip/T23109 at Glasgow Haskell Compiler / GHC Commits: 3acd8182 by Andreas Klebinger at 2025-04-10T22:32:12-04:00 Expand docs for RTS flag `-M`. The behaviour of how/when exceptions are raised was not really covered in the docs. - - - - - 026c1a39 by Adam Sandberg Ericsson at 2025-04-10T22:32:56-04:00 add cases for more SchedulerStatus codes in rts_checkSchedStatus - - - - - 5977c6a1 by sheaf at 2025-04-10T22:33:46-04:00 Squash warnings in GHC.Runtime.Heap.Inspect There were incomplete record selector warnings in GHC.Runtime.Heap.Inspect due to the use of the partial 'dataArgs' record selector. This is fixed by passing the fields to the 'extractSubTerms' function directly, rather than passing a value of the parent data type. - - - - - 6a3e38f5 by Andreas Klebinger at 2025-04-11T15:13:53-04:00 hadrian: Make ghcWithInterpreter the universal source of truth about availability of the interpreter We were doing some ad-hoc checks in different places in hadrian to determine whether we supported the interprter or not. Now this check if confined to one function, `ghcWithInterpreter`, and all the places which use this information consult `ghcWithInterpreter` to determine what to do. Fixes #25533. - - - - - 207de6f1 by Matthew Pickering at 2025-04-11T15:14:37-04:00 testsuite: Fix running TH tests with profiled dynamic compiler Previously, I had failed to update the ghc_th_way_flags logic for the profiled dynamic compiler. In addition to this `ghc_dynamic` was incorrectly set for profiled dynamic compiler. I also updated MultiLayerModulesTH_OneShot test to work for any compiler linkage rather than just dynamic. Fixes #25947 ------------------------- Metric Decrease: MultiLayerModulesTH_Make ------------------------- - - - - - 5455f2b9 by Matthew Pickering at 2025-04-12T08:31:36-04:00 driver: Add support for "Fixed" nodes in the ModuleGraph A fixed node in the module graph is one which we presume is already built. It's therefore up to the user to make sure that the interface file and any relevant artifacts are available for a fixed node. Fixed/Compile nodes are represented by the ModuleNodeInfo type, which abstracts the common parts of Fixed/Compile nodes with accessor functions of type `ModuleNodeInfo -> ...`. Fixed nodes can only depend on other fixed nodes. This invariant can be checked by the function `checkModuleGraph` or `mkModuleGraphChecked`. --make mode is modified to work with fixed mode. In order to "compile" a fixed node, the artifacts are just loaded into the HomePackageTable. Currently nothing in the compiler will produce Fixed nodes but this is tested with the FixedNodes GHC API test. In subsequent patches we are going to remove the ExternalModuleGraph and use Fixed nodes for modules in the module graph in oneshot mode. Fixes #25920 - - - - - ad64d5c2 by Cheng Shao at 2025-04-12T08:32:19-04:00 ci: remove manual case of ghc-wasm-meta downstream testing jobs This patch removes the manual case of ghc-wasm-meta downstream testing jobs; now the only way of including them in the pipeline and running them is via the test-wasm label. The reason of the removal is it proves to be problematic for MRs with only the wasm label; the wasm job would succeed, then the pipeline status would be waiting for manual action instead of succeeding. There needs to be separate jobs for the label-triggered and manual-triggered cases, but I don't think it's worth that extra complexity, the label-triggered case is already sufficient. - - - - - b34890c7 by Vladislav Zavialov at 2025-04-13T01:08:21+03:00 Fix EmptyCase panic in tcMatches (#25960) Due to faulty reasoning in Note [Pattern types for EmptyCase], tcMatches was too keen to panic. * Old (incorrect) assumption: pat_tys is a singleton list. This does not hold when \case{} is checked against a function type preceded by invisible forall. See the new T25960 test case. * New (hopefully correct) assumption: vis_pat_tys is a singleton list. This should follow from: checkArgCounts :: MatchGroup GhcRn ... -> TcM VisArity checkArgCounts (MG { mg_alts = L _ [] }) = return 1 ... - - - - - 84806ebc by Vladislav Zavialov at 2025-04-13T11:40:08-04:00 Remove unused type: TokenLocation - - - - - 05eb50df by Vladislav Zavialov at 2025-04-13T19:16:38-04:00 Register EpToken in Parser.PostProcess.Haddock (#22558) This change allows us to reject more badly placed Haddock comments. Examples: module -- | Bad comment for the module T17544_kw where data Foo -- | Bad comment for MkFoo where MkFoo :: Foo newtype Bar -- | Bad comment for MkBar where MkBar :: () -> Bar class Cls a -- | Bad comment for clsmethod where clsmethod :: a - - - - - 01944e5e by Vladislav Zavialov at 2025-04-13T19:17:21-04:00 Reject puns in T2T (#24153) This patch implements pun detection in T2T. Consider: x = 42 f, g :: forall a -> ... f (type x) = g x In accordance with the specification, the `g x` function call is renamed as a term, so `x` refers to the top-level binding `x = 42`, not to the type variable binding `type x` as one might expect. This is somewhat counterintuitive because `g` expects a type argument. Forbidding puns in T2T allows us to produce a helpful error message: Test.hs:5:16: error: [GHC-09591] Illegal punned variable occurrence in a required type argument. The name ‘x’ could refer to: ‘x’ defined at Test.hs:3:1 ‘x’ bound at Test.hs:5:9 This commit is a follow up to 0dfb1fa799af254c8a1e1045fc3996af2d57a613 where checking for puns was left as future work. - - - - - cc580552 by Vladislav Zavialov at 2025-04-13T19:18:02-04:00 Additional test cases for #12088, #13790 Extract more test cases from ticket discussions, including multi-module examples. Follow up to 5712e0d646f611dfbfedfd7ef6dff3a18c016edb - - - - - 324ab7ca by Simon Peyton Jones at 2025-04-15T17:44:42+01:00 Restore backtrace behaviour This is a temporary patch, pending a proper fix to #25898 - - - - - 05b3afaf by Simon Peyton Jones at 2025-04-15T17:48:06+01:00 Make injecting implicit bindings into its own pass Previously we were injecting "impliicit bindings" (data constructor worker and wrappers etc) - both at the end of CoreTidy, - and at the start of CorePrep This is unpleasant and confusing. This patch puts it it its own pass, addImplicitBinds, which runs between the two. The function `GHC.CoreToStg.AddImplicitBinds.addImplicitBinds` now takes /all/ TyCons, not just the ones for algebraic data types. That change ripples through to - corePrepPgm - doCodeGen - byteCodeGen All take [TyCon] which includes all TyCons - - - - - c0a6062b by Simon Peyton Jones at 2025-04-15T17:49:33+01:00 Fix infelicities in the Specialiser On the way to #23109 (unary classes) I discovered some infelicities (or maybe bugs, I forget) in the type-class specialiser. Specifically: * I enhanced `wantCallsFor`, whih previously always said `True`, to discard calls of class-ops, data constructors etc. This is a bit more efficient; and it means we don't need to worry about filtering them out later. * I tidied up some tricky logic that eliminated redundant specialisations. It wasn't working correctly. See the expanded Note [Specialisations already covered], and (MP3) in Note [Specialising polymorphic dictionaries]. I also added a useful Note [The (CI-KEY) invariant] - - - - - c713feed by Simon Peyton Jones at 2025-04-15T17:49:33+01:00 Implement unary classes The big change is described exhaustively in Note [Unary class magic] in GHC.Core.TyCon Other changes * We never unbox class dictionaries in worker/wrapper. This has been true for some time now, but the logic is now centralised in functions in GHC.Core.Opt.WorkWrap.Utils, namely `canUnboxTyCon`, and `canUnboxArg` See Note [Do not unbox class dictionaries] in GHC.Core.Opt.WorkWrap.Utils. * Refactored the `notWorthFloating` logic in GHc.Core.Opt.SetLevels. I can't remember if I actually changed any behaviour here, but if so it's only in a corner cases. * Fixed a bug in `GHC.Core.TyCon.isEnumerationTyCon`, which was wrongly returning True for (##). * Remove redundant Role argument to `liftCoSubstWithEx`. It was always Representational. * I refactored evidence generation in the constraint solver: * Made GHC.Tc.Types.Evidence contain better abstactions for evidence generation. * I deleted the file `GHC.Tc.Types.EvTerm` and merged its (small) contents elsewhere. It wasn't paying its way. * Made evidence for implicit parameters go via a proper abstraction. Smaller things * Rename `isDataTyCon` to `isBoxedDataTyCon`. * GHC.Core.Corecion.liftCoSubstWithEx was only called with Representational role, so I baked that into the function and removed the argument. * Get rid of `GHC.Core.TyCon.tyConSingleAlgDataCon_maybe` in favour of calling `not isNewTyCon` at the call sites; more explicit. * Refatored `GHC.Core.TyCon.isInjectiveTyCon`; but I don't think I changed its behaviour * Moved `decomposeIPPred` to GHC.Core.Predicate - - - - - 163 changed files: - .gitlab-ci.yml - compiler/GHC/Builtin/Types.hs - compiler/GHC/ByteCode/InfoTable.hs - compiler/GHC/Core/Class.hs - compiler/GHC/Core/Coercion.hs - compiler/GHC/Core/DataCon.hs - compiler/GHC/Core/FamInstEnv.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/CprAnal.hs - compiler/GHC/Core/Opt/DmdAnal.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/SetLevels.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Opt/WorkWrap/Utils.hs - compiler/GHC/Core/Predicate.hs - compiler/GHC/Core/Rules.hs - compiler/GHC/Core/TyCo/Rep.hs - compiler/GHC/Core/TyCon.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Unfold.hs - compiler/GHC/Core/Unfold/Make.hs - compiler/GHC/Core/Utils.hs - compiler/GHC/CoreToStg.hs - + compiler/GHC/CoreToStg/AddImplicitBinds.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Backpack.hs - compiler/GHC/Driver/Downsweep.hs - compiler/GHC/Driver/Errors/Ppr.hs - compiler/GHC/Driver/Main.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Foreign/Call.hs - compiler/GHC/Iface/Decl.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/Iface/Tidy.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Runtime/Eval.hs - compiler/GHC/Runtime/Heap/Inspect.hs - compiler/GHC/StgToByteCode.hs - compiler/GHC/StgToCmm.hs - compiler/GHC/Tc/Errors.hs - compiler/GHC/Tc/Errors/Ppr.hs - compiler/GHC/Tc/Errors/Types.hs - compiler/GHC/Tc/Gen/App.hs - compiler/GHC/Tc/Gen/Bind.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Instance/Class.hs - compiler/GHC/Tc/Instance/Family.hs - compiler/GHC/Tc/Solver/Default.hs - compiler/GHC/Tc/Solver/Dict.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Solver/Monad.hs - compiler/GHC/Tc/Solver/Solve.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/Build.hs - compiler/GHC/Tc/TyCl/Instance.hs - compiler/GHC/Tc/TyCl/PatSyn.hs - compiler/GHC/Tc/TyCl/Utils.hs - − compiler/GHC/Tc/Types/EvTerm.hs - compiler/GHC/Tc/Types/Evidence.hs - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Types/Basic.hs - compiler/GHC/Types/Demand.hs - compiler/GHC/Types/Error/Codes.hs - compiler/GHC/Types/Id.hs - compiler/GHC/Types/Id/Make.hs - compiler/GHC/Types/RepType.hs - compiler/GHC/Types/TyThing.hs - compiler/GHC/Unit/Module/Graph.hs - compiler/GHC/Unit/Module/ModNodeKey.hs - compiler/GHC/Utils/Panic.hs - compiler/GHC/Utils/Panic/Plain.hs - compiler/ghc.cabal.in - docs/users_guide/runtime_control.rst - ghc/GHCi/UI.hs - hadrian/src/Oracles/Flag.hs - hadrian/src/Oracles/Setting.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Settings/Builders/Cabal.hs - hadrian/src/Settings/Builders/RunTest.hs - hadrian/src/Settings/Packages.hs - rts/RtsAPI.c - rts/include/RtsAPI.h - testsuite/config/ghc - testsuite/driver/testlib.py - testsuite/mk/boilerplate.mk - testsuite/tests/backpack/should_fail/bkpfail51.stderr - testsuite/tests/core-to-stg/T24124.stderr - testsuite/tests/deSugar/should_compile/T2431.stderr - + testsuite/tests/dependent/should_compile/T12088f.hs - + testsuite/tests/dependent/should_compile/T12088g.hs - + testsuite/tests/dependent/should_compile/T12088i.hs - + testsuite/tests/dependent/should_compile/T12088j.hs - + testsuite/tests/dependent/should_compile/T12088mm1.hs - + testsuite/tests/dependent/should_compile/T12088mm1_helper.hs - + testsuite/tests/dependent/should_compile/T12088mm2.hs - + testsuite/tests/dependent/should_compile/T12088mm2_helper.hs - + testsuite/tests/dependent/should_compile/T12088mm3.hs - + testsuite/tests/dependent/should_compile/T12088mm3_helper.hs - + testsuite/tests/dependent/should_compile/T13790.hs - testsuite/tests/dependent/should_compile/all.T - testsuite/tests/dependent/should_fail/T13135_simple.stderr - testsuite/tests/dmdanal/should_compile/T16029.stdout - testsuite/tests/dmdanal/sigs/T21119.stderr - testsuite/tests/dmdanal/sigs/T21888.stderr - testsuite/tests/driver/T20459.stderr - testsuite/tests/driver/T24196/T24196.stderr - testsuite/tests/driver/T24275/T24275.stderr - + testsuite/tests/ghc-api/fixed-nodes/FixedNodes.hs - + testsuite/tests/ghc-api/fixed-nodes/FixedNodes.stdout - + testsuite/tests/ghc-api/fixed-nodes/Makefile - + testsuite/tests/ghc-api/fixed-nodes/ModuleGraphInvariants.hs - + testsuite/tests/ghc-api/fixed-nodes/ModuleGraphInvariants.stdout - + testsuite/tests/ghc-api/fixed-nodes/T1.hs - + testsuite/tests/ghc-api/fixed-nodes/T1A.hs - + testsuite/tests/ghc-api/fixed-nodes/T1B.hs - + testsuite/tests/ghc-api/fixed-nodes/T1C.hs - + testsuite/tests/ghc-api/fixed-nodes/all.T - testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.hs - testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr - testsuite/tests/indexed-types/should_compile/T2238.hs - testsuite/tests/numeric/should_compile/T15547.stderr - testsuite/tests/numeric/should_compile/T23907.stderr - testsuite/tests/perf/compiler/Makefile - testsuite/tests/perf/compiler/all.T - testsuite/tests/roles/should_compile/Roles14.stderr - testsuite/tests/roles/should_compile/Roles3.stderr - testsuite/tests/roles/should_compile/Roles4.stderr - testsuite/tests/simplCore/should_compile/DataToTagFamilyScrut.stderr - testsuite/tests/simplCore/should_compile/T15205.stderr - testsuite/tests/simplCore/should_compile/T17366.stderr - testsuite/tests/simplCore/should_compile/T17966.stderr - testsuite/tests/simplCore/should_compile/T22309.stderr - testsuite/tests/simplCore/should_compile/T22375DataFamily.stderr - testsuite/tests/simplCore/should_compile/T23307.stderr - testsuite/tests/simplCore/should_compile/T23307a.stderr - testsuite/tests/simplCore/should_compile/T25389.stderr - testsuite/tests/simplCore/should_compile/T25713.stderr - testsuite/tests/simplCore/should_compile/T7360.stderr - testsuite/tests/simplStg/should_compile/T15226b.stderr - testsuite/tests/tcplugins/CtIdPlugin.hs - testsuite/tests/typecheck/should_compile/Makefile - testsuite/tests/typecheck/should_compile/T12763.stderr - testsuite/tests/typecheck/should_compile/T14774.stdout - testsuite/tests/typecheck/should_compile/T18406b.stderr - testsuite/tests/typecheck/should_compile/T18529.stderr - + testsuite/tests/typecheck/should_compile/T25960.hs - testsuite/tests/typecheck/should_compile/all.T - + testsuite/tests/typecheck/should_fail/T25004k.hs - + testsuite/tests/typecheck/should_fail/T25004k.stderr - testsuite/tests/typecheck/should_fail/all.T - testsuite/tests/unboxedsums/unpack_sums_7.stdout - + testsuite/tests/vdq-rta/should_fail/T23738_fail_pun.hs - + testsuite/tests/vdq-rta/should_fail/T23738_fail_pun.stderr - testsuite/tests/vdq-rta/should_fail/all.T - testsuite/tests/wasm/should_run/control-flow/LoadCmmGroup.hs - utils/haddock/haddock-api/src/Haddock/Interface.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b578612f56476abd9a7381e8d4faee0... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b578612f56476abd9a7381e8d4faee0... You're receiving this email because of your account on gitlab.haskell.org.