[Git][ghc/ghc][ghc-9.10] 35 commits: Consider Wanteds with rewriters as insoluble
Andreas Klebinger (@AndreasK)
gitlab at gitlab.haskell.org
Fri Feb 21 12:57:53 UTC 2025
Andreas Klebinger pushed to branch ghc-9.10 at Glasgow Haskell Compiler / GHC
Commits:
128825be by Simon Peyton Jones at 2025-02-06T13:28:48+01:00
Consider Wanteds with rewriters as insoluble
This MR fixes #25325
See GHC.Tc.Types.Constraint, Note [Insoluble Wanteds], especially (IW2)
There is a small change in the error message for T14172, but it looks
entirely acceptable to me.
(cherry picked from commit 083703a12cd34369e7ed2f0efc4a5baee47aedab)
- - - - -
d6f6d927 by Simon Peyton Jones at 2025-02-06T13:29:07+01:00
Wibbles
(cherry picked from commit 0dfaeb66fb8457e7339abbd44d5c53a81ad8ae3a)
- - - - -
8ee0a3df by Simon Peyton Jones at 2025-02-06T13:29:14+01:00
Spelling errors
(cherry picked from commit 09d24d828e48c2588a317e6dad711f8673983703)
- - - - -
68d3ab8b by Arnaud Spiwack at 2025-02-06T13:45:53+01:00
Don't bypass MonoLocalBind in empty patterns
Fixes #25428
(cherry picked from commit 52d97f4ecd37bf598560dbded2d50649db5cfe1d)
- - - - -
15ca7b2c by Andreas Klebinger at 2025-02-06T14:25:25+01:00
hadrian: Bump directory bound to >=1.3.9
Earlier versions of `directory` are racy on Windows due to #24382.
- - - - -
420e9244 by Andreas Klebinger at 2025-02-14T13:10:44+01:00
Revert "AArch64: Implement switch/jump tables (#19912)"
This reverts commit 9b4326cf4180eb70f7474aa143b46a49cb69306f.
- - - - -
8871bb89 by Ben Gamari at 2025-02-14T13:10:44+01:00
rts/linker: Fix out-of-bounds mapping logic
Previously the structure of `mmapInRegion` concealed a subtle bug
concerning handling of `mmap` returning mappings below the beginning of
the desired region. Specifically, we would reset `p = result + bytes`
and then again reset `p = region->start` before looping around for
another iteration. This resulted in an infinite loop on FreeBSD.
Fixes #25492.
(cherry picked from commit 292ed74ea908b64490e91346b890cbebdcde37d0)
- - - - -
663c1711 by Ben Gamari at 2025-02-14T13:10:44+01:00
rts/linker: Clarify debug output
(cherry picked from commit 20912f5bac6fe4146172accc1849d9b762eb45e3)
- - - - -
9b2e13db by Ben Gamari at 2025-02-14T13:10:44+01:00
hadrian: Mitigate mktexfmt race
At least some versions of Texlive's `mktexfmt` utility cannot be invoked
concurrently in their initial run since they fail to handle failure of
`mkdir` due to racing. Specifically, we see
```
| Run Xelatex: users_guide.tex => /tmp/extra-dir-9616886274866
| Run Xelatex: Haddock.tex => /tmp/extra-dir-9616886274869
This is XeTeX, Version 3.14159265-2.6-0.999992 (TeX Live 2020) (preloaded format=xelatex)
restricted \write18 enabled.
kpathsea: Running mktexfmt xelatex.fmt
mktexfmt: mktexfmt is using the following fmtutil.cnf files (in precedence order):
mktexfmt: /usr/share/texlive/texmf-dist/web2c/fmtutil.cnf
mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes:
mktexfmt: /builds/ghc/ghc/tmp-home/.texlive2020/texmf-config/web2c/fmtutil.cnf
/usr/bin/mktexfmt: mkdir(/builds/ghc/ghc/tmp-home/.texlive2020/texmf-var/web2c/) failed for tree /builds/ghc/ghc/tmp-home/.texlive2020/texmf-var/web2c: File exists at /usr/share/texlive/tlpkg/TeXLive/TLUtils.pm line 937.
I can't find the format file `xelatex.fmt'!
```
That is two `mktexfmt` invocations (for the user's guide and haddock
builds) attempted to create `$HOME/texlive2020/texmf-var/web2c` and
raced. One of the two `mkdir`'s consequently failed, bringing down the
entire build.
We avoid this by ensuring that the first `xelatex` invocation is always
performed serially.
Fixes #25564.
(cherry picked from commit 41dae5b86955094aa4c5647f63f1f52f1a8a5519)
- - - - -
4b00e0dc by Ben Gamari at 2025-02-14T13:10:44+01:00
rts/CheckUnload: Reset old_objects if unload is skipped
Previously `checkUnload` failed to reset `old_objects` when it decided
not to unload (e.g. due to heap profiling being enabled).
Fixes #24935.
(cherry picked from commit 9efbc51f99118e8f9c3abf2bcb6dc3295893ded6)
- - - - -
653b86ae by Ben Gamari at 2025-02-14T13:10:44+01:00
rts(setNumCapabilities): Assert that n_caps < MAX_N_CAPS
It was noticed in #25560 that this would previously be allowed,
resulting in a segfault.
I will add a proper exception in `base` in a future commit.
(cherry picked from commit f08a72eb484193934c56e34366b277f4d7247a24)
- - - - -
1e7ef0a1 by Ben Gamari at 2025-02-14T13:10:44+01:00
ghc-internal: Fix inconsistent FFI import types
The foreign imports of `enabled_capabilities` and
`getNumberOfProcessors` were declared as `CInt` whereas they are defined
as `uint32_t`.
(cherry picked from commit e10d31ad849b5f7c1f052e7c93f7c7aaf85918c9)
- - - - -
e3b3358f by Ben Gamari at 2025-02-14T13:10:44+01:00
rts: Mention maximum capability count in users guide
Addresses #25560.
(cherry picked from commit 06265655bfe6b48cde6923a933d81c9889a443a3)
- - - - -
9229aef9 by Ben Gamari at 2025-02-14T13:10:44+01:00
rts/Capability: Move induction variable declaration into `for`s
Just a stylistic change.
(cherry picked from commit d488470ba302760cfd2f3515d9338d1d75f84dd5)
- - - - -
a1791350 by Ben Gamari at 2025-02-14T13:10:44+01:00
rts: Determine max_n_capabilities at RTS startup
Previously the maximum number of capabilities supported by the RTS was
statically capped at 256. However, this bound is uncomfortably low given
the size of today's machine.
While supporting unbounded, fully-dynamic adjustment would be nice, it
is complex and so instead we do something simpler: Probe the logical
core count at RTS startup and use this as the static bound for the rest
of our execution.
This should avoid users running into the capability limit on large
machines while avoiding wasting memory on a large capabilities array for
most users and keeping complexity at bay.
Addresses #25560.
(cherry picked from commit 71f050b74eaa2fdc2ca5da53f85497ac94ab6a2a)
- - - - -
b8efe316 by Ben Gamari at 2025-02-14T13:10:44+01:00
testsuite: Introduce req_c_rts
As suggested by @hsyl20, this is intended to mark tests that rely on the
behavior of the C RTS.
(cherry picked from commit 1e84b41108d96cb721dd11281105fdf621105a12)
- - - - -
4a48042c by Ben Gamari at 2025-02-14T13:10:44+01:00
testsuite: Add test for #25560
(cherry picked from commit 683115a40fd989a287fa51efe140af9448526098)
- - - - -
ae36c9e7 by Ben Gamari at 2025-02-14T13:10:44+01:00
rts/CheckUnload: Don't prepare to unload if we can't unload
Previously `prepareUnloadCheck` would move the `objects` list to
`old_objects` even when profiling (where we cannot unload). This caused
us to vacate the `objects` list during major GCs, losing track of loaded
objects. Fix this by ensuring that `prepareUnloadCheck` and
`checkUnload` both use the same short-cutting logic.
(cherry picked from commit 34d3e8e69b62b92cc438514f7fb8e37ce639efea)
- - - - -
8c363c54 by Matthew Pickering at 2025-02-14T13:10:44+01:00
typechecker: Perform type family consistency checks in topological order
Consider a module M importing modules A, B and C.
We can waste a lot of work depending on the order that the modules are
checked for family consistency.
Consider that C imports A and B. When compiling C we must have already
checked A and B for consistency, therefore if C is processed first then
A and B will not need to be checked for consistency again.
If A and B are compared first, then the consistency checks will be
performed against (wasted as we already performed them for C).
At the moment the order which modules are checked is non-deterministic.
Clearly we should engineer that C is checked before B and A, but by what
scheme?
A simple one is to observe that if a module M is in the transitive
closure of X then the size of the consistent family set of M is less
than or equal to size of the consistent family set of X.
Therefore by sorting the imports by the size of the consistent family
set and processing the largest first, you make sure to process modules
in topological order.
In practice we have observed that this strategy has reduced the amount
of consistency checks performed.
One solution to #25554
(cherry picked from commit 13fe48d40004d9cdf3c73300a18f144bdc5191d9)
- - - - -
a31ca08b by Ben Gamari at 2025-02-14T13:10:44+01:00
rts: Fix incorrect format specifiers in era profiling
Fixes #25581.
(cherry picked from commit 430d965a176d6c9e629d169fa0606923275c8332)
- - - - -
045ff13b by Cheng Shao at 2025-02-14T13:10:44+01:00
ci: minor nix-in-docker improvements
This patch makes some minor improvements re nix-in-docker logic in the
ci configuration:
- Update `nixos/nix` to the latest version
- Apply $CPUS to `cores`/`max-jobs` to avoid oversubscribing while
allowing a reasonable degree of parallelism
- Remove redundant `--extra-experimental-features nix-command` in
later `nix shell` invocations, it's already configured in
`/etc/nix/nix.conf`
(cherry picked from commit 291388e18b5b61a02a43cc153a642fd67d6127c4)
- - - - -
852c738e by Zubin Duggal at 2025-02-14T13:10:44+01:00
ghcup metadata: output metadata fragment in CI
(cherry picked from commit 52b58a660e735b20961d792d8fa9267f01247a50)
(cherry picked from commit 04433916cdedab80114cbed1dc399ae816bada91)
- - - - -
1f594b60 by Zubin Duggal at 2025-02-14T13:10:44+01:00
ghcup metatdata: use fedora33 for redhat
Redhat 9 doesn't have libtinfo.so.5 anymore
(cherry picked from commit dc86785eb43afd1bd292287c064fb5ad94fe8c7f)
(cherry picked from commit 7c78804e3b25d2c0246cd1f3ce0d4015431e5831)
- - - - -
98d0ec4e by Zubin Duggal at 2025-02-14T13:10:44+01:00
ghcup metadata: still use centos for redhat <9
(cherry picked from commit 1d72cfb2c1054bc8a399855d5c68443c969d2f66)
- - - - -
29e25ab0 by Simon Peyton Jones at 2025-02-14T13:10:44+01:00
Preserve orientation when unifying kinds
This MR fixes yet another manifestation of the trickiness caused
by Note [Fundeps with instances, and equality orientation].
I wish there was a more robust way to do this, but this fix is
a definite improvement.
Fixes #25597
(cherry picked from commit 63d63f9d3e074c3bcf5b526ee14e50cb2b6b9d70)
- - - - -
418b6bc7 by ARATA Mizuki at 2025-02-14T13:37:49+01:00
Fix LLVM version detection
With a recent LLVM, `llc -version` emits the version on the first line
if the vendor is set. It emits the version on the second line
otherwise.
Therefore, we need to check the both lines to detect the version.
GHC now emits a warning if it fails to detect the LLVM version,
so we can notice if the output of `llc -version` changes in the future.
Also, the warning for using LLVM < 10 on s390x is removed, because
we assume LLVM >= 13 now.
This fixes the definition of __GLASGOW_HASKELL_LLVM__ macro.
Fixes #25606
(cherry picked from commit a928c326011f1a6bef3289a4c36d4e19b5951229)
- - - - -
f4847884 by Cheng Shao at 2025-02-14T13:37:58+01:00
xxhash: bump to v0.8.3
(cherry picked from commit 42826a8941ecedd329844b675e26d30bdb6cd46b)
- - - - -
a7402f41 by Ben Gamari at 2025-02-14T13:38:06+01:00
compiler: Fix CPP guards around ghc_unique_counter64
The `ghc_unique_counter64` symbol was introduced in the RTS in the
64-bit unique refactor (!10568) which has been backported to %9.6.7 and
%9.8.4. Update the CPP to reflect this.
Fixes #25576.
(cherry picked from commit 595013d41464c1e328369bb81ce0ea2814e91b68)
- - - - -
600e7de5 by Jens Petersen at 2025-02-14T13:38:46+01:00
hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23
Fix build with gcc-15 which defaults to C23 standard (-std=gnu23)
Fixes #25662
```
utils/hp2ps/Utilities.c:6:14: error:
warning: conflicting types for built-in function ‘malloc’; expected ‘void *(long unsigned int)’ [-Wbuiltin-declaration-mismatch]
6 | extern void* malloc();
| ^~~~~~
|
6 | extern void* malloc();
| ^
utils/hp2ps/Utilities.c:5:1: error:
note: ‘malloc’ is declared in header ‘<stdlib.h>’
4 | #include "Error.h"
+++ |+#include <stdlib.h>
5 |
|
5 |
| ^
utils/hp2ps/Utilities.c: In function ‘xmalloc’:
utils/hp2ps/Utilities.c:80:17: error:
error: too many arguments to function ‘malloc’; expected 0, have 1
80 | r = (void*) malloc(n);
| ^~~~~~ ~
|
80 | r = (void*) malloc(n);
| ^
utils/hp2ps/Utilities.c:6:14: error:
note: declared here
6 | extern void* malloc();
| ^~~~~~
|
6 | extern void* malloc();
| ^
utils/hp2ps/Utilities.c: In function ‘xrealloc’:
utils/hp2ps/Utilities.c:92:18: error:
warning: conflicting types for built-in function ‘realloc’; expected ‘void *(void *, long unsigned int)’ [-Wbuiltin-declaration-mismatch]
92 | extern void *realloc();
| ^~~~~~~
|
92 | extern void *realloc();
| ^
utils/hp2ps/Utilities.c:92:18: error:
note: ‘realloc’ is declared in header ‘<stdlib.h>’
|
92 | extern void *realloc();
| ^
utils/hp2ps/Utilities.c:94:9: error:
error: too many arguments to function ‘realloc’; expected 0, have 2
94 | r = realloc(p, n);
| ^~~~~~~ ~
|
94 | r = realloc(p, n);
| ^
utils/hp2ps/Utilities.c:92:18: error:
note: declared here
92 | extern void *realloc();
| ^~~~~~~
|
92 | extern void *realloc();
| ^
```
(cherry picked from commit f983a00ffc97b779eb52b10e69e254ec107f8311)
- - - - -
858349a6 by Jens Petersen at 2025-02-14T13:39:04+01:00
hp2ps/Utilities.c: add extern parameter types for malloc and realloc for C23
use portable C types!
(cherry picked from commit 70f7741acd9d50a6cc07553aeaae600afe4a72b8)
- - - - -
f66bba73 by Matthew Pickering at 2025-02-14T13:39:54+01:00
bytecode: Do not generate `SLIDE x 0` instructions
SLIDE x 0 is a no-op as it means to shift x elements of the stack by no
spaces. In the interpreter, this results in a loop which copies an array
element into the same place.
I have instrumented GHCi to count how many of these instructions are interpreted.
The workload was `ghc` compiling two simple modules.
Total no-op slides: 7793476
Total slides: 11413289
Percentage useless (slides): 68%
Percentage uselss of total instructions: 9%
(cherry picked from commit bf8c7d6edf224c083c90ab3ddac49979ac18ad39)
- - - - -
9d3dcef2 by Luite Stegeman at 2025-02-14T14:00:21+01:00
Add flags for switching off speculative evaluation.
We found that speculative evaluation can increase the amount of
allocations in some circumstances. This patch adds new flags for
selectively disabling speculative evaluation, allowing us to
test the effect of the optimization.
The new flags are:
-fspec-eval
globally enable speculative evaluation
-fspec-eval-dictfun
enable speculative evaluation for dictionary functions (no effect
if speculative evaluation is globally disabled)
The new flags are on by default for all optimisation levels.
See #25284
(cherry picked from commit 2309975247543a4f77009ea5c3c7a8ebe06dc60b)
- - - - -
1f0035f6 by Andrei Borzenkov at 2025-02-17T17:07:04+01:00
Add missing entires to the release notes (#24970, #24830)
(cherry picked from commit 2bb21ba8c6a1b66e17b27a3e6ace338c1f38a46d)
- - - - -
388573b2 by Andreas Klebinger at 2025-02-19T15:07:57+01:00
Small fixes for CI/testsuite
- - - - -
b7c579a3 by Andreas Klebinger at 2025-02-20T14:54:21+01:00
Windows ci fix
- - - - -
64 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToLlvm.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Driver/Config/CoreToStg/Prep.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/SysTools/Tasks.hs
- compiler/GHC/Tc/Errors.hs
- compiler/GHC/Tc/Gen/Bind.hs
- compiler/GHC/Tc/Instance/Family.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver/Equality.hs
- compiler/GHC/Tc/Types/Constraint.hs
- compiler/GHC/Tc/Utils/Unify.hs
- compiler/cbits/genSym.c
- docs/users_guide/9.10.1-notes.rst
- docs/users_guide/phases.rst
- docs/users_guide/using-concurrent.rst
- docs/users_guide/using-optimisation.rst
- hadrian/cabal.project
- hadrian/hadrian.cabal
- hadrian/src/Rules/Documentation.hs
- hadrian/stack.yaml
- libraries/ghc-internal/src/GHC/Internal/Conc/Sync.hs
- rts/Capability.c
- rts/Capability.h
- rts/CheckUnload.c
- rts/Linker.c
- rts/ProfHeap.c
- rts/RtsSymbols.c
- rts/Schedule.c
- rts/include/rts/Config.h
- rts/include/rts/Threads.h
- rts/linker/MMap.c
- rts/xxhash.h
- testsuite/driver/testlib.py
- + testsuite/tests/core-to-stg/T25284/A.hs
- + testsuite/tests/core-to-stg/T25284/B.hs
- + testsuite/tests/core-to-stg/T25284/Cls.hs
- + testsuite/tests/core-to-stg/T25284/Main.hs
- + testsuite/tests/core-to-stg/T25284/T25284.stdout
- + testsuite/tests/core-to-stg/T25284/all.T
- testsuite/tests/linear/should_compile/all.T
- + testsuite/tests/llvm/should_compile/T25606.hs
- testsuite/tests/llvm/should_compile/all.T
- testsuite/tests/polykinds/T14172.stderr
- testsuite/tests/rep-poly/RepPolyMcGuard.stderr
- testsuite/tests/rep-poly/RepPolyRecordUpdate.stderr
- testsuite/tests/rep-poly/T12709.stderr
- + testsuite/tests/rts/T25560.hs
- testsuite/tests/rts/all.T
- + testsuite/tests/typecheck/should_compile/T25597.hs
- testsuite/tests/typecheck/should_compile/all.T
- + testsuite/tests/typecheck/should_fail/T25325.hs
- + testsuite/tests/typecheck/should_fail/T25325.stderr
- testsuite/tests/typecheck/should_fail/all.T
- utils/hp2ps/Utilities.c
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e41456fca25b1407193536c4243dd19a82b40ab7...b7c579a378945f81c5ff6ee9a76bb3ca83dc6534
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/e41456fca25b1407193536c4243dd19a82b40ab7...b7c579a378945f81c5ff6ee9a76bb3ca83dc6534
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20250221/a2c14eb0/attachment-0001.html>
More information about the ghc-commits
mailing list