Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC Commits: 64848f4d by Sylvain Henry at 2026-11-20T15:14:57-05:00 NCG: List each destination of a jump table once jumpDestsOfInstr listed a block once per jump table entry that named it. The linear register allocator makes a fixup block per listed destination, so such a block got several fixup blocks. The patch of the jump sends every entry to the first one. The other fixup blocks were dead code, and the CFG had an edge to each of them. jumpDestsOfInstr now lists each destination once, in every backend. joinToTargets asserts it in debug builds. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> - - - - - b2219a50 by Andreas Klebinger at 2026-11-20T15:14:57-05:00 x86 ncg: Track the current block in NatM to keep the CFG in sync The x86 NCG uses a CFG for code layout. When instruction selection makes new blocks (word2Float#, cmpxchg loops, 64-bit shifts on i386), it must add them to the CFG. Some sites did not. The CFG went out of sync, the layout was bad, and the register allocator panicked when it added fixup blocks (#27694, #27915). NatM now keeps the current block in its state. Combinators update the CFG and the current block together. See Note [Updating the CFG during CodeGen] in GHC.CmmToAsm.Monad. Other changes: * -dasm-lint checks that the jumps in the code and the edges in the CFG agree in both directions. This found a second desync: the CFG did not follow the jumps that allocMoreStack retargets. The new addPreentryBlock fixes it. * The code must be emitted in generation order, because the CFG records new blocks in that order. A store now generates the code of its value before the code of its address, in the order it emits them. Atomic operations take their address from the new getNonClobberedAmode, so the code of their other operands cannot clobber it. Fixes #27694, #27915 Co-authored-by: Sylvain Henry <sylvain@haskus.fr> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> - - - - - 13a2136e by Sylvain Henry at 2026-11-20T15:14:57-05:00 x86 ncg: Maintain the CFG on i386 The i386 NCG now keeps its CFG in sync with the code (see the previous commit), so backendMaintainsCfg is now True for i386. i386 gets the CFG based code layout, dead code elimination and the -dasm-lint check, like x86-64. The compiler allocates more on i386: the CFG now goes through the register allocator, branch shortcutting and optimizeCFG, which i386 skipped before. x86-64 already does this work. Metric Increase: CoOpt_Read ManyAlternatives T10421 T12425 T12707 T13056 T13253 T13253-spj T13960 T15164 T15304 T15630 T15630a T15703 T16577 T17516 T17836 T18140 T18282 T18304 T18698a T18698b T18730 T18923 T19695 T20049 T21839c T24471 T26425 T26989 T5642 T6048 T783 T9233 T9630 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> - - - - - 52473d64 by Simon Peyton Jones at 2026-11-20T15:14:58-05:00 Redesign the noinline magic The principal goal of this MR is to avoid `noinline` getting in the way of strictness analysis and specialisation. It involves a bit of redesign. Main idea: * When simplifying `noinline (f e1 e2)`, switch off inlining when simplifying `f`, but not when simplifying `e1` and `e2`. * Mechanism: see `simplOutId`, the `noinlineIdKey` case * If: we see `noinline (f e1) e2`, the simplifier moves the `e2` inside; see the `splitContArgs` call. This is important so you can write `noinline f e1 e2` and have it mean the same as `noinline (f e1 e2)`. * Now `f` sees all its arguments, hence: * Fixes #27724 (noinline inhibits specialisation) * Fixes #23911 (noinline worsens demand signatures) * Also fixes #27803 where we were not respecting `noinline` if the RHS was trivial See Note [noinlineId magic] for lots of specifics. It's surprisingly tricky! For some reason a couple of perf tests allocate 1.2% less at compile time,n namely T29872 and T8095. Geom mean decease of 0.1% Metric Decrease: T9872d - - - - - 431241d7 by fendor at 2026-11-20T15:15:00-05:00 `ghc -M`: Add support for link nodes to json output `LinkNode`s are part of the module graph and indicate that a certain linking artefact is to be produced from other module graph nodes. We expose `LinkNode`s in the output of `ghc -M -dep-json`, allowing consumers to see when a linking artefact is to be produced. Only the JSON output format of `ghc -M` supports `LinkNode` as it is unclear how the Makefile output should be retrofitted to express the dependencies, and whether it would require a feature guard. Closes #28007 - - - - - 77efb8d4 by Ryan Scott at 2026-11-20T15:15:01-05:00 GHC.HsToCore.Quote: Quote \cases with the correct type Previously, `\cases` expressions inside of Template Haskell quotes would incorrectly use the `Match` type instead of `Clause` for the element type. We now use `nonEmptyCoreList` when quoting `\cases`, which infers the correct type automatically. This works because `\cases` has an invariant that the list of clauses is always non-empty. Fixes #27826. - - - - - 0211a206 by Simon Peyton Jones at 2026-11-20T15:15:03-05:00 Better desugaring for bang patterns Ticket #27862 showed that we were desugaring bang patterns in a silly way, which led to bad code. This small fix makes it much better. I ended up refactoring `decomposeFirstPat` to be of type (LPat -> LPat) instead of (Pat -> Pat) which made it much easier to keep the locations correct. On the way I also fixed #28137, a missing warning. See Note [Tidying patterns] which has new (TP1) and (TP2) and Note [Grouping equations] especially (GE1) - - - - - b4bdac1f by Hannes Siebenhandl at 2026-11-20T15:15:05-05:00 Use Set operations over Foldable operations Use `O(log n)` operations over `O(n)` for all call-sites of `hsc_all_home_unit_ids`. - - - - - 38ef56f6 by Alan Zimmerman at 2026-11-20T15:15:06-05:00 EPA: Use AnnList in DecBrl Via updating the TTG extension point payload - - - - - 0fca6f0d by David Eichmann at 2026-11-20T15:15:08-05:00 Fix race condition in IOManager test - - - - - 5a5a886a by Simon Peyton Jones at 2026-11-20T15:15:09-05:00 Fix a zonking bug As #28135 showed, we were failing to zonk some type-variable binders before doing scoped-sort dependency analysis, resulting in chaos. The fix is easy. - - - - - 47a96bb7 by mangoiv at 2026-11-20T15:15:10-05:00 ci: nightly push can run on any arch - - - - - 131 changed files: - .gitlab-ci.yml - + changelog.d/27694 - + changelog.d/T27137 - + changelog.d/T27724 - + changelog.d/T27862 - + changelog.d/T28135 - + changelog.d/make-depends-link-nodes - compiler/GHC/Builtin/WiredIn/Ids.hs - compiler/GHC/Builtin/WiredIn/Prim.hs - compiler/GHC/Builtin/WiredIn/Types/Box.hs - compiler/GHC/CmmToAsm.hs - compiler/GHC/CmmToAsm/AArch64/CodeGen.hs - compiler/GHC/CmmToAsm/AArch64/Instr.hs - compiler/GHC/CmmToAsm/BlockLayout.hs - compiler/GHC/CmmToAsm/CFG.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/LA64/Instr.hs - compiler/GHC/CmmToAsm/Monad.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/RV64/Instr.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/Core/Opt/SetLevels.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/TyCo/Make.hs - compiler/GHC/Core/TyCo/Rep.hs - compiler/GHC/Core/Type.hs - compiler/GHC/CoreToIface.hs - compiler/GHC/CoreToStg/Prep.hs - compiler/GHC/Driver/Config/Core/Opt/Simplify.hs - compiler/GHC/Driver/Downsweep.hs - compiler/GHC/Driver/Make.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/HsToCore.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Match.hs - compiler/GHC/HsToCore/Match/Literal.hs - compiler/GHC/HsToCore/Monad.hs - compiler/GHC/HsToCore/Pmc.hs - compiler/GHC/HsToCore/Pmc/Solver/Types.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/Iface/Load.hs - compiler/GHC/Iface/Recomp.hs - compiler/GHC/Parser.y - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Instance/Class.hs - compiler/GHC/Tc/Solver.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/Types/Origin.hs - + distrib/configure.ac - docs/users_guide/make-depends-json-schema-1_0.json - libraries/ghc-internal/src/GHC/Internal/Exts.hs - libraries/ghc-internal/src/GHC/Internal/Magic.hs - testsuite/tests/ado/T22483.stderr - + testsuite/tests/codeGen/should_compile/T27694.hs - + testsuite/tests/codeGen/should_compile/T27694c.hs - + testsuite/tests/codeGen/should_compile/T27694d.hs - testsuite/tests/codeGen/should_compile/all.T - + testsuite/tests/codeGen/should_run/T27694b.hs - + testsuite/tests/codeGen/should_run/T27694b.stdout - + testsuite/tests/codeGen/should_run/T27915.hs - + testsuite/tests/codeGen/should_run/T27915.stdout-ws-32 - + testsuite/tests/codeGen/should_run/T27915.stdout-ws-64 - testsuite/tests/codeGen/should_run/all.T - testsuite/tests/corelint/LintEtaExpand.hs - + testsuite/tests/deSugar/should_compile/T27862.hs - + testsuite/tests/deSugar/should_compile/T27862.stderr - + testsuite/tests/deSugar/should_compile/T27862a.hs - + testsuite/tests/deSugar/should_compile/T27862a.stderr - + testsuite/tests/deSugar/should_compile/T27862b.hs - + testsuite/tests/deSugar/should_compile/T27862b.stderr - + testsuite/tests/deSugar/should_compile/T27862c.hs - + testsuite/tests/deSugar/should_compile/T27862c.stderr - + testsuite/tests/deSugar/should_compile/T27862d.hs - + testsuite/tests/deSugar/should_compile/T27862d.stderr - + testsuite/tests/deSugar/should_compile/T28137.hs - + testsuite/tests/deSugar/should_compile/T28137.stderr - testsuite/tests/deSugar/should_compile/all.T - testsuite/tests/deSugar/should_run/dsrun008.stderr - + testsuite/tests/dmdanal/should_compile/T23911.hs - + testsuite/tests/dmdanal/should_compile/T23911.stderr - testsuite/tests/dmdanal/should_compile/all.T - testsuite/tests/driver/mkdepend/all.T - + testsuite/tests/driver/mkdepend/mhu04/app/Main.hs - + testsuite/tests/driver/mkdepend/mhu04/app/Utils.hs - + testsuite/tests/driver/mkdepend/mhu04/lib/Lib.hs - + testsuite/tests/driver/mkdepend/mhu04/lib/Lib/Internal.hs - + testsuite/tests/driver/mkdepend/mhu04/unitApp - + testsuite/tests/driver/mkdepend/mhu04/unitLib - + testsuite/tests/driver/mkdepend/mhu05/app/Main.hs - + testsuite/tests/driver/mkdepend/mhu05/lib/Lib.hs - + testsuite/tests/driver/mkdepend/mhu05/lib/Lib/Internal.hs - + testsuite/tests/driver/mkdepend/mhu05/test/Spec.hs - + testsuite/tests/driver/mkdepend/mhu05/unitApp - + testsuite/tests/driver/mkdepend/mhu05/unitLib - + testsuite/tests/driver/mkdepend/mhu05/unitTest - + testsuite/tests/driver/mkdepend/mkdepend02.dep-json - + testsuite/tests/driver/mkdepend/mkdepend02/Main.hs - + testsuite/tests/driver/mkdepend/mkdepend_bkp_01/bkp01.bkp - + testsuite/tests/driver/mkdepend/mkdepend_mhu04.dep-json - + testsuite/tests/driver/mkdepend/mkdepend_mhu04.dep-makefile - + testsuite/tests/driver/mkdepend/mkdepend_mhu05.dep-json - + testsuite/tests/driver/mkdepend/mkdepend_mhu05.dep-makefile - 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/ghc-experimental-exports.stdout - testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32 - testsuite/tests/interface-stability/ghc-prim-exports.stdout - testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32 - testsuite/tests/pmcheck/should_compile/T24234.stderr - testsuite/tests/rts/IOManager.hsc - testsuite/tests/rts/all.T - testsuite/tests/simplCore/should_compile/T18995.stderr - + testsuite/tests/simplCore/should_compile/T27724a.hs - + testsuite/tests/simplCore/should_compile/T27724a.stderr - + testsuite/tests/simplCore/should_compile/T27803.hs - + testsuite/tests/simplCore/should_compile/T27803.stderr - testsuite/tests/simplCore/should_compile/all.T - + testsuite/tests/th/T27826.hs - testsuite/tests/th/all.T - + testsuite/tests/typecheck/should_compile/T28135.hs - testsuite/tests/typecheck/should_compile/all.T - testsuite/tests/typecheck/should_fail/T17940.stderr - testsuite/tests/typecheck/should_fail/tcfail203a.stderr - utils/check-exact/ExactPrint.hs - utils/genprimopcode/Main.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dc81dc01fdb57aae680f8e988144edf... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/dc81dc01fdb57aae680f8e988144edf... 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