[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 13 commits: rts: Fix unwinding information for StgRun
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 1340d255 by ARATA Mizuki at 2026-11-23T20:13:03-05:00 rts: Fix unwinding information for StgRun The unwinding rule for rsp updated in a5ec467ee3d4e77c026437a545981269acde3434 was wrong. It gave the value of rsp _after_ the call instruction (i.e. on entry to StgRun), whereas it should give the value _before_ the call instruction (i.e. the caller's rsp). Fixes #27637 - - - - - 56bb91d9 by Alan Zimmerman at 2026-11-23T20:13:44-05:00 EPA: Replace AnnListLayout / AnnListBrackets with EpLayout We have harmonised the use of `AnnListLayout` and `AnnListBrackets` to be equivalent to `EpLayout`. We now take the final step, and remove them completely in favour of `EpLayout`. The change looks bigger than it is, because a lot of golden test output gets updated. - - - - - f0fa4c04 by Simon Peyton Jones at 2026-11-24T00:51:50-05:00 Use a different herald for -ddump-simpl-trace ... so that we can more easily skip the high-volume ones - - - - - bd812078 by Simon Peyton Jones at 2026-11-24T00:51:50-05:00 Update comments and user manual This commit addresses the comment-related suggestions in #27973 - - - - - 227f2bfe by Simon Peyton Jones at 2026-11-24T00:51:50-05:00 Document and refactor eta-reduction documentation Triggered by #27212, this patch does several related things. * #27212 suggested that `findRhsArity` should ask for eta-expansion whenever the RHS's `manifestArity` is less than the arity it finds. That is a misconception: it deliberately compares with `exprArity`, which counts PAPs, so that we do not eta-expand PAPs (#9020). Switching to `manifestArity` makes compile time worse in T13960 and T13056. So this patch changes no code here; we continue to expand only to increase `exprArity` not `manifestArity`. Instead it documents the design in `findRhsArity`, `tryEtaExpandRhs`, `wantEtaExpansion` and Note [Do not eta-expand PAPs] (which now records the #27212 experiment). * Refactor GHC.Core.Opt.Arity.tryEtaReduce, which was hard to understand: - Accumulate an MCoercion rather than a Coercion, so the common no-cast case builds no coercions at all. - Separate equations of `go` for type and value arguments. For value arguments, the new `getTrivialHead_maybe` looks through any nesting of casts and floatable ticks, and `mkEtaReduceFunCo` builds the coercion. - Make the FunCo with `mkFunCo2` and compute its right-hand FunTyFlag from the coercion kinds. The cast can turn a Type-kinded argument into a Constraint-kinded one. New test T27212 covers this. - `mkEtaReduceForAllMCo` builds the ForAllCo for type arguments. It is tiresomely similar to `mkEtaForAllMCo`, but with the visibilities the other way round (#24014). It will go away again once !17006 lands. - New helper `mCoToCo` in GHC.Core.TyCo.Make. * Drop the checks on multiplicity in `tryEtaReduce`, which sometimes disabled eta-reduction. For example, (\x. K x) has type Int -> T, but the data constructor has type K :: Int %1 -> T, so we used to refuse to eta-reduce it to K. But Note [Linting linearity] in GHC.Core.Lint (EXAMPLE 4) already says that we do not preserve linearity under eta-reduction, so this change just puts that claim into practice. See (EtaMult) in Note [Eta reduction soundness]. Consequences in the testsuite: - T18052a: the pattern-synonym builder (\x y. (x,y)) is now just (,). - T21888a: the NOINLINE function (f x = Just x) becomes (f = Just), so f loses its CPR signature. The test is about demands, not CPR. * Tidy up the documentation of eta-reduction: - Relabel the criteria in Note [Eta reduction soundness] as (EtaA), (EtaS), (EtaR), (EtaE), (EtaT), (EtaJ), (EtaB) and (EtaW), and update all references to them. Also fix references to point (2) of Note [Eta reduction makes sense], which no longer exists. - Replace the confused "never reduce arity" bullet with an example in (EtaA), cross-referenced from Note [Arity robustness]. - Add historical notes (EtaMult) and (EtaBot). - Label the equations in Note [Eta reduction with casted arguments] (ECA1-4), and point to the code that implements them. LLM disclosure: I interacted with Claude a lot for this MR, but I wrote all the code and docs myself. - - - - - b2b6920b by Zubin Duggal at 2026-11-24T00:51:51-05:00 linker: Remove DotA and DotDLL constructors of LinkablePart As far as I can, we have never actually used these constructors, and they have never appeared in a positive position, ever since they were introduced a long time ago. Foreign libraries aren't loaded through these either, that happens either through `loadPackages` which uses `LibrarySpec` or through 'loadCmdLineLibs' Also, a Linkable defines the build product of a single home module. DotA/DotDLL are library like things, so they don't fit into a Linkable anyway. - - - - - e2ba1375 by Zubin Duggal at 2026-11-24T00:51:51-05:00 Identify Linkable with fingerprints of their contents rather than modtimes - - - - - 7177d4d8 by Zubin Duggal at 2026-11-24T00:51:51-05:00 Linker cleanup delete a bunch of unused functions - - - - - 93eee371 by Zubin Duggal at 2026-11-24T00:51:51-05:00 Record constituent hashes for bytecode libraries A bytecode library now records the combined hash of its constituents, so relinking can be skipped when they haven't changed. - - - - - c77c3525 by Zubin Duggal at 2026-11-24T00:51:51-05:00 bytecode: Give persistent bytecode files a fixed-size header with a hash The header of .gbc and .bytecodelib files now consists of the magic word, the compiler version and a hash, all with fixed-length encodings. The hash is the gbc_hash of a bytecode file, or the inputs hash of a bytecode library. readBinByteCodeHash and readBytecodeLibInputsHash now read only the header rather than the whole file. The version is written as its four numeric components instead of as a string. - - - - - 6902245d by Zubin Duggal at 2026-11-24T00:51:51-05:00 driver: Refresh ms_bytecode_date when reusing a ModSummary - - - - - 5ded42a7 by Zubin Duggal at 2026-11-24T00:51:51-05:00 bytecode: Treat persistent bytecode files with a bad header as stale - - - - - 46235ab5 by Zubin Duggal at 2026-11-24T00:51:52-05:00 bytecode: Record the inputs hash in BytecodeLib ------------------------- Metric Increase: MultiLayerModulesRecomp MultiLayerModulesTH_OneShot ------------------------- - - - - - 76 changed files: - + changelog.d/T27212 - + changelog.d/T27637 - compiler/GHC/ByteCode/Binary.hs - compiler/GHC/ByteCode/Serialize.hs - compiler/GHC/Core/Coercion.hs - compiler/GHC/Core/Opt/Arity.hs - compiler/GHC/Core/Opt/OccurAnal.hs - compiler/GHC/Core/Opt/Pipeline.hs - compiler/GHC/Core/Opt/Simplify/Env.hs - compiler/GHC/Core/Opt/Simplify/Inline.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/TyCo/Make.hs - compiler/GHC/Core/Type.hs - compiler/GHC/Core/Utils.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Driver/Downsweep.hs - compiler/GHC/Driver/Main/Compile.hs - compiler/GHC/Driver/Main/Passes.hs - compiler/GHC/Driver/Pipeline.hs - compiler/GHC/Linker/ByteCode.hs - compiler/GHC/Linker/Deps.hs - compiler/GHC/Linker/Loader.hs - compiler/GHC/Linker/Types.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/Annotation.hs - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Unit/Finder.hs - compiler/GHC/Utils/Logger.hs - compiler/Language/Haskell/Syntax/Binds/InlinePragma.hs - docs/users_guide/debug-info.rst - docs/users_guide/using-optimisation.rst - rts/StgCRun.c - testsuite/tests/dmdanal/sigs/T21888a.stderr - testsuite/tests/driver/bytecode-object/Makefile - testsuite/tests/driver/bytecode-object/all.T - + testsuite/tests/driver/bytecode-object/bytecode_object27.stdout - + testsuite/tests/driver/bytecode-object/bytecode_object28.script - + testsuite/tests/driver/bytecode-object/bytecode_object28.stdout - + testsuite/tests/driver/bytecode-object/bytecode_object29.stdout - + testsuite/tests/driver/recomp023/M.hs - + testsuite/tests/driver/recomp023/M2.hs - + testsuite/tests/driver/recomp023/Makefile - + testsuite/tests/driver/recomp023/all.T - + testsuite/tests/driver/recomp023/recomp023.stdout - testsuite/tests/ghc-api/exactprint/T22919.stderr - testsuite/tests/ghc-api/exactprint/Test20239.stderr - testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr - testsuite/tests/module/mod185.stderr - testsuite/tests/parser/should_compile/DumpParsedAst.stderr - testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr - testsuite/tests/parser/should_compile/DumpRenamedAst.stderr - testsuite/tests/parser/should_compile/DumpSemis.stderr - testsuite/tests/parser/should_compile/KindSigs.stderr - testsuite/tests/parser/should_compile/T14189.stderr - testsuite/tests/parser/should_compile/T15279.stderr - testsuite/tests/parser/should_compile/T15323.stderr - testsuite/tests/parser/should_compile/T20452.stderr - testsuite/tests/parser/should_compile/T20718.stderr - testsuite/tests/parser/should_compile/T20846.stderr - testsuite/tests/printer/T18052a.stderr - testsuite/tests/printer/T18791.stderr - testsuite/tests/printer/Test20297.stdout - testsuite/tests/printer/Test24533.stdout - testsuite/tests/simplCore/should_compile/T24726.stderr - + testsuite/tests/simplCore/should_compile/T27212.hs - testsuite/tests/simplCore/should_compile/all.T - utils/check-exact/ExactPrint.hs - utils/check-exact/Main.hs - utils/check-exact/Transform.hs - utils/check-exact/Utils.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c3e4541acb2242a45f445a9e584aae9... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c3e4541acb2242a45f445a9e584aae9... 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
participants (1)
-
Marge Bot (@marge-bot)