[Git][ghc/ghc][master] Add genindex to index.rst. This adds a link to the index in the navigation bar.
by Marge Bot (@marge-bot) 23 Jan '26
by Marge Bot (@marge-bot) 23 Jan '26
23 Jan '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
5aa328fb by Zubin Duggal at 2026-01-23T03:29:30-05:00
Add genindex to index.rst. This adds a link to the index in the navigation bar.
Fixes #26437
- - - - -
1 changed file:
- docs/users_guide/index.rst
Changes:
=====================================
docs/users_guide/index.rst
=====================================
@@ -29,6 +29,7 @@ Contents:
eventlog-formats
glossary
editing-guide
+ genindex
Indices and tables
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5aa328fb2d4f64df99a7937772b797d…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5aa328fb2d4f64df99a7937772b797d…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
23 Jan '26
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
be8e5236 by Ben Gamari at 2026-01-23T03:28:45-05:00
hadrian: Bump QuickCheck upper bound
This patch bumps QuickCheck upper bound to 2.18. selftest rule
manually tested to work with current latest QuickCheck-2.17.1.0.
- - - - -
1 changed file:
- hadrian/hadrian.cabal
Changes:
=====================================
hadrian/hadrian.cabal
=====================================
@@ -190,4 +190,4 @@ executable hadrian
if flag(selftest)
other-modules: Rules.Selftest
cpp-options: -DHADRIAN_ENABLE_SELFTEST
- build-depends: QuickCheck >= 2.6 && < 2.15
+ build-depends: QuickCheck >= 2.6 && < 2.18
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/be8e5236ecd5b7d359e8a779e40c035…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/be8e5236ecd5b7d359e8a779e40c035…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/T26503] 32 commits: Add evals for strict data-con args in worker-functions
by Brandon Chinn (@brandonchinn178) 23 Jan '26
by Brandon Chinn (@brandonchinn178) 23 Jan '26
23 Jan '26
Brandon Chinn pushed to branch wip/T26503 at Glasgow Haskell Compiler / GHC
Commits:
c56567ec by Simon Peyton Jones at 2026-01-15T23:19:04+00:00
Add evals for strict data-con args in worker-functions
This fixes #26722, by adding an eval in a worker for
arguments of strict data constructors, even if the
function body uses them strictly.
See (WIS1) in Note [Which Ids should be strictified]
I took the opportunity to make substantial improvements in the
documentation for call-by-value functions. See especially
Note [CBV Function Ids: overview] in GHC.Types.Id.Info
Note [Which Ids should be CBV candidates?] ditto
Note [EPT enforcement] in GHC.Stg.EnforceEpt
among others.
- - - - -
9719ce5d by Simon Peyton Jones at 2026-01-15T23:19:04+00:00
Improve `interestingArg`
This function analyses a function's argument to see if it is
interesting enough to deserve an inlining discount. Improvements
for
* LitRubbish arguments
* exprIsExpandable arguments
See Note [Interesting arguments] which is substantially rewritten.
- - - - -
7b616b9f by Cheng Shao at 2026-01-16T06:45:00-05:00
compiler: fix regression when compiling foreign stubs in the rts unit
This patch fixes a regression when compiling foreign stubs in the rts
unit introduced in 05e25647f72bc102061af3f20478aa72bff6ff6e. A simple
revert would fix it, but it's better to implement a proper fix with
comment for better understanding of the underlying problem, see the
added comment for explanation.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
c343ef64 by Sylvain Henry at 2026-01-16T06:45:51-05:00
base: remove GHC.JS.Prim.Internal.Build (#23432)
See accepted CLC proposal https://github.com/haskell/core-libraries-committee/issues/329
- - - - -
29c0aceb by Simon Peyton Jones at 2026-01-16T17:18:11-05:00
Improve newtype unwrapping
Ticket #26746 describes several relatively-minor shortcomings of newtype
unwrapping. This MR addresses them, while also (arguably) simplifying
the code a bit.
See new Note [Solving newtype equalities: overview]
and Note [Decomposing newtype equalities]
and Note [Eager newtype decomposition]
and Note [Even more eager newtype decomposition]
For some reason, on Windows only, runtime allocations decrease for test
T5205 (from 52k to 48k). I have not idea why. No change at all on Linux.
I'm just going to accept the change. (I saw this same effect in another
MR so I think it's a fault in the baseline.)
Metric Decrease:
T5205
- - - - -
8b59e62c by Andreas Klebinger at 2026-01-16T17:18:52-05:00
testsuite: Widen acceptance window for T5205.
Fixes #26782
- - - - -
9e5e0234 by mangoiv at 2026-01-17T06:03:03-05:00
add a new issue template for getting verified
To reduce spam created by new users, we will in future not grant
any rights but reporting issues to new users. That is why we will
have to be able to verify them. The added issue template serves that
purpose.
- - - - -
b18b2c42 by Cheng Shao at 2026-01-17T06:03:44-05:00
llvm: fix split sections for llvm backend
This patch fixes split sections for llvm backend:
- Pass missing `--data-sections`/`--function-sections` flags to
llc/opt.
- Use `@llvm.compiler.used` instead of `@llvm.used` to avoid sections
being unnecessarily retained at link-time.
Fixes #26770.
-------------------------
Metric Decrease:
libdir
size_hello_artifact
size_hello_unicode
-------------------------
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
ebf66f67 by Cheng Shao at 2026-01-17T13:16:50-05:00
Update autoconf scripts
Scripts taken from autoconf a2287c3041a3f2a204eb942e09c015eab00dc7dd
- - - - -
598624b9 by Andreas Klebinger at 2026-01-17T13:17:32-05:00
CString.hs: Update incorrect comment.
Fixes #26322
- - - - -
eea2036b by Cheng Shao at 2026-01-18T10:00:49-05:00
libraries: bump haskeline submodule to 0.8.4.1
This patch bumps the haskeline submodule to 0.8.4.1 which includes an
important fix for an ANSI handling bug on Windows
(https://github.com/haskell/haskeline/pull/126)
- - - - -
87d8f6c2 by Cheng Shao at 2026-01-18T10:01:30-05:00
hadrian: replace default -H32m/-H64m with -O64M to improve mutator productivity
Most hadrian build flavours pass `-H32m`/`-H64m` to GHC as
conventional wisdom to improve mutator productivity and reduce GC
overhead. They were inherited from the legacy Make build system, and
there used to be make flags to instrument a build process with
`-Rghc-timing` option to collect GC stats of each GHC run from stderr.
It's time to revisit whether there are better defaults for
`-H32m`/`-H64m`, and this patch changes it to `-O64M` which indeed
improves mutator productivity based on real statistics. `-O64M` is
more aggressive than `-H64m`; it allows the old generation to grow to
at least 64M before triggering major GC and reduces major GC runs.
The stats of a clean build with `validate` flavour and `-H64m`:
```
h64m.log
matched RTS stat lines: 5499
sum MUT cpu : 2400.808 s
sum GC cpu : 1378.292 s
sum MUT elapsed : 2788.253 s
sum GC elapsed : 1389.233 s
GC/MUT cpu ratio : 0.574 (GC is 57.4% of MUT)
GC/MUT elapsed ratio : 0.498 (GC is 49.8% of MUT)
GC fraction of (MUT+GC) cpu : 36.5%
GC fraction of (MUT+GC) elapsed : 33.3%
per-line GC/MUT cpu ratio: median 0.691, p90 1.777
per-line GC/MUT elapsed ratio: median 0.519, p90 1.081
```
The stats of a clean build with `validate` flavour and `-O64M`:
```
o64m.log
matched RTS stat lines: 5499
sum MUT cpu : 2377.383 s
sum GC cpu : 1127.146 s
sum MUT elapsed : 2758.857 s
sum GC elapsed : 1135.587 s
GC/MUT cpu ratio : 0.474 (GC is 47.4% of MUT)
GC/MUT elapsed ratio : 0.412 (GC is 41.2% of MUT)
GC fraction of (MUT+GC) cpu : 32.2%
GC fraction of (MUT+GC) elapsed : 29.2%
per-line GC/MUT cpu ratio: median 0.489, p90 1.099
per-line GC/MUT elapsed ratio: median 0.367, p90 0.806
```
Mutator time is roughly in the same ballpark, but GC CPU time has
reduced by 18.22%, and mutator productivity has increased from 63.5%
to 67.8%.
- - - - -
8372e13d by Cheng Shao at 2026-01-18T10:02:12-05:00
rts: remove unused .def files from rts/win32
This patch removes unused .def files from `rts/win32`, given we don't
build .dll files for rts/ghc-internal/ghc-prim at all. Even when we
resurrect win32 dll support at some point in the future, these .def
files still contain incorrect symbols anyway and won't be of any use.
- - - - -
f6af485d by Cheng Shao at 2026-01-18T10:03:19-05:00
.gitmodules: use gitlab mirror for the libffi-clib submodule
This patch fixes .gitmodules to use the gitlab mirror for the
libffi-clib submodule, to make it coherent with other submodules that
allow ghc developers to experiment with wip branches in submodules for
ghc patches. Fixes #26783.
- - - - -
41432d25 by Cheng Shao at 2026-01-18T10:05:13-05:00
hadrian: remove the horrible i386 speedHack
When hadrian builds certain rts objects for i386, there's a horrible
speedHack that forces -fno-PIC even for dynamic ways of those objects.
This is not compatible with newer versions of gcc/binutils as well as
clang/lld, and this patch removes it. Fixes #26792.
- - - - -
323eb8f0 by Cheng Shao at 2026-01-18T21:48:19-05:00
hadrian: enable split sections for cross stage0
This patch fixes a minor issue with `splitSectionsArgs` in hadrian:
previously, it's unconditionally disabled for stage0 libraries because
it's not going to be shipped in the final bindists. But it's only true
when not cross compiling. So for now we also need to enable it for
cross stage0 as well.
- - - - -
3fadfefe by Andreas Klebinger at 2026-01-18T21:49:01-05:00
RTS: Document -K behaviour better
- - - - -
30f442a9 by Teo Camarasu at 2026-01-20T13:57:26-05:00
base: don't expose GHC.Num.{BigNat, Integer, Natural}
We no longer expose GHC.Num.{BigNat, Integer, Natural} from base instead users should get these modules from ghc-bignum.
We make this change to insulate end users from changes to GHC's implementation of big numbers.
Implements CLC proposal 359: https://github.com/haskell/core-libraries-committee/issues/359
- - - - -
75a9053d by Teo Camarasu at 2026-01-20T13:58:07-05:00
base: deprecate GHC internals in GHC.Num
Implements CLC proposal: https://github.com/haskell/core-libraries-committee/issues/360
- - - - -
9534b032 by Andreas Klebinger at 2026-01-20T13:58:50-05:00
ghc-experimental: Update Changelog
I tried to reconstruct a high level overview of the changes and when
they were made since we introduced it.
Fixes #26506
Co-authored-by: Teo Camarasu <teofilcamarasu(a)gmail.com>
- - - - -
346f2f5a by Cheng Shao at 2026-01-20T13:59:30-05:00
hadrian: remove RTS options in ghc-in-ghci flavour
This patch removes the RTS options passed to ghc in ghc-in-ghci
flavour, to workaround command line argument handling issue in
hls/hie-boot that results in `-O64M` instead of `+RTS -O64M -RTS`
being passed to ghc. It's not a hadrian bug per se, since ghc's own
ghc-in-ghci multi repl works fine, but we should still make sure HLS
works. Closes #26801.
- - - - -
759fd15a by Andreas Klebinger at 2026-01-21T16:05:28-05:00
Don't build GHC with -Wcompat
Without bumping the boot compiler the warnings it produces are often not
actionable leading to pointless noise.
Fixes #26800
- - - - -
3172db94 by Torsten Schmits at 2026-01-21T16:06:11-05:00
Use the correct field of ModOrigin when formatting error message listing hidden reexports
- - - - -
485c12b2 by Cheng Shao at 2026-01-21T16:06:54-05:00
Revert "hadrian: handle findExecutable "" gracefully"
This reverts commit 1e5752f64a522c4025365856d92f78073a7b3bba. The
underlying issue has been fixed in
https://github.com/haskell/directory/commit/75828696e7145adc09179111a0d631b…
and present since 1.3.9.0, and hadrian directory lower bound is
1.3.9.0, so we can revert our own in house hack now.
- - - - -
5efb58dc by Cheng Shao at 2026-01-21T16:07:36-05:00
rts: fix typo in TICK_ALLOC_RTS
This patch fixes a typo in the `TICK_ALLOC_RTS` macro, the original
`bytes` argument was silently dropped. The Cmm code has its own
version of `TICK_ALLOC_RTS` not affected by this typo, it affected the
C RTS, and went unnoticed because the variable `n` happened to also be
available at its call site. But the number was incorrect. Also fixes
its call site since `WDS()` is not available in C.
- - - - -
c406ea69 by Cheng Shao at 2026-01-21T16:07:36-05:00
rts: remove broken & unused ALLOC_P_TICKY
This patch removes the `ALLOC_P_TICKY` macro from the rts, it's
unused, and its expanded code is already broken.
- - - - -
34a27e20 by Simon Peyton Jones at 2026-01-21T16:08:17-05:00
Make the implicit-parameter class have representational role
This MR addresses #26737, by making the built-in class IP
have a representational role for its second parameter.
See Note [IP: implicit parameter class] in
ghc-internal:GHC.Internal.Classes.IP
In fact, IP is (unfortunately, currently) exposed by
base:GHC.Base, so we ran a quick CLC proposal to
agree the change:
https://github.com/haskell/core-libraries-committee/issues/385
Some (small) compilations get faster because they only need to
load (small) interface file GHC.Internal.Classes.IP.hi,
rather than (large) GHC.Internal.Classes.hi.
Metric Decrease:
T10421
T12150
T12425
T24582
T5837
T5030
- - - - -
ca79475f by Cheng Shao at 2026-01-21T16:09:00-05:00
testsuite: avoid re.sub in favor of simple string replacements
This patch refactors the testsuite driver and avoids the usage of
re.sub in favor of simple string replacements when possible. The
changes are not comprehensive, and there are still a lot of re.sub
usages lingering around the tree, but this already addresses a major
performance bottleneck in the testsuite driver that might has to do
with quadratic or worse slowdown in cpython's regular expression
engine when handling certain regex patterns with large strings.
Especially on i386, and i386 jobs are the bottlenecks of all full-ci
validate pipelines!
Here are the elapsed times of testing x86_64/i386 with -j48 before
this patch:
x86_64: `Build completed in 6m06s`
i386: `Build completed in 1h36m`
And with this patch:
x86_64: `Build completed in 4m55s`
i386: `Build completed in 4m23s`
Fixes #26786.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
88c93796 by Zubin Duggal at 2026-01-21T16:09:42-05:00
ghc-toolchain: Also configure windres on non-windows platforms.
It may be needed for cross compilation.
Fixes #24588
- - - - -
9788c0ec by Cheng Shao at 2026-01-21T16:10:24-05:00
ghci: print external interpreter trace messages to stderr instead of stdout
This patch makes ghci print external interpreter trace messages to
stderr instead of stdout, which is a much saner choice for diagnostic
information. Closes #26807.
- - - - -
bc4d948a by Brandon Chinn at 2026-01-21T19:52:29-08:00
Unify HsString + HsMultilineString
- - - - -
c32aefd9 by Brandon Chinn at 2026-01-22T22:29:24-08:00
Implement QualifiedStrings (#26503)
See Note [Implementation of QualifiedStrings]
- - - - -
173 changed files:
- + .gitlab/issue_templates/get-verified.md
- .gitmodules
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/CmmToLlvm.hs
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/Core/FamInstEnv.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Opt/WorkWrap.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/Tidy.hs
- compiler/GHC/Core/Unfold.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Driver/CodeOutput.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Lit.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Match/Literal.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/Lexer.x
- compiler/GHC/Parser/String.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Stg/EnforceEpt.hs
- compiler/GHC/Stg/Lint.hs
- compiler/GHC/StgToCmm/Closure.hs
- compiler/GHC/StgToCmm/Expr.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Utils/Instantiate.hs
- compiler/GHC/Tc/Utils/TcMType.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Id.hs
- compiler/GHC/Types/Id/Info.hs
- compiler/GHC/Types/Id/Make.hs
- + compiler/GHC/Types/StringMeta.hs
- compiler/GHC/Unit/State.hs
- compiler/Language/Haskell/Syntax/Extension.hs
- compiler/Language/Haskell/Syntax/Lit.hs
- compiler/ghc.cabal.in
- config.guess
- config.sub
- docs/users_guide/9.16.1-notes.rst
- + docs/users_guide/exts/qualified_strings.rst
- docs/users_guide/runtime_control.rst
- hadrian/doc/flavours.md
- hadrian/src/Hadrian/Utilities.hs
- hadrian/src/Rules/Docspec.hs
- hadrian/src/Rules/Lint.hs
- hadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Builders/RunTest.hs
- hadrian/src/Settings/Builders/SplitSections.hs
- hadrian/src/Settings/Default.hs
- hadrian/src/Settings/Flavours/Benchmark.hs
- hadrian/src/Settings/Flavours/Development.hs
- hadrian/src/Settings/Flavours/GhcInGhci.hs
- hadrian/src/Settings/Flavours/Performance.hs
- hadrian/src/Settings/Flavours/Quick.hs
- hadrian/src/Settings/Flavours/QuickCross.hs
- hadrian/src/Settings/Flavours/Quickest.hs
- hadrian/src/Settings/Flavours/Validate.hs
- hadrian/src/Settings/Packages.hs
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/src/Data/Array/Byte.hs
- − libraries/base/src/GHC/JS/Prim/Internal/Build.hs
- libraries/base/src/GHC/Num.hs
- − libraries/base/src/GHC/Num/BigNat.hs
- − libraries/base/src/GHC/Num/Integer.hs
- − libraries/base/src/GHC/Num/Natural.hs
- libraries/base/src/System/CPUTime/Utils.hs
- libraries/ghc-bignum/ghc-bignum.cabal
- libraries/ghc-boot-th/GHC/Boot/TH/Ppr.hs
- libraries/ghc-experimental/CHANGELOG.md
- libraries/ghc-experimental/ghc-experimental.cabal.in
- libraries/ghc-experimental/src/GHC/TypeNats/Experimental.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/CString.hs
- libraries/ghc-internal/src/GHC/Internal/Classes.hs
- + libraries/ghc-internal/src/GHC/Internal/Classes/IP.hs
- libraries/ghc-internal/src/GHC/Internal/LanguageExtensions.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Lib.hs
- libraries/ghc-internal/src/GHC/Internal/TH/Syntax.hs
- libraries/ghci/GHCi/Server.hs
- libraries/haskeline
- libraries/template-haskell/Language/Haskell/TH/Lib.hs
- rts/include/Cmm.h
- rts/include/stg/Ticky.h
- rts/sm/Storage.c
- − rts/win32/libHSffi.def
- − rts/win32/libHSghc-internal.def
- − rts/win32/libHSghc-prim.def
- testsuite/driver/runtests.py
- testsuite/driver/testlib.py
- testsuite/driver/testutil.py
- testsuite/tests/count-deps/CountDepsAst.stdout
- testsuite/tests/count-deps/CountDepsParser.stdout
- testsuite/tests/deriving/should_fail/T8984.stderr
- testsuite/tests/deriving/should_fail/deriving-via-fail.stderr
- testsuite/tests/deriving/should_fail/deriving-via-fail4.stderr
- testsuite/tests/deriving/should_fail/deriving-via-fail5.stderr
- testsuite/tests/driver/T4437.hs
- testsuite/tests/ghc-api/annotations-literals/literals.stdout
- testsuite/tests/ghc-api/annotations-literals/parsed.hs
- testsuite/tests/ghc-api/annotations-literals/parsed.stdout
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/interface-stability/ghc-prim-exports.stdout
- testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32
- testsuite/tests/interface-stability/template-haskell-exports.stdout
- testsuite/tests/parser/should_compile/DumpParsedAst.stderr
- testsuite/tests/parser/should_compile/DumpParsedAstComments.stderr
- testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
- testsuite/tests/parser/should_compile/DumpTypecheckedAst.stderr
- testsuite/tests/perf/should_run/all.T
- + testsuite/tests/qualified-strings/Makefile
- + testsuite/tests/qualified-strings/should_compile/Example/Length.hs
- + testsuite/tests/qualified-strings/should_compile/all.T
- + testsuite/tests/qualified-strings/should_compile/qstrings_redundant_pattern.hs
- + testsuite/tests/qualified-strings/should_compile/qstrings_redundant_pattern.stderr
- + testsuite/tests/qualified-strings/should_fail/Example/Length.hs
- + testsuite/tests/qualified-strings/should_fail/Makefile
- + testsuite/tests/qualified-strings/should_fail/all.T
- + testsuite/tests/qualified-strings/should_fail/qstrings_bad_expr.hs
- + testsuite/tests/qualified-strings/should_fail/qstrings_bad_expr.stderr
- + testsuite/tests/qualified-strings/should_fail/qstrings_bad_pat.hs
- + testsuite/tests/qualified-strings/should_fail/qstrings_bad_pat.stderr
- + testsuite/tests/qualified-strings/should_fail/qstrings_multiline_no_ext.hs
- + testsuite/tests/qualified-strings/should_fail/qstrings_multiline_no_ext.stderr
- + testsuite/tests/qualified-strings/should_run/Example/ByteStringAscii.hs
- + testsuite/tests/qualified-strings/should_run/Example/ByteStringUtf8.hs
- + testsuite/tests/qualified-strings/should_run/Example/Text.hs
- + testsuite/tests/qualified-strings/should_run/Makefile
- + testsuite/tests/qualified-strings/should_run/all.T
- + testsuite/tests/qualified-strings/should_run/qstrings_expr.hs
- + testsuite/tests/qualified-strings/should_run/qstrings_expr.stdout
- + testsuite/tests/qualified-strings/should_run/qstrings_pat.hs
- + testsuite/tests/qualified-strings/should_run/qstrings_pat.stdout
- + testsuite/tests/qualified-strings/should_run/qstrings_th.hs
- + testsuite/tests/qualified-strings/should_run/qstrings_th.stdout
- testsuite/tests/simplCore/should_compile/T18013.stderr
- + testsuite/tests/simplCore/should_compile/T26722.hs
- + testsuite/tests/simplCore/should_compile/T26722.stderr
- testsuite/tests/simplCore/should_compile/all.T
- testsuite/tests/th/TH_implicitParams.stdout
- + testsuite/tests/typecheck/should_compile/T26737.hs
- + testsuite/tests/typecheck/should_compile/T26746.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_fail/T15801.stderr
- testsuite/tests/typecheck/should_fail/T22924b.stderr
- testsuite/tests/typecheck/should_fail/TcCoercibleFail.hs
- testsuite/tests/typecheck/should_fail/TcCoercibleFail.stderr
- testsuite/tests/typecheck/should_fail/all.T
- utils/check-exact/ExactPrint.hs
- utils/ghc-toolchain/exe/Main.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6dfed3a3d0b444bc6b971a6e32ba9e…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/6dfed3a3d0b444bc6b971a6e32ba9e…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
23 Jan '26
Simon Hengel pushed new branch wip/sol/roles-documentation at Glasgow Haskell Compiler / GHC
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/tree/wip/sol/roles-documentation
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/spj-apporv-Oct24] 39 commits: base: don't expose GHC.Num.{BigNat, Integer, Natural}
by Apoorv Ingle (@ani) 23 Jan '26
by Apoorv Ingle (@ani) 23 Jan '26
23 Jan '26
Apoorv Ingle pushed to branch wip/spj-apporv-Oct24 at Glasgow Haskell Compiler / GHC
Commits:
30f442a9 by Teo Camarasu at 2026-01-20T13:57:26-05:00
base: don't expose GHC.Num.{BigNat, Integer, Natural}
We no longer expose GHC.Num.{BigNat, Integer, Natural} from base instead users should get these modules from ghc-bignum.
We make this change to insulate end users from changes to GHC's implementation of big numbers.
Implements CLC proposal 359: https://github.com/haskell/core-libraries-committee/issues/359
- - - - -
75a9053d by Teo Camarasu at 2026-01-20T13:58:07-05:00
base: deprecate GHC internals in GHC.Num
Implements CLC proposal: https://github.com/haskell/core-libraries-committee/issues/360
- - - - -
9534b032 by Andreas Klebinger at 2026-01-20T13:58:50-05:00
ghc-experimental: Update Changelog
I tried to reconstruct a high level overview of the changes and when
they were made since we introduced it.
Fixes #26506
Co-authored-by: Teo Camarasu <teofilcamarasu(a)gmail.com>
- - - - -
346f2f5a by Cheng Shao at 2026-01-20T13:59:30-05:00
hadrian: remove RTS options in ghc-in-ghci flavour
This patch removes the RTS options passed to ghc in ghc-in-ghci
flavour, to workaround command line argument handling issue in
hls/hie-boot that results in `-O64M` instead of `+RTS -O64M -RTS`
being passed to ghc. It's not a hadrian bug per se, since ghc's own
ghc-in-ghci multi repl works fine, but we should still make sure HLS
works. Closes #26801.
- - - - -
759fd15a by Andreas Klebinger at 2026-01-21T16:05:28-05:00
Don't build GHC with -Wcompat
Without bumping the boot compiler the warnings it produces are often not
actionable leading to pointless noise.
Fixes #26800
- - - - -
3172db94 by Torsten Schmits at 2026-01-21T16:06:11-05:00
Use the correct field of ModOrigin when formatting error message listing hidden reexports
- - - - -
485c12b2 by Cheng Shao at 2026-01-21T16:06:54-05:00
Revert "hadrian: handle findExecutable "" gracefully"
This reverts commit 1e5752f64a522c4025365856d92f78073a7b3bba. The
underlying issue has been fixed in
https://github.com/haskell/directory/commit/75828696e7145adc09179111a0d631b…
and present since 1.3.9.0, and hadrian directory lower bound is
1.3.9.0, so we can revert our own in house hack now.
- - - - -
5efb58dc by Cheng Shao at 2026-01-21T16:07:36-05:00
rts: fix typo in TICK_ALLOC_RTS
This patch fixes a typo in the `TICK_ALLOC_RTS` macro, the original
`bytes` argument was silently dropped. The Cmm code has its own
version of `TICK_ALLOC_RTS` not affected by this typo, it affected the
C RTS, and went unnoticed because the variable `n` happened to also be
available at its call site. But the number was incorrect. Also fixes
its call site since `WDS()` is not available in C.
- - - - -
c406ea69 by Cheng Shao at 2026-01-21T16:07:36-05:00
rts: remove broken & unused ALLOC_P_TICKY
This patch removes the `ALLOC_P_TICKY` macro from the rts, it's
unused, and its expanded code is already broken.
- - - - -
34a27e20 by Simon Peyton Jones at 2026-01-21T16:08:17-05:00
Make the implicit-parameter class have representational role
This MR addresses #26737, by making the built-in class IP
have a representational role for its second parameter.
See Note [IP: implicit parameter class] in
ghc-internal:GHC.Internal.Classes.IP
In fact, IP is (unfortunately, currently) exposed by
base:GHC.Base, so we ran a quick CLC proposal to
agree the change:
https://github.com/haskell/core-libraries-committee/issues/385
Some (small) compilations get faster because they only need to
load (small) interface file GHC.Internal.Classes.IP.hi,
rather than (large) GHC.Internal.Classes.hi.
Metric Decrease:
T10421
T12150
T12425
T24582
T5837
T5030
- - - - -
ca79475f by Cheng Shao at 2026-01-21T16:09:00-05:00
testsuite: avoid re.sub in favor of simple string replacements
This patch refactors the testsuite driver and avoids the usage of
re.sub in favor of simple string replacements when possible. The
changes are not comprehensive, and there are still a lot of re.sub
usages lingering around the tree, but this already addresses a major
performance bottleneck in the testsuite driver that might has to do
with quadratic or worse slowdown in cpython's regular expression
engine when handling certain regex patterns with large strings.
Especially on i386, and i386 jobs are the bottlenecks of all full-ci
validate pipelines!
Here are the elapsed times of testing x86_64/i386 with -j48 before
this patch:
x86_64: `Build completed in 6m06s`
i386: `Build completed in 1h36m`
And with this patch:
x86_64: `Build completed in 4m55s`
i386: `Build completed in 4m23s`
Fixes #26786.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
88c93796 by Zubin Duggal at 2026-01-21T16:09:42-05:00
ghc-toolchain: Also configure windres on non-windows platforms.
It may be needed for cross compilation.
Fixes #24588
- - - - -
9788c0ec by Cheng Shao at 2026-01-21T16:10:24-05:00
ghci: print external interpreter trace messages to stderr instead of stdout
This patch makes ghci print external interpreter trace messages to
stderr instead of stdout, which is a much saner choice for diagnostic
information. Closes #26807.
- - - - -
0491f08a by Sylvain Henry at 2026-01-22T03:44:26-05:00
GC: don't use CAS without PARALLEL_GC on
If we're not using the parallel GC, there is no reason to do a costly
CAS. This was flagged as taking time in a perf profile.
- - - - -
211a8f56 by Sylvain Henry at 2026-01-22T03:44:26-05:00
GC: suffix parallel GC with "par" instead of "thr"
Avoid some potential confusion (see discussion in !15351).
- - - - -
77a23cbd by fendor at 2026-01-22T03:45:08-05:00
Remove blanket ignore that covers libraries/
- - - - -
18bf7f5c by Léana Jiang at 2026-01-22T08:58:45-05:00
doc: update Flavour type in hadrian user-settings
- - - - -
3d5a1365 by Cheng Shao at 2026-01-22T08:59:28-05:00
hadrian: add missing notCross predicate for stage0 -O0
There are a few hard-coded hadrian args that pass -O0 when compiling
some heavy modules in stage0, which only makes sense when not
cross-compiling and when cross-compiling we need properly optimized
stage0 packages. So this patch adds the missing `notCross` predicate
in those places.
- - - - -
ee937134 by Matthew Pickering at 2026-01-22T09:00:10-05:00
Fix ghc-experimental GHC.Exception.Backtrace.Experimental module
This module wasn't added to the cabal file so it was never compiled or
included in the library.
- - - - -
1b490f5a by Zubin Duggal at 2026-01-22T09:00:53-05:00
hadrian: Add ghc-{experimental,internal}.cabal to the list of dependencies of the doc target
We need these files to detect the version of these libraries
Fixes #26738
- - - - -
cdb74049 by Cheng Shao at 2026-01-22T14:52:36-05:00
rts: avoid Cmm loop to initialize Array#/SmallArray#
Previously, `newArray#`/`newSmallArray#` called an RTS C function to
allocate the `Array#`/`SmallArray#`, then used a Cmm loop to
initialize the elements. Cmm doesn't have native for-loop so the code
is a bit awkward, and it's less efficient than a C loop, since the C
compiler can effectively vectorize the loop with optimizations.
So this patch moves the loop that initializes the elements to the C
side. `allocateMutArrPtrs`/`allocateSmallMutArrPtrs` now takes a new
`init` argument and initializes the elements if `init` is non-NULL.
- - - - -
4c784f00 by Cheng Shao at 2026-01-22T14:53:19-05:00
Fix testsuite run for +ipe flavour transformer
This patch makes the +ipe flavour transformer pass the entire
testsuite:
- An RTS debug option `-DI` is added, the IPE trace information is now
only printed with `-DI`. The test cases that do require IPE trace
are now run with `-DI`.
- The testsuite config option `ghc_with_ipe` is added, enabled when
running the testsuite with `+ipe`, which skips a few tests that are
sensitive to eventlog output, allocation patterns etc that can fail
under `+ipe`.
This is the first step towards #26799.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
b175c608 by Apoorv Ingle at 2026-01-22T16:53:09-06:00
This commit:
- Streamlines implementations of `tcExpr` and `tcXExpr` to work on `XExpr`
Calls `setInGeneratedCode` everytime the typechecker goes over an `XExpr`
- Kills `VACtxt` (and its associated VAExpansion and VACall) datatype, it is subsumed by simply a SrcSpan.
- Kills the function `addHeadCtxt` as it is now mearly setting a location
- The function `tcValArgs` does its own argument number management
- Makes `splitHsApps` not look through `XExpr`
- `tcExprSigma` is called if the head of the expression after calling `splitHsApps` turns out to be an `XExpr`
- Removes location information from `OrigPat` payload
- Removes special case of tcBody from `tcLambdaMatches`
- Removes special case of `dsExpr` for `ExpandedThingTc`
- Moves `setQLInstLevel` inside `tcInstFun`
- Rename `HsThingRn` to `SrcCodeCtxt`
- Kills `tcl_in_gen_code` and `tcl_err_ctxt`. It is subsumed by `ErrCtxtStack`
- Kills `ExpectedFunTyOrig`. It is subsumed by `CtOrigin`
- Fixes `CtOrigin` for `HsProjection` case in `exprCtOrigin`. It was previously assigned to be `SectionOrigin`. It is now just the expression
- Adds a new `CtOrigin.ExpansionOrigin` for storing the original syntax
- Adds a new `CtOrigin.ExpectedTySyntax` as a replacement for `ExpectedTySyntaxOp`. Cannot kill the former yet because of `ApplicativeDo`
- Renames `tcMonoExpr` -> `tcMonoLExpr`, `tcMonoExprNC` -> `tcMonoLExpr`
- Renames `EValArg`, `EValArgQL` fields: `ea_ctxt` -> `ea_loc_span` and `eaql_ctx` -> `eaql_loc_span`
Notes added [Error Context Stack]
Notes updated Note [Expanding HsDo with XXExprGhcRn]
-------------------------
Metric Decrease:
T9020
-------------------------
- - - - -
f1720d38 by Apoorv Ingle at 2026-01-22T16:53:09-06:00
- kill PopErrCtxt
- Pass in the location of the head of the application chain to `addArgCtxt` to print better error messages.
Make `addArgCtxt` print in the nth argument if the head of the application chain is user located.
- match context with record updates dont get added in error context
- Do not use HsPar in Last statement
- simplify addArgCtxt and push setSrcSpan inside addLExprCtxt. Make sure addExprCtxt is not called by itself
- fun_orig in tcApp depends on the SrcSpan of the head of the application chain (similar to addArgCtxt)
- rename fun_ctxt to fun_lspan, fun_orig passed in tcInstFun to default to app chain head if its user located, fall back to srcCodeOrigin if it's a generated location
- fix quickLookArg function to blame the correct application chain head. The arguments application chain head should be blamed, not the original head when we quick look arg
- Make sure only expression wrapped around generated src span are ignored while adding them to the error context stack
- In `addArgCtxt` the nth argument's err ctxt adds a generated error ctxt if the argument is XExpr
- - - - -
95655789 by Apoorv Ingle at 2026-01-22T16:53:09-06:00
- make sure landmark error contexts are always printed. accept some testcases
- fix overloaded list error message. Expanded Expressions head `listFromN` should be wrapped in a generated source span
(Wrinkle) This may make some HIE tests to fail, but HIE should fix the behaviour there.
- Fix notes
- fix for MonadFailErrors test case. OrigPat now also stores the statement to make the error message resonable
- - - - -
ebf00d9c by Apoorv Ingle at 2026-01-22T16:54:20-06:00
- `getDeepSubsumptionFlag_DataConHead` performs a non-trivial traversal if the expression passed to it is complex.
This traversal is necessary if the head of the function is an `XExpr` and `splitHsApps` does not look through them
- The deepsubsumption flag is stored in EVAlArgQL to reduce the need to call `getDeepSubsumptionFlag_DataConHead`
- `getDeepSubsumptionFlag_DataConHead` is called in `tcExprSigma` and `tcInferAppHead` to reduce AST traversals
- refactor building CtOrigin before instantiations as a function. It does state lookup only if needed.
- In tcDoStmts, we lose the location of the first statement. It is needed for getting the pattern match check right
Further, do not call addErrCtxt on it, the tcMonoLExpr will do it for us.
- during QL arg's function head instantiation use more a more accurate location for arg when the application chain is null
- - - - -
36daacf3 by Apoorv Ingle at 2026-01-22T16:54:33-06:00
do not add error context in tcExprSigma for XExpr and do not setQLInstLevel before tcInstFun
- - - - -
aa723089 by Apoorv Ingle at 2026-01-22T16:54:33-06:00
wrap expanded records in an XExpr. Accept test cases
- - - - -
071c5c37 by Apoorv Ingle at 2026-01-22T16:54:33-06:00
in QuicklookArg, wrap the inferAppHead_maybe with an optional error context update. If the head is a XExpr, we need to flip the state to generated
- - - - -
f06d4526 by Apoorv Ingle at 2026-01-22T16:54:33-06:00
ignore patterns wrapped around generated src span while type checking patterns
- - - - -
a53bbd67 by Apoorv Ingle at 2026-01-22T16:54:33-06:00
fixing some more error messages
- - - - -
0b9459f8 by Apoorv Ingle at 2026-01-22T16:54:33-06:00
wrap fromListN with a generated src span
- - - - -
5168027e by Apoorv Ingle at 2026-01-22T16:54:33-06:00
some minor things
- - - - -
39a4eaa9 by Apoorv Ingle at 2026-01-22T16:54:33-06:00
enable NB for custom, user written HasField constraint errors
- - - - -
da99bb68 by Apoorv Ingle at 2026-01-22T16:54:33-06:00
rebase changes
- - - - -
d8e2b6ef by Apoorv Ingle at 2026-01-22T16:54:33-06:00
add Overview note
- - - - -
9cc0b6ce by Apoorv Ingle at 2026-01-22T16:54:33-06:00
fix for failing test case
- - - - -
68f1bb56 by Apoorv Ingle at 2026-01-22T18:05:30-06:00
do not overwrite err ctxt head when we add err ctxt due to expanded exprs `(XExpr (OrigStmt{})` fixes RecordDotSyntaxFail and T26480b test cases where a record is updated within a do statement
- - - - -
35f9fbfc by Apoorv Ingle at 2026-01-22T18:06:03-06:00
- Make a new variant `GeneratedSrcSpan` in `SrcSpan` for HIEAst Nodes
- remove UnhelpfulGenerated from UnhelpfulSpanReason and into new datatype GeneratedSrcSpanDetails
- Fixes T23540, tcfail181
- - - - -
151 changed files:
- .gitignore
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Hs/DocString.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Monad.hs
- compiler/GHC/HsToCore/Pmc.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Ext/Utils.hs
- compiler/GHC/Parser/HaddockLex.x
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Utils.hs
- compiler/GHC/Runtime/Debugger/Breakpoints.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Gen/App.hs
- + compiler/GHC/Tc/Gen/App.hs-boot
- compiler/GHC/Tc/Gen/Do.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Expr.hs-boot
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/Instance/Class.hs
- compiler/GHC/Tc/Types/CtLoc.hs
- compiler/GHC/Tc/Types/ErrCtxt.hs
- compiler/GHC/Tc/Types/LclEnv.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/GHC/Types/Error.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/GHC/Types/Name/Reader.hs
- compiler/GHC/Types/SrcLoc.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Logger.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.16.1-notes.rst
- docs/users_guide/runtime_control.rst
- ghc/GHCi/UI.hs
- ghc/GHCi/UI/Info.hs
- hadrian/doc/user-settings.md
- hadrian/src/Flavour.hs
- hadrian/src/Hadrian/Utilities.hs
- hadrian/src/Rules/Docspec.hs
- hadrian/src/Rules/Documentation.hs
- hadrian/src/Rules/Lint.hs
- hadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Builders/RunTest.hs
- hadrian/src/Settings/Flavours/GhcInGhci.hs
- hadrian/src/Settings/Packages.hs
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/src/Data/Array/Byte.hs
- libraries/base/src/GHC/Num.hs
- − libraries/base/src/GHC/Num/BigNat.hs
- − libraries/base/src/GHC/Num/Integer.hs
- − libraries/base/src/GHC/Num/Natural.hs
- libraries/base/src/System/CPUTime/Utils.hs
- libraries/ghc-bignum/ghc-bignum.cabal
- libraries/ghc-compact/tests/all.T
- libraries/ghc-experimental/CHANGELOG.md
- libraries/ghc-experimental/ghc-experimental.cabal.in
- libraries/ghc-experimental/src/GHC/Exception/Backtrace/Experimental.hs
- libraries/ghc-experimental/src/GHC/TypeNats/Experimental.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Classes.hs
- + libraries/ghc-internal/src/GHC/Internal/Classes/IP.hs
- libraries/ghc-internal/tests/backtraces/all.T
- libraries/ghci/GHCi/Server.hs
- rts/AllocArray.c
- rts/AllocArray.h
- rts/ClosureTable.c
- rts/Heap.c
- rts/PrimOps.cmm
- rts/RtsFlags.c
- rts/Threads.c
- rts/Trace.c
- rts/Weak.c
- rts/include/Cmm.h
- rts/include/rts/Flags.h
- rts/include/stg/Ticky.h
- rts/rts.cabal
- rts/sm/Evac.c
- rts/sm/Evac_thr.c → rts/sm/Evac_par.c
- rts/sm/Scav_thr.c → rts/sm/Scav_par.c
- rts/sm/Storage.c
- testsuite/driver/runtests.py
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- testsuite/driver/testutil.py
- testsuite/tests/indexed-types/should_fail/T2693.stderr
- testsuite/tests/indexed-types/should_fail/T5439.stderr
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
- testsuite/tests/interface-stability/ghc-prim-exports.stdout
- testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32
- testsuite/tests/overloadedrecflds/should_fail/T26480b.stderr
- testsuite/tests/parser/should_fail/RecordDotSyntaxFail10.stderr
- testsuite/tests/parser/should_fail/RecordDotSyntaxFail11.stderr
- testsuite/tests/parser/should_fail/RecordDotSyntaxFail8.stderr
- testsuite/tests/plugins/test-defaulting-plugin.stderr
- testsuite/tests/printer/T17697.stderr
- testsuite/tests/rebindable/rebindable6.stderr
- testsuite/tests/rep-poly/RepPolyDoBind.stderr
- testsuite/tests/rep-poly/RepPolyDoBody1.stderr
- testsuite/tests/rep-poly/RepPolyDoBody2.stderr
- testsuite/tests/rep-poly/RepPolyRecordUpdate.stderr
- testsuite/tests/rts/Makefile
- testsuite/tests/rts/all.T
- testsuite/tests/rts/ipe/all.T
- testsuite/tests/th/TH_implicitParams.stdout
- + testsuite/tests/typecheck/should_compile/ExpansionQLIm.hs
- testsuite/tests/typecheck/should_compile/T14590.stderr
- + testsuite/tests/typecheck/should_compile/T26737.hs
- testsuite/tests/typecheck/should_compile/all.T
- testsuite/tests/typecheck/should_compile/valid_hole_fits.stderr
- testsuite/tests/typecheck/should_fail/DoExpansion1.stderr
- testsuite/tests/typecheck/should_fail/DoExpansion2.stderr
- testsuite/tests/typecheck/should_fail/T10971d.stderr
- testsuite/tests/typecheck/should_fail/T13311.stderr
- testsuite/tests/typecheck/should_fail/T3323.stderr
- testsuite/tests/typecheck/should_fail/T3613.stderr
- testsuite/tests/typecheck/should_fail/T6069.stderr
- testsuite/tests/typecheck/should_fail/T7851.stderr
- testsuite/tests/typecheck/should_fail/T7857.stderr
- testsuite/tests/typecheck/should_fail/T8603.stderr
- testsuite/tests/typecheck/should_fail/T9612.stderr
- testsuite/tests/typecheck/should_fail/tcfail102.stderr
- testsuite/tests/typecheck/should_fail/tcfail128.stderr
- testsuite/tests/typecheck/should_fail/tcfail140.stderr
- testsuite/tests/typecheck/should_fail/tcfail181.stderr
- utils/check-exact/ExactPrint.hs
- utils/check-exact/Parsers.hs
- utils/check-exact/Transform.hs
- utils/check-exact/Utils.hs
- utils/ghc-toolchain/exe/Main.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hyperlinker/Parser.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Utils.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/97246591adca6ce6fe1c3383e45233…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/97246591adca6ce6fe1c3383e45233…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
Simon Peyton Jones pushed to branch wip/26805 at Glasgow Haskell Compiler / GHC
Commits:
596c2135 by Simon Peyton Jones at 2026-01-22T23:29:28+00:00
wibble
- - - - -
1 changed file:
- compiler/GHC/Tc/Utils/Monad.hs
Changes:
=====================================
compiler/GHC/Tc/Utils/Monad.hs
=====================================
@@ -1750,7 +1750,7 @@ Other wrinkles
(CERR2) In #26015 I found that from the constraints
[W] alpha ~ Int -- A class constraint
[W] F alpha ~# Bool -- An equality constraint
- we were dropping the first (becuase it's a class constraint) but not the
+ we were dropping the first (because it's a class constraint) but not the
second, and then getting a misleading error message from the second. As
#25607 shows, we can get not just one but a zillion bogus messages, which
conceal the one genuine error. Boo.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/596c213508daa7976fb39fdb60cf71e…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/596c213508daa7976fb39fdb60cf71e…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/26805] Finally fix the constraints-library bug
by Simon Peyton Jones (@simonpj) 23 Jan '26
by Simon Peyton Jones (@simonpj) 23 Jan '26
23 Jan '26
Simon Peyton Jones pushed to branch wip/26805 at Glasgow Haskell Compiler / GHC
Commits:
ed1e2ce4 by Simon Peyton Jones at 2026-01-22T23:28:26+00:00
Finally fix the constraints-library bug
- - - - -
4 changed files:
- compiler/GHC/Tc/Solver/Dict.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Utils/Monad.hs
Changes:
=====================================
compiler/GHC/Tc/Solver/Dict.hs
=====================================
@@ -748,7 +748,8 @@ try_inert_dicts inerts dict_w@(DictCt { di_ev = ev_w, di_cls = cls, di_tys = tys
= -- There is a matching dictionary in the inert set
do { -- For a Wanted, first to try to solve it /completely/ from top level instances
-- See Note [Shortcut solving]
- ; short_cut_worked <- tryShortCutSolver (isGiven ev_i) dict_w
+ ; dflags <- getDynFlags
+ ; short_cut_worked <- tryShortCutSolver dflags (isGiven ev_i) dict_w
; if | short_cut_worked
-> stopWith ev_w "shortCutSolver worked(1)"
@@ -776,7 +777,8 @@ try_inert_dicts inerts dict_w@(DictCt { di_ev = ev_w, di_cls = cls, di_tys = tys
; continueWith () }
-- See Note [Shortcut solving]
-tryShortCutSolver :: Bool -- True <=> try the short-cut solver; False <=> don't
+tryShortCutSolver :: DynFlags
+ -> Bool -- True <=> try the short-cut solver; False <=> don't
-> DictCt -- Work item
-> TcS Bool -- True <=> success
-- We are about to solve a [W] constraint from a [G] constraint. We take
@@ -784,34 +786,25 @@ tryShortCutSolver :: Bool -- True <=> try the short-cut solver; False <=>
-- Note that we only do this for the sake of performance. Exactly the same
-- programs should typecheck regardless of whether we take this step or
-- not. See Note [Shortcut solving]
-tryShortCutSolver try_short_cut dict_w@(DictCt { di_ev = ev_w })
- | not try_short_cut
- = return False
- | otherwise
- = do { dflags <- getDynFlags
- ; if | CtWanted (WantedCt { ctev_pred = pred_w }) <- ev_w
-
- , not (couldBeIPLike pred_w) -- Not for implicit parameters (#18627)
+tryShortCutSolver dflags try_short_cut dict_w
+ | try_short_cut
+ , DictCt { di_ev = ev_w } <- dict_w
+ , CtWanted (WantedCt { ctev_pred = pred_w }) <- ev_w
+ , not (couldBeIPLike pred_w) -- Not for implicit parameters (#18627)
- , not (xopt LangExt.IncoherentInstances dflags)
+ , not (xopt LangExt.IncoherentInstances dflags)
-- If IncoherentInstances is on then we cannot rely on coherence of proofs
-- in order to justify this optimization: The proof provided by the
-- [G] constraint's superclass may be different from the top-level proof.
-- See Note [Shortcut solving: incoherence]
-
- , gopt Opt_SolveConstantDicts dflags
+ , gopt Opt_SolveConstantDicts dflags
-- Enabled by the -fsolve-constant-dicts flag
- -> tryShortCutTcS $ -- tryTcS tries to completely solve some contraints
- do { residual <- solveSimpleWanteds (unitBag (CDictCan dict_w))
- ; return (isSolvedWC residual) }
- -- NB: isSolvedWC, not isEmptyWC (#26805). We might succeed
- -- in fully-solving the constraint but still leave some
- -- /solved/ implications in the residual.
- -- See (SCS4) in Note [Shortcut solving]
+ = tryShortCutTcS $ -- tryTcS tries to completely solve some contraints
+ solveSimpleWanteds (unitBag (CDictCan dict_w))
- | otherwise
- -> return False }
+ | otherwise
+ = return False
{- *******************************************************************
@@ -846,7 +839,7 @@ try_instances inerts work_item@(DictCt { di_ev = ev@(CtWanted wev), di_cls = cls
; case lkup_res of
OneInst { cir_what = what }
-> do { let is_local_given = case what of { LocalInstance -> True; _ -> False }
- ; take_shortcut <- tryShortCutSolver is_local_given work_item
+ ; take_shortcut <- tryShortCutSolver dflags is_local_given work_item
; if take_shortcut
then stopWith ev "shortCutSolver worked(2)"
else do { insertSafeOverlapFailureTcS what work_item
=====================================
compiler/GHC/Tc/Solver/Monad.hs
=====================================
@@ -1351,7 +1351,7 @@ nestTcS (TcS thing_inside)
; return res }
-tryShortCutTcS :: TcS Bool -> TcS Bool
+tryShortCutTcS :: TcS WantedConstraints -> TcS Bool
-- Like nestTcS, but
-- (a) be a no-op if the nested computation returns False
-- (b) if (but only if) success, propagate nested bindings to the caller
@@ -1384,28 +1384,38 @@ tryShortCutTcS (TcS thing_inside)
vcat [ text "old_ev_binds:" <+> ppr old_ev_binds_var
, text "new_ev_binds:" <+> ppr new_ev_binds_var
, ppr old_inerts ]
- ; solved <- thing_inside nest_env
+ ; residual <- thing_inside nest_env
+ ; let solved = isSolvedWC residual
+ -- NB: isSolvedWC, not isEmptyWC (#26805). We might succeed
+ -- in fully-solving the constraint but still leave some
+ -- /solved/ implications in the residual.
+ -- See (SCS4) in Note [Shortcut solving]
; TcM.traceTc "tryShortCutTcS }" (ppr solved)
- ; if not solved
- then return False
- else do { -- Successfully solved
- -- Add the new bindings to the existing ones
- ; old_ebvs <- TcM.readTcRef (ebv_binds old_ev_binds_var)
+ ; when solved $ -- Successfully solved
+ do { -- Add the new bindings to the existing ones
+ ; TcM.combineTcEvBinds old_ev_binds_var new_ev_binds_var
- ; TcM.combineTcEvBinds old_ev_binds_var new_ev_binds_var
+ -- We are discarding some implications; we must add their
+ -- NeededEvIds to the current bindings, lest we fail to r
+ ; TcM.addNeededEvIds old_ev_binds_var $
+ foldr add_implic emptyVarSet $
+ wc_impl residual
- ; final_ebvs <- TcM.readTcRef (ebv_binds old_ev_binds_var)
- ; TcM.traceTc "update" (text "old" <+> ppr old_ebvs $$
- text "new" <+> ppr final_ebvs)
+ -- Update the existing inert set
+ ; new_inerts <- TcM.readTcRef new_inert_var
+ ; TcM.updTcRef inerts_var (`updateInertsWith` new_inerts) }
- -- Update the existing inert set
- ; new_inerts <- TcM.readTcRef new_inert_var
- ; TcM.updTcRef inerts_var (`updateInertsWith` new_inerts)
- ; TcM.traceTc "tryTcS update" (ppr (inert_solved_dicts new_inerts))
-
- ; return True } }
+ ; return solved
+ }
+ where
+ add_implic :: Implication -> NeededEvIds -> NeededEvIds
+ add_implic implic@(Implic { ic_status = status }) needs
+ | IC_Solved { ics_dm = dm, ics_non_dm = non_dm } <- status
+ = needs `unionVarSet` dm `unionVarSet` non_dm
+ | otherwise
+ = pprPanic "tryShortCutTcS" (ppr implic)
updateInertsWith :: InertSet -> InertSet -> InertSet
-- Update the current inert set with bits from a nested solve,
=====================================
compiler/GHC/Tc/Types/Evidence.hs
=====================================
@@ -15,7 +15,7 @@ module GHC.Tc.Types.Evidence (
-- * Evidence bindings
TcEvBinds(..), EvBindsVar(..), NeededEvIds,
- EvBindsState(..), emptyEvBindsState, unionEvBindsState, addCoVarsEBS,
+ EvBindsState(..), emptyEvBindsState, unionEvBindsState, addNeededEvIdsEBS,
EvBindsMap(..), emptyEvBindsMap, extendEvBinds, unionEvBindsMap,
lookupEvBind, evBindMapBinds,
foldEvBindsMap, nonDetStrictFoldEvBindsMap,
@@ -765,8 +765,8 @@ unionEvBindsState (EBS { ebs_binds = bs1, ebs_needs = n1 })
= EBS { ebs_binds = bs1 `unionEvBindsMap` bs2
, ebs_needs = n1 `unionVarSet` n2 }
-addCoVarsEBS :: VarSet -> EvBindsState -> EvBindsState
-addCoVarsEBS n1 ebs@(EBS { ebs_needs = n2 })
+addNeededEvIdsEBS :: NeededEvIds -> EvBindsState -> EvBindsState
+addNeededEvIdsEBS n1 ebs@(EBS { ebs_needs = n2 })
= ebs { ebs_needs = n1 `unionVarSet` n2 }
instance Outputable EvBindsState where
=====================================
compiler/GHC/Tc/Utils/Monad.hs
=====================================
@@ -106,7 +106,7 @@ module GHC.Tc.Utils.Monad(
newTcEvBinds, newNoTcEvBinds, cloneEvBindsVar,
addTcEvCoBind, addTcEvBind, addTopEvBinds,
getTcEvBindsMap, getTcEvBindsState,
- setTcEvBindsMap, combineTcEvBinds,
+ setTcEvBindsMap, combineTcEvBinds, addNeededEvIds,
chooseUniqueOccTc,
getConstraintVar, setConstraintVar,
emitConstraints, emitSimple, emitSimples,
@@ -2018,7 +2018,7 @@ combineTcEvBinds (EvBindsVar { ebv_binds = old_ebv_ref })
combineTcEvBinds (EvBindsVar { ebv_binds = old_tcv_ref })
(CoEvBindsVar { ebv_needs = new_tcv_ref })
= do { new_tcvs <- readTcRef new_tcv_ref
- ; updTcRef old_tcv_ref (addCoVarsEBS new_tcvs) }
+ ; updTcRef old_tcv_ref (addNeededEvIdsEBS new_tcvs) }
combineTcEvBinds (CoEvBindsVar { ebv_needs = old_tcv_ref })
(CoEvBindsVar { ebv_needs = new_tcv_ref })
= do { new_tcvs <- readTcRef new_tcv_ref
@@ -2027,16 +2027,17 @@ combineTcEvBinds old_var new_var
= pprPanic "combineTcEvBinds" (ppr old_var $$ ppr new_var)
-- Terms inside types, no good
+addNeededEvIds :: EvBindsVar -> NeededEvIds -> TcM ()
+addNeededEvIds (EvBindsVar { ebv_binds = bs_ref }) needed
+ = updTcRef bs_ref (addNeededEvIdsEBS needed)
+addNeededEvIds (CoEvBindsVar { ebv_needs = need_ref }) needed
+ = updTcRef need_ref (unionVarSet needed)
+
addTcEvCoBind :: EvBindsVar -> CoercionHole -> CoercionPlusHoles -> TcM ()
addTcEvCoBind ebv hole co_plus_holes@(CPH { cph_co = co })
= do { fillCoercionHole hole co_plus_holes
-- Record usage of the free vars of this coercion
- ; let fvs = coVarsOfCo co
- ; case ebv of
- EvBindsVar { ebv_binds = bs_ref }
- -> updTcRef bs_ref (addCoVarsEBS fvs)
- CoEvBindsVar { ebv_needs = need_ref }
- -> updTcRef need_ref (unionVarSet fvs) }
+ ; addNeededEvIds ebv (coVarsOfCo co) }
addTcEvBind :: EvBindsVar -> EvBind -> TcM ()
-- Add a binding to the TcEvBinds by side effect
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ed1e2ce4564907132f92e484fb0897d…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/ed1e2ce4564907132f92e484fb0897d…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/26699] Migrating the simplest types required for Trees That Grow progress
by recursion-ninja (@recursion-ninja) 23 Jan '26
by recursion-ninja (@recursion-ninja) 23 Jan '26
23 Jan '26
recursion-ninja pushed to branch wip/26699 at Glasgow Haskell Compiler / GHC
Commits:
d970f2bb by Recursion Ninja at 2026-01-22T16:20:00-05:00
Migrating the simplest types required for Trees That Grow progress
from GHC.Types.Basic to Language.Haskell.Syntax.Basic. Related
function definitions were also moved. Outputable type-class instances
are defined in GHC.Utils.Outputable. Binary instance of Boxity was
moved to GHC.Utils.Binary.
Migrated types:
* TopLevelFlag
* RuleName
* TyConFlavour
* TypeOrData
* NewOrData
- - - - -
18 changed files:
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
Changes:
=====================================
compiler/GHC/Hs/Decls.hs
=====================================
@@ -17,7 +17,7 @@ module GHC.Hs.Decls (
-- * Toplevel declarations
HsDecl(..), LHsDecl, HsDataDefn(..), HsDeriving, LHsFunDep,
HsDerivingClause(..), LHsDerivingClause, DerivClauseTys(..), LDerivClauseTys,
- NewOrData, newOrDataToFlavour, anyLConIsGadt,
+ NewOrData, newOrDataToFlavour, dataDefnConsNewOrData, anyLConIsGadt,
StandaloneKindSig(..), LStandaloneKindSig, standaloneKindSigName,
-- ** Class or type declarations
@@ -1106,6 +1106,11 @@ anyLConIsGadt xs = case toList xs of
{-# SPECIALIZE anyLConIsGadt :: [GenLocated l (ConDecl pass)] -> Bool #-}
{-# SPECIALIZE anyLConIsGadt :: DataDefnCons (GenLocated l (ConDecl pass)) -> Bool #-}
+dataDefnConsNewOrData :: DataDefnCons a -> NewOrData
+dataDefnConsNewOrData = \ case
+ NewTypeCon {} -> NewType
+ DataTypeCons {} -> DataType
+
{-
************************************************************************
* *
=====================================
compiler/GHC/Hs/Utils.hs
=====================================
@@ -53,6 +53,7 @@ module GHC.Hs.Utils(
-- * Bindings
mkFunBind, mkVarBind, mkHsVarBind, mkSimpleGeneratedFunBind, mkTopFunBind,
mkPatSynBind,
+ familyInfoTyConFlavour,
isInfixFunBind,
spanHsLocaLBinds,
@@ -148,6 +149,7 @@ import Control.Arrow ( first )
import Data.Foldable ( toList )
import Data.List ( partition )
import Data.List.NonEmpty ( NonEmpty (..), nonEmpty )
+import Data.Maybe ( isNothing )
import qualified Data.List.NonEmpty as NE
import Data.IntMap ( IntMap )
@@ -1502,6 +1504,18 @@ hsLTyClDeclBinders (L loc (DataDecl { tcdLName = (L _ name)
where
flav = newOrDataToFlavour $ dataDefnConsNewOrData $ dd_cons defn
+familyInfoTyConFlavour
+ :: Maybe tc -- ^ Just cls <=> this is an associated family of class cls
+ -> FamilyInfo pass
+ -> TyConFlavour tc
+familyInfoTyConFlavour mb_parent_tycon info =
+ case info of
+ DataFamily -> OpenFamilyFlavour (IAmData DataType) mb_parent_tycon
+ OpenTypeFamily -> OpenFamilyFlavour IAmType mb_parent_tycon
+ ClosedTypeFamily _ -> assert (isNothing mb_parent_tycon)
+ -- See Note [Closed type family mb_parent_tycon]
+ ClosedTypeFamilyFlavour
+
-------------------
hsForeignDeclsBinders :: forall p a. (UnXRec (GhcPass p), IsSrcSpanAnn p a)
=> [LForeignDecl (GhcPass p)] -> [LIdP (GhcPass p)]
=====================================
compiler/GHC/HsToCore/Errors/Types.hs
=====================================
@@ -4,7 +4,7 @@ module GHC.HsToCore.Errors.Types where
import GHC.Prelude
-import GHC.Core (CoreRule, CoreExpr, RuleName)
+import GHC.Core (CoreRule, CoreExpr)
import GHC.Core.DataCon
import GHC.Core.ConLike
import GHC.Core.Type
=====================================
compiler/GHC/Rename/Env.hs
=====================================
@@ -80,7 +80,7 @@ import GHC.Core.ConLike
import GHC.Core.DataCon
import GHC.Core.TyCon
import GHC.Builtin.Names( rOOT_MAIN )
-import GHC.Types.Basic ( TopLevelFlag(..), TupleSort(..), tupleSortBoxity )
+import GHC.Types.Basic ( TupleSort(..), tupleSortBoxity )
import GHC.Types.TyThing ( tyThingGREInfo )
import GHC.Types.SrcLoc as SrcLoc
import GHC.Utils.Outputable as Outputable
=====================================
compiler/GHC/Rename/Module.hs
=====================================
@@ -52,7 +52,7 @@ import GHC.Types.ForeignCall ( CCallTarget(..) )
import GHC.Types.Name
import GHC.Types.Name.Set
import GHC.Types.Name.Env
-import GHC.Types.Basic ( VisArity, TyConFlavour(..), TypeOrKind(..), RuleName )
+import GHC.Types.Basic ( VisArity, TyConFlavour(..), TypeOrKind(..) )
import GHC.Types.GREInfo (ConLikeInfo (..), ConInfo, mkConInfo, conInfoFields)
import GHC.Types.Hint (SigLike(..))
import GHC.Types.Unique.Set
=====================================
compiler/GHC/Rename/Names.hs
=====================================
@@ -70,7 +70,7 @@ import GHC.Types.FieldLabel
import GHC.Types.Hint
import GHC.Types.SourceFile
import GHC.Types.SrcLoc as SrcLoc
-import GHC.Types.Basic ( TopLevelFlag(..), TyConFlavour (..), convImportLevel )
+import GHC.Types.Basic ( TyConFlavour (..), convImportLevel )
import GHC.Types.SourceText
import GHC.Types.Id
import GHC.Types.PkgQual
=====================================
compiler/GHC/Rename/Splice.hs
=====================================
@@ -32,7 +32,7 @@ import GHC.Rename.Unbound ( isUnboundName )
import GHC.Rename.Module ( rnSrcDecls, findSplice )
import GHC.Rename.Pat ( rnPat )
import GHC.Types.Error
-import GHC.Types.Basic ( TopLevelFlag, isTopLevel, maxPrec )
+import GHC.Types.Basic ( maxPrec )
import GHC.Types.SourceText ( SourceText(..) )
import GHC.Types.ThLevelIndex
import GHC.Utils.Outputable
=====================================
compiler/GHC/Tc/Gen/Head.hs
=====================================
@@ -62,7 +62,6 @@ import GHC.Types.Id
import GHC.Types.Name
import GHC.Types.Name.Reader
import GHC.Types.SrcLoc
-import GHC.Types.Basic
import GHC.Types.Error
import GHC.Builtin.Names
=====================================
compiler/GHC/Tc/Utils/Env.hs
=====================================
@@ -119,7 +119,6 @@ import GHC.Data.List.SetOps
import GHC.Data.Maybe( MaybeErr(..), orElse, maybeToList, fromMaybe )
import GHC.Types.SrcLoc
-import GHC.Types.Basic hiding( SuccessFlag(..) )
import GHC.Types.TypeEnv
import GHC.Types.SourceFile
import GHC.Types.Name
=====================================
compiler/GHC/Tc/Utils/Monad.hs
=====================================
@@ -239,7 +239,7 @@ import GHC.Types.Unique.DFM
import GHC.Types.Unique.Supply
import GHC.Types.Unique (uniqueTag)
import GHC.Types.Annotations
-import GHC.Types.Basic( TopLevelFlag(..), TypeOrKind(..) )
+import GHC.Types.Basic( TypeOrKind(..) )
import GHC.Types.CostCentre.State
import GHC.Types.SourceFile
=====================================
compiler/GHC/Types/Basic.hs
=====================================
@@ -103,7 +103,6 @@ module GHC.Types.Basic (
import GHC.Prelude
import GHC.ForeignSrcLang
-import GHC.Data.FastString
import GHC.Utils.Outputable
import GHC.Utils.Panic
import GHC.Utils.Binary
@@ -111,15 +110,16 @@ import GHC.Types.Arity
import GHC.Types.SourceText
import qualified GHC.LanguageExtensions as LangExt
import {-# SOURCE #-} Language.Haskell.Syntax.Type (PromotionFlag(..), isPromoted)
-import Language.Haskell.Syntax.Basic (Boxity(..), isBoxed, ConTag)
import {-# SOURCE #-} Language.Haskell.Syntax.Expr (HsDoFlavour)
+
+import Language.Haskell.Syntax.Basic
+import Language.Haskell.Syntax.ImpExp
+
import Control.DeepSeq ( NFData(..) )
import Data.Data
import Data.Maybe
import qualified Data.Semigroup as Semi
-import Language.Haskell.Syntax.ImpExp
-
{-
************************************************************************
* *
@@ -420,55 +420,10 @@ instance NFData FunctionOrData where
************************************************************************
-}
-type RuleName = FastString
-
pprRuleName :: RuleName -> SDoc
pprRuleName rn = doubleQuotes (ftext rn)
-{-
-************************************************************************
-* *
-\subsection[Top-level/local]{Top-level/not-top level flag}
-* *
-************************************************************************
--}
-
-data TopLevelFlag
- = TopLevel
- | NotTopLevel
- deriving Data
-
-isTopLevel, isNotTopLevel :: TopLevelFlag -> Bool
-
-isNotTopLevel NotTopLevel = True
-isNotTopLevel TopLevel = False
-
-isTopLevel TopLevel = True
-isTopLevel NotTopLevel = False
-
-instance Outputable TopLevelFlag where
- ppr TopLevel = text "<TopLevel>"
- ppr NotTopLevel = text "<NotTopLevel>"
-
-{-
-************************************************************************
-* *
- Boxity flag
-* *
-************************************************************************
--}
-
-instance Outputable Boxity where
- ppr Boxed = text "Boxed"
- ppr Unboxed = text "Unboxed"
-
-instance Binary Boxity where -- implemented via isBoxed-isomorphism to Bool
- put_ bh = put_ bh . isBoxed
- get bh = do
- b <- get bh
- pure $ if b then Boxed else Unboxed
-
{-
************************************************************************
* *
@@ -1524,11 +1479,13 @@ instance NFData TypeOrConstraint where
TypeLike -> ()
ConstraintLike -> ()
-{- *********************************************************************
+{-
+************************************************************************
* *
- TyConFlavour
+TyConFlavour
* *
-********************************************************************* -}
+************************************************************************
+-}
-- | Paints a picture of what a 'TyCon' represents, in broad strokes.
-- This is used towards more informative error messages.
@@ -1571,7 +1528,6 @@ instance Outputable (TyConFlavour tc) where
go BuiltInTypeFlavour = "built-in type"
go PromotedDataConFlavour = "promoted data constructor"
-
-- | Get the enclosing class TyCon (if there is one) for the given TyConFlavour
tyConFlavourAssoc_maybe :: TyConFlavour tc -> Maybe tc
tyConFlavourAssoc_maybe (OpenFamilyFlavour _ mb_parent) = mb_parent
@@ -1584,22 +1540,10 @@ data TypeOrData
| IAmType
deriving (Eq, Data)
--- | When we only care whether a data-type declaration is `data` or `newtype`,
--- but not what constructors it has.
-data NewOrData
- = NewType -- ^ @newtype Blah ...@
- | DataType -- ^ @data Blah ...@
- deriving ( Eq, Data ) -- Needed because Demand derives Eq
-
instance Outputable TypeOrData where
ppr (IAmData newOrData) = ppr newOrData
ppr IAmType = text "type"
-instance Outputable NewOrData where
- ppr = \case
- NewType -> text "newtype"
- DataType -> text "data"
-
{- *********************************************************************
* *
Defaulting options
=====================================
compiler/GHC/Utils/Binary.hs
=====================================
@@ -117,6 +117,7 @@ module GHC.Utils.Binary
import GHC.Prelude
+import Language.Haskell.Syntax.Basic
import Language.Haskell.Syntax.Binds.InlinePragma
import Language.Haskell.Syntax.Module.Name (ModuleName(..))
import Language.Haskell.Syntax.ImpExp.IsBoot (IsBootInterface(..))
@@ -2011,6 +2012,12 @@ instance NFData a => NFData (FingerprintWithValue a) where
rnf (FingerprintWithValue fp mflags)
= rnf fp `seq` rnf mflags `seq` ()
+instance Binary Boxity where -- implemented via isBoxed-isomorphism to Bool
+ put_ bh = put_ bh . isBoxed
+ get bh = do
+ b <- get bh
+ pure $ if b then Boxed else Unboxed
+
instance Binary ConInfoTable where
get bh = Binary.decode <$> get bh
=====================================
compiler/GHC/Utils/Outputable.hs
=====================================
@@ -112,6 +112,7 @@ module GHC.Utils.Outputable (
import {-# SOURCE #-} GHC.Unit.Types ( Unit, Module, moduleName )
import {-# SOURCE #-} GHC.Types.Name.Occurrence( OccName )
+import Language.Haskell.Syntax.Basic
import Language.Haskell.Syntax.Binds.InlinePragma
import Language.Haskell.Syntax.Module.Name ( ModuleName(..) )
@@ -2001,19 +2002,32 @@ instance IsDoc HDoc where
{-# INLINE CONLIKE dualDoc #-}
instance Outputable (ActivationX p) where
- ppr AlwaysActive = empty
- ppr NeverActive = brackets (text "~")
- ppr (ActiveBefore n) = brackets (char '~' <> int n)
- ppr (ActiveAfter n) = brackets (int n)
- ppr (XActivation _) = text "[final]"
+ ppr AlwaysActive = empty
+ ppr NeverActive = brackets (text "~")
+ ppr (ActiveBefore n) = brackets (char '~' <> int n)
+ ppr (ActiveAfter n) = brackets (int n)
+ ppr (XActivation _) = text "[final]"
instance Outputable InlineSpec where
- ppr Inline = text "INLINE"
- ppr NoInline = text "NOINLINE"
- ppr Inlinable = text "INLINABLE"
- ppr Opaque = text "OPAQUE"
- ppr NoUserInlinePrag = empty
+ ppr Inline = text "INLINE"
+ ppr NoInline = text "NOINLINE"
+ ppr Inlinable = text "INLINABLE"
+ ppr Opaque = text "OPAQUE"
+ ppr NoUserInlinePrag = empty
+
+instance Outputable Boxity where
+ ppr Boxed = text "Boxed"
+ ppr Unboxed = text "Unboxed"
instance Outputable RuleMatchInfo where
- ppr ConLike = text "CONLIKE"
- ppr FunLike = text "FUNLIKE"
+ ppr ConLike = text "CONLIKE"
+ ppr FunLike = text "FUNLIKE"
+
+instance Outputable NewOrData where
+ ppr = \case
+ NewType -> text "newtype"
+ DataType -> text "data"
+
+instance Outputable TopLevelFlag where
+ ppr TopLevel = text "<TopLevel>"
+ ppr NotTopLevel = text "<NotTopLevel>"
=====================================
compiler/Language/Haskell/Syntax/Basic.hs
=====================================
@@ -10,6 +10,37 @@ import Prelude
import GHC.Data.FastString (FastString)
import Control.DeepSeq
+{-
+************************************************************************
+* *
+Rules
+* *
+************************************************************************
+-}
+
+type RuleName = FastString
+
+{-
+************************************************************************
+* *
+\subsection[Top-level/local]{Top-level/not-top level flag}
+* *
+************************************************************************
+-}
+
+data TopLevelFlag
+ = TopLevel
+ | NotTopLevel
+ deriving Data
+
+isTopLevel, isNotTopLevel :: TopLevelFlag -> Bool
+
+isNotTopLevel NotTopLevel = True
+isNotTopLevel TopLevel = False
+
+isTopLevel TopLevel = True
+isTopLevel NotTopLevel = False
+
{-
************************************************************************
* *
@@ -125,3 +156,10 @@ data Fixity = Fixity Int FixityDirection
instance NFData Fixity where
rnf (Fixity i d) = rnf i `seq` rnf d `seq` ()
+
+-- | When we only care whether a data-type declaration is `data` or `newtype`,
+-- but not what constructors it has.
+data NewOrData
+ = NewType -- ^ @newtype Blah ...@
+ | DataType -- ^ @data Blah ...@
+ deriving ( Eq, Data ) -- Needed because Demand derives Eq
=====================================
compiler/Language/Haskell/Syntax/Decls.hs
=====================================
@@ -18,7 +18,7 @@ module Language.Haskell.Syntax.Decls (
-- * Toplevel declarations
HsDecl(..), LHsDecl, HsDataDefn(..), HsDeriving, LHsFunDep, FunDep(..),
HsDerivingClause(..), LHsDerivingClause, DerivClauseTys(..), LDerivClauseTys,
- NewOrData(..), DataDefnCons(..), dataDefnConsNewOrData,
+ NewOrData(..), DataDefnCons(..),
isTypeDataDefnCons, firstDataDefnCon,
StandaloneKindSig(..), LStandaloneKindSig,
@@ -31,7 +31,7 @@ module Language.Haskell.Syntax.Decls (
FamilyDecl(..), LFamilyDecl,
-- ** Instance declarations
- InstDecl(..), LInstDecl, FamilyInfo(..), familyInfoTyConFlavour,
+ InstDecl(..), LInstDecl, FamilyInfo(..),
TyFamInstDecl(..), LTyFamInstDecl,
TyFamDefltDecl, LTyFamDefltDecl,
DataFamInstDecl(..), LDataFamInstDecl,
@@ -91,6 +91,7 @@ import {-# SOURCE #-} Language.Haskell.Syntax.Expr
( HsExpr, HsUntypedSplice )
-- Because Expr imports Decls via HsBracket
+import Language.Haskell.Syntax.Basic (TopLevelFlag, RuleName, NewOrData(..))
import Language.Haskell.Syntax.Binds
import Language.Haskell.Syntax.Binds.InlinePragma (Activation)
import Language.Haskell.Syntax.Extension
@@ -98,8 +99,7 @@ import Language.Haskell.Syntax.Type
import Language.Haskell.Syntax.Basic (Role, LexicalFixity)
import Language.Haskell.Syntax.Specificity (Specificity)
-import GHC.Types.Basic (TopLevelFlag, OverlapMode, RuleName
- ,TyConFlavour(..), TypeOrData(..), NewOrData(..))
+import GHC.Types.Basic (OverlapMode)
import GHC.Types.ForeignCall (CType, CCallConv, Safety, Header, CLabelString, CCallTarget, CExportSpec)
import GHC.Data.FastString (FastString)
@@ -108,7 +108,6 @@ import GHC.Hs.Doc (WithHsDocIdentifiers)
import GHC.Types.SourceText (StringLiteral)
import Control.DeepSeq
-import Control.Exception (assert)
import Control.Monad
import Data.Data hiding (TyCon, Fixity, Infix)
import Data.Maybe
@@ -779,18 +778,6 @@ data FamilyInfo pass
-- said "type family Foo x where .."
| ClosedTypeFamily (Maybe [LTyFamInstEqn pass])
-familyInfoTyConFlavour
- :: Maybe tc -- ^ Just cls <=> this is an associated family of class cls
- -> FamilyInfo pass
- -> TyConFlavour tc
-familyInfoTyConFlavour mb_parent_tycon info =
- case info of
- DataFamily -> OpenFamilyFlavour (IAmData DataType) mb_parent_tycon
- OpenTypeFamily -> OpenFamilyFlavour IAmType mb_parent_tycon
- ClosedTypeFamily _ -> assert (isNothing mb_parent_tycon)
- -- See Note [Closed type family mb_parent_tycon]
- ClosedTypeFamilyFlavour
-
{- Note [Closed type family mb_parent_tycon]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There's no way to write a closed type family inside a class declaration:
@@ -932,11 +919,6 @@ data DataDefnCons a
[a] -- The (possibly empty) list of data constructors
deriving ( Eq, Data, Foldable, Functor, Traversable ) -- Needed because Demand derives Eq
-dataDefnConsNewOrData :: DataDefnCons a -> NewOrData
-dataDefnConsNewOrData = \ case
- NewTypeCon {} -> NewType
- DataTypeCons {} -> DataType
-
-- | Are the constructors within a @type data@ declaration?
-- See Note [Type data declarations] in GHC.Rename.Module.
isTypeDataDefnCons :: DataDefnCons a -> Bool
=====================================
utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
=====================================
@@ -33,7 +33,6 @@ import GHC
import GHC.Core.InstEnv
import qualified GHC.Driver.DynFlags as DynFlags
import GHC.Driver.Ppr
-import GHC.Plugins (TopLevelFlag (..))
import GHC.Types.SourceText
import GHC.Unit.State
import GHC.Utils.Outputable as Outputable
=====================================
utils/haddock/haddock-api/src/Haddock/Convert.hs
=====================================
@@ -59,7 +59,7 @@ import GHC.Core.TyCo.Rep
import GHC.Core.TyCon
import GHC.Core.Type
import GHC.Hs
-import GHC.Types.Basic (DefMethSpec (..), TopLevelFlag (..), TupleSort (..))
+import GHC.Types.Basic (DefMethSpec (..), TupleSort (..))
import GHC.Types.Id (idType, setIdType)
import GHC.Types.Name
import GHC.Types.Name.Reader (mkVarUnqual)
=====================================
utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
=====================================
@@ -37,7 +37,7 @@ import GHC hiding (NoLink, HsTypeGhcPsExt (..))
import GHC.Builtin.Types (eqTyCon_RDR, tupleDataConName, tupleTyConName)
import GHC.Core.TyCon (tyConResKind)
import GHC.Driver.DynFlags (getDynFlags)
-import GHC.Types.Basic (TopLevelFlag (..), TupleSort (..))
+import GHC.Types.Basic (TupleSort (..))
import GHC.Types.Name
import GHC.Types.Name.Reader (RdrName (Exact))
import Language.Haskell.Syntax.BooleanFormula(BooleanFormula(..))
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d970f2bb8e0c5d173becef1c1aa8f1e…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d970f2bb8e0c5d173becef1c1aa8f1e…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/26699] 23 commits: base: don't expose GHC.Num.{BigNat, Integer, Natural}
by recursion-ninja (@recursion-ninja) 23 Jan '26
by recursion-ninja (@recursion-ninja) 23 Jan '26
23 Jan '26
recursion-ninja pushed to branch wip/26699 at Glasgow Haskell Compiler / GHC
Commits:
30f442a9 by Teo Camarasu at 2026-01-20T13:57:26-05:00
base: don't expose GHC.Num.{BigNat, Integer, Natural}
We no longer expose GHC.Num.{BigNat, Integer, Natural} from base instead users should get these modules from ghc-bignum.
We make this change to insulate end users from changes to GHC's implementation of big numbers.
Implements CLC proposal 359: https://github.com/haskell/core-libraries-committee/issues/359
- - - - -
75a9053d by Teo Camarasu at 2026-01-20T13:58:07-05:00
base: deprecate GHC internals in GHC.Num
Implements CLC proposal: https://github.com/haskell/core-libraries-committee/issues/360
- - - - -
9534b032 by Andreas Klebinger at 2026-01-20T13:58:50-05:00
ghc-experimental: Update Changelog
I tried to reconstruct a high level overview of the changes and when
they were made since we introduced it.
Fixes #26506
Co-authored-by: Teo Camarasu <teofilcamarasu(a)gmail.com>
- - - - -
346f2f5a by Cheng Shao at 2026-01-20T13:59:30-05:00
hadrian: remove RTS options in ghc-in-ghci flavour
This patch removes the RTS options passed to ghc in ghc-in-ghci
flavour, to workaround command line argument handling issue in
hls/hie-boot that results in `-O64M` instead of `+RTS -O64M -RTS`
being passed to ghc. It's not a hadrian bug per se, since ghc's own
ghc-in-ghci multi repl works fine, but we should still make sure HLS
works. Closes #26801.
- - - - -
759fd15a by Andreas Klebinger at 2026-01-21T16:05:28-05:00
Don't build GHC with -Wcompat
Without bumping the boot compiler the warnings it produces are often not
actionable leading to pointless noise.
Fixes #26800
- - - - -
3172db94 by Torsten Schmits at 2026-01-21T16:06:11-05:00
Use the correct field of ModOrigin when formatting error message listing hidden reexports
- - - - -
485c12b2 by Cheng Shao at 2026-01-21T16:06:54-05:00
Revert "hadrian: handle findExecutable "" gracefully"
This reverts commit 1e5752f64a522c4025365856d92f78073a7b3bba. The
underlying issue has been fixed in
https://github.com/haskell/directory/commit/75828696e7145adc09179111a0d631b…
and present since 1.3.9.0, and hadrian directory lower bound is
1.3.9.0, so we can revert our own in house hack now.
- - - - -
5efb58dc by Cheng Shao at 2026-01-21T16:07:36-05:00
rts: fix typo in TICK_ALLOC_RTS
This patch fixes a typo in the `TICK_ALLOC_RTS` macro, the original
`bytes` argument was silently dropped. The Cmm code has its own
version of `TICK_ALLOC_RTS` not affected by this typo, it affected the
C RTS, and went unnoticed because the variable `n` happened to also be
available at its call site. But the number was incorrect. Also fixes
its call site since `WDS()` is not available in C.
- - - - -
c406ea69 by Cheng Shao at 2026-01-21T16:07:36-05:00
rts: remove broken & unused ALLOC_P_TICKY
This patch removes the `ALLOC_P_TICKY` macro from the rts, it's
unused, and its expanded code is already broken.
- - - - -
34a27e20 by Simon Peyton Jones at 2026-01-21T16:08:17-05:00
Make the implicit-parameter class have representational role
This MR addresses #26737, by making the built-in class IP
have a representational role for its second parameter.
See Note [IP: implicit parameter class] in
ghc-internal:GHC.Internal.Classes.IP
In fact, IP is (unfortunately, currently) exposed by
base:GHC.Base, so we ran a quick CLC proposal to
agree the change:
https://github.com/haskell/core-libraries-committee/issues/385
Some (small) compilations get faster because they only need to
load (small) interface file GHC.Internal.Classes.IP.hi,
rather than (large) GHC.Internal.Classes.hi.
Metric Decrease:
T10421
T12150
T12425
T24582
T5837
T5030
- - - - -
ca79475f by Cheng Shao at 2026-01-21T16:09:00-05:00
testsuite: avoid re.sub in favor of simple string replacements
This patch refactors the testsuite driver and avoids the usage of
re.sub in favor of simple string replacements when possible. The
changes are not comprehensive, and there are still a lot of re.sub
usages lingering around the tree, but this already addresses a major
performance bottleneck in the testsuite driver that might has to do
with quadratic or worse slowdown in cpython's regular expression
engine when handling certain regex patterns with large strings.
Especially on i386, and i386 jobs are the bottlenecks of all full-ci
validate pipelines!
Here are the elapsed times of testing x86_64/i386 with -j48 before
this patch:
x86_64: `Build completed in 6m06s`
i386: `Build completed in 1h36m`
And with this patch:
x86_64: `Build completed in 4m55s`
i386: `Build completed in 4m23s`
Fixes #26786.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
88c93796 by Zubin Duggal at 2026-01-21T16:09:42-05:00
ghc-toolchain: Also configure windres on non-windows platforms.
It may be needed for cross compilation.
Fixes #24588
- - - - -
9788c0ec by Cheng Shao at 2026-01-21T16:10:24-05:00
ghci: print external interpreter trace messages to stderr instead of stdout
This patch makes ghci print external interpreter trace messages to
stderr instead of stdout, which is a much saner choice for diagnostic
information. Closes #26807.
- - - - -
0491f08a by Sylvain Henry at 2026-01-22T03:44:26-05:00
GC: don't use CAS without PARALLEL_GC on
If we're not using the parallel GC, there is no reason to do a costly
CAS. This was flagged as taking time in a perf profile.
- - - - -
211a8f56 by Sylvain Henry at 2026-01-22T03:44:26-05:00
GC: suffix parallel GC with "par" instead of "thr"
Avoid some potential confusion (see discussion in !15351).
- - - - -
77a23cbd by fendor at 2026-01-22T03:45:08-05:00
Remove blanket ignore that covers libraries/
- - - - -
18bf7f5c by Léana Jiang at 2026-01-22T08:58:45-05:00
doc: update Flavour type in hadrian user-settings
- - - - -
3d5a1365 by Cheng Shao at 2026-01-22T08:59:28-05:00
hadrian: add missing notCross predicate for stage0 -O0
There are a few hard-coded hadrian args that pass -O0 when compiling
some heavy modules in stage0, which only makes sense when not
cross-compiling and when cross-compiling we need properly optimized
stage0 packages. So this patch adds the missing `notCross` predicate
in those places.
- - - - -
ee937134 by Matthew Pickering at 2026-01-22T09:00:10-05:00
Fix ghc-experimental GHC.Exception.Backtrace.Experimental module
This module wasn't added to the cabal file so it was never compiled or
included in the library.
- - - - -
1b490f5a by Zubin Duggal at 2026-01-22T09:00:53-05:00
hadrian: Add ghc-{experimental,internal}.cabal to the list of dependencies of the doc target
We need these files to detect the version of these libraries
Fixes #26738
- - - - -
cdb74049 by Cheng Shao at 2026-01-22T14:52:36-05:00
rts: avoid Cmm loop to initialize Array#/SmallArray#
Previously, `newArray#`/`newSmallArray#` called an RTS C function to
allocate the `Array#`/`SmallArray#`, then used a Cmm loop to
initialize the elements. Cmm doesn't have native for-loop so the code
is a bit awkward, and it's less efficient than a C loop, since the C
compiler can effectively vectorize the loop with optimizations.
So this patch moves the loop that initializes the elements to the C
side. `allocateMutArrPtrs`/`allocateSmallMutArrPtrs` now takes a new
`init` argument and initializes the elements if `init` is non-NULL.
- - - - -
4c784f00 by Cheng Shao at 2026-01-22T14:53:19-05:00
Fix testsuite run for +ipe flavour transformer
This patch makes the +ipe flavour transformer pass the entire
testsuite:
- An RTS debug option `-DI` is added, the IPE trace information is now
only printed with `-DI`. The test cases that do require IPE trace
are now run with `-DI`.
- The testsuite config option `ghc_with_ipe` is added, enabled when
running the testsuite with `+ipe`, which skips a few tests that are
sensitive to eventlog output, allocation patterns etc that can fail
under `+ipe`.
This is the first step towards #26799.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
e84b457e by Recursion Ninja at 2026-01-22T15:56:58-05:00
Migrating the simplest types required for Trees That Grow progress
from GHC.Types.Basic to Language.Haskell.Syntax.Basic. Related
function definitions were also moved. Outputable type-class instances
are defined in GHC.Utils.Outputable. Binary instance of Boxity was
moved to GHC.Utils.Binary.
Migrated types:
* TopLevelFlag
* RuleName
* TyConFlavour
* TypeOrData
* NewOrData
- - - - -
89 changed files:
- .gitignore
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Errors/Types.hs
- compiler/GHC/Rename/Env.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Rename/Splice.hs
- compiler/GHC/Tc/Gen/Head.hs
- compiler/GHC/Tc/Utils/Env.hs
- compiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Types/Basic.hs
- compiler/GHC/Unit/State.hs
- compiler/GHC/Utils/Binary.hs
- compiler/GHC/Utils/Outputable.hs
- compiler/Language/Haskell/Syntax/Basic.hs
- compiler/Language/Haskell/Syntax/Decls.hs
- compiler/ghc.cabal.in
- docs/users_guide/9.16.1-notes.rst
- docs/users_guide/runtime_control.rst
- hadrian/doc/user-settings.md
- hadrian/src/Flavour.hs
- hadrian/src/Hadrian/Utilities.hs
- hadrian/src/Rules/Docspec.hs
- hadrian/src/Rules/Documentation.hs
- hadrian/src/Rules/Lint.hs
- hadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Builders/RunTest.hs
- hadrian/src/Settings/Flavours/GhcInGhci.hs
- hadrian/src/Settings/Packages.hs
- libraries/base/base.cabal.in
- libraries/base/changelog.md
- libraries/base/src/Data/Array/Byte.hs
- libraries/base/src/GHC/Num.hs
- − libraries/base/src/GHC/Num/BigNat.hs
- − libraries/base/src/GHC/Num/Integer.hs
- − libraries/base/src/GHC/Num/Natural.hs
- libraries/base/src/System/CPUTime/Utils.hs
- libraries/ghc-bignum/ghc-bignum.cabal
- libraries/ghc-compact/tests/all.T
- libraries/ghc-experimental/CHANGELOG.md
- libraries/ghc-experimental/ghc-experimental.cabal.in
- libraries/ghc-experimental/src/GHC/Exception/Backtrace/Experimental.hs
- libraries/ghc-experimental/src/GHC/TypeNats/Experimental.hs
- libraries/ghc-internal/ghc-internal.cabal.in
- libraries/ghc-internal/src/GHC/Internal/Classes.hs
- + libraries/ghc-internal/src/GHC/Internal/Classes/IP.hs
- libraries/ghc-internal/tests/backtraces/all.T
- libraries/ghci/GHCi/Server.hs
- rts/AllocArray.c
- rts/AllocArray.h
- rts/ClosureTable.c
- rts/Heap.c
- rts/PrimOps.cmm
- rts/RtsFlags.c
- rts/Threads.c
- rts/Trace.c
- rts/Weak.c
- rts/include/Cmm.h
- rts/include/rts/Flags.h
- rts/include/stg/Ticky.h
- rts/rts.cabal
- rts/sm/Evac.c
- rts/sm/Evac_thr.c → rts/sm/Evac_par.c
- rts/sm/Scav_thr.c → rts/sm/Scav_par.c
- rts/sm/Storage.c
- testsuite/driver/runtests.py
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- testsuite/driver/testutil.py
- testsuite/tests/interface-stability/base-exports.stdout
- testsuite/tests/interface-stability/base-exports.stdout-javascript-unknown-ghcjs
- testsuite/tests/interface-stability/base-exports.stdout-mingw32
- testsuite/tests/interface-stability/base-exports.stdout-ws-32
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout
- testsuite/tests/interface-stability/ghc-experimental-exports.stdout-mingw32
- testsuite/tests/interface-stability/ghc-prim-exports.stdout
- testsuite/tests/interface-stability/ghc-prim-exports.stdout-mingw32
- testsuite/tests/rts/Makefile
- testsuite/tests/rts/all.T
- testsuite/tests/rts/ipe/all.T
- testsuite/tests/th/TH_implicitParams.stdout
- + testsuite/tests/typecheck/should_compile/T26737.hs
- testsuite/tests/typecheck/should_compile/all.T
- utils/ghc-toolchain/exe/Main.hs
- utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
- utils/haddock/haddock-api/src/Haddock/Convert.hs
- utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7c9295b1dddc52b03dfa418d28d5ae…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/7c9295b1dddc52b03dfa418d28d5ae…
You're receiving this email because of your account on gitlab.haskell.org.
1
0
[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: rts: avoid Cmm loop to initialize Array#/SmallArray#
by Marge Bot (@marge-bot) 23 Jan '26
by Marge Bot (@marge-bot) 23 Jan '26
23 Jan '26
Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC
Commits:
cdb74049 by Cheng Shao at 2026-01-22T14:52:36-05:00
rts: avoid Cmm loop to initialize Array#/SmallArray#
Previously, `newArray#`/`newSmallArray#` called an RTS C function to
allocate the `Array#`/`SmallArray#`, then used a Cmm loop to
initialize the elements. Cmm doesn't have native for-loop so the code
is a bit awkward, and it's less efficient than a C loop, since the C
compiler can effectively vectorize the loop with optimizations.
So this patch moves the loop that initializes the elements to the C
side. `allocateMutArrPtrs`/`allocateSmallMutArrPtrs` now takes a new
`init` argument and initializes the elements if `init` is non-NULL.
- - - - -
4c784f00 by Cheng Shao at 2026-01-22T14:53:19-05:00
Fix testsuite run for +ipe flavour transformer
This patch makes the +ipe flavour transformer pass the entire
testsuite:
- An RTS debug option `-DI` is added, the IPE trace information is now
only printed with `-DI`. The test cases that do require IPE trace
are now run with `-DI`.
- The testsuite config option `ghc_with_ipe` is added, enabled when
running the testsuite with `+ipe`, which skips a few tests that are
sensitive to eventlog output, allocation patterns etc that can fail
under `+ipe`.
This is the first step towards #26799.
Co-authored-by: Codex <codex(a)openai.com>
- - - - -
33c700f6 by Ben Gamari at 2026-01-22T15:26:06-05:00
hadrian: Bump QuickCheck upper bound
This patch bumps QuickCheck upper bound to 2.18. selftest rule
manually tested to work with current latest QuickCheck-2.17.1.0.
- - - - -
b1a60194 by Zubin Duggal at 2026-01-22T15:26:12-05:00
Add genindex to index.rst. This adds a link to the index in the navigation bar.
Fixes #26437
- - - - -
21 changed files:
- docs/users_guide/index.rst
- docs/users_guide/runtime_control.rst
- hadrian/hadrian.cabal
- hadrian/src/Flavour.hs
- libraries/ghc-compact/tests/all.T
- libraries/ghc-internal/tests/backtraces/all.T
- rts/AllocArray.c
- rts/AllocArray.h
- rts/ClosureTable.c
- rts/Heap.c
- rts/PrimOps.cmm
- rts/RtsFlags.c
- rts/Threads.c
- rts/Trace.c
- rts/Weak.c
- rts/include/rts/Flags.h
- testsuite/driver/testglobals.py
- testsuite/driver/testlib.py
- testsuite/tests/rts/Makefile
- testsuite/tests/rts/all.T
- testsuite/tests/rts/ipe/all.T
Changes:
=====================================
docs/users_guide/index.rst
=====================================
@@ -29,6 +29,7 @@ Contents:
eventlog-formats
glossary
editing-guide
+ genindex
Indices and tables
=====================================
docs/users_guide/runtime_control.rst
=====================================
@@ -1588,6 +1588,7 @@ recommended for everyday use!
.. rts-flag:: -Ds DEBUG: scheduler
.. rts-flag:: -Di DEBUG: interpreter
+.. rts-flag:: -DI DEBUG: IPE
.. rts-flag:: -Dw DEBUG: weak
.. rts-flag:: -DG DEBUG: gccafs
.. rts-flag:: -Dg DEBUG: gc
=====================================
hadrian/hadrian.cabal
=====================================
@@ -190,4 +190,4 @@ executable hadrian
if flag(selftest)
other-modules: Rules.Selftest
cpp-options: -DHADRIAN_ENABLE_SELFTEST
- build-depends: QuickCheck >= 2.6 && < 2.15
+ build-depends: QuickCheck >= 2.6 && < 2.18
=====================================
hadrian/src/Flavour.hs
=====================================
@@ -384,9 +384,15 @@ omitPragmas = addArgs
-- | Build stage2 dependencies with options to enable IPE debugging
-- information.
enableIPE :: Flavour -> Flavour
-enableIPE = addArgs
- $ notStage0 ? builder (Ghc CompileHs)
- ? pure ["-finfo-table-map", "-fdistinct-constructor-tables"]
+enableIPE =
+ addArgs $
+ mconcat
+ [ notStage0
+ ? builder (Ghc CompileHs)
+ ? pure
+ ["-finfo-table-map", "-fdistinct-constructor-tables"],
+ builder Testsuite ? arg "--config=ghc_with_ipe=True"
+ ]
enableLateCCS :: Flavour -> Flavour
enableLateCCS = addArgs
=====================================
libraries/ghc-compact/tests/all.T
=====================================
@@ -20,7 +20,8 @@ test('compact_gc', [fragile_for(17253, ['ghci']), ignore_stdout], compile_and_ru
# this test computes closure sizes and those are affected
# by the ghci and prof ways, because of BCOs and profiling headers.
# Optimization levels slightly change what is/isn't shared so only run in normal mode
-test('compact_share', only_ways(['normal']), compile_and_run, [''])
+test('compact_share', [only_ways(['normal']), when(ghc_with_ipe(), skip)], # IPE changes allocation/layout affecting compactSize output.
+ compile_and_run, [''])
test('compact_bench', [ ignore_stdout, extra_run_opts('100') ],
compile_and_run, [''])
test('T17044', normal, compile_and_run, [''])
=====================================
libraries/ghc-internal/tests/backtraces/all.T
=====================================
@@ -2,5 +2,5 @@ test('T14532a', [], compile_and_run, [''])
test('T14532b', [], compile_and_run, [''])
test('T26507', [ when(have_profiling(), extra_ways(['prof']))
, when(js_arch(), skip)
- , exit_code(1)], compile_and_run, [''])
-
+ , when(ghc_with_ipe(), skip) # IPE builds include an IPE backtrace section on stderr.
+ , exit_code(1)], compile_and_run, [''])
=====================================
rts/AllocArray.c
=====================================
@@ -5,6 +5,7 @@
StgMutArrPtrs *allocateMutArrPtrs (Capability *cap,
StgWord nelements,
+ StgClosure *init,
CostCentreStack *ccs USED_IF_PROFILING)
{
/* All sizes in words */
@@ -25,6 +26,12 @@ StgMutArrPtrs *allocateMutArrPtrs (Capability *cap,
arr->ptrs = nelements;
arr->size = arrsize;
+ if (init != NULL) {
+ for (StgWord i = 0; i < nelements; ++i) {
+ arr->payload[i] = init;
+ }
+ }
+
/* Initialize the card array. Note that memset needs sizes in bytes. */
memset(&(arr->payload[nelements]), 0, mutArrPtrsCards(nelements));
@@ -33,6 +40,7 @@ StgMutArrPtrs *allocateMutArrPtrs (Capability *cap,
StgSmallMutArrPtrs *allocateSmallMutArrPtrs (Capability *cap,
StgWord nelements,
+ StgClosure *init,
CostCentreStack *ccs
USED_IF_PROFILING)
{
@@ -47,6 +55,13 @@ StgSmallMutArrPtrs *allocateSmallMutArrPtrs (Capability *cap,
/* No write barrier needed since this is a new allocation. */
SET_HDR(arr, &stg_SMALL_MUT_ARR_PTRS_DIRTY_info, ccs);
arr->ptrs = nelements;
+
+ if (init != NULL) {
+ for (StgWord i = 0; i < nelements; ++i) {
+ arr->payload[i] = init;
+ }
+ }
+
return arr;
}
=====================================
rts/AllocArray.h
=====================================
@@ -21,16 +21,19 @@
*/
/* Allocate a StgMutArrPtrs for a given number of elements. It is allocated in
- * the DIRTY state.
+ * the DIRTY state. If init is non-NULL, initialize payload elements to init.
*/
StgMutArrPtrs *allocateMutArrPtrs (Capability *cap,
StgWord nelements,
+ StgClosure *init,
CostCentreStack *ccs);
-/* Allocate a StgSmallMutArrPtrs for a given number of elements.
+/* Allocate a StgSmallMutArrPtrs for a given number of elements. If init is
+ * non-NULL, initialize payload elements to init.
*/
StgSmallMutArrPtrs *allocateSmallMutArrPtrs (Capability *cap,
StgWord nelements,
+ StgClosure *init,
CostCentreStack *ccs);
/* Allocate a StgArrBytes for a given number of bytes.
=====================================
rts/ClosureTable.c
=====================================
@@ -46,7 +46,7 @@ bool enlargeClosureTable(Capability *cap, ClosureTable *t, int newcapacity)
ASSERT(newcapacity > oldcapacity);
StgMutArrPtrs *newarr;
- newarr = allocateMutArrPtrs(cap, newcapacity, CCS_SYSTEM_OR_NULL);
+ newarr = allocateMutArrPtrs(cap, newcapacity, NULL, CCS_SYSTEM_OR_NULL);
if (RTS_UNLIKELY(newarr == NULL)) return false;
StgArrBytes *newfree;
@@ -276,4 +276,3 @@ static bool isCompactClosureTable(ClosureTable *t)
}
return isCompact;
}
-
=====================================
rts/Heap.c
=====================================
@@ -279,7 +279,7 @@ StgMutArrPtrs *heap_view_closurePtrs(Capability *cap, StgClosure *closure) {
StgClosure **ptrs = (StgClosure **) stgMallocBytes(sizeof(StgClosure *) * size, "heap_view_closurePtrs");
StgWord nptrs = collect_pointers(closure, ptrs);
- StgMutArrPtrs *arr = allocateMutArrPtrs(cap, nptrs, cap->r.rCCCS);
+ StgMutArrPtrs *arr = allocateMutArrPtrs(cap, nptrs, NULL, cap->r.rCCCS);
if (RTS_UNLIKELY(arr == NULL)) goto end;
SET_INFO((StgClosure *) arr, &stg_MUT_ARR_PTRS_FROZEN_CLEAN_info);
=====================================
rts/PrimOps.cmm
=====================================
@@ -386,24 +386,11 @@ stg_newArrayzh ( W_ n /* words */, gcptr init )
again: MAYBE_GC(again);
- ("ptr" arr) = ccall allocateMutArrPtrs(MyCapability() "ptr", n, CCCS);
+ ("ptr" arr) = ccall allocateMutArrPtrs(MyCapability() "ptr", n, init "ptr", CCCS);
if (arr == NULL) (likely: False) {
jump stg_raisezh(HsIface_heapOverflow_closure(W_[ghc_hs_iface]));
}
- // Initialise all elements of the array with the value init
- W_ p;
- p = arr + SIZEOF_StgMutArrPtrs;
- // Avoid the shift for `WDS(n)` in the inner loop
- W_ limit;
- limit = arr + SIZEOF_StgMutArrPtrs + WDS(n);
- for:
- if (p < limit) (likely: True) {
- W_[p] = init;
- p = p + WDS(1);
- goto for;
- }
-
return (arr);
}
@@ -496,24 +483,11 @@ stg_newSmallArrayzh ( W_ n /* words */, gcptr init )
again: MAYBE_GC(again);
- ("ptr" arr) = ccall allocateSmallMutArrPtrs(MyCapability() "ptr", n, CCCS);
+ ("ptr" arr) = ccall allocateSmallMutArrPtrs(MyCapability() "ptr", n, init "ptr", CCCS);
if (arr == NULL) (likely: False) {
jump stg_raisezh(HsIface_heapOverflow_closure(W_[ghc_hs_iface]));
}
- // Initialise all elements of the array with the value init
- W_ p;
- p = arr + SIZEOF_StgSmallMutArrPtrs;
- // Avoid the shift for `WDS(n)` in the inner loop
- W_ limit;
- limit = arr + SIZEOF_StgSmallMutArrPtrs + WDS(n);
- for:
- if (p < limit) (likely: True) {
- W_[p] = init;
- p = p + WDS(1);
- goto for;
- }
-
return (arr);
}
=====================================
rts/RtsFlags.c
=====================================
@@ -209,6 +209,8 @@ void initRtsFlagsDefaults(void)
RtsFlags.DebugFlags.numa = false;
RtsFlags.DebugFlags.compact = false;
RtsFlags.DebugFlags.continuation = false;
+ RtsFlags.DebugFlags.iomanager = false;
+ RtsFlags.DebugFlags.ipe = false;
#if defined(PROFILING)
RtsFlags.CcFlags.doCostCentres = COST_CENTRES_NONE;
@@ -482,6 +484,7 @@ usage_text[] = {
#if defined(DEBUG)
" -Ds DEBUG: scheduler",
" -Di DEBUG: interpreter",
+" -DI DEBUG: IPE",
" -Dw DEBUG: weak",
" -DG DEBUG: gccafs",
" -Dg DEBUG: gc",
@@ -2311,6 +2314,9 @@ static void read_debug_flags(const char* arg)
case 'o':
RtsFlags.DebugFlags.iomanager = true;
break;
+ case 'I':
+ RtsFlags.DebugFlags.ipe = true;
+ break;
default:
bad_option( arg );
}
=====================================
rts/Threads.c
=====================================
@@ -894,7 +894,7 @@ StgMutArrPtrs *listThreads(Capability *cap)
}
// Allocate a suitably-sized array...
- StgMutArrPtrs *arr = allocateMutArrPtrs(cap, n_threads, cap->r.rCCCS);
+ StgMutArrPtrs *arr = allocateMutArrPtrs(cap, n_threads, NULL, cap->r.rCCCS);
if (RTS_UNLIKELY(arr == NULL)) goto end;
// Populate it...
=====================================
rts/Trace.c
=====================================
@@ -685,7 +685,8 @@ void traceHeapProfSampleString(const char *label, StgWord residency)
void traceIPE(const InfoProvEnt *ipe)
{
#if defined(DEBUG)
- if (RtsFlags.TraceFlags.tracing == TRACE_STDERR) {
+ if (RtsFlags.TraceFlags.tracing == TRACE_STDERR
+ && RtsFlags.DebugFlags.ipe) {
ACQUIRE_LOCK(&trace_utx);
char closure_desc_buf[CLOSURE_DESC_BUFFER_SIZE] = {};
=====================================
rts/Weak.c
=====================================
@@ -146,7 +146,7 @@ scheduleFinalizers(Capability *cap, StgWeak *list)
debugTrace(DEBUG_weak, "weak: batching %d finalizers", n);
- StgMutArrPtrs *arr = allocateMutArrPtrs(cap, n, CCS_SYSTEM_OR_NULL);
+ StgMutArrPtrs *arr = allocateMutArrPtrs(cap, n, NULL, CCS_SYSTEM_OR_NULL);
if (RTS_UNLIKELY(arr == NULL)) exitHeapOverflow();
// No write barrier needed here; this array is only going to referred to by this core.
SET_INFO((StgClosure *) arr, &stg_MUT_ARR_PTRS_FROZEN_CLEAN_info);
=====================================
rts/include/rts/Flags.h
=====================================
@@ -118,6 +118,7 @@ typedef struct _DEBUG_FLAGS {
bool compact; /* 'C' */
bool continuation; /* 'k' */
bool iomanager; /* 'o' */
+ bool ipe; /* 'I' */
} DEBUG_FLAGS;
/* See Note [Synchronization of flags and base APIs] */
=====================================
testsuite/driver/testglobals.py
=====================================
@@ -72,6 +72,10 @@ class TestConfig:
# Was the compiler compiled with -debug?
self.debug_rts = False
+ # Were the compiler + libraries built with IPE-related options
+ # (e.g. -finfo-table-map, -fdistinct-constructor-tables)?
+ self.ghc_with_ipe = False
+
# Was the compiler compiled with LLVM?
self.ghc_built_by_llvm = False
=====================================
testsuite/driver/testlib.py
=====================================
@@ -1074,6 +1074,9 @@ def have_profiling( ) -> bool:
def have_threaded( ) -> bool:
return config.ghc_with_threaded_rts
+def ghc_with_ipe( ) -> bool:
+ return config.ghc_with_ipe
+
def in_tree_compiler( ) -> bool:
return config.in_tree_compiler
=====================================
testsuite/tests/rts/Makefile
=====================================
@@ -140,7 +140,7 @@ T20199:
.PHONY: EventlogOutput_IPE
EventlogOutput_IPE:
"$(TEST_HC)" $(TEST_HC_OPTS) -debug -finfo-table-map -v0 EventlogOutput.hs
- ./EventlogOutput +RTS -va 2> EventlogOutput_IPE.stderr.log
+ ./EventlogOutput +RTS -va -DI 2> EventlogOutput_IPE.stderr.log
grep "IPE:" EventlogOutput_IPE.stderr.log
.PHONY: T23142
=====================================
testsuite/tests/rts/all.T
=====================================
@@ -535,6 +535,7 @@ test('T13676',
test('InitEventLogging',
[ only_ways(['normal'])
, extra_run_opts('+RTS -RTS')
+ , when(ghc_with_ipe(), skip) # IPE builds can change eventlog writer call counts.
, req_c
],
compile_and_run, ['InitEventLogging_c.c'])
@@ -588,6 +589,7 @@ test('cloneThreadStack', [req_c, only_ways(['threaded1']), extra_ways(['threaded
test('decodeMyStack',
[ omit_ghci, js_broken(22261) # cloneMyStack# not yet implemented
+ , when(ghc_with_ipe(), skip) # IPE builds can change decoded stack output.
], compile_and_run, ['-finfo-table-map'])
# Options:
@@ -595,6 +597,7 @@ test('decodeMyStack',
test('decodeMyStack_underflowFrames',
[ extra_run_opts('+RTS -kc8K -RTS')
, omit_ghci, js_broken(22261) # cloneMyStack# not yet implemented
+ , when(ghc_with_ipe(), skip) # IPE builds can change decoded stack layout/length.
], compile_and_run, ['-finfo-table-map -rtsopts'])
# -finfo-table-map intentionally missing
@@ -602,6 +605,7 @@ test('decodeMyStack_emptyListForMissingFlag',
[ ignore_stdout
, ignore_stderr
, js_broken(22261) # cloneMyStack# not yet implemented
+ , when(ghc_with_ipe(), skip) # IPE builds can populate IPE info even without -finfo-table-map on this module.
], compile_and_run, [''])
# Tests RTS flag parsing. Skipped on JS as it uses a distinct RTS.
@@ -646,7 +650,7 @@ test('T25280', [unless(opsys('linux'),skip),req_process,js_skip], compile_and_ru
test('T25560', [req_c_rts, ignore_stderr], compile_and_run, [''])
test('TestProddableBlockSet', [req_c_rts], multimod_compile_and_run, ['TestProddableBlockSet.c', '-no-hs-main'])
-test('T22859',
+test('T22859',
[js_skip,
# This test is vulnerable to changes in allocation behaviour, so we disable it in some ways
when(arch('wasm32'), skip),
=====================================
testsuite/tests/rts/ipe/all.T
=====================================
@@ -8,7 +8,7 @@ test('ipeMap', [extra_files(['ipe_lib.c', 'ipe_lib.h']), c_src, omit_ghci], comp
test('ipeEventLog',
[ c_src,
extra_files(['ipe_lib.c', 'ipe_lib.h']),
- extra_run_opts('+RTS -va -RTS'),
+ extra_run_opts('+RTS -va -DI -RTS'),
grep_errmsg('table_name_'),
only_ways(debug_ways),
normalise_errmsg_fun(noCapabilityOutputFilter),
@@ -24,7 +24,7 @@ test('ipeEventLog',
test('ipeEventLog_fromMap',
[ c_src,
extra_files(['ipe_lib.c', 'ipe_lib.h']),
- extra_run_opts('+RTS -va -RTS'),
+ extra_run_opts('+RTS -va -DI -RTS'),
grep_errmsg('table_name_'),
only_ways(debug_ways),
normalise_errmsg_fun(noCapabilityOutputFilter),
@@ -34,4 +34,3 @@ test('ipeEventLog_fromMap',
when(opsys('darwin'), fragile(0))
],
compile_and_run, ['ipe_lib.c'])
-
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8f45dfca553ce91069e2f9fa10eead…
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/8f45dfca553ce91069e2f9fa10eead…
You're receiving this email because of your account on gitlab.haskell.org.
1
0