Mikolaj Konarski pushed to branch wip/ncg-notes at Glasgow Haskell Compiler / GHC Commits: 56757900 by Sebastian Graf at 2026-11-04T20:36:47+01:00 Documentation for the Core data constructors Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> - - - - - 9f57c265 by Sylvain Henry at 2026-11-06T06:46:15-05:00 ghc-internal: avoid unnecessary allocations in bignum division (#27231) Avoid unnecessary allocations in bignum division in the Haskell (native) backend. The long-division loop used to allocate a fresh BigNat for the partial product on every iteration, plus one more per quotient-digit correction; it now subtracts the partial product in place and materializes nothing. The quotient-digit estimate is also refined against the second-highest divisor word, so the add-back correction runs at most once per iteration. bignat_quotrem_normalized now requires a divisor of at least 2 words, so bignat_quotrem dispatches 1-word divisors to bignat_quotrem_word. See Note [Knuth division loop] and Note [Fused multiply-subtract for long division] in GHC.Internal.Bignum.Backend.Native. Measured on the new T27231 perf test (10000 native-backend 8192/2048-bit Integer quotRem calls): bytes allocated drops from 305 MB to 52 MB (-83%). Improvement on CI (x86-64-linux-deb13-int_native): space_leak_001(normal) run/alloc 12,492,185,536 9,073,055,928 -27.4% GOOD Metric Decrease: space_leak_001 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> - - - - - c5b80f4e by mangoiv at 2026-11-06T06:46:57-05:00 ci: build and test stage Split up CI in a build and test stage: 1. in the build stage, just produce a bindist as well as running the stage1 tests 2. in the test stage, install the bindist, then run the testsuite with out of tree args - - - - - e4b1c892 by mangoiv at 2026-11-06T06:46:57-05:00 ci: reorder packaging and testing stages - - - - - 19901b41 by mangoiv at 2026-11-06T06:46:57-05:00 ci: out of tree compiler does not imply no hadrian being available - - - - - 83a860a7 by mangoiv at 2026-11-06T06:46:57-05:00 ci: don't do msys deps check on stage1 compiler - - - - - abf5b3af by mangoiv at 2026-11-06T06:46:57-05:00 testsuite: allow metric decreases on windows Metric Decrease: LinkableUsage01 MultiLayerModulesTH_OneShot T10547 T12234 T12425 T13035 T13253-spj T13820 T18140 T18730 T18923 T9198 TcPlugin_RewritePerf mhu-perf - - - - - 9185f1ab by mangoiv at 2026-11-06T06:46:57-05:00 ci: stop using ellipses in testsuite output and output env before invoking hadrian - - - - - bf9ece2b by Simon Jakobi at 2026-11-06T06:47:42-05:00 testsuite: Skip the changelog-d test in CI Full-build validate jobs run the whole testsuite and thus repeated the changelog validation that the dedicated lint-changelog job had already reported in the early tool-lint stage. Skip the test when GITLAB_CI is set, making lint-changelog the only CI check of changelog.d while keeping the test available in local testsuite runs. Fixes #27325. Assisted-by: Claude Fable 5 - - - - - ef6adb30 by ARATA Mizuki at 2026-11-06T06:48:31-05:00 testsuite: Mark T367_letnoescape fragile for the optllvm way It was marked broken, but it is now unexpectedly passing on aarch64-linux-deb13-validate+llvm. Marking it fragile for now. See #7292 - - - - - 1db5f9d7 by Rodrigo Mesquita at 2026-11-06T06:49:13-05:00 interp: Make resumeExec and ExecBreak use `Resume` directly Previously, `Resume` contexts were just put directly in the global interactive environment state, so they were only accessible through it. However, in the context of multi-threaded debugging, in that many threads may hit breakpoints, it no longer suffices to have a global linear list of breakpoints hit. We need a per-breakpoint Resume context and need to be able to wield it directly rather than going through a global context. The driving changes of this commit are: - Put the Resume data in ExecBreak - Make resumeExec receive a Resume as an argument This also simplifies the interpreter in that we no longer necessarily rely on the global interactive state to resume a thread. We can do it directly from the ExecBreak. The interactive context still maintains a stack of resumes, but `resumeExec` can no longer pop the resume it resumes off of the breakpoints stack, since it is no longer guaranteed to be resuming the first in that list. Hence, callers of `resumeExec` must update ic_resume on their own. Fixes #28058 - - - - - fd00a88c by Rodrigo Mesquita at 2026-11-06T06:49:54-05:00 Per-thread break-on exception (TSO_STOP_ON_EXCEPTION) The `-fbreak-on-exception` flag allows the interactive interpreter to stop when a synchronous exception is raised. However, this is a global toggle backed by a global variable in the RTS (rts_stop_on_exception) which is not compatible with a multi-threaded debugger where we may want to stop if some threads raise a synchronous exception but not other. This commit makes -break-on-exception similar to step-next and step-out where there is a per-thread toggle on each TSO (TSO_STOP_ON_EXCEPTION), and that break-on-exception set in EvalOpts when resuming a statement only affect the thread being resumed. Fixes #28068 - - - - - d735b507 by Andrea Vezzosi at 2026-11-06T06:50:35-05:00 driver: Don't let -dynamic unset -fsplit-sections `addWay' WayDyn` used to unset Opt_SplitSections, so -fsplit-sections was ignored if it came before -dynamic, but worked if it came after. The -fsplit-sections -dynamic combination has legitimate uses, e.g. an executable can be linked dynamically against libraries and still have dead code from its own sources to eliminate. Or the same objects could be used for both static archives and shared objects. The removal of Opt_SplitSections was also motivated by problems on Darwin. It is now done in `makeDynFlagsConsistent` instead, see Note [Split sections are not supported on Mach-O]. For consistency, we also keep Opt_SplitSections when `dynamicNow` is activated. There is a cost of larger .dyn_o (but not .so) files and slower link times (esp. with ld.bfd), but does not seem significant enough to warrant special casing. Fixes #28061 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> - - - - - 10e36bd2 by Alan Zimmerman at 2026-11-06T06:51:18-05:00 EPA: Use AnnList in AnnClassDecl Capture parser layout - - - - - 20334e1d by sheaf at 2026-11-06T06:52:06-05:00 Avoid panic in 'solveImplicationsUsingUnsatGiven' Commit 52a4d1da refactored this code to use 'setWantedDict' which panics for equality constraints. This commit fixes that by explicitly handling HoleDest. Fixes #28081 - - - - - 0423f413 by Kazu Yamamoto at 2026-11-07T08:06:59+09:00 testsuite: add tests for the IO manager lock-up of #21969 T21969a 'closeFdWith' takes every 'EventManager''s 'callbackTableVar' inside 'uninterruptibleMask_' and only puts them back on the paths that do not throw, so a throw from 'closeFd_' leaves those MVars empty for good. Afterwards every 'threadWaitRead' and 'closeFdWith' on an fd in the same bucket blocks forever. T21969b 'closeFdWith' runs the fd's callbacks while asynchronous exceptions are uninterruptibly masked, so a callback that blocks makes the thread calling it permanently unkillable. T21969c 'closeFd_' drops the registrations before telling the backend to forget the fd, so when the backend throws the fd is never closed and the threads waiting on it are never woken. T21969d the cleanup handler of 'threadWait' calls 'unregisterFd_', which throws on backend errors. It runs inside the handler for the asynchronous exception being delivered, so its exception replaces that one: 'killThread' returns but 'ThreadKilled' never arrives. T21969e an exception from re-arming an fd escapes the poll loop, and 'loop' turns it into 'cleanup mgr': the 'EventManager' of that capability is shut down and every thread using it is left blocked. This is the lock-up of #21969 itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> - - - - - 5c197e2e by Kazu Yamamoto at 2026-11-07T08:06:59+09:00 Make the IO manager cope with errors from the polling backend (#21969) Three changes in 'GHC.Internal.Event.Thread': 'closeFdWith' puts every 'callbackTableVar' back on the paths that throw too and no longer skips the callbacks when 'close' fails, those callbacks now run under the 'mask_' of 'close_loop' rather than uninterruptibly masked, and the cleanup of 'threadWait' ignores a failure from 'unregisterFd_'. This fixes T21969a, T21969b and T21969d, and clears their expect_broken. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> - - - - - cb765ded by Kazu Yamamoto at 2026-11-07T08:06:59+09:00 Do not let backend errors abandon the close of a file descriptor (#21969) 'closeFd_' and 'closeFd' now ignore errors from telling the backend to forget the fd: the registration is being torn down and the error says it is already gone. 'registerFd_' still reports them (!10643), where the caller has to learn that the registration did not happen. Both also test 'I.elEvent oldEls /= mempty' rather than 'oldEls /= mempty'. This fixes T21969c, and clears its expect_broken. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> - - - - - 9073bc43 by Kazu Yamamoto at 2026-11-07T08:06:59+09:00 Do not let a backend error take down a capability's IO manager (#21969) A failure to re-arm an fd in 'selectCallbacks' is now handled the way 'registerFd_' handles one (!10643): the registrations are taken back out of the callback table and returned, so their callbacks run and the waiting threads find out for themselves instead of hanging. Checked on aarch64 Linux (epoll) and aarch64 macOS (kqueue), 10 runs each way. This fixes T21969e, and clears its expect_broken. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> - - - - - cdff4e76 by Kazu Yamamoto at 2026-11-07T08:06:59+09:00 Do not let the deregistration of threadWaitSTM throw either (#21969) 'threadWaitReadSTM' and 'threadWaitWriteSTM' return the action that gives up interest in the fd as the second component of their pair, and it was return (waitAction, unregisterFd_ mgr reg >> return ()) 'unregisterFd_' talks to the polling backend, which throws on errors such as ENOENT and EBADF -- which is how a backend reports an fd it no longer knows, once that fd has been closed without going through 'closeFdWith'. That is the same shape as the cleanup of 'threadWait', which the rest of this series made quiet, and it is the same on both counts. There is nothing to decide: the registration is being abandoned, and "the backend does not know this fd" is the state the action is trying to reach. And it does harm: the action is what a caller uses from the cleanup of a 'bracket', where an exception out of it replaces whatever was being propagated. It now goes through 'quietUnregisterFd', as the cleanup of 'threadWait' does, and that function's comment covers both callers. T21969f covers it, and is deterministic on both backends: dropping the only registration changes the event set, so 'unregisterFd_' always reaches the backend. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> - - - - - a7ed305b by Kazu Yamamoto at 2026-11-07T08:06:59+09:00 testsuite: let T21969 run on FreeBSD, and unmark it (#21969, #25512) T21969 now carries the descriptor from 'createPipe' instead of recovering it with 'handleToFd', which rejects the 'DuplexHandle' that FreeBSD's bidirectional pipes become and killed the test in setup there (#25512). The expect_broken goes with it: with the descriptor problem out of the way the test times out on master, so it can only be unmarked on top of this series. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> - - - - - 3074ae61 by Sylvain Henry at 2026-11-08T10:21:50-05:00 rts: heap census counts every small pinned object Blocks of small pinned objects carry BF_LARGE as well as BF_PINNED but hold many objects. heapCensusChain treated every BF_LARGE block whose first object is an ARR_WORDS as holding that single object, a workaround for the slop left by shrinkMutableByteArray# (#11627). So every heap profile mode under-reported pinned byte arrays, i.e. ByteString payloads. Shrinking now writes a slop marker that skipSlop understands (#19048, #27585), so the block walk is safe for large and pinned blocks alike. The block that a capability fills with small pinned objects stays attached to the capability until it is full (see allocatePinned), so it is on no generation list and the census never saw its objects. heapCensus now walks cap->pinned_object_block too. A pinned block is kept or freed as a whole (#28005), so dead pinned objects are counted until their block is freed. T7275 gains one sample in which its dead small arrays still show. The user guide and changelog document this. T7257 retains most of its pinned blocks and takes a census at every GC (+RTS -i0 -hT), so walking every pinned object made it 7x slower and it hit the CI timeout. It now runs 1000000 iterations instead of 5000000. Metric Decrease: T7257 Fixes #28000 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> - - - - - 16fd075a by Sylvain Henry at 2026-11-08T10:22:39-05:00 rts: fix GC CPU time accounting with idle GC threads (#26169) stat_endGC summed gc_end_cpu - gc_start_cpu over every GC thread, but only the threads that take part in a collection set these fields, and new_gc_thread did not initialise them. With -qn below the capability count, the first collection after setNumCapabilities added garbage to the GC CPU time. Let each participating thread add its own CPU time to an accumulator in stat_endGCWorker, and let stat_endGC take the total. This removes the loop over gc_threads, the reset from #21082 and the gc_end_cpu field. Also drop the unused gc_end_elapsed field. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> - - - - - 0ef732e2 by Sylvain Henry at 2026-11-08T10:23:30-05:00 Serialized: encode numbers with LEB128 serializeWithData used the Binary instances of Data.Binary for the numbers in a ConstrRep. They have a fixed width: 8 bytes for the constructor index (an Int) and 5 bytes for a small Integer. Each element of a [Int] cost 15 bytes. Now the constructor representation is one unsigned LEB128 number that also contains the index of an algebraic constructor, and the payloads (Integer, Rational, Char) are LEB128 encoded. Most constructors take one byte, and small numbers two. See Note [Serialized encoding]. Sizes measured by the T16841 test: [1..100] :: [Int] 1509 -> 338 bytes "helloworld" 119 -> 31 bytes 2^100 :: Integer 24 -> 16 bytes Just True 18 -> 2 bytes 3.25 :: Double 11 -> 3 bytes 42 :: Int 6 -> 2 bytes A new test, SerializedRoundTrip, round-trips values at the boundaries of the encoding (negative numbers, big Integers, Rationals, Chars). Follow-up to !16841 (#28002). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> - - - - - 22344fbc by Sylvain Henry at 2026-11-08T10:24:21-05:00 docs: fix duplicate label in qualified_strings.rst The file started with the label "multiline-strings", copied from multiline_strings.rst. Sphinx warned about the duplicate label on every build. Use the label "qualified-strings" instead. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> - - - - - b7022624 by Alan Zimmerman at 2026-11-08T10:25:02-05:00 EPA: Use LHsLocalBinds instead of HsLocalBinds This reverses an earlier change, and brings processing of local binds into alignement with the exact printing principle that the LocatedA contents provide the location and extent of the enclosed item, together with any comments or context-specific trailing items like commas or semi colons. The internal TTG extension points only carry exact print annotations related to printing the item within its bounds. This change brings back the problem of EmptyLocalBinds, which by definition cannot have a location. These get a noSrcSpan location, which is ignored in the exact printing process. - - - - - bc2fae45 by Rodrigo Mesquita at 2026-11-08T18:37:40-05:00 Build EvalOpts once per exec rather than per breakpoint stop We were unnecessarily constructing `eval_opts` in `handleRunStatus` (which is run many times in a loop until we hit a breakpoint we care about, e.g. when :steplocal), despite the `eval_opts` being constant across all these runs. So, construct `eval_opts` outside `handleRunStatus` and share the value in all loop calls. The loop always uses the same eval_opts, so no point in constructing them inside `handleRunStatus` from scratch every time. I found out about the significance of this re-construction of `EvalOpts` when I added a record update of `eval_opts` *after* the construction from scratch inside `handleRunStatus` that regressed allocations significantly. This improves the performance of `interpreter_steplocal` on my machine: Baseline Test Metric value New value Change ------------------------------------------------------------------------- interpreter_steplocal(ghci) ghc/alloc 459,845,696 449,843,480 -2.2% Fixes #28068 - - - - - ba579288 by Rodrigo Mesquita at 2026-11-08T18:38:21-05:00 refactor: move and order helper functions in GHCi.Run A small refactor to the order of top-level functions in GHCi.Run - - - - - 24927752 by Luite Stegeman at 2026-11-09T09:21:24-05:00 rts: add missing nonmoving write barrier in out-of-line array copies The out-of-line entries stg_copyArrayzh/stg_copyMutableArrayzh (taken whenever the element count of copyArray#/copyMutableArray# is not a compile-time constant) didn't push the overwritten elements to the nonmoving collector's remembered set. Fixes #27376 - - - - - 6dbcca65 by Rodrigo Mesquita at 2026-11-09T09:22:06-05:00 interp: Set per-thread break flags consistently on eval/resume Currently, the per-thread flags are: - Single-step: Stop at the immediate next breakpoint in this thread - Step-out: Stop at the next continuation with a breakpoint this thread returns to. - Break-on-exception: Stop the next time a synchronous exception is raised in this thread. Originally, these flags were all set globally across all threads. More recently, these flags are set per-thread when `resume`ing that thread, but globally when starting the evaluation of a new expression (`evalStmt`). With this commit, we now use per-TSO flags in both scenarios evaluating expressions in the interpreter (`evalStmt` and `resumeStmt`). - In `resumeStmt` we set the `EvalOpts` specifically in the `ThreadId` being resumed. - In `evalStmt`, we set the `EvalOpts` exclusively on the sandbox thread we fork to evaluate the given expression - When not using the sandbox thread (i.e. -fno-ghci-sandbox), we don't support the debugger anyway, so the break flags are irrelevant. We do this by consistently calling `setBreakFlags` when starting, resuming, or killing the evaluation. See Note [Always setBreakFlags on running thread]. This slightly changes the behavior of evaluating a new expression in the debugger (resuming a thread behaves the same as before). Namely, `:step <expr>`, where <expr> forks a thread, will stop at the immediate next breakpoint in the <expr> main thread, not on a breakpoint of any forked thread. NB: the forked thread may still stop at breakpoint, if it is enabled by index specifically, and then :step-ing from that thread's breakpoint will toggle per-thread stepping for that forked thread. We will want to control stepping in "all threads, regardless of whether we control them or if they were spawned by the debuggee" separately from the commands which trigger evaluation of just an expression. Namely, we'll likely want a "break at the next immediate breakpoint hit on ANY thread" command that the user can execute before launching a debuggee which is multi-threaded. This may even be the default for GHCi. Towards #26064 Fixes #28080 - - - - - 19ff36f2 by Simon Jakobi at 2026-11-09T09:22:47-05:00 testsuite: Mark T8209 fragile for the ghci ways on FreeBSD and darwin A shutdown race in the I/O manager intermittently fails T8209(ghci) on x86_64-freebsd14-validate and aarch64-darwin-validate, recently killing several Marge batches. Mark it fragile there until the race is fixed. See #27948. Assisted-by: Claude Opus 5.5 - - - - - 212c292f by Rajkumar Natarajan at 2026-11-11T13:54:08-05:00 document what ->>> stands for in heap profile updates the profiling section of the user's guide to explain how types are approximated when using -hy. Also adds haddocks to getTyDescription with the same information. Fixes #26754 - - - - - c64fc319 by Jonathan at 2026-11-11T13:54:55-05:00 Fix AArch64 veneer target for relocations with an addend Fixes #27807 The RTS linker would construct invalid relocation veneers on AArch64 if the addend was non-zero, which typically caused SIGILL crashes. This could be triggered by evaluating Template Haskell in a package with a large number of dependencies using a static build of GHC. - - - - - cd4dce19 by Kazu Yamamoto at 2026-11-11T13:55:45-05:00 testsuite: add a test for registerFd_ trusting the callback table (#27821) registerFd001 shows a 'threadWaitRead' that never finishes after an fd is closed with 'closeFd' rather than 'closeFdWith'. Darwin is the only platform this reaches -- one-shot registrations are implemented but not used there (#7651) -- so the test is expect_broken on Darwin only. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> - - - - - 5ab442ee by Kazu Yamamoto at 2026-11-11T13:55:45-05:00 registerFd_: always tell the polling backend (#27821) Where the backend has no one-shot registrations, 'registerFd_' now tells it about every registration, rather than only when the events differ from the ones the callback table records: the table alone cannot say whether the backend still knows the fd. The 'modify' it returns is unchanged. See Note [Do not trust the callback table]. This fixes registerFd001 and clears its expect_broken. Changelog wording from Duncan Coutts in review. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> - - - - - ab8b5b06 by Vladislav Zavialov at 2026-11-11T13:56:27-05:00 Curried contexts in prefix GADT constructors (#27424) Prefix GADT constructor declarations now accept multiple consecutive contexts, equivalent to a single conjoined context: data G a where MkCurried :: C a => (D a, E a) => G a MkConjoined :: (C a, D a, E a) => G a This is a step towards GHC Proposal #402 "Stable GADT constructor syntax". To represent multiple contexts, the `con_mb_cxt` field of `ConDeclGADT` has been replaced by `con_cxts`, which stores a list instead of a Maybe: - con_mb_cxt :: Maybe (LHsContext pass) + con_cxts :: [LHsContext pass] The rest of this patch follows from this change. Note that in ConDeclH98, the optional context is still stored as a Maybe. To accommodate this difference, a few helper functions were generalised over a Foldable container `t`: hsConDeclTheta :: Foldable t => t (LHsContext ...) -> [LHsType ...] pprLHsContext :: (Foldable t, ...) => t (LHsContext ...) -> SDoc repContexts :: Foldable t => t (LHsContext GhcRn) -> MetaM (Core (M TH.Cxt)) tcHsContext :: Foldable t => t (LHsContext GhcRn) -> TcM [PredType] In practice, the instantiations of `t` are either `Maybe` or `[]`. Record-style GADT constructors continue to accept at most one context. `splitLHsGadtTy` accounts for this by splitting off only the first context if it detects record syntax, leaving the offending part of the type in the body for the renamer to reject later on. Test cases: T12087a T27424a T27424b T27424c T27424d GadtConSigs_th_dump1 - - - - - d2f135ff by Sylvain Henry at 2026-11-11T13:57:22-05:00 NCG: cache register usage in liveness annotations regUsageOfInstr allocates fresh register lists on every call, and on the linear allocator path it was called three times per instruction: in the backward liveness pass, in the forward liveness pass and in the allocator itself. Store the usage computed by the backward pass in the Liveness annotation and reuse it in the other passes (and in the graph allocator's spill passes). patchRegsLiveInstr recomputes it for the patched instruction. See Note [Cached register usage in liveness annotations]. Part of #28008. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> - - - - - ff0a5d32 by Sylvain Henry at 2026-11-11T13:57:22-05:00 NCG: describe register usage with a small DSL This new register usage DSL (see Note [Register usage DSL] in GHC.CmmToAsm.RegUsage) reduces allocation compared to the previous list-based approach. Fixes #28008. Metric Decrease: ManyAlternatives T12707 T13035 T13379 T13960 T18698b T19695 T21839c T3064 T3294 T4801 T5321FD T5321Fun T783 T9198 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> - - - - - 51f38f3a by Sylvain Henry at 2026-11-11T13:58:14-05:00 haddock-library: fix the build of the spec and fixtures test suites The documentation pipeline moved from String to Text (commit 202ed264141) but the two test suites of haddock-library were left behind and no longer compiled. They are not run by GHC's CI (see #16206), so this went unnoticed. The fixtures suite still has four pre-existing failures (list-blocks1, table1, table4, table5) that are not addressed here. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> - - - - - 394d9d6d by Sylvain Henry at 2026-11-11T13:58:14-05:00 haddock: parse backtick spans as monospaced text A backtick span whose content is not a valid Haskell identifier, such as `foo bar`, was rendered as plain text with literal backticks. It is now parsed as monospaced text, like @foo bar@. A closed backtick span whose whole content is one identifier keeps its meaning as a hyperlinked identifier. A span such as `foldl' f z xs` is code: it is no longer read as the identifier foldl between a backtick and a single quote. The TeX-style form `foo' stays an identifier when no backtick closes the span on the same line. Code spans follow the CommonMark rules: a span opened by a run of N backticks ends at the next run of exactly N backticks on the same line, so ``x `plus` y`` is code "x `plus` y". One space is removed at each end when both are present, and an unclosed opening run is plain text. The content is literal: no markup is parsed and backslashes are kept, so `\x -> x` renders as written. See Note [Backtick code spans] in Documentation.Haddock.Parser. Fixes #28090 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> - - - - - 7ae41c37 by Sylvain Henry at 2026-11-11T13:58:14-05:00 Use 'T' instead of `T' in Haddock comments next to backtick spans With backtick code spans, a TeX-style quote `T' followed by a backtick on the same line opens a code span up to that backtick. Use the 'T' form in the Haddock comments where this happens. See Note [Backtick code spans] in Documentation.Haddock.Parser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> - - - - - ce96f0b6 by Sylvain Henry at 2026-11-11T13:58:14-05:00 haddock: do not parse backtick spans inside @...@ Text between @...@ is already code, so backtick code spans are no longer parsed there. Thus in @x <- f -- of type `M Bool`@ the backticks stay as text. Inline markup inside @...@, such as /.../, passes this context down. See Note [Backticks in code] in Documentation.Haddock.Parser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> - - - - - 744b3036 by Sylvain Henry at 2026-11-11T13:58:15-05:00 haddock: keep the backticks of infix identifiers inside @...@ A backticked identifier inside @...@ was always rendered without its backticks, so @f `elem` xs@ rendered as "f elem xs". Now an identifier in an infix application or an operator section, such as @f `elem` xs@ or @(`elem` xs)@, is parsed in infix form, as if written ``elem``, and renders with its backticks and with elem linked. Elsewhere, as in @`foldlM` :: ...@, the backticks still only mark the link. See Note [Backticks in code] in Documentation.Haddock.Parser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> - - - - - 0d8e1f8d by Sylvain Henry at 2026-11-11T13:59:05-05:00 PPC NCG: print non-standard NaN literals in target byte order The PowerPC NCG printed a non-standard NaN literal byte by byte with floatToBytes/doubleToBytes, which use the byte order of the host. This is wrong when the host and the target have a different endianness (e.g. from x86_64 to big-endian PowerPC). Print the bits with `.long`/`.quad` instead, so that the assembler uses the target byte order. Also make `ppr_item` print its argument: some clauses printed the literal of `pprDataItem` instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> - - - - - 5a9db1ed by Sylvain Henry at 2026-11-11T13:59:05-05:00 Print all NaN literals as integer bits (#28101) The x86 and PowerPC NCGs printed the quiet NaNs 0x7fc00000 and 0x7ff8000000000000 as `.float NaN`/`.double NaN`. GNU as and clang encode these with all mantissa bits set, so constant-folded bit casts of these values gave 0x7fffffff/0x7fffffffffffffff. The C backend printed every NaN as `NAN`, losing its sign and payload. Now the NCGs print all NaNs with `.long`/`.quad` and the C backend with hs_bitcastword2float/hs_bitcastword642double. See Note [Printing NaN literals]. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> - - - - - b4ceb6a9 by mangoiv at 2026-11-11T13:59:47-05:00 ci: fix ghcup nightly script misbehaviour - download all jobs instead of just the first 100 - stop using a canary job to detect whether it's a nightly or release pipeline - - - - - aefa0c1b by Alan Zimmerman at 2026-11-11T14:00:28-05:00 EPA: Use AnnList in HsMultiIf It introduces layout, capture it - - - - - d72505e4 by Simon Jakobi at 2026-11-12T15:26:14-05:00 testsuite: Fix T17088 flakiness and restore bug coverage T17088 reads and prints a byte from an uninitialized array. Debug RTS ways fill allocated memory with 0xaa, so the test can fail due to an output mismatch unrelated to the pointer-tagging bug it covers. Initialize the byte to zero to make the output deterministic. The original bug requires the compacting collector and particular compiler and RTS settings. Run the test only in the compacting_gc way with -O1 and -A128k. Also disable STG lambda lifting because it removes the closure shape needed to reproduce the pointer-tagging failure. This makes the test reliable while ensuring it remains an effective reproducer for #17088. Closes #27534. Assisted-by: gpt-5.6-sol via Codex CLI - - - - - 5a7591b3 by David Eichmann at 2026-11-12T15:26:56-05:00 testsuite: Fix python type errors These errors appear when using the VSCode python extension which uses Pylance under the hood. - - - - - 52f129f8 by David Eichmann at 2026-11-12T15:26:56-05:00 Add test modifier to test over all IO Managers - - - - - 22e8b92a by David Eichmann at 2026-11-12T15:26:56-05:00 testsuite: include custom IO Manager in test name - - - - - 82c34ccd by Simon Jakobi at 2026-11-12T15:27:40-05:00 Make T2464 actually test #ifdef'd pragmas The test guarded a LANGUAGE EmptyDataDecls pragma behind #if, but EmptyDataDecls is on by default since Haskell2010, so the module compiled even when the guarded pragma was ignored. Guard MagicHash instead, which is unlikely to be included in a future default language. The test also checks that warnings from file-header pragmas are emitted only once, even though the pragmas are parsed both before and after CPP, using the -fffi deprecation warning as the canary. Use an unrecognised warning flag instead, so the test no longer depends on a deprecated flag that is about to be removed. Context: #27939 Assisted-by: Claude Fable 5.1 - - - - - 419f2a12 by Simon Jakobi at 2026-11-12T15:27:40-05:00 Remove command-line flags deprecated in GHC 8.2 or earlier Also remove the INCLUDE file-header pragma, which only expanded to the now-removed -#include. Closes #27939. Assisted-by: Claude Fable 5.1 - - - - - adc294d0 by Erik de Castro Lopo at 2026-11-12T15:28:21-05:00 TimerManager: publish only evaluated timeout queues (#9809) The issue in #9809 was triggered by many threads registering timeouts at the same time and those timeouts being stored as unevaluated thunks in the shared list. When say 100,000 timeouts are registered at the same time, the program can be slowed down considerably and the memory usage grow unacceptably large. The commit that caused the problem was 2d5eccdf1c, a 2013 change that fixed #7653. The fix is to add a modifyTimeouts function which applies an edit to a copy of the list and fully evaluates the result before replacing the shared list with a CAS operation. Performance has improved for the threaded case and not regressed for the single thread case: Forked registrations of 100k timeouts (median of 5 runs): -N4: 0.577 s, 428 MB -> 0.078 s, 39 MB -N12: 1.227 s, 479 MB -> 0.127 s, 80 MB Forked registrations of 1M timeouts on -N1 (median of 3 and 10 runs): 5.21 s (range 0.67-9.47 s), 1613 MB -> 0.67 s, 250 MB Single-thread registrations are unchanged or slightly faster, and timer latency during registration storms improves (p99 lateness of a 1 ms threadDelay during 100k forked registrations on -N4: 302-394 ms -> 3.5-4.1 ms). The registration code still runs in constant stack, so #7653 stays fixed; T7653 and the concurrent, base and ghc-internal testsuites pass. modifyTimeouts is OPAQUE so that the optimiser cannot expose the edit function's inspection of the old queue next to the compare-and-swap and replace the expected pointer with the evaluated queue, which would make the compare-and-swap keep failing when the MutVar# holds a thunk or indirection. Regression test T9809.hs included. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> - - - - - b294b82f by Moritz Angermann at 2026-11-12T15:28:21-05:00 testsuite: give pause_resume_via_safe_ffi_concurrent 60s on Darwin CI The 10s System.Timeout watchdog was a false deadlock: five serialized 1s pauses plus rts_pause waiting on threadDelay/timer-manager traffic overruns that budget on loaded Mac runners. Keep a watchdog so a real hang still fails. - - - - - 1543f834 by Simon Jakobi at 2026-11-12T15:29:03-05:00 testsuite/README: Don't append new tests at the end of all.T Patches that each add a test at the end of the same all.T conflict with each other. Tests added elsewhere in the file usually merge cleanly. Context: #26285 Assisted-by: Claude Opus 5.5 - - - - - 9ad25cb2 by Sven Tennie at 2026-11-14T06:20:13-05:00 hadrian: Add Stage3 cross-compiled target bindist (#26924) Add a `binary-dist-stage3` Hadrian target that packages target executables (produced by the stage2 compiler) into a separate '_build/bindist-stage3/' folder, distinct from the stage2 regular or cross-compiler bindist in '_build/bindist/'. This allows a single CI pipeline job to produce both a cross-compiler bindist (e.g. x86_64 -> RISC-V) and a target-architecture bindist (e.g. RISC-V -> RISC-V) that can be installed and run natively on the target. To avoid issues with stale files or race-conditions on them, generate the `configure` script per stage in `_build/<stage>/distrib` directories. - - - - - ca91017d by Sven Tennie at 2026-11-14T06:20:13-05:00 ci: Build Stage3 and Stage2 bindists for cross targets in one job (#26924) Building the stage3 target bindist already produces most of the stage2 cross-compiler bindist as a byproduct, so building them in separate jobs duplicates the build efforts for no benefit. Instead of a separate CROSS_STAGE=3 job, the stage3 job now also builds and publishes the stage2 bindist. The stage3 tarball is named and versioned as if it were built natively on the target (target triple prefix, non-cross opsys), so its artifact name stays what downstream consumers already expect and no changes are needed on their side. For now, this is only enabled for the RISC-V job. Others can easily follow. - - - - - 71b41e09 by Sven Tennie at 2026-11-14T06:20:14-05:00 ci: model cross targets as structured TargetPlatform triples (#26924) Storing the cross target as a raw triple forced ad-hoc parsing at every use, and broke the single responsibility rule. Modelling it as a structured `TargetPlatform`` instead, avoids parsing and provides a clear separation of concerns. - - - - - 8067c2f9 by Sven Tennie at 2026-11-14T06:20:14-05:00 ci: extract the cross smoke tests into a separate smoke_test command (#26924) This reduces if-nesting and complexity of the main `test_hadrian` command. The decision how to test is now made by the caller. This is a fair choice, because most test cases can run under emulation - they are just very slow then. The Stage3 smoke test also checks that the target compiler does not report itself as cross-compiling and, when supported, runs a small GHCi expression. - - - - - 7ece99a7 by fendor at 2026-11-14T06:20:57-05:00 Add `-dep-json` flag to `ghc -M` Add an optional flag to `ghc -M` that allows to write the dependency information in JSON Lines format. The JSON Lines format enables us to stream the output of the dependency generation to a consumer. The output of `-dep-json` is streamed to a temporary file and then copied to the final destination to avoid partial writes. Each line contains one of two possible json objects: 1. A Home Unit Dependency * Contains the name of the home module, its unit, where it is located, whether a preprocessor is used, and all of its imports. Importantly, the imports include `-XExplicitLevelImports` information. * If requested via `-include-pkg-deps`, includes imports of external units, e.g. modules from `base`. * If requested via `-include-cpp-deps`, files included via CPP. 2. External Unit Dependency * Only if `-include-pkg-deps` is given * Contains unit-id, its package name and package id. --- This PR refactors the Makefile generation to use phases appropriately. We introduce an intermediate data structure that is generated based on the module graph nodes, and only then generate the Makefile rules. This allows the dep-json and dep-makefile generation to use the same dependency processing. - - - - - 0f6e0146 by fendor at 2026-11-14T06:20:57-05:00 Add multiple home unit support to `ghc -M` Allows to process the module graph of multiple home units at once using the same syntax as `--make` and `--interactive`: ghc -M -unit @unitA -unit @unitB The semantics are identical to `--make` and `--interactive`. Each home unit can declare individually to use `-include-cpp-deps` and `-include-pkg-deps`. However, there can only be one output file, and `-dep-json` and `-dep-makefile` can only be provided at the top of the cli invocation. We introduce a new GHC API `doMkDepend` that allows to use multiple home units conveniently. The output of `-dep-json` and `-dep-makefile` does not change, since we were careful to choose a format that supports multiple home units from the start. Single home units are still accepted like before with no changes. - - - - - 5598e6a0 by fendor at 2026-11-14T06:20:57-05:00 Deprecate `doMkDependHS` in favour of `doMkDepend` - - - - - 39f2943e by David Eichmann at 2026-11-14T06:21:41-05:00 rts: Expose getRtsSymbols() and store redirect labels and external symbols tag - - - - - aa159605 by David Eichmann at 2026-11-14T06:21:41-05:00 hadrian: when running tests, properly set have_gdb and have_readelf - - - - - ff826da4 by David Eichmann at 2026-11-14T06:21:41-05:00 testsuite: add have_ldd() test modifier - - - - - b9f0b7e2 by David Eichmann at 2026-11-14T06:21:41-05:00 testsuite driver: on windows, ensure PATH correctly contains mingw and ghc-pkg libraries - - - - - 543c108e by David Eichmann at 2026-11-14T06:21:41-05:00 testsuite: driver now sets WAY_FLAGS variable for makefile tests - - - - - 13408a2b by David Eichmann at 2026-11-14T06:21:41-05:00 Add golden test for rts/RtsSymbols.c This test compares declared symbols against symbols observed in the rts DSO (.so file). - - - - - 8b5bb896 by Mikolaj Konarski at 2026-11-16T11:35:51+01:00 Fix stale and false comments in the NCG Of what anyone working with the NCG needs, this commit serves "Comments and Notes that are true of the code they describe." Comments and documentation only: the generated code is the same. Each item names a comment, says what it said, and says what holds instead. - The comment above genMachCode in GHC.CmmToAsm named stix code and the UniqSM monad. The code is Cmm, and genMachCode switches from the UniqDSM monad to NatM. - NcgImpl's extractUnwindPoints, in GHC.CmmToAsm.Monad, placed Note [Unwinding information in the NCG] in that module. The Note is in GHC.CmmToAsm. - The header of GHC.CmmToAsm.PIC named the modules CLabel, Cmm, AsmCodeGen and MachCodeGen. It now names the modules and functions that do what it lists. - The header of GHC.CmmToAsm.Reg.Target said that the module keeps the NCG from emitting code for an architecture other than the host's. Each of its functions dispatches on the target platform's architecture, and the sentence is deleted. - Note [CFG based code layout] in GHC.CmmToAsm.BlockLayout ran optimizeCFG right after instruction selection. cmmNativeGen runs it after register allocation and shortcutting. - Note [CFG Edge Weights] in GHC.CmmToAsm.CFG gave the default weight as 20k; defaultWeights has 1000. It said that likely branches are taken more than 80% of the time and unlikely ones less than 20%; the default weights give 75% and 25%. It said that the false side of a regular branch is preferred; getCfg gives both sides the same weight, the x86-64 instruction selector adds 3 to the false side of a floating-point comparison, and optHsPatterns' favourFewerPreds may then prefer one side by its predecessors. It said that calls are ignored completely; the layout leaves a call's edge out only while it builds chains, and divides its weight by 64 when it merges them. - Note [Layout relevant edge weights] in GHC.CmmToAsm.BlockLayout also said that edges constituted by a call are ignored. The layout ignores them only while it builds the chains, and counts a 64th of their weight when it merges the chains. - Note [Static Branch Prediction] in GHC.CmmToAsm.CFG named two heuristics where staticBranchPrediction applies three, ohPredicts being the third. - In staticBranchPrediction, in GHC.CmmToAsm.CFG, a comment said that s1 is the branch in the true case; s1 is the successor with the smaller label. The guard commented "Only backedges" is also reached by a back edge beside a heap or stack check's edge, and its comment now says so. - The comment above findBackEdges, in GHC.CmmToAsm.CFG, said that it finds back edges by BFS. It finds them by a depth-first search (classifyEdges in GHC.Data.Graph.Directed). - The Instruction class asked regUsageOfInstr to state precisely the registers an instruction reads and writes. x86's states them as the register allocators are to see them, and the comment now says where that departs from what the hardware does. - The comment at the last arm of regUsageOfInstr's MOV case, in GHC.CmmToAsm.X86.Instr, said that the MOV instructions reaching it zero any remaining upper part of the destination. Some do, such as a 32-bit MOV into a general register and a load at FF32 or FF64; others keep it, such as a MOV between registers at FF32 or FF64, printed movss or movsd, and an 8-bit or 16-bit MOV into a general register. - Comments in the liveness pass, in both register allocators and at the Ord instances of CmmTickScope, LocalReg and VirtualReg said that deterministic code generation is not supported, which -fobject-determinism provides. In the liveness pass and the allocators, each now says whether the order at hand matters and, where it does, what it decides; at the Ord instances, that the order compares uniques and so is deterministic only if the uniques are. - In GHC.CmmToAsm.Reg.Graph.SpillCost, a comment said that there are no loops in the code, so that the block frequencies can be 1. Given a CFG, slurpSpillCostInfo scales the uses and definitions it counts by the CFG's block frequencies; the comment is deleted. - linearRegAlloc's haddock and the comment over process said that a block of an SCC is allocated before a jump into it only if it is the procedure's first block; any of its entry blocks is. The comment over process also said that process loops where a block's assignment never gets set. It stops after a round that allocates no block, and so drops such a block. - findPrefRealReg's comment said that the preferred register is the first one the variable was assigned to. It is the variable's register in the first entry assignment, in allocation order, that maps it to a register; a block's entry assignment is recorded at the first jump into it. - Two comments in GHC.CmmToAsm.Reg.Graph named the flag -fasm-lint, which is -dasm-lint. - Two comments in GHC.CmmToAsm.Reg.Linear.Base named the stats flag -ddrop-asm-stats, which is -ddump-asm-stats. - The executable specification of FreeRegs, in GHC.CmmToAsm.Reg.Linear.FreeRegs, handed out the most recently released registers first. It now gives noFreeRegs as [] and has getFreeRegs hand out the registers in each instance's fixed order. - The header of GHC.CmmToAsm.Reg.Linear.StackMap said that a slot stays associated with its register to the end of the procedure. A register that outgrows its slot moves to new ones; what holds is that no other register gets the old slot. - The comment at handleComponent's case for a cycle of moves, in GHC.CmmToAsm.Reg.Linear.JoinToTargets, said that it spills all the cycle's source registers. It spills one. - makeRegMovementGraph's comment said that cyclic components seem to occur only very rarely. They are frequent in some code: in the benchmark of orthotope, a Haskell array library on Hackage, compiled by a GHC build of 2026-10 whose linear allocator was master's, the fixup code breaks 39 register cycles through a stack slot in $w$s$wequalT1 and 59 in $w$s$w$ccompare1. The two counts were not taken again on master 37ad471050. The sentence is deleted. - GHC.CmmToAsm.Reg.Linear.State cited Note [The one-shot state monad trick] across two lines, where the notes linter does not match it. The citation is now on one line. - GHC.CmmToAsm.X86.Ppr's pprNatCmmDecl cited Note [Internal proc labels] in GHC.Cmm.Label, across two lines. The Note is in GHC.Cmm.CLabel, and the citation is now on one line. - A comment in GHC.CmmToAsm.Reg.Linear.AArch64 said that getFreeRegs scans the integer registers from 28 down. It starts from x18. - The comment at classOfRealReg in GHC.CmmToAsm.X86.Regs said "On x86" of what holds on i386 alone, and numbered the registers with 8-bit versions 1-4, and the allocatable ones among them 1, 3 and 4. It now says "On i386", and they are 0-3, and 0, 2 and 3. - The haddock of RegArch's Separate, in GHC.Platform.Reg.Class, gave RISC-V as an example. registerArch gives RISC-V NoVectors and no architecture Separate. - X86's stmtToInstrs took the condition of a conditional branch to be likely false, GHC.Cmm.ContFlowOpt having arranged for the likely side to fall through. ContFlowOpt also inverts a condition whatever its likelihood where the false target has more than one predecessor, so the condition may be likely true; genCondBranch does not read the likelihood. - mkCmmIfThenElse', in GHC.StgToCmm.Monad, said that the NCG does not know about likely annotations. The PowerPC code generator has printed them as branch hints since 2017, and since 2018 getCfg has weighted the CFG's edges by them, which the block layout follows on x86-64. Its clause on a fallthrough is replaced by what the swap does: where the test can be inverted it becomes a likely-true test of the inverse, and GHC.Cmm.ContFlowOpt swaps the branches back where the true target, after shortcutting, has one predecessor. - The users' guide said that -fcmm-static-pred's prediction is used by the register allocation and code layout passes. The prediction is made only in the x86-64 native code generator, and is used, after register allocation and without -finfo-table-map, for the layout. - The users' guide's entry of -fcmm-sink said that the sinking pass attempts to find identical Cmm blocks and eliminate the duplicates. Those are words of the -fcmm-elim-common-blocks entry, run into this entry's sentence since the two entries were written; the sentence now says only that the pass attempts to move variable bindings closer to their usage sites. Assisted-by: Claude Opus 5.5 - - - - - fb384696 by Mikolaj Konarski at 2026-11-16T12:36:21+01:00 Define the labels of the NCG's comments Of what anyone working with the NCG needs, this commit serves "The kind of each statement in the NCG's comments, shown at the statement: a bug, half-done work, a likely change or code meant to stay.", "What a comment that does not show the kind of its statements does and does not claim." and "How the statements on bugs, half-done work and likely changes are kept true as the code changes." Comments only; the generated code is the same. Note [Labels in NCG comments], added to GHC.CmmToAsm, defines the labels that the native code generator's comments put at the head of a statement. The commits that follow label each statement they add, and are read under this Note: BUG wrong behaviour, a missing check or misleading code; the statement says in short what it leads to and where it is reached WIP half-done work TODO what is likely to change, correct or buggy; a bug marked TODO alone is accepted for now and worked around BUG TODO both, where both are to be stressed no label what is meant to stay; a kept trade-off says why A BUG statement names its consequence: wrong code, wrong debugging information, a panic or another failed compilation, assembly the assembler rejects, only slower or larger code, only a warning from the assembler, only more C stack space, or only a misled reader. The Note does not reach back to older comments: their TODO, ToDo, FIXME and XXX predate its meanings, and an older comment that carries no label makes no claim that the code is meant to stay. The Note also says how the labels are kept true. A change to what a labelled statement describes removes or rewrites the statement in the same change; BUG and TODO gain the issue's number when the issue is filed; and a git grep given in the Note lists the labelled lines. Assisted-by: Claude Opus 5.5 - - - - - b0b7482a by Mikolaj Konarski at 2026-11-16T12:36:21+01:00 Document bugs and TODOs in the NCG's CFG and block layout Of what anyone working with the NCG needs, this commit serves "Where the code does something other than what reading it suggests.", "Where the code is known to behave wrongly or is half done.", "What each known bug leads to, such as wrong code, a compiler panic or only slower code, and under which flags and on which targets it is reached." and "Where the code is likely to change, and how." Comments only; the generated code is the same. The statements carry the labels of Note [Labels in NCG comments]: BUG for wrong behaviour, TODO for what is likely to change, none for what is meant to stay. What each BUG leads to, where it is reached and what that rests on: - postRegCFG in GHC.CmmToAsm (BUG: X86's allocMoreStack retargets every jump into an entry block to the block it adds after it, but addImmediateSuccessor moves only the entry block's own edges). The CFG keeps an edge into the entry block from each block that jumps there, though the code now jumps to the added block, and lacks those blocks' edges to the added block. This costs only speed, through static prediction and block layout. It is reached on x86-64, the only target with a CFG after register allocation, where ncgAllocMoreStack adds blocks, that is, where allocation needs more spill slots than maxSpillSlots. This rests on master's code read. The linear allocator's fixup blocks were added to the CFG before postRegCFG, and the added block is reachable, through the entry block's edge to it. No reader of the CFG after postRegCFG panics on these edges: shortcutWeightMap has no lookup that panics; optimizeCFG's lookups take their blocks and edges from the CFG itself; sanityCheckCfg compares blocks only; sequenceTop places every block of the code and takes the jumps from the code; and invertCondBranches takes an edge's information as a Maybe and leaves a jump without it alone. - build_mapping in shortcutBranches, GHC.CmmToAsm (BUG: under -g a block that holds only its jump also holds the location and unwinding information that -g adds, so it is kept where without -g it is shorted). The code under -g jumps through the kept block, and static prediction and block layout get another CFG than without -g. This costs only speed and code size, under -g and -fasm-shortcutting. This rests on master's code read: split matches a block of exactly one instruction, and under -g on ELF targets other than AArch64 the instruction selectors put a LOCATION at the head of a block with a source note, and under -g x86's gives a CmmUnwind an UNWIND, neither of which emits code. On a development branch whose block layout differed from master's, this changed the code of a probe under -g. - Note [Updating the CFG during shortcutting] in GHC.CmmToAsm.CFG (BUG: with tables next to code too, a block that is only a tail call's jump to a label is shortcut away, and with it the edge A -> B). A's branch has one target fewer in the CFG than in the code, and a loop whose only exit was the lost edge has no exit in the CFG, so calcFreqs caps its cycle probability. This costs only speed, through static prediction and block layout. It is reached on x86-64, the only target with a CFG after register allocation, under -fasm-shortcutting. This rests on master's code read: the removed block ends in a tail call and has no edges out in the CFG; it leaves the code and the CFG together, and no block becomes unreachable; and the readers of the CFG after shortcutWeightMap, listed above for postRegCFG, do not panic on a missing edge. - getCfg in GHC.CmmToAsm.CFG (BUG, ISSUE 28088: the CFG gets only the blocks reachable from the entry, while instruction selection still covers the blocks that cmmToCmm makes unreachable when, after the Cmm pipeline has removed the unreachable blocks, it turns a branch on a constant into a jump). Where such a block updates the CFG at its current block, as X86's cmpxchg loop for an atomic and, or, xor or nand does, the compiler panics with "getSuccessorEdges: Block does not exist". This is reached on x86 and x86-64, at any optimisation level: cmmToCmm turns a branch on a literal into a jump under every flag, and the literal comes at -O0 from cmmToCmm's own constant folding and at -O from sinking's. For x86-64 this rests on master's code read and on runs of master's compiler under -dcmm-lint. A procedure whose if (1 != 0) leaves a block with a fetch-and-and unreachable panics with that message at -O0 and at -O, and also at both with -finfo-table-map added, under which no CFG is kept after instruction selection, as on i386. Where the branch tests a local set to 1 instead, the procedure panics at -O and compiles at -O0. For i386 it rests on master's code read alone, no i386 compiler having been run: getCfgProc builds the CFG for every target, i386 runs the same selector (ncgX86 = ncgX86_64), and updateCfgNat forces each update, so addImmediateSuccessor's call of getSuccessorEdges panics during instruction selection whether or not a CFG is kept after it. It rests also on ISSUE 28088's record. A TODO citing ISSUE 20428, at livenessCfg and at ncgEnableDeadCodeElimination, says that -finfo-table-map turns dead code elimination off, and with it every use of the CFG from the liveness pass on. No CFG is then kept after register allocation, so the layout has neither static prediction nor the chains of -fblock-layout-cfg, and lays the blocks out without weights. Two Notes now say what -fcmm-static-pred changes: Note [CFG based code layout], that the loop analysis and the refinement of the weights run for the layout only under it; and Note [CFG Edge Weights], that under it the weights become estimated frequencies before the layout uses them. A TODO in Note [Layout relevant edge weights], in GHC.CmmToAsm.BlockLayout, citing ISSUE 27799, says that the modifier on the edges of a conditional branch under-prices such an edge where buildChains skips the branch's other edge because it would close a cycle, as it can skip a loop latch's back edge. At getCfg's case for a switch, master's comment says that the weight -1 given to every target of a switch with more than ten targets, a compiler performance hack, keeps the layout from considering them. A TODO there now says that the layout considers them nonetheless, and that what the hack saves has not been measured. Other TODOs say: - at the Ord instance of CfgEdge, that edges of equal weight are ordered by their labels, which carry no meaning for the layout; - in Note [Updating the CFG during shortcutting], that where shortcutting redirects an edge onto one already there, only one EdgeInfo is kept and the weights are not summed; - at allEdges' relevantWeight in sequenceChain, that it differs from directEdges'; - at dropJumps, that a block that only jumps to the next one is left as an empty label and a jump over it is kept. In X86's genCondBranch', a comment says that the 3 added to the weight of a floating-point comparison's false edge breaks layout ties toward the side GHC.Cmm.ContFlowOpt arranges to fall through. Assisted-by: Claude Opus 5.5 - - - - - 693ae1bb by Mikolaj Konarski at 2026-11-16T12:36:21+01:00 Document bugs and TODOs in static branch prediction and loop analysis Of what anyone working with the NCG needs, this commit serves "The paper or earlier design each part of the NCG is based on, where there is one, and which code is no longer used and since which change.", "Where the code does something other than what reading it suggests.", "Where the code is known to behave wrongly or is half done.", "What each known bug leads to, such as wrong code, a compiler panic or only slower code, and under which flags and on which targets it is reached." and "Where the code is likely to change, and how." Comments only; the generated code is the same. The statements carry the labels of Note [Labels in NCG comments]: BUG for wrong behaviour, BUG TODO for a bug that is also likely to change, WIP for half-done work, TODO for what is likely to change, none for what is meant to stay. What each BUG leads to, where it is reached and what that rests on: - getCfg in GHC.CmmToAsm.CFG (BUG: after fixStgRegisters, a test of CurrentTSO or CurrentNursery reads BaseReg and is tagged HeapStackCheck, as rts/Updates.cmm's if (v == CurrentTSO) is). The exemptions of Note [Static Branch Prediction] for heap and stack checks then apply to such a test, so its weights are left unpredicted. This costs only speed, on x86-64 under -fcmm-static-pred. This rests on master's code read. The tag is read only through isHeapOrStackCheck, all of whose callers are in staticBranchPrediction, which runs inside mkGlobalWeights. mkGlobalWeights reaches the code through staticPredCfg, only under -fcmm-static-pred, and otherwise only through the graph allocator's spill costs, whose frequencies no spill choice reads. - Note [Back edges in loopInfo] in GHC.CmmToAsm.CFG, its first BUG (an edge into the entry block is never a back edge, as mkDomMap leaves the root out of every dominator set). A loop whose head is the entry block is not found. This costs only speed, on x86-64 under -fcmm-static-pred. This rests on master's code read. loopInfo's result reaches the code only through static prediction and block layout: of its two callers, loopLevels is never called, and mkGlobalWeights serves staticPredCfg, under -fcmm-static-pred, and otherwise only the graph allocator's spill costs, whose frequencies no spill choice reads. - Note [Back edges in loopInfo] in GHC.CmmToAsm.CFG, its BUG citing ISSUE 28093 (a self loop is a back edge only where its block dominates no other block). A block that jumps to itself and to an exit it dominates, as cmpxchg_code's retry loop in GHC.CmmToAsm.X86.CodeGen does, is not a loop. calcFreqs then takes the block for irreducible and gives frequency 0 to it and to every block it dominates. This costs only speed, on x86-64 under -fcmm-static-pred, by the same path as the first BUG. This rests on master's code read, on the record of ISSUE 28093, and on -ddump-cfg-weights of a loop calling fetchOrIntArray#, compiled by a GHC built from 3d326d7d28 with changes outside the native code generator: the retry block's edges and the loop's back edge weigh 0. Between 3d326d7d28 and master 37ad471050, GHC.CmmToAsm.CFG and cmpxchg_code are unchanged, and the dominator code loses only a `return = pure`. - Note [Static Branch Prediction] in GHC.CmmToAsm.CFG (BUG: the back edge rule supersedes a likely annotation in the Cmm as well). A branch with both a back edge and another edge is predicted to take the back edge, whatever its annotation says. This costs only speed, on x86-64 under -fcmm-static-pred. This rests on master's code read: staticBranchPrediction's case for a mix of back edges and other edges reads no annotation. - ohPredicts in staticBranchPrediction, GHC.CmmToAsm.CFG (BUG TODO: a constructor-tag test is predicted like any other comparison, its equal side unlikely). The prediction is right for a list and wrong for the trees of Data.Map, Data.Set and Data.IntMap, which declare Bin first: in a lookup, the side that stays in the loop is predicted unlikely. This costs only speed, on x86-64 under -fcmm-static-pred. It is accepted until the knowledge of the likely side reaches the CFG, hence TODO as well. This rests on master's code read. - ohPredicts in staticBranchPrediction, GHC.CmmToAsm.CFG, its BUG (s1 is taken for the true side only where it is ltrue, the label the branch was made with, which an edge no longer ends at once the linear allocator's fixup block, by addNodesBetween, or shortcutting, by shortcutWeightMap, has redirected it). Where the redirected true edge's new target has the smaller label of the two, each side gets the other's prediction, and the layout's estimate takes the likely side for the unlikely one. This costs only speed, on x86-64 under -fcmm-static-pred. This rests on master's code read, and on a count over nofib's modules on a development branch whose static prediction also predicts an inequality with a literal, which found such branches inverted at -O2 and none at -O1. - calcFreqs in GHC.CmmToAsm.CFG (BUG: mkGlobalWeights passes the loops in the order of loopInfo's back edges, by label, and not by nesting). An enclosing loop's pass can come before an inner loop's and read the branch probability of an inner back edge where its cycle probability belongs, which gives nested loops wrong cycle probabilities. This costs only speed, through the layout, on x86-64 under -fcmm-static-pred. This rests on master's code read. A WIP in Note [Static Branch Prediction] says that the paper's other heuristics are stubs. calcFreqs' comment on an irreducible block, "Rare we don't care", now says what frequency such a block keeps and, as a TODO, that such blocks are not rare, that the layout then ranks edges by frequencies that do not add up, with a loop calling fetchOrIntArray# for a case, and what summing their inflow measured on a development branch. Other TODOs say: - in Note [Back edges in loopInfo], that findBackEdges, which optHsPatterns uses for the back edge bonus, disagrees with loopInfo on edges into the entry block, on back edges of irreducible cycles and on self loops; - at ohPredicts, that only MO_Eq is read, so the spelling GHC.Cmm.ContFlowOpt leaves decides whether a test is predicted, and that predicting a pointer-tag test spelt with MO_Ne as its MO_Eq spelling is predicted was tried on a development branch and gained nothing; - at lehPredicts, that where a heap or stack check's call to the garbage collector returns into the procedure, loopInfo takes the cycle through that call for a loop: the heuristic then says nothing about a branch into the checking block where that block is the loop's head, and takes a branch towards a case alternative without such a check for a loop exit where the head is the block choosing the alternative; - at calcFreqs, that nothing checks its result, and that a check could compare each block's frequency with the sum of the frequencies on its in-edges, which the propagation departs from at some blocks, among them an irreducible block, a loop head whose cycle probability is capped, and the entry block; - at loopMembers, that neither it nor loopLevels has a caller in GHC: loopMembers since the graph allocator's spill costs, for which it was added early in 2019, began that year to weight by block frequencies instead, and loopLevels since it came with the loop analysis that year. A comment at optimizeCFG says that static prediction starts from the weights optHsPatterns leaves, so that their adjustments carry into the predicted probabilities, except where the back edge rule replaces them. Assisted-by: Claude Opus 5.5 - - - - - 5d25c383 by Mikolaj Konarski at 2026-11-16T12:36:21+01:00 Document bugs and TODOs in liveness and the register allocators Of what anyone working with the NCG needs, this commit serves "The invariants the code depends on.", "Where the code does something other than what reading it suggests.", "Where the code is known to behave wrongly or is half done.", "What each known bug leads to, such as wrong code, a compiler panic or only slower code, and under which flags and on which targets it is reached." and "Where the code is likely to change, and how." Comments only; the generated code is the same. The statements carry the labels of Note [Labels in NCG comments]. What each BUG leads to, where it is reached and what that rests on: - regAlloc in GHC.CmmToAsm.Reg.Graph (BUG: it hands ncgAllocMoreStack slotsCount', the highest slot number, which counts the preallocated slots, where the linear allocator gives only the slots beyond maxSpillSlots): the preallocated slots are reserved a second time. This costs only C stack space, under -fregs-graph or -fregs-iterative, on every target. This rests on master's code read. Every target's allocMoreStack moves the stack pointer by the slots it is given times spillSlotSize, and each target's mkStackAllocInstr handles large amounts, so the cost is stack space alone. The graph allocator can be chosen for any target, and trivColorable covers x86, x86-64, PowerPC, AArch64, RISC-V and LoongArch. - pprSpillCostRecord in GHC.CmmToAsm.Reg.Graph.SpillCost (BUG: it binds a SpillCostRecord as (reg, uses, defs, life), where the type's comments give its fields as the writes, the reads and the lifetime). Only the names are wrong: it prints the two counts in the record's order, under no names, and their sum, and nothing in GHC calls it. This rests on master's code read: slurpSpillCostInfo's incDefs fills the second field and incUses the third. - joinToTargets in GHC.CmmToAsm.Reg.Linear.JoinToTargets (BUG: on x86 a floating-point comparison's block ends in two jumps that name one target, genCondBranch's parity jump and a conditional or unconditional one, and each is joined on its own). Where that target needs a fixup block, each of the two jumps gets one, with the same moves, and both are reachable. This costs only code size, on x86 and x86-64 under the linear allocator. This rests on master's code read and on constructed Cmm compiled by master's compiler; no module of nofib or of the compile benchmarks was found to show it. A fix that shares the block where the two jumps' stack deltas agree, the target's vregs have the same locations at both and no value moves between two slots was written on a development branch and is left out. - joinToTargets_again in GHC.CmmToAsm.Reg.Linear.JoinToTargets (BUG: once it has made a fixup block for a target and patched the jump to go there, the destinations still to consider keep the target's later occurrences, as a jump table lists a target once for each entry naming it). Each later occurrence makes the same moves again, into a block nothing jumps to, which is given an edge in the CFG, laid out and emitted: dead code. This costs only code size, under the linear allocator. This rests on master's code read: x86's jumpDestsOfInstr lists a jump table's targets with their repetitions, and the other targets with jump tables do likewise. Such a block was found in GHC's own GHC.CmmToAsm.Dwarf.Constants and in none of nofib's or the testsuite's modules. - makeRegMovementGraph, handleComponent and makeMove in GHC.CmmToAsm.Reg.Linear.JoinToTargets, and the header of GHC.CmmToAsm.Reg.Linear.StackMap (BUG, ISSUE 27638: since ISSUE 26668 a virtual register whose format has outgrown its slot gets new slots, so a jump can need a move between two slots of one register): such a move ends in makeMove's panic, "makeMove: we don't handle mem->mem moves". And where handleComponent's cyclic case moves to an InBoth destination (BUG, a statement of its own, ISSUE 27638 reporting only the panic), the destination's slot is written only if it is the slot spillR picks; otherwise it keeps a stale value, which is wrong code where the slot is reloaded. Both are reached under the linear allocator, where a virtual register's format grows past 8 bytes, which only a vector format does, and so only on i386, x86-64 and AArch64, the targets whose code generators take vectors (checkVecCompatibility in GHC.StgToCmm.Prim; RV64's and LA64's stop with sorry on vectors, PowerPC's sends them to LLVM). The first is reached on x86-64 at -O1 and -O2: master's compiler panics so on a function in which a Double, also broadcast to a DoubleX2#, is live at a join of two arms of a case that both load eleven Int#s and seventeen Doubles. No program reaching the second is known. The first can be reached two ways, by expandNode: a jump into a block that holds the virtual register in another of its slots only, and a jump into a block that holds it in a register and another slot, where makeMove loads the register first. A fix cannot count on a spare register: nothing keeps one free at a jump, and the block's entry assignment can hold every allocatable register, on x86-64 the eleven integer registers (rax, rbx, rcx, rdx, rsi, rdi, r8 to r11 and r14) and the sixteen vector registers, the others being the stack pointer and those of STG's Base, Sp, Hp and SpLim (freeReg in compiler/CodeGen.Platform.h). This rests on master's code read, ISSUE 27638's record and a run of master's compiler. The cyclic case drops the InMem half of an InBoth destination (expandNode lists InReg first) and writes only spillR's slot, which is getStackSlotFor's newest slot of the virtual register and differs from the destination's only after the register grew. And allocateRegsAndSpill frees the register of an InBoth virtual register without a store, so that its next use reloads the slot. - livenessSCCs in GHC.CmmToAsm.Reg.Liveness (BUG, ISSUE 27619: Regs' Eq compares the registers and not their formats, so the fixpoint can stop before the formats recorded for a cycle's blocks converge): a vector register can be recorded live at a format narrower than the value it holds, and a spill or reload at that format loses the rest of the value, which is wrong code. No program giving a wrong result is known. This rests on master's code read and ISSUE 27619's record, whose program shows a register recorded so. - getSlotMap in slurpReloadCoalesce, GHC.CmmToAsm.Reg.Liveness (BUG: it folds the slot maps of a block's predecessors from the empty map with mergeSlotMaps, which keeps only the slots both maps hold). The slot map on entry to a block is always empty, so a reload is coalesced with a spill only inside one block. This costs only speed, under -fregs-graph or -fregs-iterative, on every target. This rests on master's code read; buildGraph in GHC.CmmToAsm.Reg.Graph is the only caller of slurpReloadCoalesce. - maxRegWithFormat in GHC.CmmToAsm.Reg.Regs (BUG, ISSUE 27619: Format's derived Ord compares a VecFormat's number of elements before their format, ranking VecFormat 16 FmtInt8, 128 bits, above VecFormat 4 FmtDouble, 256 bits): it can keep the narrower of two formats. Were one register read at both, a spill or reload at the narrower would be wrong code; whether any register is read so is not known. This rests on master's code read and ISSUE 27619's record. The other statements, by part. The linear allocator: - Note [The first jump into a block fixes its entry assignment], in GHC.CmmToAsm.Reg.Linear.JoinToTargets, says that the first jump into a block that the allocator processes records the block's entry assignment, spilled values included, and that every later jump conforms to it by fixup code. Its three TODOs are what follows from that: a loop head recorded from a preheader that spilled a loop-carried value has the value reloaded on every iteration, and stored again by every back edge once the body has written it; a return continuation and the procedure's entry that enter one loop at two blocks record incompatible assignments (ISSUE 27800); and the block that a failed heap or stack check returns to from the garbage collector can be allocated before the hot path's jump into the checking block and record that block's entry assignment, as the order of allocation depends on no frequency. process' comment cites the Note. - Note [Unique order in the linear allocator], in GHC.CmmToAsm.Reg.Linear, says, as a TODO, which decisions take the order of the vregs' uniques as a ranking: the spill victim, and the order in which saveClobberedTemps moves values out of clobbered registers. It also says that the order decides joinToTargets' fixup moves. The comments at those three folds cite it. - Open issues get labels where the code behaves as they report: TODO for ISSUE 27980, closed as a duplicate of ISSUE 27800, at findPrefRealReg, for ISSUE 27981 at joinToTargets_first's release of registers, and for ISSUE 26631 at saveClobberedTemps' choice of a register; BUG for ISSUE 27638 at handleComponent, makeMove, makeRegMovementGraph and StackMap's header, whose comments ruled out a move between two stack slots, which ISSUE 26668 made possible. - TODOs without an issue: raInsn's elimination of a move gives the destination the source's register, whatever register an entry assignment recorded for a block it is live into expects; findPrefRealReg's preference is keyed by virtual register, while a Cmm local is one virtual register over all its live ranges; and expandNode stores a value InBoth at both ends of a jump into the slot that already holds it. - The header of GHC.CmmToAsm.Reg.Linear.StackMap says that a stack slot belongs to one virtual register for the whole procedure, as getStackSlotFor takes new slots only at the next free one, which only grows, and a register that outgrows its slot gets another, keeping the first; that the fixups at a jump rely on this; and that it costs stack, the slots of a procedure adding up over every register spilled in it. - Step (j) of the outline at the top of GHC.CmmToAsm.Reg.Linear, re-adding a dead spilled register's stack slot to the free list, is marked WIP: it is not done, as a StackMap never frees a slot. - A comment at clobberRegs' filter says that frAllocateReg panics on a register already allocated on AArch64, RISC-V and LoongArch. - Three designs that a trial on a development branch found no gain in are recorded beside the code they would change: handing out the floating-point registers in descending order (at the TODO for ISSUE 26631 in saveClobberedTemps), taking the entry block first and then, after each SCC, an SCC holding a block whose entry assignment is recorded (at the TODO for ISSUE 27800), and putting fixup moves before an unconditional jump rather than in a block of their own (in joinToTargets_again). Liveness, in GHC.CmmToAsm.Reg.Liveness and GHC.CmmToAsm.Reg.Regs: - The fixpoint of livenessSCCs says that it compares the whole map at every round (TODO, ISSUE 27437), and that its steps are monotone, so that a test comparing the formats too would reach a result independent of the order in which the blocks are walked. Regs' Eq says that it ignores formats (TODO, ISSUE 27619). - The comment on the SCCs' order says that no block may fall through before allocation, and liveDieRead's haddock that at a branch it also holds the registers live into its targets only. - A comment at computeLiveness' panic on SCCs out of reverse dependent order says that, where sccBlocks has a CFG, a jump to a block missing from the CFG reaches it too. The graph allocator: in GHC.CmmToAsm.Reg.Graph.SpillCost, a WIP comment says that the block frequencies scale only the counts of uses and definitions, on which no spill choice depends, as spillCost_chaitin, which would read them, is commented out. Both allocators: a TODO at patchRegsOfInstr says that, as it maps a register to a register, both allocators reload a spilled value into a register for an instruction that reads it, even at its last read, where an x86 instruction could read the stack slot. Assisted-by: Claude Opus 5.5 - - - - - bc86972d by Mikolaj Konarski at 2026-11-16T12:36:22+01:00 Document bugs and TODOs in code generators, DWARF and an unused module Of what anyone working with the NCG needs, this commit serves "The paper or earlier design each part of the NCG is based on, where there is one, and which code is no longer used and since which change.", "Where the code does something other than what reading it suggests.", "Where the code is known to behave wrongly or is half done.", "What each known bug leads to, such as wrong code, a compiler panic or only slower code, and under which flags and on which targets it is reached." and "Where the code is likely to change, and how." Comments only; the generated code is the same. The statements carry the labels of Note [Labels in NCG comments]. What each BUG leads to, where it is reached and what that rests on: - getRegister' in GHC.CmmToAsm.AArch64.CodeGen (BUG, ISSUE 28126: isNbitEncodeable 12 admits label offsets from -2048 to 2047, while check_off in GHC.CmmToAsm.AArch64.Ppr accepts only 0 to 4095): on AArch64, compiling a label at an offset from -2048 to -1 stops with check_off's error, a pgmError, "GHC.CmmToAsm.AArch64.Ppr.check_off : -8 is out of 12 bit" for an offset of -8. Below -2048 the guard fails, and the next clause adds the offset through a register. This rests on master's code read (litToImm', ImmIndex, check_off), ISSUE 28126's record and a run of master's x86-64 compiler given an AArch64 target description, in which a Cmm load from a label less 8, at -O0 and at -O, and plusAddr# of a string literal and -1#, at -O, stop with check_off's error; nothing was run on AArch64. - lower_CmmRegOff in GHC.CmmToAsm.Wasm.FromCmm and the cases for CmmRegOff of getRegister' in GHC.CmmToAsm.RV64.CodeGen and GHC.CmmToAsm.LA64.CodeGen, one BUG at each (the sum is not truncated to a sub-word register's width, as each target's general lowering of a sub-word MO_Add truncates its result, and cmmMachOpFoldM in GHC.Cmm.Opt folds a sub-word register plus a literal into a CmmRegOff at any width validOffsetRep allows). Where an operation reads the bits above the width, this is wrong code: on wasm32 a widening MO_UU_Conv of a sub-word value masks nothing, and on RV64 and LA64 Note [Signed arithmetic on RISCV64] and LA64's comment "Signed arithmetic on LoongArch64" keep a sub-word value zero-extended between operations. This rests on master's code read alone; nothing was run on these targets. On RV64 and LA64 an offset that fits in 12 bits goes to the case of MO_Add for such a literal, which does not truncate either. - getRegister''s case for CmmRegOff in GHC.CmmToAsm.X86.CodeGen (BUG: neither mangleIndexTree nor add_int narrows the offset to the register's width, and cmmMachOpFoldM's folds of literals into a CmmRegOff sum them unnarrowed). For a 16-bit register whose offset lies outside 16 bits, add_int's LEA, printed as an ADD of an immediate where the result takes the operand's register, makes the assembler warn that it shortened the immediate (addw $90000,%ax for a 16-bit register plus three times 30000); the shortened immediate gives the value meant, so this costs only the warning, on x86 and x86-64. An 8-bit register's sum takes an ADD whose immediate litToImm narrows, an LEA printed as an LEA takes the offset as a 32-bit displacement without a warning, and a wider register holds any offset add_int is given. This rests on master's code read (mangleIndexTree, add_code, add_int and the printing of an LEA as an ADD in GHC.CmmToAsm.X86.Ppr), on master's compiler, whose assembly for such a sum in Cmm made the assembler warn so, and on GNU as given addw and leaw with such an immediate and displacement, with and without --32: it warned of the addw alone and assembled both. - getHiVirtualRegFromLo in GHC.Platform.Reg, pointed to from localReg64 and getNewReg64 in GHC.CmmToAsm.Monad and from genByteSwap in GHC.CmmToAsm.X86.CodeGen (BUG, ISSUE 28125: the high half keeps the number of the low half's unique): a 64-bit Cmm local and a 64-bit NCG temporary with the same number share their high half, and where both are live, writing one overwrites the other's high 32 bits. This is wrong code on i386; 32-bit PowerPC, which uses the same functions, was not tried. Equal numbers occur, as the NCG's uniques count from 0 in each Haskell module (initDUniqSupply 'n' 0 in GHC.Driver.Main.Compile). In genByteSwap, equal high halves with different low halves arise only so, and the branch for that case swaps correctly. This rests on master's code read and ISSUE 28125's record. - verifyBasicBlock in GHC.CmmToAsm.X86.CodeGen (BUG: nothing checks that a block of native code ends in a transfer of control; this checks, in a DEBUG compiler, only that nothing but jumps follows a jump). A block that did not end in one would run on into whichever block the layout puts after it, which is wrong code; no instruction selector is known to make such a block. This rests on master's code read. - getAmode in GHC.CmmToAsm.X86.CodeGen, three clauses (BUG, ISSUE 28105: each can emit a displacement outside the signed 32-bit range: -i where i = -2^31; an offset left unchecked; and an offset checked only at shift 3, as && binds tighter than ||): where the displacement does not fit, the x86-64 assembler rejects the module. This rests on master's code read and ISSUE 28105's record. - getAmode in GHC.CmmToAsm.X86.CodeGen, its clause for a register offset plus a shift (BUG: nor is the offset narrowed to the register's width). On i386 an offset outside 32 bits reaches the assembler, which warns and shortens it modulo 2^32, to the address meant, so this costs only the warning; on x86-64 such an offset is the BUG of ISSUE 28105 at the same clause. This rests on master's code read, nothing having been compiled for i386, and on GNU as given such displacements with --32, which it shortened with a warning and assembled. - genPrim in GHC.CmmToAsm.X86.CodeGen (BUG, ISSUE 27694: MO_UF_Conv's genWordToFloat does not return the last block it adds, so a later statement of the same Cmm block that splits its current block in turn, as a second conversion does, moves the wrong block's edges): the CFG lacks the edges of the jumps ending the Cmm block, and where the linear allocator puts a fixup block on one of them, addNodesBetween panics with "Can't find weight for edge that should have one", the panic of ISSUE 27915. Where the second conversion's last block is a lone jump, shortcutting (-fasm-shortcutting, on at -O2) cuts it, and shortcutWeightMap drops its out-edges, which in the CFG are the only edges into the first conversion's blocks; the blocks stay in the CFG, unreachable from the entry and with edges, and classifyEdges in GHC.Data.Graph.Directed, which findBackEdges calls for optHsPatterns, panics with "Failed to classify edge of CFG - not not timed" on an edge out of them. Both are reached on x86-64, the only target for which backendMaintainsCfg holds. -dasm-lint does not catch the missing edges first, as sanityCheckCfg compares the CFG's blocks with the code's and not its edges. This rests on master's code read, the records of ISSUE 27694 and ISSUE 27915, a run of master's compiler on a loop with two word2Double# in one Cmm block: it panics in addNodesBetween at -O, at -O2 and at -O -dasm-lint, and compiles at -O0 and at -O -fregs-graph, as the graph allocator makes no fixup blocks; and a run of master's compiler on two word2Double# in one Cmm block ahead of a loop: it panics in classifyEdges at -O2, at -O2 -dasm-lint, at -O2 -fregs-graph, at -O1 -fasm-shortcutting and at -O0 -fasm-shortcutting, and compiles at -O0, at -O1 and at -O2 -fno-asm-shortcutting. - addDefaultUnwindings in GHC.CmmToAsm.Dwarf (BUG: it gives every unwinding table that does not name Sp the rule Sp has at the procedure's entry, and the table that X86's addSpUnwindings adds where the C stack pointer moves, as around a C call, names MachSp alone). Up to the block's next table that names Sp, DWARF gives the canonical frame address by Sp's rule at entry: after a C call, rbp+0 on x86-64 where it was rbp+16 before the call. A debugger unwinding from there finds the wrong frame. This is reached under -g on ELF targets, on x86 and x86-64, as ncgDwarfUnwindings holds on ELF targets under -g and addSpUnwindings is X86's. This rests on master's code read and on readelf's reading of the frame table of an object that master's compiler made under -g. The other statements: - backendMaintainsCfg in GHC.CmmToAsm.BlockLayout said that i386 should work but is untested. It now says, as WIP, that i386 is left out because it is untested and its iselExpr64 splits blocks for 64-bit shifts without adding them to the CFG. - genPrim's comment says that its remaining cases add no blocks, while MO_UF_Conv's genWordToFloat adds blocks: the BUG above stands there. - mkRegRegMoveInstr in GHC.CmmToAsm.X86.Instr says that its move clears the upper part of the register. A TODO says that for a float or a double it is MOV FF64, printed movsd, which keeps the destination's upper half. - invertCondBranches inverts a jump only after an integer comparison. A TODO says that maybeInvertCond's complement on the flags is as sound after a floating-point one. - pprBasicBlock in GHC.CmmToAsm.X86.Ppr aligns, past a procedure's start, only a block with an info table (TODO, ISSUE 27668). - condIntCode' tests a value against zero even on a path where the instruction computing it has set ZF and SF from it, as on the back edge of a loop that counts down: it sees only the comparison, and another path into the test, such as the loop's entry, may set no flags. Only a condition that reads ZF and SF alone could use the flags of a dec, which writes OF and leaves CF where TEST clears both (TODO, ISSUE 27738). - GHC.CmmToAsm.Reg.Graph.Coalesce says, as a TODO, that no module imports it, and that its pass, which ran before allocation, has had no caller since 2007, when it was taken out of the pipeline in favour of the coalescing that GHC.Data.Graph.Color.colorGraph does. Assisted-by: Claude Opus 5.5 - - - - - 3931d9e0 by Mikolaj Konarski at 2026-11-16T12:36:22+01:00 State the NCG's norms and where a branch's likely side is known Of what anyone working with the NCG needs, this commit serves "The norms and principles that apply to the NCG, whether each is agreed or only proposed, and which trade-offs are acceptable." Comments only; the generated code is the same. Note [Norms of the NCG], in GHC.CmmToAsm, states two norms that GHC's own documents hold the native code generator to, and what each means for a change. Under -fobject-determinism the output is bit-for-bit the same for the same inputs, so an order taken from uniques is a question for review. The testsuite passes -dcmm-lint, so a test written in Cmm must be one that Cmm lint accepts. Note [Where a branch's likely side is known], in GHC.CmmToAsm.CFG, says where the code generator learns which side of a conditional branch is likely: where the branch is made, as for heap and stack checks; upstream, and not carried down, for constructor-tag tests; and nowhere, for the rest, to which static prediction applies its heuristics. It also states the trade-offs kept with that knowledge, each with its reason: conditions inverted so that the likely side falls through, and edges across calls left out when chains are built. Note [Norms of the NCG] points to it. Assisted-by: Claude Opus 5.5 - - - - - 2da34539 by Mikolaj Konarski at 2026-11-16T12:36:22+01:00 Rewrite the NCG's overview Note Of what anyone working with the NCG needs, this commit serves "Comments and Notes that are true of the code they describe.", "Which targets go through the NCG, which of its parts each target uses, and what the NCG takes from the Cmm pipeline, StgToCmm and the RTS.", "The NCG's passes in the order they run, and what each requires of the one before.", "The invariants the code depends on." and "What the tests cover and what they do not: which targets CI runs natively, which paths have few or no tests, and which performance test exercises which pass." Comments only; the generated code is the same. Note [Native code generator], the module header of GHC.CmmToAsm, named CmmStmts, cmmCodeGen, targetDoubleSize and smStablePtrTable, which no longer exist, and machine-independent optimisations "defined below", which are in GHC.Cmm.GenericOpt. This commit rewrites it. The Note now says: - which targets go through cmmNativeGen, that wasm32 has a generator of its own, and which back end the other targets get by default; - what the Cmm pipeline hands over, and what the NCG takes from StgToCmm and the RTS; - the interfaces through which the machine-independent parts access a target, and what only some targets have; - the passes, in the order cmmNativeGen runs them, with the flags that turn them on and the dump flags that show their output, and, at step 4, what instruction selection must ensure; - where the NCG's uniques come from; - the flags, testsuite directories and benchmarks for working on the NCG. For detail it cites the Notes and labelled statements of the preceding commits. Assisted-by: Claude Opus 5.5 - - - - - 9b937721 by Mikolaj Konarski at 2026-11-16T12:36:22+01:00 Propose two principles for the NCG Of what anyone working with the NCG needs, this commit serves "The norms and principles that apply to the NCG, whether each is agreed or only proposed, and which trade-offs are acceptable." Comments only; the generated code is the same. Note [Proposed principles of the NCG], in GHC.CmmToAsm, puts two principles to GHC's developers and says that the native code generator does not keep them yet: - correctness first: semantic correctness is not traded for a gain that an incorrect form gives by accident, until a form with both has been looked for and the trade agreed in review; - one TODO set: a departure from correctness that is left in place is marked TODO, as a member of one set that is accepted for now and re-investigated together. No other commit cites the Note, so this commit can be dropped on its own. Assisted-by: Claude Opus 5.5 - - - - - 42f5e2e8 by Mikolaj Konarski at 2026-11-16T12:36:22+01:00 Add a README to the NCG's directory Of what anyone working with the NCG needs, this commit serves "An order in which to read the NCG's Notes.", "One place where the terms the NCG's comments use are defined.", "One small function followed through the NCG's dumps, in the order of its passes.", "Which parts of the NCG were examined for bugs, half-done work and likely changes, and which were not.", "The invariants the code depends on." and "How to find the pass at fault for a miscompilation or a compiler panic, and how to reduce the case to a Cmm test." Documentation only; the generated code is the same. compiler/GHC/CmmToAsm/README.md is a way in for anyone working with the native code generator, whether reading its output and dumps, tracking a fault to its pass, reviewing or making a change, or maintaining it. It says what to read and what to do, and for each fact about the code it cites a Note or a comment by name. Its sections: - Where to start reading: three Notes of GHC.CmmToAsm, then Notes on the passes, each with its module, in the overview's order. - Vocabulary: the terms the NCG's comments use without defining them, each with where it is defined or used. - Finding the pass at fault for a wrong result or a panic: the oracles to compare with, the flags that switch a pass off or swap it, the lints, and how to cut a case down to a Cmm test. - One function through the dumps: a small loop compiled at -O on x86-64, with an excerpt for each dump flag in the overview's list of passes but -ddump-asm-regalloc-stages, which prints nothing under the linear allocator. - Reviewing a change: the invariants the code depends on, as questions by kind of change, each citing the Note or comment that states it. - What the labelled statements cover: which parts of the NCG they were first written from, and which were left out. The excerpts are cut from the dumps of one compilation by a compiler built from master: each of their lines is a line of a dump, in the dump's order, with tabs replaced by spaces. Every Note, function, module, flag and path the README names exists at this commit. The overview, Note [Native code generator], now ends by pointing to the README. Assisted-by: Claude Opus 5.5 - - - - - 404 changed files: - .gitignore - .gitlab-ci.yml - .gitlab/ci.sh - .gitlab/common.sh - .gitlab/generate-ci/gen_ci.hs - .gitlab/jobs.yaml - .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py - + changelog.d/21969 - + changelog.d/26169.md - + changelog.d/27821 - + changelog.d/28002-leb128 - + changelog.d/28080 - + changelog.d/28081 - + changelog.d/28101 - + changelog.d/T26754 - + changelog.d/T9809-timer-manager-contention - changelog.d/allow-gadt-prefix-con-parens - + changelog.d/bignum-quotrem-no-alloc - + changelog.d/fix-aarch64-veneer-target-16686 - + changelog.d/fix-copyarray-nonmoving-barrier-27376 - + changelog.d/fix-heap-census-pinned-blocks.md - + changelog.d/gadt-curried-contexts-27424 - + changelog.d/ghc-api-exec-break-resume - + changelog.d/make-depends-deprecate-doMkDependHS - + changelog.d/make-depends-json - + changelog.d/make-depends-multiple-home-units - + changelog.d/ncg-reg-usage.md - + changelog.d/remove-long-deprecated-flags.md - + changelog.d/split-sections-dynamic - + changelog.d/stage3-cross-bindists - compiler/GHC/Cmm/Node.hs - compiler/GHC/Cmm/Reg.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/Dwarf.hs - compiler/GHC/CmmToAsm/Instr.hs - compiler/GHC/CmmToAsm/LA64/CodeGen.hs - compiler/GHC/CmmToAsm/LA64/Instr.hs - compiler/GHC/CmmToAsm/Monad.hs - compiler/GHC/CmmToAsm/PIC.hs - compiler/GHC/CmmToAsm/PPC/Instr.hs - compiler/GHC/CmmToAsm/PPC/Ppr.hs - + compiler/GHC/CmmToAsm/README.md - compiler/GHC/CmmToAsm/RV64/CodeGen.hs - compiler/GHC/CmmToAsm/RV64/Instr.hs - compiler/GHC/CmmToAsm/Reg/Graph.hs - compiler/GHC/CmmToAsm/Reg/Graph/Base.hs - compiler/GHC/CmmToAsm/Reg/Graph/Coalesce.hs - compiler/GHC/CmmToAsm/Reg/Graph/Spill.hs - compiler/GHC/CmmToAsm/Reg/Graph/SpillCost.hs - compiler/GHC/CmmToAsm/Reg/Linear.hs - compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs - compiler/GHC/CmmToAsm/Reg/Linear/Base.hs - compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs - compiler/GHC/CmmToAsm/Reg/Linear/JoinToTargets.hs - compiler/GHC/CmmToAsm/Reg/Linear/StackMap.hs - compiler/GHC/CmmToAsm/Reg/Linear/State.hs - compiler/GHC/CmmToAsm/Reg/Liveness.hs - compiler/GHC/CmmToAsm/Reg/Regs.hs - compiler/GHC/CmmToAsm/Reg/Target.hs - + compiler/GHC/CmmToAsm/RegUsage.hs - compiler/GHC/CmmToAsm/Wasm/FromCmm.hs - compiler/GHC/CmmToAsm/X86/CodeGen.hs - compiler/GHC/CmmToAsm/X86/Instr.hs - compiler/GHC/CmmToAsm/X86/Ppr.hs - compiler/GHC/CmmToAsm/X86/Regs.hs - compiler/GHC/CmmToC.hs - compiler/GHC/Core.hs - compiler/GHC/CoreToStg.hs - compiler/GHC/Driver/Config/CmmToAsm.hs - compiler/GHC/Driver/Downsweep.hs - compiler/GHC/Driver/DynFlags.hs - compiler/GHC/Driver/Flags.hs - compiler/GHC/Driver/MakeFile.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Driver/Session/Units.hs - compiler/GHC/Hs/Binds.hs - compiler/GHC/Hs/Decls.hs - compiler/GHC/Hs/Dump.hs - compiler/GHC/Hs/Expr.hs - compiler/GHC/Hs/Type.hs - compiler/GHC/Hs/Utils.hs - compiler/GHC/HsToCore/Arrows.hs - compiler/GHC/HsToCore/Expr.hs - compiler/GHC/HsToCore/Expr.hs-boot - compiler/GHC/HsToCore/Match.hs - compiler/GHC/HsToCore/Pmc/Desugar.hs - compiler/GHC/HsToCore/Quote.hs - compiler/GHC/HsToCore/Ticks.hs - compiler/GHC/Iface/Ext/Ast.hs - compiler/GHC/Parser.y - compiler/GHC/Parser/Errors/Ppr.hs - compiler/GHC/Parser/Errors/Types.hs - compiler/GHC/Parser/Header.hs - compiler/GHC/Parser/Lexer.x - compiler/GHC/Parser/PostProcess.hs - compiler/GHC/Parser/PostProcess/Haddock.hs - compiler/GHC/Platform/Reg.hs - compiler/GHC/Platform/Reg/Class.hs - compiler/GHC/Platform/Ways.hs - compiler/GHC/Rename/Bind.hs - compiler/GHC/Rename/Expr.hs - compiler/GHC/Rename/Module.hs - compiler/GHC/Rename/Utils.hs - compiler/GHC/Runtime/Eval.hs - compiler/GHC/Runtime/Eval/Types.hs - compiler/GHC/Stg/Make.hs - compiler/GHC/StgToCmm/Closure.hs - compiler/GHC/StgToCmm/Monad.hs - compiler/GHC/StgToCmm/Prim.hs - compiler/GHC/Tc/Deriv/Functor.hs - compiler/GHC/Tc/Deriv/Generate.hs - compiler/GHC/Tc/Gen/Arrow.hs - compiler/GHC/Tc/Gen/Expr.hs - compiler/GHC/Tc/Gen/HsType.hs - compiler/GHC/Tc/Gen/Match.hs - compiler/GHC/Tc/Module.hs - compiler/GHC/Tc/Solver/Default.hs - compiler/GHC/Tc/Solver/Monad.hs - compiler/GHC/Tc/TyCl.hs - compiler/GHC/Tc/TyCl/PatSyn.hs - compiler/GHC/Tc/Zonk/Type.hs - compiler/GHC/ThToHs.hs - compiler/GHC/Types/Literal/Floating.hs - compiler/GHC/Types/Tickish.hs - compiler/GHC/Utils/Json.hs - compiler/Language/Haskell/Syntax/Decls.hs - compiler/Language/Haskell/Syntax/Decls/Foreign.hs - compiler/Language/Haskell/Syntax/Expr.hs - compiler/Language/Haskell/Syntax/Type.hs - compiler/ghc.cabal.in - docs/users_guide/codegens.rst - docs/users_guide/expected-undocumented-flags.txt - docs/users_guide/exts/control.rst - docs/users_guide/exts/ffi.rst - docs/users_guide/exts/gadt_syntax.rst - docs/users_guide/exts/pragmas.rst - docs/users_guide/exts/qualified_strings.rst - docs/users_guide/ghc.rst - + docs/users_guide/make-depends-json-schema-1_0.json - docs/users_guide/phases.rst - docs/users_guide/profiling.rst - docs/users_guide/separate_compilation.rst - docs/users_guide/using-optimisation.rst - − docs/users_guide/what_glasgow_exts_does.rst - ghc/GHCi/UI.hs - ghc/GHCi/UI/Monad.hs - ghc/Main.hs - hadrian/doc/cross-compile.md - hadrian/src/Base.hs - hadrian/src/BindistConfig.hs - hadrian/src/Builder.hs - hadrian/src/Context.hs - hadrian/src/Flavour.hs - hadrian/src/Hadrian/Haskell/Hash.hs - hadrian/src/Hadrian/Package.hs - hadrian/src/Oracles/Flag.hs - hadrian/src/Oracles/Setting.hs - hadrian/src/Oracles/TestSettings.hs - hadrian/src/Packages.hs - hadrian/src/Rules/BinaryDist.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Rules/Program.hs - hadrian/src/Rules/Test.hs - hadrian/src/Settings/Builders/DeriveConstants.hs - hadrian/src/Settings/Builders/RunTest.hs - hadrian/src/Settings/Packages.hs - libraries/base/src/Data/Foldable.hs - libraries/base/tests/.gitignore - + libraries/base/tests/T9809.hs - libraries/base/tests/all.T - libraries/ghc-boot/GHC/Serialized.hs - libraries/ghc-heap/GHC/Exts/Heap/FFIClosures_ProfilingDisabled.hsc - libraries/ghc-heap/GHC/Exts/Heap/FFIClosures_ProfilingEnabled.hsc - libraries/ghc-heap/tests/parse_tso_flags.hs - libraries/ghc-internal/src/GHC/Internal/Bignum/Backend/Native.hs - libraries/ghc-internal/src/GHC/Internal/Conc/IO.hs - libraries/ghc-internal/src/GHC/Internal/Event/Manager.hs - libraries/ghc-internal/src/GHC/Internal/Event/Thread.hs - libraries/ghc-internal/src/GHC/Internal/Event/TimerManager.hs - libraries/ghc-internal/src/GHC/Internal/Heap/Closures.hs - libraries/ghci/GHCi/Debugger.hs - libraries/ghci/GHCi/Run.hs - rts/Exception.cmm - rts/Interpreter.c - rts/Interpreter.h - rts/Linker.c - rts/LinkerInternals.h - rts/PrimOps.cmm - rts/ProfHeap.c - rts/RtsSymbols.c - rts/RtsSymbols.h - rts/RtsUtils.c - rts/Stats.c - rts/Stats.h - rts/include/Cmm.h - rts/include/Rts.h - rts/include/rts/Constants.h - + rts/include/rts/RtsSymbols.h - rts/include/stg/MiscClosures.h - rts/linker/PEi386.c - rts/linker/elf_reloc_aarch64.c - rts/rts.cabal - rts/sm/GC.c - rts/sm/GCThread.h - rts/sm/NonMovingMark.c - testsuite/README.md - testsuite/config/ghc - testsuite/driver/junit.py - testsuite/driver/runtests.py - testsuite/driver/testglobals.py - testsuite/driver/testlib.py - testsuite/driver/testutil.py - testsuite/mk/test.mk - + testsuite/tests/annotations/should_run/SerializedRoundTrip.hs - + testsuite/tests/annotations/should_run/SerializedRoundTrip.stdout - + testsuite/tests/annotations/should_run/SerializedRoundTrip.stdout-ws-32 - testsuite/tests/annotations/should_run/T16841.stdout - testsuite/tests/annotations/should_run/all.T - + testsuite/tests/cmm/should_run/T28101.hs - + testsuite/tests/cmm/should_run/T28101.stdout - + testsuite/tests/cmm/should_run/T28101_cmm.cmm - testsuite/tests/cmm/should_run/all.T - testsuite/tests/codeGen/should_gen_asm/all.T - + testsuite/tests/codeGen/should_gen_asm/split-sections-dynamic1.asm - + testsuite/tests/codeGen/should_gen_asm/split-sections-dynamic1.hs - + testsuite/tests/codeGen/should_gen_asm/split-sections-dynamic2.asm - + testsuite/tests/codeGen/should_gen_asm/split-sections-dynamic2.hs - testsuite/tests/concurrent/should_run/T21969.hs - + testsuite/tests/concurrent/should_run/T21969a.hs - + testsuite/tests/concurrent/should_run/T21969a.stdout - + testsuite/tests/concurrent/should_run/T21969b.hs - + testsuite/tests/concurrent/should_run/T21969b.stdout - + testsuite/tests/concurrent/should_run/T21969c.hs - + testsuite/tests/concurrent/should_run/T21969c.stdout - + testsuite/tests/concurrent/should_run/T21969d.hs - + testsuite/tests/concurrent/should_run/T21969d.stdout - + testsuite/tests/concurrent/should_run/T21969e.hs - + testsuite/tests/concurrent/should_run/T21969e.stdout - + testsuite/tests/concurrent/should_run/T21969f.hs - + testsuite/tests/concurrent/should_run/T21969f.stdout - testsuite/tests/concurrent/should_run/all.T - + testsuite/tests/concurrent/should_run/registerFd001.hs - + testsuite/tests/concurrent/should_run/registerFd001.stdout - testsuite/tests/driver/Makefile - testsuite/tests/driver/T2464.hs - testsuite/tests/driver/T2464.stderr - + testsuite/tests/driver/mkdepend/Makefile - + testsuite/tests/driver/mkdepend/README.md - + testsuite/tests/driver/mkdepend/T24384/A.hs - + testsuite/tests/driver/mkdepend/T24384/C.hs - + testsuite/tests/driver/mkdepend/T24384/C.hs-boot - + testsuite/tests/driver/mkdepend/T24384/D.hs - + testsuite/tests/driver/mkdepend/T24384/E.hs - + testsuite/tests/driver/mkdepend/T24384/dep-internal/DepInternal.hs - + testsuite/tests/driver/mkdepend/T24384/dep-internal/dep-internal.pkg - + testsuite/tests/driver/mkdepend/T24384/dep-public/DepPublic.hs - + testsuite/tests/driver/mkdepend/T24384/dep-public/dep-public.pkg - + testsuite/tests/driver/mkdepend/T24384/dep/Dep.hs - + testsuite/tests/driver/mkdepend/T24384/dep/dep.pkg - + testsuite/tests/driver/mkdepend/T24384/foo.h - + testsuite/tests/driver/mkdepend/T24384/lib/B.hs - + testsuite/tests/driver/mkdepend/T24384/lib/B.hs-boot - + testsuite/tests/driver/mkdepend/T24384/preproc.sh - + testsuite/tests/driver/mkdepend/T24384a.stdout - + testsuite/tests/driver/mkdepend/T24384b.stdout - + testsuite/tests/driver/mkdepend/T24384c.stdout - + testsuite/tests/driver/mkdepend/all.T - + testsuite/tests/driver/mkdepend/format_json.sh - + testsuite/tests/driver/mkdepend/format_makefile.sh - + testsuite/tests/driver/mkdepend/mhu01/a/A/Base.hs - + testsuite/tests/driver/mkdepend/mhu01/a/A/Base.hs-boot - + testsuite/tests/driver/mkdepend/mhu01/a/A/TH.hs - + testsuite/tests/driver/mkdepend/mhu01/a/Util.hs - + testsuite/tests/driver/mkdepend/mhu01/b/B/Normal.hs - + testsuite/tests/driver/mkdepend/mhu01/b/B/Splice.hs - + testsuite/tests/driver/mkdepend/mhu01/b/Util.hs - + testsuite/tests/driver/mkdepend/mhu01/c/C.hs - + testsuite/tests/driver/mkdepend/mhu01/unitA - + testsuite/tests/driver/mkdepend/mhu01/unitB - + testsuite/tests/driver/mkdepend/mhu01/unitC - + testsuite/tests/driver/mkdepend/mhu02/A.hs - + testsuite/tests/driver/mkdepend/mhu02/B.hs - + testsuite/tests/driver/mkdepend/mhu02/pp.sh - + testsuite/tests/driver/mkdepend/mhu02/unitA - + testsuite/tests/driver/mkdepend/mhu02/unitB - + testsuite/tests/driver/mkdepend/mhu03/pkg/A.hs - + testsuite/tests/driver/mkdepend/mhu03/pkg/pp.sh - + testsuite/tests/driver/mkdepend/mhu03/unitA - + testsuite/tests/driver/mkdepend/mkdepend01.dep-json - + testsuite/tests/driver/mkdepend/mkdepend01.dep-makefile - + testsuite/tests/driver/mkdepend/mkdepend01/A.hs - + testsuite/tests/driver/mkdepend/mkdepend_mhu01.dep-json - + testsuite/tests/driver/mkdepend/mkdepend_mhu01.dep-makefile - + testsuite/tests/driver/mkdepend/mkdepend_mhu02.dep-json - + testsuite/tests/driver/mkdepend/mkdepend_mhu03.dep-json - testsuite/tests/ffi/should_run/T2594.hs - testsuite/tests/ffi/should_run/ffi015.hs - testsuite/tests/ffi/should_run/fptr01.hs - testsuite/tests/ffi/should_run/fptrfail01.hs - − testsuite/tests/gadt/T12087.stderr - + testsuite/tests/gadt/T12087a.hs - testsuite/tests/gadt/T12087.hs → testsuite/tests/gadt/T12087b.hs - + testsuite/tests/gadt/T12087b.stderr - + testsuite/tests/gadt/T27424a.hs - + testsuite/tests/gadt/T27424b.hs - + testsuite/tests/gadt/T27424b.stderr - testsuite/tests/gadt/all.T - testsuite/tests/ghc-api/exactprint/T22919.stderr - testsuite/tests/ghc-api/exactprint/ZeroWidthSemi.stderr - testsuite/tests/ghci.debugger/scripts/all.T - + testsuite/tests/ghci.debugger/scripts/break037.hs - + testsuite/tests/ghci.debugger/scripts/break037.script - + testsuite/tests/ghci.debugger/scripts/break037.stdout - testsuite/tests/ghci/linking/T25155_iserv_main.c - testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr - testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr - testsuite/tests/indexed-types/should_compile/all.T - testsuite/tests/indexed-types/should_fail/SkolemOccursLoop.hs - testsuite/tests/linters/all.T - testsuite/tests/llvm/should_compile/all.T - + testsuite/tests/llvm/should_compile/split-sections-darwin.hs - 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/DumpTypecheckedAst.stderr - testsuite/tests/parser/should_compile/KindSigs.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/perf/compiler/hard_hole_fits.stderr - testsuite/tests/perf/compiler/large-project/all.T - + testsuite/tests/perf/compiler/large-project/large-project-mhu.sh - + testsuite/tests/perf/should_run/T27231.hs - + testsuite/tests/perf/should_run/T27231.stdout - testsuite/tests/perf/should_run/T7257.hs - testsuite/tests/perf/should_run/T7257.stdout - testsuite/tests/perf/should_run/all.T - testsuite/tests/primops/should_run/all.T - testsuite/tests/printer/Makefile - testsuite/tests/printer/T18791.stderr - + testsuite/tests/printer/T27424c.hs - testsuite/tests/printer/Test20297.hs - testsuite/tests/printer/Test20297.stdout - testsuite/tests/printer/Test24533.stdout - testsuite/tests/printer/all.T - testsuite/tests/profiling/should_run/T7275.stdout - testsuite/tests/rts/Makefile - testsuite/tests/rts/T17088.hs - + testsuite/tests/rts/T26169.hs - + testsuite/tests/rts/T27376.hs - + testsuite/tests/rts/T27376.stdout - testsuite/tests/rts/all.T - + testsuite/tests/rts/census_pinned.hs - + testsuite/tests/rts/census_pinned.stdout-ws-32 - + testsuite/tests/rts/census_pinned.stdout-ws-64 - + testsuite/tests/rts/census_pinned.stdout-ws-64-mingw32 - testsuite/tests/rts/linker/Makefile - + testsuite/tests/rts/linker/T27807.s - + testsuite/tests/rts/linker/T27807.stdout - testsuite/tests/rts/linker/all.T - testsuite/tests/rts/pause-resume/all.T - testsuite/tests/rts/pause-resume/pause_resume_via_safe_ffi_concurrent.hs - + testsuite/tests/rts/symbols/Main.hs - + testsuite/tests/rts/symbols/Makefile - + testsuite/tests/rts/symbols/all.T - + testsuite/tests/rts/symbols/dumpDeclaredSymbols.c - + testsuite/tests/rts/symbols/rts-check-symbols.sh - + testsuite/tests/rts/symbols/rts-check-symbols.stdout - testsuite/tests/th/GadtConSigs_th_dump1.hs - testsuite/tests/th/GadtConSigs_th_dump1.stderr - + testsuite/tests/th/T27424d.hs - + testsuite/tests/th/T27424d.stderr - testsuite/tests/th/all.T - + testsuite/tests/unsatisfiable/T28081.hs - testsuite/tests/unsatisfiable/all.T - utils/check-exact/ExactPrint.hs - utils/check-exact/Main.hs - utils/check-exact/Transform.hs - utils/check-exact/Utils.hs - utils/haddock/CHANGES.md - utils/haddock/doc/markup.rst - utils/haddock/haddock-api/haddock-api.cabal - utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs - utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs - utils/haddock/haddock-api/src/Haddock/Convert.hs - utils/haddock/haddock-api/src/Haddock/GhcUtils.hs - utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs - utils/haddock/haddock-library/CHANGES.md - utils/haddock/haddock-library/fixtures/Fixtures.hs - + utils/haddock/haddock-library/fixtures/examples/codeBackticks.input - + utils/haddock/haddock-library/fixtures/examples/codeBackticks.parsed - + utils/haddock/haddock-library/fixtures/examples/codeDoubleBackticks.input - + utils/haddock/haddock-library/fixtures/examples/codeDoubleBackticks.parsed - utils/haddock/haddock-library/haddock-library.cabal - utils/haddock/haddock-library/src/Documentation/Haddock/Parser.hs - utils/haddock/haddock-library/src/Documentation/Haddock/Parser/Identifier.hs - utils/haddock/haddock-library/test/Documentation/Haddock/ParserSpec.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f36155cf1d77d9790f66f54bfc0af80... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f36155cf1d77d9790f66f54bfc0af80... 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)
-
Mikolaj Konarski (@Mikolaj)