Florian Ragwitz pushed to branch wip/rafl/hpc-viewpatterns at Glasgow Haskell Compiler / GHC Commits: 3a72b8a2 by Hannes Siebenhandl at 2026-10-14T13:48:32-04:00 Fix #27836, normalise unit database path in ExternalUnitDatabases Add a regression test, proofing that all variations: - local-unit-db/my-test.conf - ./local-unit-db/my-test.conf - ./local-unit-db/my-test.conf/ are parsed only once. - - - - - 8ddbc6f9 by Florian Ragwitz at 2026-10-14T13:49:28-04:00 Remove obsolete HPC types Fixes #27946. - - - - - f34c79ee by Alan Zimmerman at 2026-10-15T04:54:47-04:00 EPA: Start using vocurly as basis for AnnListLayout For the existing cases that populate AnnList. This uses AnnListBraces when braces are explicitly supplied, and AnnListLayout when vocurly is used The change also shows up AnnList usages that can never capture layout, these are cleared up later. - - - - - 033ba59c by sheaf at 2026-10-15T04:55:44-04:00 Make exprFreeVars deep exprFreeVars used to be a shallow free-variable finder (it didn't look into kinds), but most callers wanted it to be deep. In particular, 'exprFreeVars' is often used to seed an 'InScopeSet', and that must contain the /deep/ free variables. This commit makes it deep, which allows us to get rid of calls to 'closeOverKinds' or other workarounds for shallowness in: - 'GHC.Core.Opt.Simplify.Utils.abstractFloats' - 'GHC.HsToCore.Binds.dsSpec_help' - 'GHC.Core.Opt.Arity.etaBodyForJoinPoint' - 'GHC.Core.FVs.freeVars' - 'GHC.Core.Lint.lintCoreRule' We also remove 'deepExprsFreeVarsDSet' and 'closeOverKindsDSet'. Other places needed a little bit more care, in particular to properly handle coercion variables free in kinds: - 'GHC.Core.Opt.Specialise.specHeader' quantifies over the binder of an unspecialised argument directly, instead of computing the free Ids of the argument. - 'GHC.HsToCore.dsWarnRuleShadowing' filters out 'CoVar's. - 'GHC.Core.Opt.SpecConstr.callToPat' had some ad-hoc logic to compute argument pattern types and a workaround with 'expandTypeSynonyms'. That logic is removed in favour of a new 'argsToPats' function which directly computes the argument pattern types by instantiating the type of the head of the call pattern. Fixes #27936 - - - - - f93d523c by Luite Stegeman at 2026-10-15T04:56:34-04:00 testsuite: Use mkWeakMVar in memo001/memo002 mkWeakPtr in the memo001/memo001 tests created weak pointers with the MVar box as the key, which is fragile in the presence of optimization. The fix is using mkWeakMVar, keying on the primitive MVar# instead. Fixes #27924 and #27396 - - - - - 8c947573 by Simon Peyton Jones at 2026-10-16T13:11:53+01:00 Improve exprOkForSpeculation Fixes #27910, which exposed an infelicity in exprOkForSpeculation The new story is carefully described in new Note [exprOkForSpeculation], esp (a-c) and (EOKS1). - - - - - 7dedcf13 by Alan Zimmerman at 2026-10-16T19:03:17-04:00 EPA: Add TTG fields to FamilyInfo This commit is a simple add, with unused extension fields. It lays the groundwork for using them for exact print annotations - - - - - 26b9a8a0 by Arkissa at 2026-10-17T16:04:10+00:00 ghci: Prefer exact source spans in :type-at Prefer expression types for identical source spans. Fixes #27412. - - - - - 70dc4e61 by sheaf at 2026-10-18T18:15:15-04:00 Carefully implement coercion zapping This commit implements coercion zapping in the rewriter, controlled by the -fzap-coercions flag (on by default). This significantly reduces the size of coercions produced when rewriting type family applications, resulting in much faster compilation. See Note [Coercion zapping] in GHC.Tc.Solver.Rewrite for an explanation and further details. The rewriter now keeps track of the `CoVar`s and `CoercionHole`s it uses when rewriting, which allows computing the dependencies of a zapped coercion without traversing the coercion the rewriter produced, as explained in Note [Computing coercion dependencies] in GHC.Tc.Solver.Rewrite. Accompanying changes: - Rework how dependencies of 'UnivCo's are tracked, purely for performance reasons. We now use the 'UnivCoDeps' datatype instead of '[Coercion]', and we now insist that 'uco_deps' also contains the CoVars that appear in the LHS and RHS types of the UnivCo (as a caching mechanism). - Several performance improvements to the rewriter (e.g. increased strictness). - Improvements to the family application cache, including: - Better documentation. - Only cache a whole chain of reduction steps. - Don't put coercion holes in the cache, fixing #27518. - Allow Core Lint to be called from within the typechecker (and from within the coercion optimiser). - Move out "annotation linting" from Core Lint into the general Core pipeline, to avoid the dependency GHC.Core.Coercion.Opt->GHC.Core.Lint causing a regression in CountDepsParser due to transitive dependencies of GHC.Core.Opt.Monad and GHC.Unit.Module.ModGuts. Fixes #8095 #27336 #27518 Summary of performance numbers Compile-time byte allocated in GHC's testsuite (0 regressions) CoOpt_Singletons(normal) ghc/alloc 634,040,332 595,448,728 -6.1% GOOD FamAppCachePerf(normal) ghc/alloc 495,629,812 191,612,920 -61.3% GOOD LargeRecord(normal) ghc/alloc 1,226,806,434 966,260,976 -21.2% GOOD SimplCastPerf(normal) ghc/alloc 160,505,678 148,112,688 -7.7% GOOD T12227(normal) ghc/alloc 244,668,982 233,037,216 -4.8% GOOD T12545(normal) ghc/alloc 697,804,842 424,705,152 -39.1% GOOD T13386(normal) ghc/alloc 422,871,076 35,213,656 -91.7% GOOD T15703(normal) ghc/alloc 288,402,364 273,692,560 -5.1% GOOD T26426(normal) ghc/alloc 86,002,052 78,152,104 -9.1% GOOD T27336(normal) ghc/alloc 498,932,268 35,886,016 -92.8% GOOD T5030(normal) ghc/alloc 117,057,706 88,785,648 -24.2% GOOD T5321Fun(normal) ghc/alloc 252,552,628 243,820,176 -3.5% GOOD T8095(normal) ghc/alloc 768,198,564 127,779,520 -83.4% GOOD T9872a(normal) ghc/alloc 1,655,675,020 1,406,017,008 -15.1% GOOD T9872b(normal) ghc/alloc 1,864,180,628 1,644,706,696 -11.8% GOOD T9872b_defer(normal) ghc/alloc 2,834,585,468 1,657,729,760 -41.5% GOOD T9872c(normal) ghc/alloc 1,572,573,116 1,354,055,424 -13.9% GOOD T9872d(normal) ghc/alloc 351,516,004 331,071,424 -5.8% GOOD TcPlugin_RewritePerf(normal) ghc/alloc 2,063,065,680 1,847,464,272 -10.5% GOOD Chesskell (github.com/Proxymoron461/chesskell/issues) Typechecking that the first N plies of kholmovVsBronsteinShort are a valid chess game: Plies | GHC 9.14 time/alloc | This commit time/alloc | -----:|---------------------|------------------------| 2 | 41s/20GB | 0.2s/19MB | 4 | 95s/49GB | 0.3s/25MB | 6 | timed out | 0.6s/522MB | 8 | timed out | 7s/673MB | 10 | timed out | timed out | Compilation of singletons-base: compile time -28%, allocations -25% ------------------------- Metric Decrease: CoOpt_Singletons FamAppCachePerf LargeRecord SimplCastPerf T12227 T12545 T13386 T15703 T24984 T26426 T27336 T5030 T5321Fun T8095 T9872a T9872b T9872b_defer T9872c T9872d TcPlugin_RewritePerf ------------------------- Co-Authored-By: Sylvain Henry <sylvain@haskus.fr> - - - - - 3d326d7d by Sylvain Henry at 2026-10-18T18:16:09-04:00 JS: fix stack corruption in h$ap_gen_fast's pushAllRegs (#27624) The loop added in 9e46990976 ("JS: support more than 128 registers (#26558)") pushed register N to stack[sp - N - 2] while the switch it falls through into, and every reader of the h$ap_gen frame, uses stack[sp - (N - 2)]. Registers >= R32 were therefore written 4 slots too low: the slots the readers consult were left stale and the frame below was silently corrupted. Fix the loop to use the same slot formula as the switch, and add a regression test: an unknown call to a thunk with 35 argument register slots, which goes through the generic apply. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> - - - - - a2ef8469 by Florian Ragwitz at 2026-10-18T23:21:37-07:00 hpc: Traverse patterns to tick contained HsExprs So we can have coverage for view patterns. Fixes #18590. - - - - - 130 changed files: - + changelog.d/27624 - + changelog.d/27936 - + changelog.d/T27412 - + changelog.d/hpc-cleanup - + changelog.d/hpc-viewpats - changelog.d/unit-index - + changelog.d/zap-coercions - compiler/GHC/Core.hs - compiler/GHC/Core/Coercion.hs - compiler/GHC/Core/Coercion.hs-boot - compiler/GHC/Core/Coercion/Opt.hs - compiler/GHC/Core/FVs.hs - compiler/GHC/Core/FamInstEnv.hs - compiler/GHC/Core/Lint.hs - + compiler/GHC/Core/Lint.hs-boot - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/Pipeline.hs - compiler/GHC/Core/Opt/Simplify/Utils.hs - compiler/GHC/Core/Opt/SpecConstr.hs - compiler/GHC/Core/Opt/Specialise.hs - compiler/GHC/Core/Reduction.hs - compiler/GHC/Core/SimpleOpt.hs - compiler/GHC/Core/Subst.hs - compiler/GHC/Core/TyCo/FVs.hs - compiler/GHC/Core/TyCo/FVs.hs-boot - compiler/GHC/Core/TyCo/Make.hs - compiler/GHC/Core/TyCo/Rep.hs - compiler/GHC/Core/TyCo/Rep.hs-boot - compiler/GHC/Core/TyCo/Subst.hs - compiler/GHC/Core/TyCo/Tidy.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Utils.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg.hs - compiler/GHC/Data/OsPath.hs - compiler/GHC/Driver/Config.hs - compiler/GHC/Driver/Config/Core/Lint.hs - compiler/GHC/Driver/DynFlags.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Binds.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Iface/Rename.hs - compiler/GHC/Iface/Syntax.hs - compiler/GHC/Iface/Type.hs - compiler/GHC/IfaceToCore.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Runtime/Eval/Types.hs - compiler/GHC/StgToJS/Apply.hs - compiler/GHC/StgToJS/ExprCtx.hs - compiler/GHC/Tc/Instance/Family.hs - compiler/GHC/Tc/Solver/Default.hs - compiler/GHC/Tc/Solver/Equality.hs - compiler/GHC/Tc/Solver/InertSet.hs - compiler/GHC/Tc/Solver/Monad.hs - compiler/GHC/Tc/Solver/Rewrite.hs - compiler/GHC/Tc/Solver/Solve.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/Types.hs - compiler/GHC/Tc/Utils/TcMType.hs - compiler/GHC/Tc/Utils/TcType.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Id/Info.hs - compiler/GHC/Types/Unique/DSet.hs - compiler/GHC/Types/Var/FV.hs - compiler/GHC/Types/Var/Set.hs - compiler/GHC/Unit/External/Database.hs - compiler/Language/Haskell/Syntax/Decls.hs - compiler/Language/Haskell/Syntax/Extension.hs - docs/users_guide/extending_ghc.rst - docs/users_guide/exts/type_families.rst - ghc/GHCi/UI/Info.hs - libraries/base/tests/Memo1.lhs - libraries/base/tests/Memo2.lhs - libraries/base/tests/all.T - + testsuite/tests/codeGen/should_run/T27624.hs - + testsuite/tests/codeGen/should_run/T27624.stdout - testsuite/tests/codeGen/should_run/all.T - testsuite/tests/corelint/T27374.hs - testsuite/tests/count-deps/CountDepsParser.stdout - testsuite/tests/dependent/should_compile/T14729.stderr - + testsuite/tests/driver/T27836/A.hs - + testsuite/tests/driver/T27836/B.hs - + testsuite/tests/driver/T27836/C.hs - + testsuite/tests/driver/T27836/Makefile - + testsuite/tests/driver/T27836/T27836.stdout - + testsuite/tests/driver/T27836/all.T - + testsuite/tests/driver/T27836/unitA - + testsuite/tests/driver/T27836/unitB - + testsuite/tests/driver/T27836/unitC - testsuite/tests/ghci/prog-mhu001/prog-mhu001c.stdout - testsuite/tests/ghci/prog-mhu002/prog-mhu002d.stdout - testsuite/tests/ghci/scripts/T16575.script - testsuite/tests/ghci/scripts/T16575.stdout - testsuite/tests/ghci/scripts/T16804.stdout - testsuite/tests/ghci/scripts/T20150.stdout - + testsuite/tests/ghci/scripts/T27412.hs - + testsuite/tests/ghci/scripts/T27412.script - + testsuite/tests/ghci/scripts/T27412.stdout - testsuite/tests/ghci/scripts/all.T - testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr - testsuite/tests/hpc/all.T - + testsuite/tests/hpc/viewpats.hs - + testsuite/tests/hpc/viewpats.stdout - + testsuite/tests/indexed-types/should_compile/ZapDeps.hs - testsuite/tests/indexed-types/should_compile/all.T - testsuite/tests/parser/should_compile/DumpParsedAst.stderr - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpSemis.stderr - testsuite/tests/parser/should_compile/KindSigs.stderr - testsuite/tests/rep-poly/RepPolyRule3.stderr - testsuite/tests/simplCore/should_compile/T26051.stderr - + testsuite/tests/simplCore/should_compile/T27910.hs - + testsuite/tests/simplCore/should_compile/T27910.stderr - + testsuite/tests/simplCore/should_compile/T27936.hs - testsuite/tests/simplCore/should_compile/all.T - utils/check-exact/ExactPrint.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs - utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs - utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs - utils/haddock/haddock-api/src/Haddock/Convert.hs - utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs - utils/haddock/haddock-api/src/Haddock/Types.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b19b9a473829cbec7491d6da0649e4b... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b19b9a473829cbec7491d6da0649e4b... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help