[Git][ghc/ghc][wip/andreask/linker_fix] Fix riscv use of misalignment field.
by Andreas Klebinger (@AndreasK) 28 Jul '26
by Andreas Klebinger (@AndreasK) 28 Jul '26
28 Jul '26
Andreas Klebinger pushed to branch wip/andreask/linker_fix at Glasgow Haskell Compiler / GHC
Commits:
2936f000 by Andreas Klebinger at 2026-07-28T14:14:13+02:00
Fix riscv use of misalignment field.
- - - - -
2 changed files:
- rts/linker/CacheFlush.c
- rts/linker/elf_reloc_riscv64.c
Changes:
=====================================
rts/linker/CacheFlush.c
=====================================
@@ -37,7 +37,7 @@ void
ocFlushInstructionCache( ObjectCode *oc )
{
/* The main object code */
- ocFlushInstructionCacheFrom(oc->image + oc->misalignment, oc->fileSize);
+ ocFlushInstructionCacheFrom(oc->image, oc->fileSize);
/* Jump Islands */
ocFlushInstructionCacheFrom(oc->symbol_extras, sizeof(SymbolExtra) * oc->n_symbol_extras);
=====================================
rts/linker/elf_reloc_riscv64.c
=====================================
@@ -678,7 +678,7 @@ void flushInstructionCacheRISCV64(ObjectCode *oc) {
// parameters couldn't be checked during development.)
/* The main object code */
- void *codeBegin = oc->image + oc->misalignment;
+ void *codeBegin = oc->image;
__builtin___clear_cache(codeBegin, (void*) ((uint64_t*) codeBegin + oc->fileSize));
/* Jump Islands */
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2936f000e372c47b03c846b9b638f17…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/2936f000e372c47b03c846b9b638f17…
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
1
0
[Git][ghc/ghc][wip/andreask/linker_fix] 81 commits: hadrian: fix HLS support
by Andreas Klebinger (@AndreasK) 28 Jul '26
by Andreas Klebinger (@AndreasK) 28 Jul '26
28 Jul '26
Andreas Klebinger pushed to branch wip/andreask/linker_fix at Glasgow Haskell Compiler / GHC
Commits:
ed261a7e by Cheng Shao at 2026-07-14T17:59:38-04:00
hadrian: fix HLS support
This patch fixes hadrian's HLS support so one can rely on HLS when
working on the hadrian codebase. Fixes #27480.
Not building/linking shared libraries for hadrian is a severely
premature optimization; this top-level setting in `cabal.project` only
affects home packages while the dependencies in the cabal store are
built with vanilla/dynamic anyway, and even adding dynamic builds to
home packages would not be costly due to cabal's usage of
`-dynamic-too`.
- - - - -
eee8ec5b by Cheng Shao at 2026-07-14T18:00:20-04:00
compiler: fix miscompiled %load_relaxed, add missing %store_relaxed
This patch fixes the %load_relaxed cmm primop compilation logic to
correctly use relaxed memory ordering, and adds the missing
%store_relaxed primop. Parsing logic of %load/%store with explicit
ordering is covered in the AtomicFetch test case. Fixes #27483.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
1718230f by Alan Zimmerman at 2026-07-14T18:01:06-04:00
EPA: Keep binds and sigs together in HsValBindsLR
We combine them into a single list for GhcPs, wrapped in the
ValBind data type, which is the bind equivalent of ValD, having
constructors for binds and sigs.
This simplifies exact print processing, especially when using it to
update the contents of local binds, as we no longer need AnnSortKey
BindTag
- - - - -
6bd1ad2a by Andreas Klebinger at 2026-07-14T18:01:49-04:00
Bump nofib submodule to account for MonoLocalBinds.
New versions of GHC enable MonoLocalBinds by default.
This breaks some of the benchmarks. I've fixed this and
this bump pulls in that fix.
- - - - -
7eb0f1c9 by Cheng Shao at 2026-07-14T18:02:31-04:00
testsuite: fix bytecodeIPE test under +ipe flavours
This patch fixes the bytecodeIPE test under +ipe flavours. It used to
fail under +ipe because the RTS is built with IPE info, then
stg_AP_info in RTS carries IPE info, so whereFrom wouldn't return
Nothing. Now the test checks IPE info of a datacon in the ghci-loaded
module which is not affected by whether the RTS is built with IPE info
or not. Fixes #27498.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
ef038aae by cydparser at 2026-07-15T04:35:41-04:00
Reduce bytes allocated for `capabilities` in RTS (fixes #27487)
In rts/Capability.c, `capabilities` is an array of pointers, but it was allocated as if it were an
array of Capability's.
- - - - -
d377e83e by Cheng Shao at 2026-07-15T04:36:27-04:00
rts: fix missing UNTAG in stg_readTVarIOzh
This patch fixes missing UNTAG on the current value closure read from
StgTVar. UNTAG is a no-op when it's stg_TREC_HEADER_info which is word
aligned; it may be a tagged closure, and reading info table from the
tagged address is an unaligned load which may cause issues on
platforms with strict alignment requirements.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
8ed03842 by Cheng Shao at 2026-07-15T04:36:27-04:00
rts: fix missing UNTAG in stg_control0zh_ll
This patch fixes missing UNTAG on the cont closure returned by
captureContinuationAndAbort. In case it's not NULL,
captureContinuationAndAbort returns a tagged StgContinuation closure,
in which case it must be untagged before accessing the
apply_mask_frame field.
In the past it worked out of luck: when apply_mask_frame was NULL then
mask_frame_offset is also 0 so the control flow didn't diverge to a
wrong path. Still, this is horribly wrong and will crash once
StgContinuation struct is refactored and fields are shuffled around.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
5aa7000a by Cheng Shao at 2026-07-15T04:37:08-04:00
compiler: fix redundant AP thunk codegen when not using -ticky-ap-thunk
This patch fixes a double negation confusion in !7525 that results in
some redundant AP thunk code generation when not using
-ticky-ap-thunk. Now, we use `stgToCmmUseStdApThunk` to indicate
whether precomputed AP thunks in the RTS should be used, which
defaults to `True`, unless `-ticky-ap-thunk` is passed.
`-finfo-table-map` now also implies `-ticky-ap-thunk`, since when
doing IPE profiling we want the generated AP thunks to be unique.
Fixes #27502.
-------------------------
Metric Decrease:
T3064
-------------------------
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
d43a7b7a by Brian McKenna at 2026-07-15T20:10:04+02:00
Strip ticks when desugaring bool guards
The special `considerAccessible` pattern was broken when compiling
with debug info. Compiling with debug info wraps expressions with
`SourceNote` ticks, which broke the internals of the
`desugarBoolGuard` function. Ticks are now ignored within this
function.
Fixes #27360
- - - - -
ede4b17b by Ben Gamari at 2026-07-15T22:59:53-04:00
base: Display ExceptionContext in WhileHandling's textual description
As originally-implemented the implementation for
`WhileHandling(displayExceptionAnnotation)` would display the
`ExceptionContext` of the exception which it carries (as this was the
behavior of `displayException`, in terms of which
`displayExceptionAnnotation` was implemented).
However, in 284ffab3 the definition of `SomeException(displayException)`
was changed to exclude the `ExceptionContext`. This means that
`WhileHandling(displayExceptionAnnotation)` fails to describe the
provenance of the exception which it captures, greatly limiting its
utility.
Return the implementation to its originally-specified behavior by
implementing `WhileHandling(displayExceptionAnnotation)` in terms of
`displayExceptionWithInfo`.
Fixes #27456.
- - - - -
0f64f348 by Cheng Shao at 2026-07-16T15:41:08+00:00
ci: add missing docker permission workaround in abi-test job
- - - - -
660cb239 by Cheng Shao at 2026-07-16T19:37:48+00:00
bindist: Fix make install -j race condition on macos/freebsd
This patch fixes make install -j race condition on macos/freebsd. BSD
install fails with EEXIST when multiple install processes concurrently
create the same prefix directory. So we add an `install_dirs`
prerequisite job that sequentially creates the directories for
subsequent jobs to work with. Fixes #27499.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
08130257 by Cheng Shao at 2026-07-16T19:37:48+00:00
ci: run bindist make install with -j
This patch makes the ci scripts run `make install` with `-j` to reduce
wall clock time when installing the bindist, see related issue for
benchmark numbers. This only affects ghc ci logic, the user-facing
default is up to distributors and is still `-j1`. Closes #27029.
- - - - -
d5ae6906 by Adam Gundry at 2026-07-17T04:57:43-04:00
Mark various language extension flags as deprecated (see #27329)
The following language extensions are now deprecated:
- AlternativeLayoutRule
- AlternativeLayoutRuleTransitional
- ParallelArrays
- PolymorphicComponents
- Rank2Types
In addition, the warning `-Walternative-layout-rule-transitional`
has been marked as deprecated, as it is emitted only under the
deprecated extension `XAlternativeLayoutRuleTransitional`.
- - - - -
fe3b059c by Andrew Lelechenko at 2026-07-17T04:58:26-04:00
base: re-export GHC.Environment.getFullArgs from System.Environment
CLC proposal https://github.com/haskell/core-libraries-committee/issues/431
- - - - -
722236dd by sheaf at 2026-07-18T08:48:31-04:00
Coercion optimisation: avoid double-Sym for InstCo
Ticket #27374 pointed out an issue with GHC.Core.Coercion.Opt.optCoercion's
handling of InstCo: it contravened (LC2) in Note [The LiftingContext in optCoercion]
because it applied the ambient 'sym' to a coercion that was then added
to the lifting context substitution.
Fixes #27374
Co-authored-by: Simon Jakobi <simon.jakobi(a)gmail.com>
- - - - -
ff70fc75 by sheaf at 2026-07-18T08:48:31-04:00
Coercion optimisation: avoid exponential behaviour
The change to coercion optimisation of 'InstCo' in the previous commit
introduces exponential behaviour to the coercion optimiser. To avoid
this, this commit provides a way to push in 'Sym' of an already-optimised
coercion: GHC.Core.Coercion.Opt.mkDeepSymCo.
See Note [Pushing Sym without re-optimising] in GHC.Core.Coercion.Opt.
- - - - -
dfef27f0 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Move THREADED_RTS-conditional struct members to end of Capability
Accessing members of the Capability struct from CMM code rely on
accessor macros. (The macros are generated by deriveConstants).
These macros have a single definition. This means that the offsets of
all struct members must *not* vary based on THREADED_RTS vs
!THREADED_RTS. This requires that any struct members that are
conditional on THREADED_RTS must occur after the unconditional struct
members. Hence we move all the ones that are conditional on
THREADED_RTS to the end.
Add a deriveConstants entry for the iomgr member of the Capability
struct, which was the motivation for this change.
Add warning messages to help our future selves. Debugging this took me
a couple hours in gdb!
- - - - -
c254e022 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Make the IOManager API use CapIOManager rather than Capability
This makes the API somewhat more self-contained and more consistent.
Now the IOManager API and each of the backends takes just the I/O
manager structure. Previously we had a bit of a mixture, depending on
whether the function needed access to the Capability or just the
CapIOManager.
We still need access to the cap, so we introduce a back reference to
reach the capability, via iomgr->cap.
Convert all uses in select and poll backends, but not win32 ones.
Convert callers in the scheduler and elsewhere.
Also convert the three CMM primops that call IOManager APIs. They just
need to use Capability_iomgr(MyCapability()).
- - - - -
4f3d8f31 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Split posix/MIO.c out of posix/Signals.c
The MIO I/O manager was secretly living inside the Signals file.
Now it gets its own file, like any other self-respecting I/O manager.
- - - - -
52ce04a9 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Rationalise some scheduler run queue utilities
Move them all to the same place in the file.
Make some static that were used only internally.
Also remove a redundant assignment after calling truncateRunQueue that
is already done within truncateRunQueue.
- - - - -
75bbdebc by Duncan Coutts at 2026-07-18T08:49:12-04:00
Rename initIOManager{AfterFork} to {re}startIOManager
These are more accurate names, since these actions happen after
initialisation and are really about starting (or restarting) background
threads.
- - - - -
724c0517 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Free per-cap I/O managers during shutdown and forkProcess
Historically this was not strictly necessary. The select and win32
legacy I/O managers did not maintain any dynamically allocated
resources. The new poll one does (an auxillary table), and so this
should be freed.
After forkProcess, all threads get deleted. This includes threads
waiting on I/O or timers. So as of this patch, resetting the I/O
manager is just about tidying things up. For example, for the poll
I/O manager this will reset the size of the AIOP table (which
otherwise grows but never shrinks).
In future however the re-initialising will become neeecessary for
functionality, since some I/O managers will need to re-initialise
wakeup fds that are set CLOEXEC.
- - - - -
c007d122 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Add a TODO to the MIO I/O manager
The direction of travel is to make I/O managers per-capability and have
all their state live in the struct CapIOManager. The MIO I/O manager
however still has a number of global variables.
It's not obvious how handle these globals however.
- - - - -
b65ab7b3 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Add a FIXME note in the Poll I/O manager
- - - - -
daf2bd6f by Duncan Coutts at 2026-07-18T08:49:12-04:00
Add missing updateRemembSetPushClosure in poll I/O manager
For the non-moving GC.
- - - - -
e33ca830 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Minor doc improvement to struct StgAsyncIOOp member outcome
Mention the enumeration names, as well as their numeric values. The rest
of the code uses the enum names.
- - - - -
4edd2579 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Minor doc improvements for StgTSOBlockInfo
Clarify that certain union members are used only by certain legacy
I/O managers. Hopefully we will be able to remove these at some point.
- - - - -
536bedbb by Duncan Coutts at 2026-07-18T08:49:12-04:00
Avoid exporting various win32-specific rts symbols
The BeginPrivate.h / EndPrivate.h scheme works perfectly well on
Windows, but all of the rts/win32/*.h files were not using it.
- - - - -
8139b5ac by Duncan Coutts at 2026-07-18T08:49:12-04:00
Remove wakeupIOManager, ioManagerWakeup and setIOManagerWakeupFd
We no longer need wakeupIOManager for the threaded RTS case, so we can
remove it and the bits only needed to support it. This includes the
pipe/eventfd fd shared between the RTS and the in-library I/O manager
used for waking up the I/O manager thread. The pipe/eventfd still
exists, but it no longer has to be communicated to the RTS, since the
RTS no longer needs to use it.
So we remove the RTS API export setIOManagerWakeupFd, and remove uses of
it within the I/O managers in ghc-internal.
- - - - -
74fe7c66 by Duncan Coutts at 2026-07-18T08:49:12-04:00
Add a new interruptIOManager API for the I/O managers
It will be used to interrupt awaitCompletedTimeoutsOrIO. Also update the
return type and docs for awaitCompletedTimeoutsOrIO to have it return
false when it gets interrupted, and have no useful post condition in
that case.
- - - - -
38792843 by Duncan Coutts at 2026-07-18T08:49:13-04:00
Add interruptIOManager support for select I/O manager
Uses the FdWakup mechanism.
- - - - -
2f3b00aa by Duncan Coutts at 2026-07-18T08:49:13-04:00
Add interruptIOManager support for poll I/O manager
Uses the FdWakup mechanism.
A quirk we have to cope with is that we now need to poll one more fd --
the wakeup_fd_r -- but this fd has no corresponding entry in the
aiop_table. This is awkward since we have set up our aiop_poll_table to
be an auxilliary table with matching indicies.
The solution this patch uses (and described in the comments) is to have
two tables: struct pollfd *aiop_poll_table, *full_poll_table;
and to have the aiop_poll_table alias the tail of the full_poll_table.
The head entry in the full_poll_table is the extra fd. So we poll the
full_poll_table, while the aiop_poll_table still has matching indicies
with the aiop_table.
Hurrah for C aliasing rules.
- - - - -
cee50131 by Duncan Coutts at 2026-07-18T08:49:13-04:00
Add interruptIOManager support for win32 legacy I/O manager
And remove unused related helper resetAbandonRequestWait. It is not
called because the event is created in auto-reset mode, so never needs
to be reset manually.
- - - - -
cf453143 by Duncan Coutts at 2026-07-18T08:49:13-04:00
Note lack of interruptIOManager support for WinIO I/O manager
Though there's a plausible design, we can't sanely test it at the moment
due to related WinIO bugs. Filed as issue #27403.
- - - - -
1b74a0ad by Duncan Coutts at 2026-07-18T08:49:13-04:00
Be more explicit about enum IOReadOrWrite values, and type within cmm
Belt and braces.
- - - - -
b388d093 by Brian McKenna at 2026-07-18T17:51:50-04:00
Ignore ticks in the pattern-match term oracle
The term-oracle in the pattern-match checker is keyed by a canonical
form of the scrutinee, computed by `makeDictsCoherent`. That canonical
form was tick-sensitive: two occurrences of an otherwise identical
expression that happened to carry different ticks were treated as
distinct values, breaking long-distance information.
This shows up in practice under `-finfo-table-map`, because the
desugarer wraps every record-selector use site in a `SourceNote`
carrying that site's span. For example:
data Box = Box { unBox :: Maybe Int }
f b = case unBox b of
Nothing -> 0
Just _ -> let Just x = unBox b in x
The two `unBox b` expressionss carry different SourceNote spans, the
pattern-match checker sees them as different, the long-distance
information from the outer `Just _` branch never reaches the
let-pattern, and `Just x = unBox b` is wrongly reported as
non-exhaustive.
We now strip all ticks in `makeDictsCoherent`. This is documented as
Wrinkle (UD1) of Note [Unique dictionaries in the TmOracle CoreMap].
Fixes #27314
- - - - -
c23e1acb by Mrjtjmn at 2026-07-18T17:52:45-04:00
Add explanations for unsolved Typeable constraints
This commit adds explanations for unsolved 'Typeable' constraints.
GHC will now provide additional explanations for an unsolved constraint
of the form 'Typeable ty', explain why GHC did not solve Typeable constraint.
e.g.:
- 'ty' is a polymorphic type (e.g. forall a. a -> a)
- 'ty' is a qualified type (e.g. Eq Int => Int)
- 'ty' is an unboxed sum type
- 'ty' is an unreduced type family application
- 'ty' whose kind is not typeable
Fixes #26532
- - - - -
cbef021e by Artem Pelenitsyn at 2026-07-19T07:49:55-04:00
ghc-internal: Lock.hs: fix typo and indentation
- - - - -
42918646 by Duncan Coutts at 2026-07-19T07:50:36-04:00
Fix failing test GcStaticPointers for non-moving GC
Minor mistake in asserting something before checking for that same
thing.
Specifically, Bdescr asserts HEAP_ALLOCED_GC, but Bdescr was being used
prior to a guard that checks HEAP_ALLOCED_GC. The solution is just to
move the use of Bdescr after the guard.
Thanks to Simon Jakobi for identifying the problem.
- - - - -
c2f6dcd4 by Sasha Bogicevic at 2026-07-20T10:31:56+02:00
Improve error messages for invalid record wildcards
Record wildcard hints are now shown in more contexts and include
constructor arity; matching with `..` on a fieldless constructor
now produces a dedicated error message.
Fixes #21101
- - - - -
4c02e76b by Duncan Coutts at 2026-07-21T10:37:21-04:00
Mark test T27105 as fragile, citing issue #27522
Scheduler fairness is fine, except when it isn't. And it isn't on CI
machines surprisingly often! See the issue for details.
- - - - -
43dd2b15 by Recursion Ninja at 2026-07-21T17:09:53-04:00
Resolving many TTG related orphan type-class instances
This is part a technical debt removal effort made possible now
that separating out the AST via TTG has come to a close.
As the AST in 'L.H.S' has been incrementally separated from the GHC internals,
there are many accumulated orphan instance of 'Binary', 'NFData', 'Outputable',
and 'Uniquable'. The orphan instance of data-types from within 'L.H.S' have had
their orphan instances moved to either:
1. The module which defines the data-type
2. The module which defines the type-class;
i.e. moving an orphan 'Binary' instance to 'GHC.Utils.Binary'
Orphan instances resolved (37):
| Data-type | Resolved instance(s) | Former orphan module(s) |
| -------------------- | -------------------------- | ------------------------- |
| Role | Binary, NFData, Outputable | GHC.Core.Coercion.Axiom |
| SrcStrictness | Binary, NFData, Outputable | GHC.Core.DataCon |
| SrcUnpackedness | Binary, NFData, Outputable | GHC.Core.DataCon |
| Fixity | Binary, Outputable | GHC.Hs.Basic |
| FixityDirection | Binary, Outputable | GHC.Hs.Basic |
| LexicalFixity | Outputable | GHC.Hs.Basic |
| CCallTarget | NFData | GHC.Hs.Decls.Foreign |
| CType | NFData | GHC.Hs.Decls.Foreign |
| Header | NFData | GHC.Hs.Decls.Foreign |
| OverlapMode | Binary, NFData | GHC.Hs.Decls.Overlap |
| WithHsDocIdentifiers | NFData, Outputable | GHC.Hs.Doc |
| HsDocString | NFData | GHC.Hs.DocString |
| HsDocStringChunk | Binary, Outputable | GHC.Hs.DocString |
| HsDocStringDecorator | Binary, Outputable | GHC.Hs.DocString |
| NamespaceSpecifier | Outputable | GHC.Hs.ImpExp |
| ForAllTyFlag | Binary, NFData, Outputable | GHC.Hs.Specificity |
| Specificity | Binary, NFData | GHC.Hs.Specificity |
| PromotionFlag | Binary, Outputable | GHC.Types.Basic |
| FieldLabelString | Outputable, Uniquable | GHC.Types.FieldLabel |
| InlinePragma | Binary | GHC.Types.InlinePragma |
-------------------------
Metric Decrease:
hard_hole_fits
-------------------------
Closes #21262, #27469
- - - - -
ab9ab895 by Cheng Shao at 2026-07-21T17:10:53-04:00
rts: always use StgInt to represent cost center id
Currently cost center id is modeled as `Int` and it should be `StgInt`
uniformly in the RTS, hence this patch. Fixes #27524.
- - - - -
94d8f83b by Cheng Shao at 2026-07-22T11:30:40-04:00
hadrian: clean up stale cabal package flags in the tree
This patch cleans up stale cabal package flags in the tree and related
hadrian/autoconf logic. Closes #27474.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
0bf1d8c9 by Sasha Bogicevic at 2026-07-22T11:31:21-04:00
parser: don't suggest ImportQualifiedPost when it is already enabled
-Wprepositive-qualified-module unconditionally attached a hint to
enable ImportQualifiedPost, even when the extension was already on
(as it is by default under GHC2021). Record the extension's state in
the PsWarnImportPreQualified diagnostic and drop the hint when it is
already enabled.
Fixes #27380
- - - - -
700a1dd1 by Simon Jakobi at 2026-07-23T11:21:20-04:00
ci: Reduce lint job setup costs
Avoid fetching unnecessary history and submodules for lightweight lint
jobs. Run changelog validation without Hadrian.
Because the lint-author job is now based on the .lint template directly,
we enhance it to allow Git to read from the runner-owned checkouts,
In the previously used .lint-params template, this permissions issue was
addressed via `chown`.
Closes #27521.
Assisted-by: gpt-5.6-sol via Codex CLI
- - - - -
26a44fb0 by ARATA Mizuki at 2026-07-23T11:22:10-04:00
testsuite: Fix memory issues of doublex2_* and simd010
doublex2_* had reads from uninitialized memory.
simd010 had out-of-bounds array access.
Fixes #27544
- - - - -
4d798b17 by Duncan Coutts at 2026-07-23T17:26:18-04:00
Eliminate STM_AWOKEN
It was used as nullary closure for the block_info.closure in the case of
a thread being awoken after an STM transaction.
However, while it was written, it was never read, so contributed nothing
to the behaviour. Furthermore, in the only place it was set (in
tryWakeupThread) the why_blocked was immediately overwritten by the
NotBlocked status, and the block_info was updated accordingly (by
appendToRunQueue).
So it didn't even serve a purpose of clarifying an intermediate state,
there really was no such intermediate state.
Cleaning this up will allow the BlockedOnSTM case to follow the same
pattern as the other why_blocked cases that do not use the block_info,
and in turn this reduces the number of different categories.
- - - - -
e1cece79 by Duncan Coutts at 2026-07-23T17:26:18-04:00
Document that eventlog thread stop code ThreadBlocked is no longer used
It has not been used since GHC 7.0.x (2011). In 7.2 all the BlockedOn*
codes were added, and these were and are used instead of ThreadBlocked.
- - - - -
795db115 by Duncan Coutts at 2026-07-23T17:26:18-04:00
Add a proper mapping to eventlog external thread stop status
That is the mapping from rts-internal codes, to the coes used in the
status field in the eventlog EVENT_STOP_THREAD event.
See issue #9003 for what goes wrong when we mess this up. In that
ticket, people note that we should really not require the internal
tso->why_blocked codes to leak into the external eventlog thread stop
codes. The same principle applies to the StgThreadReturnCode.
This change properly separates them, and explicitly maps between them
using a pair of (compact, constant) tables. These tables are pretty
small (with no alignment constraints) and will soon shrink so it seems
a sensible tradeoff.
We also introduce and use proper EVENT_STOP_THREAD constants in the
event log format header. Previously there was not specification in the
code for these (only in the docs): the values were encoded into the
conversion code.
This will allow us to renumber the internal why_blockd codes without
breaking the eventlog output.
- - - - -
6f1c8efa by Duncan Coutts at 2026-07-23T17:26:18-04:00
Remove unused tso->block_info.wakeup member
Presumably it was used once, but not now.
- - - - -
740b88a9 by Duncan Coutts at 2026-07-23T17:26:18-04:00
Document StgTSOBlockInfo to say what cases use what members
In principle, tso->why_blocked is the tag for the StgTSOBlockInfo union,
so we should be able to say for each union member the why_blocked cases
that use that member.
- - - - -
5b92eae2 by Duncan Coutts at 2026-07-23T17:26:18-04:00
Add a tso->block_info.mvar member and use it
in preference to the generic block_info.closure union member, with
casts.
The plan is that when we know what case we're in (via tso->why_blocked)
then we can always access the correct union member, and so we will only
need to access block_info.closure for generic cases where we don't know
or don't care.
- - - - -
d931715f by Duncan Coutts at 2026-07-23T17:26:18-04:00
Add a tso->block_info.unused member and use it
in preference to the generic block_info.closure union member, with
casts.
The plan is that when we know what case we're in (via tso->why_blocked)
then we can always access the correct union member, and so we will only
need to access block_info.closure for generic cases where we don't know
or don't care.
- - - - -
47e28ebb by Duncan Coutts at 2026-07-23T17:26:18-04:00
Avoid storing to tso->block_info.closure
In one case we can use a specific union member (.prev) instead. In
several cases the stores were in fact redundant because of subsequent
overwrites.
In scavengeTSO we replace setting tso->block_info.closure to a valid
closure, with an assertion that the block_info.unused is already set to
END_TSO_QUEUE which is a valid (static) closure.
- - - - -
96e4749d by Duncan Coutts at 2026-07-23T17:26:18-04:00
Renumber the tso->why_blocked constants
We can do this now because we have separated the internal values from
the external ones used in the eventlog.
This lets us put them back into a deliberate order and consolodate some
gaps.
More importantly, it is a prepation for a slightly more sophisticated
encoding.
- - - - -
8f62661c by Duncan Coutts at 2026-07-23T17:26:18-04:00
Define constants for the existing stg_threadStatuszh return codes
The stg_threadStatuszh reuses the internal tso->why_blocked codes but
also extends them with a couple previously magic values. This is awkward
since we need to know what those magic values are so we don't
accidentally use those values to mean something else. By pulling a
definition up to where the why_blocked codes are defined we will be able
to avoid mistakenly assining those codes some meaning (or just changing
the BlockedThreadComplete, BlockedThreadKilled code if necessary).
- - - - -
42c69ae2 by Duncan Coutts at 2026-07-23T17:26:18-04:00
Extend the tso->why_blocked encoding to indicate block_info closures
We use some bit tricks to cheaply and generically test if a
tso->why_blocked tag implies that the corresponding tso->block_info will
contain a non-trivial valid closure (i.e. not just block_info.unused set
to END_TSO_QUEUE).
In particular we arrange for most why_blocked values to naturally have a
distinguishing bit, but for the BlockedOn{Read,Write,Delay} cases, they
can come in either non-closure or closure forms. We allow an additional
bit to distinguish these cases. The non-closure forms are only from
legacy I/O managers: select and win32-legacy. So this extra bit
mechanism will be able to be retired once the legacy I/O managers are
themselves retired.
This means in a few places we need to untag the why_blocked value before
inspecting it, but in most places we do not.
- - - - -
7c64632b by Duncan Coutts at 2026-07-23T17:26:18-04:00
Use BlockInfoForceNonClosure in the select I/O manager
- - - - -
8fd7104a by Duncan Coutts at 2026-07-23T17:26:18-04:00
Use BlockInfoForceNonClosure in the win32-legacy I/O manager
for the BlockedOn{Read,Write} since these use the non-heap allocated
StgAsyncIOResult.
- - - - -
e0da603b by Duncan Coutts at 2026-07-23T17:26:18-04:00
Enforce the why_blocked and block_info rules in checkTSO
We now check the cases wher IsBlockInfoClosure should hold, the cases
that are supposed to use block_info.unused == END_TSO_QUEUE, and which
cases are allowed to use BlockInfoForceNonClosure.
This partially enforces the use of why_blocked as a tag for the
block_info union. We could be stricter and check for the correct
expected info table for the closure cases.
- - - - -
1dd0f381 by Duncan Coutts at 2026-07-23T17:26:18-04:00
Use IsBlockInfoClosure to simplify several tests
In GC and generic traversal we need to know if we should look at the
block_info.closure or not. Now we can do just that using a cheap bit
test on the why_blocked tag.
This fixes issue 26717, where the problem was that some GC modes did not
know when to look at block_info.closure, because the poll I/O manager
uses a closure for BlockedOn{Read,Write} while the select I/O manager
uses a non-closure. Now this information is in the why_blocked tag
itself.
- - - - -
7a00ffbc by Duncan Coutts at 2026-07-23T17:26:18-04:00
Remove the now-unused scavengeTSOIOManager
The GC no longer has to delegate to the I/O manager, since it can use
IsBlockInfoClosure to decide things itself.
- - - - -
522a481f by Duncan Coutts at 2026-07-23T17:26:18-04:00
Remove duplicate assertion
- - - - -
0874d965 by Duncan Coutts at 2026-07-23T17:26:18-04:00
Follow atomic access rules more consistently for tso->why_blocked
The rule is this:
store block_info *before* why_blocked
store why_blocked using store release
load why_blocked using load acquire
load block_info *after* why_blocked
This is a an atomic store release / load acquire pair and (if the reads
are in a separate thread to the writes, and the read receives the value
stored) then this guarantees a full "happens before" relationship of
these stores and loads.
In some cases, we do not need a full load acquire, because we don't read
the block_info at all and so do not need any ordering. In this case we
just need an atomic relaxed load.
This was being followed in most places, but not all. If there's good
reason in any case that we don't need atomic access, then we should
document that in a comment. In the absence of that I think it's easier
to follow the rule everywhere.
- - - - -
8f0bdbe1 by Duncan Coutts at 2026-07-23T17:26:19-04:00
Add a changelog entry
- - - - -
4fdfe757 by Alan Zimmerman at 2026-07-23T17:27:06-04:00
EPA: Keep decls together in ClassDecl
Similar to 1718230f4d3d19d8c49c0e5d496cb0fb6f399528 for HsValBindsLR,
this commit updates ClassDecl so that it no longer splits out the
assorted `LHsDecl GhcPs` until the renamer.
It does this by inserting a type family (separate from the classic TTG one) for this.
So
data TyClDecl
...
| ClassDecl {
...
tcdDecls :: XClassDecls pass
with
type instance XClassDecls GhcPs = [LHsDecl GhcPs]
type instance XClassDecls GhcRn = ClassDeclX GhcRn
type instance XClassDecls GhcTc = ClassDeclX GhcTc
data ClassDeclX pass
= ClassDeclX { tcdSigs :: [LSig pass], -- ^ Methods' signatures
tcdMeths :: LHsBinds pass, -- ^ Default methods
tcdATs :: [LFamilyDecl pass], -- ^ Associated types;
tcdATDefs :: [LTyFamDefltDecl pass], -- ^ Associated type defaults
tcdDocs :: [LDocDecl pass] -- ^ Haddock docs
}
- - - - -
f586c885 by Simon Jakobi at 2026-07-24T18:05:00-04:00
ci: Use shallow submodule clones by default
Limit submodule clones to depth one to reduce CI checkout costs. Keep
fetching full submodule history for the submodule lint jobs, which
inspect commits across a range.
Assisted-by: gpt-5.6-sol via Codex CLI
- - - - -
306120d2 by Duncan Coutts at 2026-07-24T18:05:43-04:00
Fix flaky test T3994 on FreeBSD
On current FreeBSD versions, calling getpgid on a zombie process fails.
In T3994, if we're really unlucky with delays and scheduling then we can
end up in exactly that situation.
Just catch that specific exception and ignore it. It's rare, and not our
fault.
- - - - -
7b116a0b by Cheng Shao at 2026-07-24T18:06:24-04:00
ci: add missing workaround for docker permissions in lint jobs
Some lint jobs use ci-images with default user `ghc`, and the gitlab
ci docker executor requires the `sudo chown` workaround to fix
workspace directory permission issue. This patch adds the missing
workarounds for the lint jobs. Fixes #27554.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
815149f3 by Andrzej Rybczak at 2026-07-25T15:06:43+00:00
Add -Wdefaulted-callstack
Adds a new warning, -Wdefaulted-callstack, which warns when an implicit
CallStack parameter is defaulted to the empty stack. In particular, this
includes call sites where a function with a HasCallStack constraint is called
from a definition that does *not* provide one. At such call sites the call stack
is cut off and does not include the enclosing definition's callers, which can be
a source of surprise if the user wants complete call stacks.
Closes #27077.
- - - - -
f6f2343f by Zubin Duggal at 2026-07-25T17:40:51-04:00
UniqueDFM: alter should preserve insertion order
Before it always inserting new elements at the end.
This is problematic because instances get inserted into the map with
`alterF`, which can change ordering of how instances are printed
with `:info` depending on the order in which we consult interfaces
I expect `alter id k = id` and `alter (fmap f) k = adjust f k`. Moving keys to
the end breaks that (`adjust` already preserves position).
Fixes #27532
- - - - -
5d0ab71a by fendor at 2026-07-27T17:31:05-04:00
Introduce global unit database cache
As a first step for better sharing of `UnitInfo` across `UnitEnv`,
we introduce a new datatype called `ExternalUnitDatabases`.
It primarily serves as an in-memory representation of *all*
`UnitDatabase`s across `UnitEnv`. This means, if multiple `HomeUnitEnv`s
depend on the same database, one way or another, we make sure that we
don't parse from disk every time.
Instead, we store the in-memory representation in `ExternalUnitDatabases`.
`ExternalUnitDatabaseCache` is the equivalent of `ExternalUnitState` in
the `UnitEnv`. It is a mutable variable wrapping `ExternalUnitDatabases`.
The mutable `ExternalUnitDatabaseCache` is used in `initUnits` to make
sure we don't parse the same unit database multiple times.
Almost by accident, we change the semantics of `initUnits` to honour
modifications to `packageDBFlags`.
The inability to change `packageDBFlags` while also reusing the already
parsed `UnitDatabase`s was reported in #26423 as a bug.
Hence, we think this behaviour change is warranted and acceptable,
especially since it comes with a breaking change to the `initUnits` API.
Add regression test for #26423
Closes #26423
- - - - -
6cce494a by fendor at 2026-07-27T17:31:05-04:00
Introduce UnitIndex for global external unit caching
`UnitInfo`s have been observed to cause a lot of memory usage in #27500.
Especially with multiple home units, as the same (external) units are
processed from scratch, even though most of the time we end up with
exactly the same `UnitInfo`.
We introduce a `UnitEnv` global cache that allows us to store external
unit information that is used across all `HomeUnitEnv`s.
The most important change in this commit is the introduction of the `UnitIndex`.
It stores a global mapping of `UnitId` -> `UnitInfo`, and `initUnits`
always uses the cached `UnitInfo` entry to populate each
`HomeUnitEnv`'s `UnitState`.
This allows us to ensure the following property:
> Each `UnitInfo` should be alive exactly once in GHC.
All `UnitState`s should reference 'UnitInfo's stored in the 'UnitIndex'.
This ensured by calling 'initUnits' with the 'UnitIndex'.
In addition, the `ExternalUnitDatabases` may also hold a reference
to each on-disk representation of `UnitInfo`.
This means, we impose an hard upper bound on the number of `UnitInfo`s
alive in the GHC session:
> The number of alive `UnitInfo`s closure objects must be the
> sum of all loaded unit database times two.
We add performance regression tests that make sure the number of live
`UnitInfo` cannot exceed this threshold.
Closes #27500
-------------------------
Metric Decrease:
MultiComponentModules
MultiComponentModulesRecomp
MultiComponentModulesRecomp100
mhu-perf
LinkableUsage02
-------------------------
These metrics increases are especially notable, as we are not even
sharing anything big but merely the global package database with 50
entries.
It shows how careful sharing of `UnitInfo` can improve memory usage.
We expect this to be much more notable when the whole cabal package
database is shared across multiple home units.
`LinkableUsage02` metric decreases on unreg and i386 platform, only.
---
Technical details
To share the `UnitInfo`s correctly, it is important that we extract
the `WireMap` into the `UnitIndex`. At the moment of writing, `WireMap`
must be globally the same for all `HomeUnitEnv`s.
This is important, as we could otherwise not cache the "fully-resolved"
`UnitInfo`, as we don't change the `UnitId` or `unitAbiHash` when
resolving wired-in units. Thus, there could be ambiguities, when the
`WireMap` is not the same for all `UnitState`s across the `UnitEnv`.
We consider a `UnitInfo` fully-resolved, if wired-in units have been
updated, the `UnitInfo` has been validated and variables in the unit
config, such as `${pkgroot}` have been resolved.
Updating the wired-in units requires the `WireMap` to be globally the
same.
- - - - -
f8e3bee9 by Zubin Duggal at 2026-07-27T17:31:49-04:00
testsuite: skip runtime stats tests on debugged compilers
Debugged flavours build the boot libraries without optimisation, so the
runtime numbers do not match the baselines.
- - - - -
1e326770 by Zubin Duggal at 2026-07-27T17:31:50-04:00
testsuite: mark #20706 tests fragile rather than broken
Whether the static linux linker issues manifest depends on the host
toolchain.
- - - - -
c0b13cbe by Zubin Duggal at 2026-07-27T17:31:50-04:00
testsuite: exclude libnuma from mostly-static
It needs static system libraries (libnuma.a) that many platforms do not
ship.
Fixes #26914
- - - - -
6f0cc851 by Andreas Klebinger at 2026-07-28T14:08:54+02:00
rts: LoadArchive/LoadObj - refactor/improvements:
Properly handle AArch64 COFF bigobj files by relying
on the PE-linker specific object identification rather doing
adhoc magic number checks.
Rather than doing adhoc magic number checking in odd places
we know always call verifyAndInitOc on ObjectCode which does
those checks in one place.
We now properly recognize all of the MachO index sections (__SYMDEF*).
Drop the MAchoMisalignment business. It's not needed we align individual
sections when loading them.
Clean up the windows Importlib detection logic a bit.
Fixes #26231
- - - - -
1e9a81cd by Andreas Klebinger at 2026-07-28T14:10:19+02:00
Fix riscv use of misalignment field.
- - - - -
377 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- + changelog.d/21101
- + changelog.d/27380
- + changelog.d/27532
- + changelog.d/T26423
- + changelog.d/T26532
- + changelog.d/T26716
- + changelog.d/T27314.md
- + changelog.d/T27329
- + changelog.d/T27360
- + changelog.d/T27374
- + changelog.d/T27456
- + changelog.d/fix-cmm-atomic-load-store
- + changelog.d/fix-make-install-j
- + changelog.d/fix-use-std-ap-thunk
- + changelog.d/rts-loader-refactor.md
- + changelog.d/unit-index
- + changelog.d/warn-defaulted-callstack
- compiler/GHC.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Core/Coercion/Axiom.hs
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Config/StgToCmm.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Main/Hsc.hs
- compiler/GHC/Driver/Main/Interactive.hs
- compiler/GHC/Driver/Main/Passes.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Driver/Session/Units.hs
- compiler/GHC/Hs/Basic.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Decls/Overlap.hs
- compiler/GHC/Hs/Doc.hs
- compiler/GHC/Hs/DocString.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/Hs/Instances.hs
- − compiler/GHC/Hs/Specificity.hs
- compiler/GHC/Hs/Stats.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Docs.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Pmc/Solver.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Parser/Annotation.hs
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Parser/PostProcess/Haddock.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Eval.hs
- compiler/GHC/StgToCmm/Bind.hs
- compiler/GHC/StgToCmm/Config.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Instance/Typeable.hs
- compiler/GHC/Tc/Solver/Default.hs
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/TyCl/Class.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Types/Rank.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/FieldLabel.hs
- compiler/GHC/Types/Fixity.hs
- compiler/GHC/Types/ForeignCall.hs
- compiler/GHC/Types/GREInfo.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/InlinePragma.hs
- compiler/GHC/Types/Unique.hs
- compiler/GHC/Types/Unique/DFM.hs
- compiler/GHC/Types/Var.hs
- compiler/GHC/Unit/Env.hs
- + compiler/GHC/Unit/External/Database.hs
- + compiler/GHC/Unit/External/Index.hs
- + compiler/GHC/Unit/External/ModuleOrigin.hs
- + compiler/GHC/Unit/External/Providers.hs
- + compiler/GHC/Unit/External/Query.hs
- + compiler/GHC/Unit/External/Substitution.hs
- + compiler/GHC/Unit/External/Validate.hs
- + compiler/GHC/Unit/External/Visibility.hs
- + compiler/GHC/Unit/External/Wired.hs
- compiler/GHC/Unit/Home/Graph.hs
- compiler/GHC/Unit/Info.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Unit/State.hs-boot
- compiler/GHC/Unit/Types.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Binds.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/Language/Haskell/Syntax/Decls/Foreign.hs
- compiler/Language/Haskell/Syntax/Doc.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/ImpExp.hs
- compiler/Language/Haskell/Syntax/Specificity.hs
- compiler/ghc.cabal.in
- configure.ac
- distrib/configure.ac.in
- docs/users_guide/eventlog-formats.rst
- docs/users_guide/expected-undocumented-flags.txt
- docs/users_guide/exts/rank_polymorphism.rst
- docs/users_guide/exts/static_pointers.rst
- docs/users_guide/using-warnings.rst
- ghc/GHCi/UI.hs
- hadrian/bindist/Makefile
- hadrian/cabal.project
- hadrian/cfg/system.config.host.in
- hadrian/cfg/system.config.target.in
- hadrian/src/Oracles/Flag.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/Test.hs
- hadrian/src/Settings/Packages.hs
- libraries/base/changelog.md
- libraries/base/src/GHC/Stack.hs
- libraries/base/src/System/Environment.hs
- libraries/base/tests/T15349.stderr
- libraries/ghc-heap/GHC/Exts/Heap/FFIClosures_ProfilingDisabled.hsc
- libraries/ghc-heap/GHC/Exts/Heap/FFIClosures_ProfilingEnabled.hsc
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Conc/Sync.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Control.hs
- libraries/ghc-internal/src/GHC/Internal/Event/Manager.hs
- libraries/ghc-internal/src/GHC/Internal/Event/TimerManager.hs
- libraries/ghc-internal/src/GHC/Internal/Exception/Type.hs
- libraries/ghc-internal/src/GHC/Internal/IO/Handle/Lock.hs
- libraries/ghc-internal/src/GHC/Internal/Stack.hs
- libraries/ghc-internal/tests/backtraces/T14532b.stdout
- m4/fp_check_pthreads.m4
- nofib
- rts/Capability.c
- rts/Capability.h
- rts/ContinuationOps.cmm
- rts/IOManager.c
- rts/IOManager.h
- rts/IOManagerInternals.h
- rts/Linker.c
- rts/LinkerInternals.h
- rts/Messages.c
- rts/PrimOps.cmm
- rts/Profiling.c
- rts/RaiseAsync.c
- rts/RaiseAsync.h
- rts/RtsStartup.c
- rts/RtsSymbols.c
- rts/STM.c
- rts/Schedule.c
- rts/Schedule.h
- rts/StgMiscClosures.cmm
- rts/Threads.c
- rts/Trace.c
- rts/Trace.h
- rts/TraverseHeap.c
- rts/eventlog/EventLog.c
- rts/eventlog/EventLog.h
- rts/include/Cmm.h
- rts/include/rts/Constants.h
- rts/include/rts/EventLogFormat.h
- rts/include/rts/IOInterface.h
- rts/include/rts/storage/Closures.h
- rts/include/rts/storage/TSO.h
- rts/include/stg/MiscClosures.h
- rts/linker/LoadArchive.c
- rts/linker/LoadNativeObjPosix.c
- rts/linker/MachO.c
- rts/linker/MachO.h
- rts/linker/PEi386.c
- rts/linker/SymbolExtras.c
- rts/linker/elf_reloc_riscv64.c
- rts/posix/FdWakeup.h
- + rts/posix/MIO.c
- + rts/posix/MIO.h
- rts/posix/Poll.c
- rts/posix/Poll.h
- rts/posix/Select.c
- rts/posix/Select.h
- rts/posix/Signals.c
- rts/posix/Signals.h
- rts/posix/Timeout.c
- rts/posix/Timeout.h
- rts/rts.cabal
- rts/sm/Compact.c
- rts/sm/NonMovingMark.c
- rts/sm/Sanity.c
- rts/sm/Scav.c
- rts/win32/AsyncMIO.c
- rts/win32/AsyncMIO.h
- rts/win32/AsyncWinIO.h
- rts/win32/AwaitEvent.c
- rts/win32/AwaitEvent.h
- rts/win32/ConsoleHandler.h
- rts/win32/MIOManager.h
- rts/win32/ThrIOManager.h
- rts/win32/WorkQueue.h
- rts/win32/veh_excn.h
- testsuite/driver/testlib.py
- testsuite/tests/backpack/should_compile/T13149.bkp
- testsuite/tests/cmm/should_run/AtomicFetch.hs
- testsuite/tests/cmm/should_run/AtomicFetch_cmm.cmm
- testsuite/tests/codeGen/should_run/cgrun025.stderr
- testsuite/tests/concurrent/should_run/T27105.hs
- testsuite/tests/concurrent/should_run/all.T
- + testsuite/tests/corelint/T27374.hs
- testsuite/tests/corelint/all.T
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/determinism/determ017/A.hs
- + testsuite/tests/driver/T26423/Hello.hs
- + testsuite/tests/driver/T26423/Makefile
- + testsuite/tests/driver/T26423/T26423.hs
- + testsuite/tests/driver/T26423/T26423.stderr
- + testsuite/tests/driver/T26423/T26423.stdout
- + testsuite/tests/driver/T26423/all.T
- + testsuite/tests/driver/T26423/test/Test.hs
- + testsuite/tests/driver/T26423/test/test.pkg
- + testsuite/tests/driver/TUnitInfo/Foo.hs
- + testsuite/tests/driver/TUnitInfo/Makefile
- + testsuite/tests/driver/TUnitInfo/all.T
- + testsuite/tests/driver/TUnitInfo/genMhu.sh
- + testsuite/tests/driver/TUnitInfo/generic-unit-info-space-mhu.stdout
- + testsuite/tests/driver/TUnitInfo/generic-unit-info-space-single.stdout
- + testsuite/tests/driver/TUnitInfo/generic-unit-info-space.hs
- + testsuite/tests/driver/TUnitInfo/generic-unit-info-space.stdout
- testsuite/tests/driver/all.T
- testsuite/tests/driver/mostly-static/Makefile
- testsuite/tests/exceptions/T26759.stderr
- testsuite/tests/ghc-e/should_fail/T18441fail7.stderr
- testsuite/tests/ghci/T13786/all.T
- testsuite/tests/ghci/T16793/T16793.stdout
- testsuite/tests/ghci/T18060/T18060.stdout
- + testsuite/tests/ghci/T27532/Makefile
- + testsuite/tests/ghci/T27532/T27532.stdout
- + testsuite/tests/ghci/T27532/T27532j4.stdout
- + testsuite/tests/ghci/T27532/a.script
- + testsuite/tests/ghci/T27532/all.T
- + testsuite/tests/ghci/T27532/b.script
- + testsuite/tests/ghci/T27532/genT27532Modules
- testsuite/tests/ghci/linking/all.T
- testsuite/tests/ghci/linking/dyn/all.T
- testsuite/tests/ghci/scripts/ListTuplePunsPpr.stdout
- testsuite/tests/ghci/scripts/T12005.script
- testsuite/tests/ghci/scripts/T4175.stdout
- testsuite/tests/ghci/scripts/T8469.stdout
- testsuite/tests/ghci/scripts/T8535.stdout
- testsuite/tests/ghci/scripts/T9881.stdout
- testsuite/tests/ghci/scripts/bytecodeIPE.hs
- testsuite/tests/ghci/scripts/ghci020.stdout
- testsuite/tests/ghci/scripts/ghci064.stdout
- testsuite/tests/ghci/should_run/T10145.stdout
- testsuite/tests/ghci/should_run/T18594.stdout
- testsuite/tests/haddock/haddock_examples/haddock.Test.stderr
- testsuite/tests/haddock/perf/Fold.hs
- testsuite/tests/haddock/should_compile_flag_haddock/T17544.stderr
- testsuite/tests/haddock/should_compile_flag_haddock/T17544_kw.stderr
- testsuite/tests/indexed-types/should_fail/T7354.hs
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/layout/layout001.stdout
- testsuite/tests/layout/layout002.stdout
- testsuite/tests/layout/layout003.stdout
- testsuite/tests/layout/layout004.stdout
- testsuite/tests/layout/layout005.stdout
- testsuite/tests/layout/layout006.stdout
- testsuite/tests/layout/layout007.stdout
- testsuite/tests/layout/layout008.stdout
- testsuite/tests/layout/layout009.stdout
- testsuite/tests/linear/should_compile/T1735Min.hs
- testsuite/tests/mdo/should_fail/mdofail006.stderr
- + testsuite/tests/module/T27380.hs
- + testsuite/tests/module/T27380.stderr
- testsuite/tests/module/all.T
- testsuite/tests/module/mod184.stderr
- testsuite/tests/package/T20010/all.T
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpSemis.stderr
- + testsuite/tests/parser/should_compile/T13087.stderr
- testsuite/tests/parser/should_compile/T20452.stderr
- testsuite/tests/parser/should_fail/T8431.stderr
- testsuite/tests/parser/should_fail/readFail038.stderr
- testsuite/tests/partial-sigs/should_compile/ExtraConstraints3.stderr
- testsuite/tests/perf/compiler/T3064.hs
- testsuite/tests/plugins/all.T
- + testsuite/tests/pmcheck/should_compile/T27314.hs
- + testsuite/tests/pmcheck/should_compile/T27360.hs
- testsuite/tests/pmcheck/should_compile/all.T
- testsuite/tests/polykinds/T7594.hs
- testsuite/tests/printer/Test20297.stdout
- testsuite/tests/printer/Test24533.stdout
- testsuite/tests/process/T3994.hs
- testsuite/tests/programs/thurston-modular-arith/Main.hs
- + testsuite/tests/rename/should_fail/T21101.hs
- + testsuite/tests/rename/should_fail/T21101.stderr
- testsuite/tests/rename/should_fail/T9815.stderr
- testsuite/tests/rename/should_fail/T9815b.stderr
- testsuite/tests/rename/should_fail/T9815bghci.stderr
- testsuite/tests/rename/should_fail/T9815ghci.stderr
- testsuite/tests/rename/should_fail/all.T
- testsuite/tests/roles/should_compile/Roles14.stderr
- testsuite/tests/roles/should_compile/Roles3.stderr
- testsuite/tests/roles/should_compile/Roles4.stderr
- testsuite/tests/roles/should_compile/T8958.stderr
- testsuite/tests/rts/all.T
- testsuite/tests/rts/ipe/IpeStats/Fold.hs
- testsuite/tests/rts/linker/all.T
- testsuite/tests/runghc/T7859.stderr-mingw32
- testsuite/tests/simd/should_run/doublex2_arith.hs
- testsuite/tests/simd/should_run/doublex2_arith.stdout
- testsuite/tests/simd/should_run/doublex2_arith_baseline.hs
- testsuite/tests/simd/should_run/doublex2_arith_baseline.stdout
- testsuite/tests/simd/should_run/doublex2_fma.hs
- testsuite/tests/simd/should_run/doublex2_fma.stdout
- testsuite/tests/simd/should_run/simd010.hs
- testsuite/tests/simplCore/should_compile/T11562.hs
- testsuite/tests/simplCore/should_run/T3591.hs
- testsuite/tests/typecheck/should_compile/DeepSubsumption02.hs
- testsuite/tests/typecheck/should_compile/T12507.hs
- testsuite/tests/typecheck/should_compile/T13951.hs
- testsuite/tests/typecheck/should_compile/T18406b.stderr
- testsuite/tests/typecheck/should_compile/T18529.stderr
- testsuite/tests/typecheck/should_compile/T18920.hs
- testsuite/tests/typecheck/should_compile/T2595.hs
- testsuite/tests/typecheck/should_compile/T7541.hs
- + testsuite/tests/typecheck/should_compile/WarnDefaultedCallStack.hs
- + testsuite/tests/typecheck/should_compile/WarnDefaultedCallStack.stderr
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T15067.stderr
- + testsuite/tests/typecheck/should_fail/T26532.hs
- + testsuite/tests/typecheck/should_fail/T26532.stderr
- testsuite/tests/typecheck/should_fail/T5300.stderr
- testsuite/tests/typecheck/should_fail/T6069.stderr
- testsuite/tests/typecheck/should_fail/T7368a.hs
- testsuite/tests/typecheck/should_fail/T9858b.stderr
- testsuite/tests/typecheck/should_fail/TcStaticPointersFail02.stderr
- testsuite/tests/typecheck/should_fail/all.T
- testsuite/tests/typecheck/should_run/T1735_Help/Basics.hs
- testsuite/tests/typecheck/should_run/T3731-short.hs
- testsuite/tests/typecheck/should_run/T3731.hs
- testsuite/tests/typecheck/should_run/church.hs
- testsuite/tests/typecheck/should_run/tcrun008.hs
- testsuite/tests/typecheck/should_run/tcrun017.hs
- testsuite/tests/typecheck/should_run/tcrun026.hs
- testsuite/tests/typecheck/should_run/tcrun035.hs
- testsuite/tests/typecheck/should_run/tcrun036.hs
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Main.hs
- utils/check-exact/Transform.hs
- utils/check-exact/Utils.hs
- utils/deriveConstants/Main.hs
- utils/haddock/haddock-api/src/Haddock.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
- utils/haddock/haddock-api/src/Haddock/Types.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/74cc3f8e9d0b64fb014490343b0f96…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/74cc3f8e9d0b64fb014490343b0f96…
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
1
0
[Git][ghc/ghc][wip/sjakobi/T27368-ppr] Cmm: print unreachable blocks under -dppr-debug (#27368)
by Simon Jakobi (@sjakobi) 28 Jul '26
by Simon Jakobi (@sjakobi) 28 Jul '26
28 Jul '26
Simon Jakobi pushed to branch wip/sjakobi/T27368-ppr at Glasgow Haskell Compiler / GHC
Commits:
e013bb00 by Simon Jakobi at 2026-07-28T13:46:16+02:00
Cmm: print unreachable blocks under -dppr-debug (#27368)
Unreachable blocks linger in a CmmGraph's block map for most of the Cmm
pipeline, but pprCmmGraph only ever printed the blocks reachable from the
entry, so dumps looked consistent while the graph was not. Bugs like
#27368 were hard to debug due to this.
pprCmmGraph now appends the stored-but-unreachable blocks under a
"// unreachable blocks:" heading when -dppr-debug is on. Existing dumps are
unchanged. See Note [unreachable blocks] in GHC.Cmm.Pipeline.
Assisted-by: Claude Opus 5
- - - - -
7 changed files:
- + changelog.d/T27368-ppr-unreachable-cmm-blocks.md
- compiler/GHC/Cmm.hs
- compiler/GHC/Cmm/Pipeline.hs
- docs/users_guide/debugging.rst
- + testsuite/tests/cmm/should_compile/T27368-ppr-debug.cmm
- + testsuite/tests/cmm/should_compile/T27368-ppr-debug.stderr
- testsuite/tests/cmm/should_compile/all.T
Changes:
=====================================
changelog.d/T27368-ppr-unreachable-cmm-blocks.md
=====================================
@@ -0,0 +1,9 @@
+section: cmm
+issues: #27368
+synopsis:
+ Cmm dumps now show unreachable blocks under ``-dppr-debug``
+description:
+ Unreachable blocks stay in a Cmm graph's block map for most of the Cmm
+ pipeline, but ``-ddump-cmm-*`` only ever printed the blocks reachable from
+ the graph's entry. Adding ``-dppr-debug`` now appends the stored but
+ unreachable blocks, which makes bugs like #27368 visible in the dumps.
=====================================
compiler/GHC/Cmm.hs
=====================================
@@ -151,15 +151,24 @@ instance OutputableP Platform CmmGraph where
toBlockMap :: CmmGraph -> LabelMap CmmBlock
toBlockMap (CmmGraph {g_graph=GMany NothingO body NothingO}) = body
+-- | Print the blocks reachable from the entry, in reverse postorder. Under
+-- @-dppr-debug@ the blocks that are stored in the graph but unreachable are
+-- appended too; see Note [unreachable blocks] in "GHC.Cmm.Pipeline".
pprCmmGraph :: Platform -> CmmGraph -> SDoc
pprCmmGraph platform g
= text "{" <> text "offset"
- $$ nest 2 (vcat $ map (pdoc platform) blocks)
+ $$ nest 2 (vcat (map (pdoc platform) blocks) $$ unreachable)
$$ text "}"
- where blocks = revPostorder g
- -- revPostorder has the side-effect of discarding unreachable code,
- -- so pretty-printed Cmm will omit any unreachable blocks. This can
- -- sometimes be confusing.
+ where
+ blocks = revPostorder g
+
+ unreachable = getPprDebug $ \debug ->
+ if not debug || mapNull dead_blocks
+ then empty
+ else text "// unreachable blocks:"
+ $$ nest 2 (vcat $ map (pdoc platform) (mapElems dead_blocks))
+
+ dead_blocks = foldr (mapDelete . entryLabel) (toBlockMap g) blocks
revPostorder :: CmmGraph -> [CmmBlock]
revPostorder g = {-# SCC "revPostorder" #-}
=====================================
compiler/GHC/Cmm/Pipeline.hs
=====================================
@@ -350,13 +350,15 @@ _GLOBAL_OFFSET_TABLE_, regardless of which entry point we arrived via.
-}
-{- Note [unreachable blocks]
- ~~~~~~~~~~~~~~~~~~~~~~~~~
+{-
+Note [unreachable blocks]
+~~~~~~~~~~~~~~~~~~~~~~~~~
The control-flow optimiser sometimes leaves unreachable blocks behind
containing junk code. These aren't necessarily a problem, but
removing them is good because it might save time in the native code
generator later.
+To make unreachable blocks visible in -ddump-cmm-* output, add -dppr-debug.
-}
dumpGraph :: Logger -> Platform -> Bool -> DumpFlag -> String -> CmmGraph -> IO ()
=====================================
docs/users_guide/debugging.rst
=====================================
@@ -564,6 +564,11 @@ C-\- representation
These flags dump various phases of GHC's C-\- pipeline.
+Cmm dumps print the blocks reachable from a graph's entry, in reverse
+post-order. Blocks can linger in a graph without being reachable; adding
+:ghc-flag:`-dppr-debug` to any of these dump flags additionally prints those,
+under a ``// unreachable blocks:`` heading.
+
.. ghc-flag:: -ddump-cmm-verbose-by-proc
:shortdesc: Show output from main C-\- pipeline passes (grouped by proc)
:type: dynamic
@@ -574,9 +579,6 @@ These flags dump various phases of GHC's C-\- pipeline.
the chosen backend. Currently only the NCG backends runs
additional passes ( :ghc-flag:`-ddump-opt-cmm` ).
- Cmm dumps don't include unreachable blocks since we print
- blocks in reverse post-order.
-
.. ghc-flag:: -ddump-cmm-verbose
:shortdesc: Write output from main C-\- pipeline passes to files
:type: dynamic
=====================================
testsuite/tests/cmm/should_compile/T27368-ppr-debug.cmm
=====================================
@@ -0,0 +1,19 @@
+#include "Cmm.h"
+
+// The block "dead" is stored in the graph but no block branches to it, so it
+// only shows up in Cmm dumps under -dppr-debug.
+testUnreachable (W_ x)
+{
+ if (x > 0) {
+ goto live;
+ }
+ return (x);
+
+dead:
+ x = x + 42;
+ return (x);
+
+live:
+ x = x - 1;
+ return (x);
+}
=====================================
testsuite/tests/cmm/should_compile/T27368-ppr-debug.stderr
=====================================
@@ -0,0 +1 @@
+// unreachable blocks:
=====================================
testsuite/tests/cmm/should_compile/all.T
=====================================
@@ -13,6 +13,9 @@ test('T20725', normal, compile, ['-package ghc'])
test('T23610', normal, makefile_test, ['T23610'])
test('T24224', [cmm_src, grep_errmsg(r'(F64.*);', [1]), only_ways(['normal'])], compile, ['-no-hs-main -ddump-cmm -dsuppress-all -dsuppress-uniques'])
test('T24474', cmm_src, compile, ['-optc-g3'])
+# -dppr-debug makes stored-but-unreachable blocks visible in Cmm dumps (#27368)
+test('T27368-ppr-debug', [cmm_src, grep_errmsg(r'(// unreachable blocks:)', [1]), only_ways(['normal'])],
+ compile, ['-no-hs-main -ddump-cmm-verbose-by-proc -dppr-debug -dsuppress-uniques'])
test('T24474-cmm-gets-c-opts', cmm_src, compile, ['-optc-DFOO'])
test('T24474-cmm-opt-order', cmm_src, compile, ['-optc-DFOO '
'-optCmmP-UFOO '
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e013bb00ea1286f1b5e31d8f8d0f294…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e013bb00ea1286f1b5e31d8f8d0f294…
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
1
0
[Git][ghc/ghc][wip/jeltsch/textual-bytecode-output] Make `ibi_info_mod` rendered in quotes, like `bi_tick_mod`
by Wolfgang Jeltsch (@jeltsch) 28 Jul '26
by Wolfgang Jeltsch (@jeltsch) 28 Jul '26
28 Jul '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/textual-bytecode-output at Glasgow Haskell Compiler / GHC
Commits:
08ba2433 by Wolfgang Jeltsch at 2026-07-28T14:42:10+03:00
Make `ibi_info_mod` rendered in quotes, like `bi_tick_mod`
- - - - -
1 changed file:
- compiler/GHC/ByteCode/Show.hs
Changes:
=====================================
compiler/GHC/ByteCode/Show.hs
=====================================
@@ -222,7 +222,9 @@ pprInternalBreakpointID
-> SDoc -- ^ The textual information
pprInternalBreakpointID current_module InternalBreakpointId {..}
| ibi_info_mod == current_module = indexDoc
- | otherwise = indexDoc <+> text "in" <+> ppr ibi_info_mod
+ | otherwise = indexDoc <+>
+ text "in" <+>
+ quotes (ppr ibi_info_mod)
where
indexDoc :: SDoc
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/08ba243389dca17ff60bcc0797cf91c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/08ba243389dca17ff60bcc0797cf91c…
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
1
0
[Git][ghc/ghc][wip/9.14.2-backports] 2 commits: hadrian: add text and parsec to stage0Packages
by Zubin (@wz1000) 28 Jul '26
by Zubin (@wz1000) 28 Jul '26
28 Jul '26
Zubin pushed to branch wip/9.14.2-backports at Glasgow Haskell Compiler / GHC
Commits:
c506d4b4 by Zubin Duggal at 2026-07-28T17:10:17+05:30
hadrian: add text and parsec to stage0Packages
text depends on template-haskell-lift, and template-haskell-lift needs to be
built in tree rather than using the boot package, so `text` and `parsec` (which
depends on `text`) must also be built in tree rather than copied from the boot
pkgdb.
Also need to disable -simdutf for text when building the stage0 version, wasm backend
doesn't like -simdutf.
- - - - -
4f3b5006 by Zubin Duggal at 2026-07-28T17:11:11+05:30
Prepare 9.14.2
Bump filpath submodule to 1.5.5.0
Bump Win32 submodule to 2.14.2.2
Metric Increase:
T4029
T13379
haddock.base
libdir
Metric Decrease:
T5030
T24602_perf_size
T25046_perf_size_gzip
T25046_perf_size_unicode
T25046_perf_size_unicode_gzip
- - - - -
46 changed files:
- − changelog.d/26616
- − changelog.d/T26978
- − changelog.d/T26979
- − changelog.d/T27046
- − changelog.d/T27047
- − changelog.d/T27123.md
- − changelog.d/T27124.md
- − changelog.d/T27131
- − changelog.d/T27182.md
- − changelog.d/T27202
- − changelog.d/T27225
- − changelog.d/T27386
- − changelog.d/bump-process
- − changelog.d/deterministic-usage-order
- − changelog.d/fix-absent-dict-projection
- − changelog.d/fix-blackhole-handling
- − changelog.d/fix-cmm-atomic-load-store
- − changelog.d/fix-compacting-gc-ap-27434
- − changelog.d/fix-exponential-case-desugar-27383
- − changelog.d/fix-finalizers-27072
- − changelog.d/fix-layout-stack-fcall
- − changelog.d/fix-peekitbl-no-tntc
- − changelog.d/fix-use-std-ap-thunk
- − changelog.d/ghc-pkg-faster-closure
- − changelog.d/hadrian-stale-package-confs-26661
- − changelog.d/jobserver-leak-fix
- − changelog.d/more-efficient-home-unit-imports-finding
- − changelog.d/reexported-module-errors
- − changelog.d/semaphore-v2
- − changelog.d/tag-inference-27005
- − changelog.d/unused-type
- − changelog.d/wasm-fix-serviceworker
- − changelog.d/windows-rethrow-overlapped-exception
- configure.ac
- docs/users_guide/9.14.2-notes.rst
- hadrian/bootstrap/generate_bootstrap_plans
- + hadrian/bootstrap/plan-9_10_3.json
- + hadrian/bootstrap/plan-9_12_4.json
- + hadrian/bootstrap/plan-bootstrap-9_10_3.json
- + hadrian/bootstrap/plan-bootstrap-9_12_4.json
- hadrian/src/Settings/Default.hs
- hadrian/src/Settings/Packages.hs
- libraries/Win32
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/filepath
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b65eecce8258934bc0c23ae1f8a330…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b65eecce8258934bc0c23ae1f8a330…
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
1
0
[Git][ghc/ghc][wip/jeltsch/textual-bytecode-output] 2 commits: Correct layout
by Wolfgang Jeltsch (@jeltsch) 28 Jul '26
by Wolfgang Jeltsch (@jeltsch) 28 Jul '26
28 Jul '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/textual-bytecode-output at Glasgow Haskell Compiler / GHC
Commits:
cf1af5fb by Wolfgang Jeltsch at 2026-07-28T14:22:50+03:00
Correct layout
- - - - -
45fe5dfb by Wolfgang Jeltsch at 2026-07-28T14:38:40+03:00
Switch to indentation with two spaces
- - - - -
1 changed file:
- compiler/GHC/ByteCode/Show.hs
Changes:
=====================================
compiler/GHC/ByteCode/Show.hs
=====================================
@@ -11,19 +11,19 @@ import GHC.Prelude
-- Bytecode
import GHC.ByteCode.Types
(
- FFIInfo (..),
- BCONPtr (..),
- BCOPtr (..),
- UnlinkedBCO (..),
- ByteCodeHpcInfo (..),
- CompiledByteCode (..)
+ FFIInfo (..),
+ BCONPtr (..),
+ BCOPtr (..),
+ UnlinkedBCO (..),
+ ByteCodeHpcInfo (..),
+ CompiledByteCode (..)
)
import GHC.ByteCode.Breakpoints
(
- InternalBreakpointId (..),
- InternalBreakLoc (..),
- CgBreakInfo (..),
- InternalModBreaks (..)
+ InternalBreakpointId (..),
+ InternalBreakLoc (..),
+ CgBreakInfo (..),
+ InternalModBreaks (..)
)
import GHC.ByteCode.Binary (OnDiskModuleByteCode (..))
import GHC.ByteCode.Serialize (readOnDiskModuleByteCode)
@@ -45,17 +45,17 @@ import GHC.Utils.Binary (BinSrcSpan (..))
import GHC.Utils.Encoding.UTF8 (utf8DecodeShortByteString, utf8DecodeByteString)
import GHC.Utils.Outputable
(
- defaultDumpStyle,
- SDoc,
- text,
- (<>),
- (<+>),
- quotes,
- hsep,
- vcat,
- hang,
- withPprStyle,
- ppr
+ defaultDumpStyle,
+ SDoc,
+ text,
+ (<>),
+ (<+>),
+ quotes,
+ hsep,
+ vcat,
+ hang,
+ withPprStyle,
+ ppr
)
import GHC.Unit.Types (Module)
import GHC.Iface.Type (IfaceType, IfaceTvBndr, IfaceIdBndr)
@@ -77,20 +77,20 @@ import Numeric (showHex)
-- | Outputs textual information about the contents of a bytecode file.
showByteCode :: Logger -> HscEnv -> FilePath -> IO ()
showByteCode logger env path = do
- byteCode <- readOnDiskModuleByteCode env path
- logMsg logger
- MCDump
- noSrcSpan
- (withPprStyle defaultDumpStyle $ pprOnDiskModuleByteCode byteCode)
+ byteCode <- readOnDiskModuleByteCode env path
+ logMsg logger
+ MCDump
+ noSrcSpan
+ (withPprStyle defaultDumpStyle $ pprOnDiskModuleByteCode byteCode)
-- | Constructs textual information about the contents of a bytecode file.
pprOnDiskModuleByteCode :: OnDiskModuleByteCode -> SDoc
pprOnDiskModuleByteCode OnDiskModuleByteCode {..}
- = vcat [
- pprModuleIdent $ odgbc_module,
- pprOnDiskModuleByteCodeHash $ odgbc_hash,
- pprCompiledByteCode odgbc_module $ odgbc_compiled_byte_code
- ]
+ = vcat [
+ pprModuleIdent $ odgbc_module,
+ pprOnDiskModuleByteCodeHash $ odgbc_hash,
+ pprCompiledByteCode odgbc_module $ odgbc_compiled_byte_code
+ ]
-- | Constructs textual information about the name of a module.
pprModuleIdent :: Module -> SDoc
@@ -105,14 +105,14 @@ pprCompiledByteCode :: Module -- ^ The enclosing module
-> CompiledByteCode -- ^ The bytecode
-> SDoc -- ^ The textual information
pprCompiledByteCode current_module CompiledByteCode {..}
- = vcat [
- pprByteCodeObjects current_module $ bc_bcos,
- pprDataConstructorInfoTables $ bc_itbls,
- pprTopLevelStrings $ bc_strs,
- pprBreakpoints current_module $ bc_breaks,
- pprStaticPointerTableEntries $ bc_spt_entries,
- pprHPCInfo $ bc_hpc_info
- ]
+ = vcat [
+ pprByteCodeObjects current_module $ bc_bcos,
+ pprDataConstructorInfoTables $ bc_itbls,
+ pprTopLevelStrings $ bc_strs,
+ pprBreakpoints current_module $ bc_breaks,
+ pprStaticPointerTableEntries $ bc_spt_entries,
+ pprHPCInfo $ bc_hpc_info
+ ]
-- | Constructs textual information about bytecode objects.
pprByteCodeObjects :: Module -- ^ The enlosing module
@@ -128,29 +128,25 @@ pprByteCodeObject :: Module -- ^ The enclosing module
-> UnlinkedBCO -- ^ The bytecode object
-> SDoc -- ^ The textual information
pprByteCodeObject current_module byte_code_object = case byte_code_object of
- UnlinkedBCO {..}
- -> entry (text "ordinary object" <+> quotes (ppr unlinkedBCOName)) $
- vcat [
- pprArity $ unlinkedBCOArity,
- pprLiterals current_module $ unlinkedBCOLits,
- pprUsedItems current_module $ unlinkedBCOPtrs
- ]
- UnlinkedStaticCon {..}
- -> entry (
- text "static-construction object" <+>
- quotes (ppr unlinkedStaticConName)
- )
- $
- vcat [
- pprDataConstructorName $ unlinkedStaticConDataConName,
- pprLiftedness $ isLifted,
- pprLiterals current_module $ unlinkedStaticConLits,
- pprUsedItems current_module $ unlinkedStaticConPtrs
- ]
- where
-
- isLifted :: Bool
- isLifted = not unlinkedStaticConIsUnlifted
+ UnlinkedBCO {..}
+ -> entry (text "ordinary object" <+> quotes (ppr unlinkedBCOName)) $
+ vcat [
+ pprArity $ unlinkedBCOArity,
+ pprLiterals current_module $ unlinkedBCOLits,
+ pprUsedItems current_module $ unlinkedBCOPtrs
+ ]
+ UnlinkedStaticCon {..}
+ -> entry (
+ text "static-construction object" <+>
+ quotes (ppr unlinkedStaticConName)
+ )
+ $
+ vcat [
+ pprDataConstructorName $ unlinkedStaticConDataConName,
+ pprLiftedness $ not unlinkedStaticConIsUnlifted,
+ pprLiterals current_module $ unlinkedStaticConLits,
+ pprUsedItems current_module $ unlinkedStaticConPtrs
+ ]
-- | Constructs textual information about the arity of an ordinary bytecode
-- object.
@@ -181,63 +177,61 @@ pprLiteral :: Module -- ^ The enclosing module
-> BCONPtr -- ^ The literal
-> SDoc -- ^ The textual information
pprLiteral current_module literal = case literal of
- BCONPtrWord word
- -> text "word" <+>
- ppr word
- BCONPtrLbl label
- -> text "label" <+>
- quotes (ppr label)
- BCONPtrItbl infoTableName
- -> text "info table of" <+>
- quotes (ppr infoTableName)
- BCONPtrAddr addrName
- -> text "address" <+>
- quotes (ppr addrName)
- BCONPtrStr encoded_string
- -> text "top-level string" <+>
- text (show (utf8DecodeByteString encoded_string))
- BCONPtrFS string
- -> text "top-level string" <+>
- text (show (unpackFS string))
- BCONPtrFFIInfo ffiInfo
- -> text "foreign function" <+>
- quotes (pprFFIInfo ffiInfo)
- BCONPtrCostCentre breakpointID
- -> text "cost center of breakpoint" <+>
- pprInternalBreakpointID current_module breakpointID
+ BCONPtrWord word
+ -> text "word" <+>
+ ppr word
+ BCONPtrLbl label
+ -> text "label" <+>
+ quotes (ppr label)
+ BCONPtrItbl infoTableName
+ -> text "info table of" <+>
+ quotes (ppr infoTableName)
+ BCONPtrAddr addrName
+ -> text "address" <+>
+ quotes (ppr addrName)
+ BCONPtrStr encoded_string
+ -> text "top-level string" <+>
+ text (show (utf8DecodeByteString encoded_string))
+ BCONPtrFS string
+ -> text "top-level string" <+>
+ text (show (unpackFS string))
+ BCONPtrFFIInfo ffiInfo
+ -> text "foreign function" <+>
+ quotes (pprFFIInfo ffiInfo)
+ BCONPtrCostCentre breakpointID
+ -> text "cost center of breakpoint" <+>
+ pprInternalBreakpointID current_module breakpointID
-- | Constructs textual information about FFI info.
pprFFIInfo :: FFIInfo -> SDoc
pprFFIInfo FFIInfo {..}
- = hsep (map (pprFFIType >>> (<+> text "->")) ffiInfoArgs) <+>
- pprFFIType ffiInfoRet
+ = hsep (map (pprFFIType >>> (<+> text "->")) ffiInfoArgs) <+>
+ pprFFIType ffiInfoRet
-- | Constructs textual information about an FFI type.
pprFFIType :: FFIType -> SDoc
pprFFIType ffi_type = assert (take 3 ident == "FFI") $ text (drop 3 ident) where
- ident :: String
- ident = show ffi_type
+ ident :: String
+ ident = show ffi_type
-- | Constructs textual information about the ID of a bytecode breakpoint.
pprInternalBreakpointID
- :: Module -- ^ The enclosing module
- -> InternalBreakpointId -- ^ The ID of the bytecode breakpoint
- -> SDoc -- ^ The textual information
+ :: Module -- ^ The enclosing module
+ -> InternalBreakpointId -- ^ The ID of the bytecode breakpoint
+ -> SDoc -- ^ The textual information
pprInternalBreakpointID current_module InternalBreakpointId {..}
- | ibi_info_mod == current_module = indexDoc
- | otherwise = indexDoc <+>
- text "in" <+>
- ppr ibi_info_mod
- where
+ | ibi_info_mod == current_module = indexDoc
+ | otherwise = indexDoc <+> text "in" <+> ppr ibi_info_mod
+ where
- indexDoc :: SDoc
- indexDoc = ppr ibi_info_index
+ indexDoc :: SDoc
+ indexDoc = ppr ibi_info_index
-- | Constructs textual information about used items.
-pprUsedItems :: Module -- ^ The enclosing module
- -> FlatBag BCOPtr -- ^ The used items
- -> SDoc -- ^ The textual information
+pprUsedItems :: Module -- ^ The enclosing module
+ -> FlatBag BCOPtr -- ^ The used items
+ -> SDoc -- ^ The textual information
pprUsedItems current_module = entry (text "used items") .
vcatOrNone .
map (pprUsedItem current_module) .
@@ -248,14 +242,14 @@ pprUsedItem :: Module -- ^ The enclosing module
-> BCOPtr -- ^ The used item
-> SDoc -- ^ The textual information
pprUsedItem current_module usedItem = case usedItem of
- BCOPtrName name
- -> text "named item" <+> quotes (ppr name)
- BCOPtrPrimOp primOp
- -> text "primitive operation" <+> quotes (ppr primOp)
- BCOPtrBCO byte_code_object
- -> pprByteCodeObject current_module byte_code_object
- BCOPtrBreakArray breakArrayModule
- -> text "break array of module" <+> quotes (ppr breakArrayModule)
+ BCOPtrName name
+ -> text "named item" <+> quotes (ppr name)
+ BCOPtrPrimOp primOp
+ -> text "primitive operation" <+> quotes (ppr primOp)
+ BCOPtrBCO byte_code_object
+ -> pprByteCodeObject current_module byte_code_object
+ BCOPtrBreakArray breakArrayModule
+ -> text "break array of module" <+> quotes (ppr breakArrayModule)
-- | Constructs textual information about data constructor info tables.
pprDataConstructorInfoTables :: [(Name, ConInfoTable)] -> SDoc
@@ -266,11 +260,11 @@ pprDataConstructorInfoTables = entry (text "data constructor info tables") .
-- | Constructs textual information about a single data constructor info table.
pprDataConstructorInfoTable :: Name -> ConInfoTable -> SDoc
pprDataConstructorInfoTable dataConstrName ConInfoTable {..}
- = entry (text "info table of" <+> quotes (ppr dataConstrName)) $
- vcat [
- pprPointerWordCount $ conItblPtrs,
- pprNonPointerWordCount $ conItblNPtrs
- ]
+ = entry (text "info table of" <+> quotes (ppr dataConstrName)) $
+ vcat [
+ pprPointerWordCount $ conItblPtrs,
+ pprNonPointerWordCount $ conItblNPtrs
+ ]
-- | Constructs textual information about a number of pointer words.
pprPointerWordCount :: Int -> SDoc
@@ -299,37 +293,36 @@ pprBreakpoints :: Module -- ^ The enclosing module
-> Maybe InternalModBreaks -- ^ The breakpoints
-> SDoc -- ^ The textual information
pprBreakpoints current_module
- = entry (text "breakpoints") .
- maybe (text "<none>") (pprActualBreakpoints current_module)
+ = entry (text "breakpoints") .
+ maybe (text "<none>") (pprActualBreakpoints current_module)
-- | Constructs textual information about actual breakpoints.
pprActualBreakpoints :: Module -- ^ The enclosing module
-> InternalModBreaks -- ^ The actual breakpoints
-> SDoc -- ^ The textual information
pprActualBreakpoints current_module InternalModBreaks {..}
- = vcat [
- pprSourceBreakpoints current_module $ imodBreaks_modBreaks,
- pprByteCodeBreakpoints current_module $ imodBreaks_breakInfo
- ]
+ = vcat [
+ pprSourceBreakpoints current_module $ imodBreaks_modBreaks,
+ pprByteCodeBreakpoints current_module $ imodBreaks_breakInfo
+ ]
-- | Constructs textual information about source breakpoints.
pprSourceBreakpoints :: Module -- ^ The enclosing module
-> ModBreaks -- ^ The source breakpoints
-> SDoc -- ^ The textual information
pprSourceBreakpoints current_module ModBreaks {..}
- = entry (text "source breakpoints") $
- assert (modBreaks_module == current_module) $
- assert (bounds modBreaks_locs_ == bounds modBreaks_decls) $
- assert (bounds modBreaks_locs_ == bounds modBreaks_vars) $
- vcatOrNone $
- zipWith4 pprSourceBreakpoint (indices modBreaks_locs_)
- (elems modBreaks_locs_)
- (elems modBreaks_decls)
- (elems modBreaks_vars)
- -- The cost center infos in 'modBreaks_ccs', when present, just contain
- -- textual representations of the declaration paths in 'modBreaks_decls'
- -- and the source spans in 'modBreaks_locs_' and are therefore never
- -- shown.
+ = entry (text "source breakpoints") $
+ assert (modBreaks_module == current_module) $
+ assert (bounds modBreaks_locs_ == bounds modBreaks_decls) $
+ assert (bounds modBreaks_locs_ == bounds modBreaks_vars) $
+ vcatOrNone $
+ zipWith4 pprSourceBreakpoint (indices modBreaks_locs_)
+ (elems modBreaks_locs_)
+ (elems modBreaks_decls)
+ (elems modBreaks_vars)
+ -- The cost center infos in 'modBreaks_ccs', when present, just contain
+ -- textual representations of the declaration paths in 'modBreaks_decls' and
+ -- the source spans in 'modBreaks_locs_' and are therefore never shown.
-- | Constructs textual information about a single source breakpoint.
pprSourceBreakpoint :: BreakTickIndex
@@ -338,12 +331,12 @@ pprSourceBreakpoint :: BreakTickIndex
-> [OccName]
-> SDoc
pprSourceBreakpoint ix srcSpan declarationPath freeVars
- = entry (text "source breakpoint" <+> ppr ix) $
- vcat [
- pprSrcSpan $ srcSpan,
- pprDeclarationPath $ declarationPath,
- pprFreeVariables $ freeVars
- ]
+ = entry (text "source breakpoint" <+> ppr ix) $
+ vcat [
+ pprSrcSpan $ srcSpan,
+ pprDeclarationPath $ declarationPath,
+ pprFreeVariables $ freeVars
+ ]
-- | Constructs textual information about a source span.
pprSrcSpan :: BinSrcSpan -> SDoc
@@ -362,10 +355,10 @@ pprByteCodeBreakpoints :: Module -- ^ The enclosing module
-> IntMap CgBreakInfo -- ^ The bytecode breakpoints
-> SDoc -- ^ The textual information
pprByteCodeBreakpoints current_module
- = entry (text "bytecode breakpoints") .
- vcatOrNone .
- map (uncurry (pprByteCodeBreakpoint current_module)) .
- IntMap.toList
+ = entry (text "bytecode breakpoints") .
+ vcatOrNone .
+ map (uncurry (pprByteCodeBreakpoint current_module)) .
+ IntMap.toList
-- | Constructs textual information about a single bytecode breakpoint.
pprByteCodeBreakpoint :: Module -- ^ The enclosing module
@@ -373,20 +366,20 @@ pprByteCodeBreakpoint :: Module -- ^ The enclosing module
-> CgBreakInfo -- ^ The bytecode breakpoint
-> SDoc -- ^ The textual information
pprByteCodeBreakpoint current_module ix CgBreakInfo {..}
- = entry (text "bytecode breakpoint" <+> ppr ix) $
- vcat [
- pprType $ cgb_resty,
- pprTypeVariables $ cgb_tyvars,
- pprVariables $ cgb_vars,
- pprCorrespondingSourceBreakpoint current_module $ cgb_tick_id
- ]
- -- That the 'cgb_resty' field holds the type of the breakpoint is apparent
- -- from the fact that this field is set by
- -- 'GHC.StgToByteCode.dehydrateCgBreakInfo' using one of its arguments and
- -- 'GHC.StgToByteCode.dehydrateCgBreakInfo' is always invoked with this
- -- argument set to the extension field of 'Breakpoint', which in turn holds
- -- the type of the breakpoint according to Note [Tickish passes] and the
- -- comment on the instance declaration of @XBreakpoint 'TickishPassStg@.
+ = entry (text "bytecode breakpoint" <+> ppr ix) $
+ vcat [
+ pprType $ cgb_resty,
+ pprTypeVariables $ cgb_tyvars,
+ pprVariables $ cgb_vars,
+ pprCorrespondingSourceBreakpoint current_module $ cgb_tick_id
+ ]
+ -- That the 'cgb_resty' field holds the type of the breakpoint is apparent
+ -- from the fact that this field is set by
+ -- 'GHC.StgToByteCode.dehydrateCgBreakInfo' using one of its arguments and
+ -- 'GHC.StgToByteCode.dehydrateCgBreakInfo' is always invoked with this
+ -- argument set to the extension field of 'Breakpoint', which in turn holds
+ -- the type of the breakpoint according to Note [Tickish passes] and the
+ -- comment on the instance declaration of @XBreakpoint 'TickishPassStg@.
-- | Constructs textual information about a type.
pprType :: IfaceType -> SDoc
@@ -413,8 +406,8 @@ pprVariable = maybe (text "<unknown>") (pprVariableBinder . fst)
-- | Constructs textual information about a variable binder.
pprVariableBinder :: IfaceIdBndr -> SDoc
pprVariableBinder (multiplicity, name, type_)
- = text "%" <> ppr multiplicity <+>
- ppr name <+> text "::" <+> ppr type_
+ = text "%" <> ppr multiplicity <+>
+ ppr name <+> text "::" <+> ppr type_
-- | Constructs textual information about a source breakpoint corresponding to a
-- bytecode breakpoint.
@@ -425,9 +418,9 @@ pprCorrespondingSourceBreakpoint :: Module
-> SDoc
-- ^ The textual information
pprCorrespondingSourceBreakpoint current_module
- = entry (text "corresponding source breakpoint") .
- pprBreakpointID current_module .
- either internalBreakLoc id
+ = entry (text "corresponding source breakpoint") .
+ pprBreakpointID current_module .
+ either internalBreakLoc id
-- | Constructs textual information about the ID of a source breakpoint.
pprBreakpointID :: Module -- ^ The enclosing module
@@ -452,7 +445,7 @@ pprStaticPointerTableEntries = entry (text "static-pointer table entries") .
-- | Constructs textual information about a single static-pointer table entry.
pprStaticPointerTableEntry :: SptEntry -> SDoc
pprStaticPointerTableEntry (SptEntry name fingerprint)
- = ppr fingerprint <> text ":" <+> ppr name
+ = ppr fingerprint <> text ":" <+> ppr name
-- | Constructs textual information about HPC info.
pprHPCInfo :: Strict.Maybe ByteCodeHpcInfo -> SDoc
@@ -462,12 +455,12 @@ pprHPCInfo = entry (text "HPC information") .
-- | Constructs textual information about actual HPC info.
pprActualHPCInfo :: ByteCodeHpcInfo -> SDoc
pprActualHPCInfo ByteCodeHpcInfo {..}
- = vcat [
- pprHPCInfoHash $ bchi_hash,
- pprModuleName $ bchi_module_name,
- pprTickBoxName $ bchi_tickbox_name,
- pprTickCount $ bchi_tick_count
- ]
+ = vcat [
+ pprHPCInfoHash $ bchi_hash,
+ pprModuleName $ bchi_module_name,
+ pprTickBoxName $ bchi_tickbox_name,
+ pprTickCount $ bchi_tick_count
+ ]
-- | Constructs textual information about the hash of HPC info.
pprHPCInfoHash :: Int -> SDoc
@@ -494,15 +487,15 @@ pprTickCount = entry (text "number of ticks") . ppr
-- natural number.
pprFixedSizeNatural :: (Integral a, FiniteBits a) => a -> SDoc
pprFixedSizeNatural num
- = assert (num >= 0) $
- text $ replicate (digitCount - length unpadded) '0' ++ unpadded
- where
+ = assert (num >= 0) $
+ text $ replicate (digitCount - length unpadded) '0' ++ unpadded
+ where
- digitCount :: Int
- digitCount = (finiteBitSize num + 3) `div` 4
+ digitCount :: Int
+ digitCount = (finiteBitSize num + 3) `div` 4
- unpadded :: String
- unpadded = showHex num ""
+ unpadded :: String
+ unpadded = showHex num ""
-- | Constructs a textual representation of a boolean, interpreting 'True' and
-- 'False' as “yes” and “no”, respectively.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/caefc9da7d625db3146216ccbef2b4…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/caefc9da7d625db3146216ccbef2b4…
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
1
0
[Git][ghc/ghc][wip/fendor/26300] Check external dependencies and home units for duplicates
by Hannes Siebenhandl (@fendor) 28 Jul '26
by Hannes Siebenhandl (@fendor) 28 Jul '26
28 Jul '26
Hannes Siebenhandl pushed to branch wip/fendor/26300 at Glasgow Haskell Compiler / GHC
Commits:
d8aa9526 by fendor at 2026-07-28T13:12:16+02:00
Check external dependencies and home units for duplicates
- - - - -
16 changed files:
- compiler/GHC/Iface/Errors/Ppr.hs
- compiler/GHC/Iface/Errors/Types.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Finder/Types.hs
- + testsuite/tests/ghci/T26300/Makefile
- + testsuite/tests/ghci/T26300/T26300.script
- + testsuite/tests/ghci/T26300/T26300.stderr
- + testsuite/tests/ghci/T26300/T26300.stdout
- + testsuite/tests/ghci/T26300/a/Main.hs
- + testsuite/tests/ghci/T26300/all.T
- + testsuite/tests/ghci/T26300/b/Bar.hs
- + testsuite/tests/ghci/T26300/b/Data/List.hs
- + testsuite/tests/ghci/T26300/c/Bar.hs
- + testsuite/tests/ghci/T26300/unitA
- + testsuite/tests/ghci/T26300/unitB
- + testsuite/tests/ghci/T26300/unitC
Changes:
=====================================
compiler/GHC/Iface/Errors/Ppr.hs
=====================================
@@ -240,7 +240,9 @@ cantFindErrorX pkg_hidden_hint may_show_locations mod_or_interface (CantFindInst
-> vcat (map pprMod mods)
where
unambiguousPackages = foldl' unambiguousPackage (Just []) mods
- unambiguousPackage (Just xs) (m, ModOrigin (Just _) _ _ _)
+ unambiguousPackage (Just xs) (m, ExternalUnitOrigin (ModOrigin (Just _) _ _ _))
+ = Just (moduleUnit m : xs)
+ unambiguousPackage (Just xs) (m, HomeOrigin{})
= Just (moduleUnit m : xs)
unambiguousPackage _ _ = Nothing
GenericMissing pkg_hiddens mod_hiddens unusables files ->
@@ -251,9 +253,16 @@ cantFindErrorX pkg_hidden_hint may_show_locations mod_or_interface (CantFindInst
where
pprMod (m, o) = text "it is bound as" <+> ppr m <+>
text "by" <+> pprOrigin m o
- pprOrigin _ ModHidden = panic "cantFindErr: bound by mod hidden"
- pprOrigin _ (ModUnusable _) = panic "cantFindErr: bound by mod unusable"
- pprOrigin m (ModOrigin e res _ f) = sep $ punctuate comma (
+
+ pprOrigin m HomeOrigin = pprHomeOrigin m
+ pprOrigin m (ExternalUnitOrigin o) = pprExtOrigin m o
+
+ pprHomeOrigin m =
+ text "package" <+> ppr (moduleUnit m)
+
+ pprExtOrigin _ ModHidden = panic "cantFindErr: bound by mod hidden"
+ pprExtOrigin _ (ModUnusable _) = panic "cantFindErr: bound by mod unusable"
+ pprExtOrigin m (ModOrigin e res _ f) = sep $ punctuate comma (
if e == Just True
then [text "package" <+> ppr (moduleUnit m)]
else [] ++
=====================================
compiler/GHC/Iface/Errors/Types.hs
=====================================
@@ -6,6 +6,7 @@ module GHC.Iface.Errors.Types (
, ReadInterfaceError(..)
, CantFindInstalled(..)
, CantFindInstalledReason(..)
+ , HomeOrExternalOrigin(..)
, FindingModuleOrInterface(..)
, BuildingCabalPackage(..)
@@ -75,9 +76,13 @@ data CantFindInstalledReason
| GenericMissing
[UnitInfo] [Unit]
[UnusableUnit] [FilePath]
- | MultiplePackages [(Module, ModuleOrigin)]
+ | MultiplePackages [(Module, HomeOrExternalOrigin)]
deriving Generic
+data HomeOrExternalOrigin
+ = HomeOrigin
+ | ExternalUnitOrigin ModuleOrigin
+
data CantFindInstalled =
CantFindInstalled ModuleName CantFindInstalledReason
deriving Generic
=====================================
compiler/GHC/Unit/Finder.hs
=====================================
@@ -82,6 +82,7 @@ import qualified Data.Set as Set (empty, intersection, difference, null, toList)
import qualified System.Directory as SD
import qualified System.OsPath as OsPath
import qualified Data.List.NonEmpty as NE
+import GHC.Iface.Errors.Types
type FileExt = OsString -- Filename extension
type BaseName = OsPath -- Basename of file
@@ -247,8 +248,12 @@ findImportedModuleNoHsc fc fopts ue home_module_name_providers_map mb_home_unit
ue_findHomeUnitEnv home_unit_id ue
other_fopts :: [(UnitId, FinderOpts)]
- other_fopts = homeUnitDepsFinderOpts ue home_module_name_providers_map
+ other_fopts =
+ let
+ (providers, others) = homeUnitDepsFinderOpts ue home_module_name_providers_map
unit_state mod_name
+ in
+ providers ++ others
-- | Locate a plugin module requested by the user, for a compiler
-- plugin. This consults the same set of exposed packages as
@@ -265,7 +270,7 @@ findPluginModuleNoHsc
findPluginModuleNoHsc fc fopts ue home_module_name_providers_map mb_home_unit@(Just home_unit) mod_name =
findHomeModuleAmongDeps fc fopts ue home_module_name_providers_map
mb_home_unit mod_name
- `orIfNotFound`
+ `combineFindResult`
findExposedPluginPackageModule fc fopts unit_state mod_name
where
unit_state = HUG.homeUnitEnv_units $
@@ -291,9 +296,9 @@ findPluginModule hsc_env mod_name = do
rankedHomeUnitDeps :: HomeModuleNameProvidersMap
-> ModuleName
-> Set UnitId
- -> [UnitId]
+ -> ([UnitId], [UnitId])
rankedHomeUnitDeps _ _ home_unit_deps | Set.null home_unit_deps
- = []
+ = ([], [])
-- The special handling of the situation where the dependency set is empty does
-- not change the result, but it avoids triggering evaluation of the module
-- graph. This is particularly important in one-shot mode, where the module
@@ -309,7 +314,7 @@ rankedHomeUnitDeps _ _ home_unit_deps | Set.null home_unit_deps
-- 3 | import {-# source #-} A
-- | ^^^^^^^^^^^^^^^^^^^^^^^
rankedHomeUnitDeps home_module_name_providers_map mod_name home_unit_deps
- = Set.toList cached_deps ++ Set.toList uncached_deps
+ = (Set.toList cached_deps, Set.toList uncached_deps)
where
cached_providers :: Set UnitId
@@ -330,12 +335,19 @@ homeUnitDepsFinderOpts
-> HomeModuleNameProvidersMap
-> UnitState -- ^ unit state of the requesting home unit
-> ModuleName
- -> [(UnitId, FinderOpts)]
+ -> ([(UnitId, FinderOpts)], [(UnitId, FinderOpts)])
homeUnitDepsFinderOpts ue home_module_name_providers_map unit_state mod_name =
- [ (uid, initFinderOpts (ue_unitFlags uid ue))
- | uid <- rankedHomeUnitDeps home_module_name_providers_map mod_name
+ let
+ (providers, otherHomeUnits) = rankedHomeUnitDeps home_module_name_providers_map mod_name
(homeUnitDepends unit_state)
- ]
+ in
+ ( [ (uid, initFinderOpts (ue_unitFlags uid ue))
+ | uid <- providers
+ ]
+ , [ (uid, initFinderOpts (ue_unitFlags uid ue))
+ | uid <- otherHomeUnits
+ ]
+ )
-- | Search for @mod_name@ in the given home unit.
findHomeUnitDepModule
@@ -371,11 +383,25 @@ findHomeModuleAmongDeps
-> ModuleName
-> IO FindResult
findHomeModuleAmongDeps fc fopts ue home_module_name_providers_map mb_home_unit mod_name =
- foldr1 orIfNotFound (home_import :| map home_pkg_import other_fopts)
- -- Do not try to be smart and change this to `foldr orIfNotFound home_import
- -- (map home_pkg_import other_fopts)`, as that would not be the same.
- -- `home_import` is first because we need to first look within the current
- -- unit before looking at the other units in order.
+ case other_fopts of
+ [] ->
+ foldr1 combineFindResult (home_import :| map home_pkg_import provider_fopts)
+ -- Do not try to be smart and change this to `foldr combineFindResult home_import
+ -- (map home_pkg_import other_fopts)`, as that would not be the same.
+ -- `home_import` is first because we need to first look within the current
+ -- unit before looking at the other units in order.
+ (x:xs) ->
+ foldr1 combineFindResult (home_import :| map home_pkg_import provider_fopts)
+ -- Do not try to be smart and change this to `foldr combineFindResult home_import
+ -- (map home_pkg_import other_fopts)`, as that would not be the same.
+ -- `home_import` is first because we need to first look within the current
+ -- unit before looking at the other units in order.
+ `orIfNotFound`
+ foldr1 orIfNotFound (home_pkg_import x :| map home_pkg_import xs)
+ -- Do not try to be smart and change this to `foldr orIfNotFound home_import
+ -- (map home_pkg_import other_fopts)`, as that would not be the same.
+ -- `home_import` is first because we need to first look within the current
+ -- unit before looking at the other units in order.
where
home_import = case mb_home_unit of
Just home_unit -> findHomeModule fc fopts home_unit mod_name
@@ -387,7 +413,7 @@ findHomeModuleAmongDeps fc fopts ue home_module_name_providers_map mb_home_unit
Nothing -> ue_homeUnitState ue
Just home_unit_id -> HUG.homeUnitEnv_units $
ue_findHomeUnitEnv home_unit_id ue
- other_fopts = homeUnitDepsFinderOpts ue home_module_name_providers_map
+ (provider_fopts, other_fopts) = homeUnitDepsFinderOpts ue home_module_name_providers_map
unit_state mod_name
-- | Search the home-unit graph and otherwise the regular exposed package
@@ -403,7 +429,7 @@ findHomeOrRegularPackageModule
findHomeOrRegularPackageModule fc fopts ue home_module_name_providers_map mb_home_unit mod_name =
findHomeModuleAmongDeps fc fopts ue home_module_name_providers_map
mb_home_unit mod_name
- `orIfNotFound`
+ `combineFindResult`
findExposedPackageModule fc fopts unit_state mod_name NoPkgQual
where
unit_state = case homeUnitId <$> mb_home_unit of
@@ -470,6 +496,40 @@ orIfNotFound this or_this = do
_other -> return res2
_other -> return res
+combineFindResult :: Monad m => m FindResult -> m FindResult -> m FindResult
+combineFindResult this or_this = do
+ res <- this
+ case res of
+ NotFound { fr_paths = paths1, fr_mods_hidden = mh1
+ , fr_pkgs_hidden = ph1, fr_unusables = u1, fr_suggestions = s1 }
+ -> do res2 <- or_this
+ case res2 of
+ NotFound { fr_paths = paths2, fr_pkg = mb_pkg2, fr_mods_hidden = mh2
+ , fr_pkgs_hidden = ph2, fr_unusables = u2
+ , fr_suggestions = s2 }
+ -> return (NotFound { fr_paths = paths1 ++ paths2
+ , fr_pkg = mb_pkg2 -- snd arg is the package search
+ , fr_mods_hidden = mh1 ++ mh2
+ , fr_pkgs_hidden = ph1 ++ ph2
+ , fr_unusables = u1 ++ u2
+ , fr_suggestions = s1 ++ s2 })
+ _other -> return res2
+ NoPackage{} -> pure res
+ FoundMultiple ms -> do
+ otherRes <- or_this
+ case otherRes of
+ Found _ other_mod -> pure $ FoundMultiple $ ms ++ [(other_mod, HomeOrigin)]
+ NoPackage{} -> pure res
+ FoundMultiple other_ms -> pure $ FoundMultiple $ ms ++ other_ms
+ NotFound{} -> pure res
+ Found _mod_location modl -> do
+ otherRes <- or_this
+ case otherRes of
+ Found _ other_mod -> pure $ FoundMultiple $ [(modl, HomeOrigin), (other_mod, HomeOrigin)]
+ NoPackage{} -> pure res
+ FoundMultiple other_ms -> pure $ FoundMultiple $ [(modl, HomeOrigin)] ++ other_ms
+ NotFound{} -> pure res
+
-- | Helper function for 'findHomeModule': this function wraps an IO action
-- which would look up @mod_name@ in the file system (the home package),
-- and first consults the 'hsc_FC' cache to see if the lookup has already
@@ -509,7 +569,7 @@ findLookupResult fc fopts r = case r of
, fr_unusables = []
, fr_suggestions = []})
LookupMultiple rs ->
- return (FoundMultiple rs)
+ return (FoundMultiple $ map (\ (m, o) -> (m, ExternalUnitOrigin o)) rs)
LookupHidden fr_pkgs_hidden mod_hiddens ->
return (NotFound{ fr_paths = [], fr_pkg = Nothing
, fr_pkgs_hidden
=====================================
compiler/GHC/Unit/Finder/Types.hs
=====================================
@@ -19,6 +19,7 @@ import GHC.Unit.Env
import GHC.Data.FastString
import GHC.Types.Unique.Set
+import GHC.Iface.Errors.Types (HomeOrExternalOrigin)
-- | The 'FinderCache' maps modules to the result of
-- searching for that module. It records the results of searching for
@@ -56,7 +57,7 @@ data FindResult
-- ^ The module was found
| NoPackage Unit
-- ^ The requested unit was not found
- | FoundMultiple [(Module, ModuleOrigin)]
+ | FoundMultiple [(Module, HomeOrExternalOrigin)]
-- ^ _Error_: both in multiple packages
-- | Not found
=====================================
testsuite/tests/ghci/T26300/Makefile
=====================================
@@ -0,0 +1,9 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+.PHONY: prog-mhu006a
+prog-mhu006a:
+ '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) $(WAY_FLAGS) $(ghciWayFlags) \
+ -no-user-package-db \
+ -unit @unitA -unit @unitB < prog-mhu006a.script
=====================================
testsuite/tests/ghci/T26300/T26300.script
=====================================
@@ -0,0 +1,3 @@
+"Report two ambiguous imports."
+"The Data.List import is ambiguous with the `base` module."
+"Bar module is defined in two home units, as such needs to be reported as ambiguous."
=====================================
testsuite/tests/ghci/T26300/T26300.stderr
=====================================
@@ -0,0 +1,8 @@
+a/Main.hs:3:1: error: [GHC-45102]
+ Ambiguous module name ‘Data.List’.
+ it was found in multiple packages: base-4.23.0.0 b-0.0.1
+
+a/Main.hs:4:1: error: [GHC-45102]
+ Ambiguous module name ‘Bar’.
+ it was found in multiple packages: c-0.0.1 b-0.0.1
+
=====================================
testsuite/tests/ghci/T26300/T26300.stdout
=====================================
@@ -0,0 +1,3 @@
+"Report two ambiguous imports."
+"The Data.List import is ambiguous with the `base` module."
+"Bar module is defined in two home units, as such needs to be reported as ambiguous."
=====================================
testsuite/tests/ghci/T26300/a/Main.hs
=====================================
@@ -0,0 +1,4 @@
+module Main where
+
+import Data.List
+import Bar
=====================================
testsuite/tests/ghci/T26300/all.T
=====================================
@@ -0,0 +1,6 @@
+test('T26300',
+ [extra_files(['a/', 'b/', 'c/', 'unitA', 'unitB', 'unitC']),
+ cmd_prefix('ghciWayFlags=' + config.ghci_way_flags),
+ normalise_slashes,
+ req_interp],
+ ghci_multiunit_script, [['unitA', 'unitB', 'unitC'], 'T26300.script'])
=====================================
testsuite/tests/ghci/T26300/b/Bar.hs
=====================================
@@ -0,0 +1 @@
+module Bar where
=====================================
testsuite/tests/ghci/T26300/b/Data/List.hs
=====================================
@@ -0,0 +1 @@
+module Data.List where
=====================================
testsuite/tests/ghci/T26300/c/Bar.hs
=====================================
@@ -0,0 +1 @@
+module Bar where
=====================================
testsuite/tests/ghci/T26300/unitA
=====================================
@@ -0,0 +1,6 @@
+-i
+-ia
+-this-unit-id a-0.0.1
+-package-id b-0.0.1
+-package-id c-0.0.1
+Main
=====================================
testsuite/tests/ghci/T26300/unitB
=====================================
@@ -0,0 +1,5 @@
+-i
+-ib
+-this-unit-id b-0.0.1
+Data.List
+Bar
=====================================
testsuite/tests/ghci/T26300/unitC
=====================================
@@ -0,0 +1,4 @@
+-i
+-ic
+-this-unit-id c-0.0.1
+Bar
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d8aa95262333abb8485c31bf8aed2da…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d8aa95262333abb8485c31bf8aed2da…
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
1
0
[Git][ghc/ghc][wip/fendor/26300] 7 commits: Introduce global unit database cache
by Hannes Siebenhandl (@fendor) 28 Jul '26
by Hannes Siebenhandl (@fendor) 28 Jul '26
28 Jul '26
Hannes Siebenhandl pushed to branch wip/fendor/26300 at Glasgow Haskell Compiler / GHC
Commits:
5d0ab71a by fendor at 2026-07-27T17:31:05-04:00
Introduce global unit database cache
As a first step for better sharing of `UnitInfo` across `UnitEnv`,
we introduce a new datatype called `ExternalUnitDatabases`.
It primarily serves as an in-memory representation of *all*
`UnitDatabase`s across `UnitEnv`. This means, if multiple `HomeUnitEnv`s
depend on the same database, one way or another, we make sure that we
don't parse from disk every time.
Instead, we store the in-memory representation in `ExternalUnitDatabases`.
`ExternalUnitDatabaseCache` is the equivalent of `ExternalUnitState` in
the `UnitEnv`. It is a mutable variable wrapping `ExternalUnitDatabases`.
The mutable `ExternalUnitDatabaseCache` is used in `initUnits` to make
sure we don't parse the same unit database multiple times.
Almost by accident, we change the semantics of `initUnits` to honour
modifications to `packageDBFlags`.
The inability to change `packageDBFlags` while also reusing the already
parsed `UnitDatabase`s was reported in #26423 as a bug.
Hence, we think this behaviour change is warranted and acceptable,
especially since it comes with a breaking change to the `initUnits` API.
Add regression test for #26423
Closes #26423
- - - - -
6cce494a by fendor at 2026-07-27T17:31:05-04:00
Introduce UnitIndex for global external unit caching
`UnitInfo`s have been observed to cause a lot of memory usage in #27500.
Especially with multiple home units, as the same (external) units are
processed from scratch, even though most of the time we end up with
exactly the same `UnitInfo`.
We introduce a `UnitEnv` global cache that allows us to store external
unit information that is used across all `HomeUnitEnv`s.
The most important change in this commit is the introduction of the `UnitIndex`.
It stores a global mapping of `UnitId` -> `UnitInfo`, and `initUnits`
always uses the cached `UnitInfo` entry to populate each
`HomeUnitEnv`'s `UnitState`.
This allows us to ensure the following property:
> Each `UnitInfo` should be alive exactly once in GHC.
All `UnitState`s should reference 'UnitInfo's stored in the 'UnitIndex'.
This ensured by calling 'initUnits' with the 'UnitIndex'.
In addition, the `ExternalUnitDatabases` may also hold a reference
to each on-disk representation of `UnitInfo`.
This means, we impose an hard upper bound on the number of `UnitInfo`s
alive in the GHC session:
> The number of alive `UnitInfo`s closure objects must be the
> sum of all loaded unit database times two.
We add performance regression tests that make sure the number of live
`UnitInfo` cannot exceed this threshold.
Closes #27500
-------------------------
Metric Decrease:
MultiComponentModules
MultiComponentModulesRecomp
MultiComponentModulesRecomp100
mhu-perf
LinkableUsage02
-------------------------
These metrics increases are especially notable, as we are not even
sharing anything big but merely the global package database with 50
entries.
It shows how careful sharing of `UnitInfo` can improve memory usage.
We expect this to be much more notable when the whole cabal package
database is shared across multiple home units.
`LinkableUsage02` metric decreases on unreg and i386 platform, only.
---
Technical details
To share the `UnitInfo`s correctly, it is important that we extract
the `WireMap` into the `UnitIndex`. At the moment of writing, `WireMap`
must be globally the same for all `HomeUnitEnv`s.
This is important, as we could otherwise not cache the "fully-resolved"
`UnitInfo`, as we don't change the `UnitId` or `unitAbiHash` when
resolving wired-in units. Thus, there could be ambiguities, when the
`WireMap` is not the same for all `UnitState`s across the `UnitEnv`.
We consider a `UnitInfo` fully-resolved, if wired-in units have been
updated, the `UnitInfo` has been validated and variables in the unit
config, such as `${pkgroot}` have been resolved.
Updating the wired-in units requires the `WireMap` to be globally the
same.
- - - - -
f8e3bee9 by Zubin Duggal at 2026-07-27T17:31:49-04:00
testsuite: skip runtime stats tests on debugged compilers
Debugged flavours build the boot libraries without optimisation, so the
runtime numbers do not match the baselines.
- - - - -
1e326770 by Zubin Duggal at 2026-07-27T17:31:50-04:00
testsuite: mark #20706 tests fragile rather than broken
Whether the static linux linker issues manifest depends on the host
toolchain.
- - - - -
c0b13cbe by Zubin Duggal at 2026-07-27T17:31:50-04:00
testsuite: exclude libnuma from mostly-static
It needs static system libraries (libnuma.a) that many platforms do not
ship.
Fixes #26914
- - - - -
10f33b9f by Rodrigo Mesquita at 2026-07-28T13:11:11+02:00
loopImports: Don't dup ms_uid in summary imports
We were writing the ms_unitid of the mod summary with every single
import of that module
That complicated the code (as though the UnitId in that list could ever
be something else) and also allocates unnecessarily per every mod
import. Very slight allocation decrease measured locally in a few tests:
(MultiComponentModulesRecomp: -0.06%; MultiComponentModulesRecomp100: -0.05%)
Purely a clean up.
- - - - -
18702319 by fendor at 2026-07-28T13:11:11+02:00
Check external dependencies and home units for duplicates
- - - - -
73 changed files:
- + changelog.d/T26423
- + changelog.d/unit-index
- compiler/GHC.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Downsweep.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Main/Hsc.hs
- compiler/GHC/Driver/Main/Interactive.hs
- compiler/GHC/Driver/Main/Passes.hs
- compiler/GHC/Driver/Session/Units.hs
- compiler/GHC/Iface/Errors/Ppr.hs
- compiler/GHC/Iface/Errors/Types.hs
- compiler/GHC/Types/Unique.hs
- compiler/GHC/Unit/Env.hs
- + compiler/GHC/Unit/External/Database.hs
- + compiler/GHC/Unit/External/Index.hs
- + compiler/GHC/Unit/External/ModuleOrigin.hs
- + compiler/GHC/Unit/External/Providers.hs
- + compiler/GHC/Unit/External/Query.hs
- + compiler/GHC/Unit/External/Substitution.hs
- + compiler/GHC/Unit/External/Validate.hs
- + compiler/GHC/Unit/External/Visibility.hs
- + compiler/GHC/Unit/External/Wired.hs
- compiler/GHC/Unit/Finder.hs
- compiler/GHC/Unit/Finder/Types.hs
- compiler/GHC/Unit/Home/Graph.hs
- compiler/GHC/Unit/Info.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Unit/State.hs-boot
- compiler/GHC/Unit/Types.hs
- compiler/ghc.cabal.in
- ghc/GHCi/UI.hs
- hadrian/src/Rules/Generate.hs
- testsuite/driver/testlib.py
- testsuite/tests/count-deps/CountDepsParser.stdout
- + testsuite/tests/driver/T26423/Hello.hs
- + testsuite/tests/driver/T26423/Makefile
- + testsuite/tests/driver/T26423/T26423.hs
- + testsuite/tests/driver/T26423/T26423.stderr
- + testsuite/tests/driver/T26423/T26423.stdout
- + testsuite/tests/driver/T26423/all.T
- + testsuite/tests/driver/T26423/test/Test.hs
- + testsuite/tests/driver/T26423/test/test.pkg
- + testsuite/tests/driver/TUnitInfo/Foo.hs
- + testsuite/tests/driver/TUnitInfo/Makefile
- + testsuite/tests/driver/TUnitInfo/all.T
- + testsuite/tests/driver/TUnitInfo/genMhu.sh
- + testsuite/tests/driver/TUnitInfo/generic-unit-info-space-mhu.stdout
- + testsuite/tests/driver/TUnitInfo/generic-unit-info-space-single.stdout
- + testsuite/tests/driver/TUnitInfo/generic-unit-info-space.hs
- + testsuite/tests/driver/TUnitInfo/generic-unit-info-space.stdout
- testsuite/tests/driver/all.T
- testsuite/tests/driver/mostly-static/Makefile
- testsuite/tests/ghci/T13786/all.T
- + testsuite/tests/ghci/T26300/Makefile
- + testsuite/tests/ghci/T26300/T26300.script
- + testsuite/tests/ghci/T26300/T26300.stderr
- + testsuite/tests/ghci/T26300/T26300.stdout
- + testsuite/tests/ghci/T26300/a/Main.hs
- + testsuite/tests/ghci/T26300/all.T
- + testsuite/tests/ghci/T26300/b/Bar.hs
- + testsuite/tests/ghci/T26300/b/Data/List.hs
- + testsuite/tests/ghci/T26300/c/Bar.hs
- + testsuite/tests/ghci/T26300/unitA
- + testsuite/tests/ghci/T26300/unitB
- + testsuite/tests/ghci/T26300/unitC
- testsuite/tests/ghci/linking/all.T
- testsuite/tests/ghci/linking/dyn/all.T
- testsuite/tests/package/T20010/all.T
- testsuite/tests/plugins/all.T
- testsuite/tests/rts/all.T
- testsuite/tests/rts/linker/all.T
- utils/haddock/haddock-api/src/Haddock.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a8a0db31aa3e13b11b75a5aa95afc4…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/a8a0db31aa3e13b11b75a5aa95afc4…
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
1
0
28 Jul '26
Hannes Siebenhandl pushed new branch wip/fendor/26300 at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/fendor/26300
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
1
0
[Git][ghc/ghc][wip/jeltsch/textual-bytecode-output] Remove import list for `GHC.Prelude`
by Wolfgang Jeltsch (@jeltsch) 28 Jul '26
by Wolfgang Jeltsch (@jeltsch) 28 Jul '26
28 Jul '26
Wolfgang Jeltsch pushed to branch wip/jeltsch/textual-bytecode-output at Glasgow Haskell Compiler / GHC
Commits:
caefc9da by Wolfgang Jeltsch at 2026-07-28T13:53:44+03:00
Remove import list for `GHC.Prelude`
- - - - -
1 changed file:
- compiler/GHC/ByteCode/Show.hs
Changes:
=====================================
compiler/GHC/ByteCode/Show.hs
=====================================
@@ -7,23 +7,6 @@ module GHC.ByteCode.Show (showByteCode) where
-- Prelude
import GHC.Prelude
- (
- (+), (-), Integral, div, -- Prelude
- (==), -- Data.Eq
- (>=), -- Data.Ord
- FiniteBits, finiteBitSize, -- Data.Bits
- ($), id, (.), -- Data.Function
- fst, uncurry, -- Data.Tuple
- Bool, otherwise, not, -- Data.Bool
- Int, -- Data.Int
- Word, -- Data.Word
- Maybe, maybe, -- Data.Maybe
- Either, either, -- Data.Either
- length, (++), map, take, drop, replicate, -- Data.List
- String, -- Data.String
- show, -- Text.Show
- IO, FilePath -- System.IO
- )
-- Bytecode
import GHC.ByteCode.Types
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/caefc9da7d625db3146216ccbef2b4c…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/caefc9da7d625db3146216ccbef2b4c…
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
1
0