[Git][ghc/ghc][wip/interpolated-strings] 55 commits: Add missing @since documentation for (!?) function
Brandon Chinn (@brandonchinn178)
gitlab at gitlab.haskell.org
Tue Dec 24 08:53:50 UTC 2024
Brandon Chinn pushed to branch wip/interpolated-strings at Glasgow Haskell Compiler / GHC
Commits:
a83b7ed6 by Matthew Stephenson at 2024-12-10T14:01:22-05:00
Add missing @since documentation for (!?) function
- - - - -
e745e3a3 by Ben Gamari at 2024-12-10T14:01:59-05:00
compiler: Don't attempt to TSAN-instrument SIMD operations
TSAN only provides instrumentation for 8, 16, 32, and 64-bit memory
loads/stores. Don't attempt to instrument wider operations.
Fixes #25563.
- - - - -
684c0018 by Ben Gamari at 2024-12-10T14:02:35-05:00
gitlab/ci: Don't clobber RUNTEST_ARGS
Previously the logic handling `IGNORE_PERF_FAILURES` clobbered the
user's `RUNTEST_ARGS`. Fix this.
- - - - -
41dae5b8 by Ben Gamari at 2024-12-10T14:03:11-05: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.
- - - - -
9efbc51f by Ben Gamari at 2024-12-10T14:03:48-05: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.
- - - - -
5192a75f by Ben Gamari at 2024-12-11T04:28:11-05:00
rts: Annotate BCOs with their Name
This introduces a new bytecode instruction, `BCO_NAME`, to aid in debugging
bytecode execution. This instruction is injected by `mkProtoBCO` and
captures the Haskell name of the BCO. It is then printed by the
disassembler, allowing ready correlation with STG dumps.
- - - - -
99225996 by Ben Gamari at 2024-12-11T04:28:48-05:00
configure: Implement ld override whitelist
Bring `configure` into alignment with `ghc-toolchain`, ensuring that the
ld-override logic will only take effect on Linux and Windows.
Fixes #25501.
- - - - -
4a8fc928 by Ben Gamari at 2024-12-11T12:33:42+00:00
testsuite: Unmark T14028 as broken on FreeBSD
This now appears to pass on FreeBSD 14.
Closes #19723.
- - - - -
d7c0eb5a by Ben Gamari at 2024-12-11T12:33:42+00:00
gitlab-ci: Migrate FreeBSD runner tag to FreeBSD 14
- - - - -
7246dacc by Ben Gamari at 2024-12-11T12:33:42+00:00
gitlab-ci: Reintroduce FreeBSD 14 job
- - - - -
4af936da by Ben Gamari at 2024-12-11T12:33:42+00:00
gitlab-ci: Allow use of newer cabal-install bindists
Newer cabal-install bindists have internal directory structure.
Here we detect and account for the presence of such structure.
- - - - -
cbf38c1b by Ben Gamari at 2024-12-11T12:33:42+00:00
gitlab-ci: Enable documentation build on FreeBSD 14
- - - - -
d68107fb by Ben Gamari at 2024-12-11T12:33:42+00:00
gitlab-ci: Use system libffi on FreeBSD
- - - - -
fea3b590 by Ben Gamari at 2024-12-11T12:33:42+00:00
testsuite: Mark linker_unload as broken on FreeeBSD
Due to #25491.
- - - - -
ccf171ee by Ben Gamari at 2024-12-11T12:33:42+00:00
gitlab-ci: Prefer system toolchain on FreeBSD
It's not uncommon to find machines with gcc installed via ports. We
should be using the system's default clang-based toolchain instead.
- - - - -
cfb34738 by Ben Gamari at 2024-12-11T12:33:42+00:00
testsuite: Mark T21969 as broken on FreeBSD
Due to #25512.
- - - - -
0b64e37c by Ben Gamari at 2024-12-11T12:33:42+00:00
testsuite: Mark RestartEventLogging as broken on FreeBSD
I am seeing this fail quite reproducibly.
Due to #19724.
- - - - -
3b412019 by Ben Gamari at 2024-12-11T12:33:42+00:00
testsuite: Mark T16180 as "broken" on FreeBSD
Sadly we in fact need to skip it as it merely times out during
compilation.
See #14012.
- - - - -
57e3cab5 by Ben Gamari at 2024-12-11T12:33:42+00:00
testsuite: Skip T16992 unless in slow speed
This test has extraordinary memory requirements and tests a rather
niche aspect of the compact region mechanism. It has been suggested
multiple times that we shouldn't run it in the default testsuite
configuration. Finally implement this.
See #21890.
See #21892.
- - - - -
f08a72eb by Ben Gamari at 2024-12-11T19:30:54-05: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.
- - - - -
e10d31ad by Ben Gamari at 2024-12-11T19:30:55-05: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`.
- - - - -
06265655 by Ben Gamari at 2024-12-11T19:30:55-05:00
rts: Mention maximum capability count in users guide
Addresses #25560.
- - - - -
d488470b by Ben Gamari at 2024-12-11T19:30:55-05:00
rts/Capability: Move induction variable declaration into `for`s
Just a stylistic change.
- - - - -
71f050b7 by Ben Gamari at 2024-12-11T19:30:55-05: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.
- - - - -
1e84b411 by Ben Gamari at 2024-12-11T19:30:55-05: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.
- - - - -
683115a4 by Ben Gamari at 2024-12-11T19:30:55-05:00
testsuite: Add test for #25560
- - - - -
ef2052a8 by Ben Gamari at 2024-12-12T04:42:32-05:00
testsuite: Only run T14497_compact in normal way
This test targets the compacting GC so it makes little sense to run it
across all ways. Moreover, it outright conflicts with the `nonmoving`
way.
- - - - -
34d3e8e6 by Ben Gamari at 2024-12-12T04:43:08-05: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.
- - - - -
9c53489d by Andrei Borzenkov at 2024-12-12T15:06:42-05:00
Update GHCi :info type declaration printing (#24459)
- Do not print result's kind in type families
because we have full kind in SAKS and we display
invisible arity using @-binders
- Do not suppress significant invisible binders
An invisible binder is considered significant when it meets at least
one of the following two criteria:
- It visibly occurs in the declaration's body
- It is followed by a significant binder,
so it affects positioning
For non-generative type declarations (type synonyms and type families)
there is one additional criterion:
- It is not followed by a visible binder, so it
affects the arity of a type synonym
See Note [Print invisible binders in interface declarations]
for more information about what is "visibly occurs"
- - - - -
13fe48d4 by Matthew Pickering at 2024-12-12T15:07:19-05: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
- - - - -
62a2b25f by Sylvain Henry at 2024-12-14T04:31:09-05:00
TNTC: set CmmProc entry_label properly (#25565)
Before this patch we were renaming the entry label of a CmmProc late in
the CmmToAsm pass. It led to inconsistencies and to some labels being
used in info tables but not being emitted (#25565).
Now we set the CmmProc entry label earlier in the StgToCmm monad and we
don't renamed it afterwards.
- - - - -
b339e7c3 by Simon Hengel at 2024-12-14T04:31:47-05:00
Make filter functionality for system tools line-based
This is more efficient as:
- All existing filter functions were line-based anyway. They broke up
the input into lines and then joined it back together.
- We already break up the output from system tools into lines when
processing it.
Splitting up the output of system tools once and then filtering and
processing it reduces both code and runtime complexity.
- - - - -
39669077 by Simon Hengel at 2024-12-14T04:31:47-05:00
Refactoring: Don't use a `Chan` when parsing SysTools output
- - - - -
64756530 by Simon Peyton Jones at 2024-12-14T22:28:04-05:00
Tidy up the handling of `assert`
Fixes #25493
- - - - -
8658fbc1 by Rodrigo Mesquita at 2024-12-14T22:28:41-05:00
base: displayException for SomeAsyncException
Provide a better implementation of `SomeException` for
`SomeAsyncException`.
The previous, implicit, implementation, would not use the
`displayException` of the exception wrapped by `SomeAsyncException`.
Implements CLC-Proposal#309
Closes #25513
- - - - -
2d3a0a70 by ARATA Mizuki at 2024-12-15T18:35:30-05:00
LLVM: When emitting a vector literal with ppTypeLit, include the type information
Fixes #25561
- - - - -
bfacc086 by Simon Peyton Jones at 2024-12-15T18:36:05-05:00
Fix signature lookup in instance declarations
This fixes a bug introduced by the fix to #16610
- - - - -
80f0e02d by Simon Peyton Jones at 2024-12-16T17:13:52+00:00
Improve GHC build times
Two small changes
* In GHC.Data.Unboxed, never omit interface pragmas. In "fast builds"
one might omit them generally, but doing so gives very bad
performance for code that imports this module.
* In GHC.Hs.Dump don't do type-class specialisation. For some reason
it goes mad and generates vast amounts of useless code. See #25463.
- - - - -
175a1355 by Simon Peyton Jones at 2024-12-16T17:13:52+00:00
Refactor Lint
Refactor Lint for two reasons:
* To improve performance
* To prepare for type-lets
The big changes are all in GHC.Core.Lint:
* Change the main APIs:
* `lintType` returns nothing rather than returning a `LintedType`;
* `lintCoercion` return nothing rather than returning a `LintedCoercion`
Reason: these functions did a lot of allocation to return a substituted
type/coercion that was often discarded, or used only to extract its kind.
Instead we now return nothing, and, when needed, extract the kind and
substitute.
* Applications are treated as a whole, by `lintApp`. By treating
multiple arguments all at once we avoid performing multiple
substitutions, each substituting a single type variable. This can
make an absolutely huge difference.
Overall this led to a pretty massive rewrite of Lint, with many smaller
changes.
Smaller chnages elsewhere
* Rename `GHC.Core.TyCo.Subst.getSubstInScope` to `substInScopeSet` for consistency
* Define and use `GHC.Core.Type.liftedTypeOrConstraintKind`
Performance. This MR someimtes gives gives a very large improvement in
compile time, when Lint is on. here is a selection of changes over 5%
in perf/compiler (with -dcore-lint)
T25196 -97.0%
T14766 -89.7%
T14683 -74.4%
T5631 -60.9%
T20261 -56.7%
T18923 -17.6%
T13035 -15.8%
T6048 -15.8%
CoOpt_Read -14.4%
T9630 -10.9%
T5642 -7.3%
Eliminating the egregious offenders is a big win.
However, in some cases the compiler allocation /increases/. Here ae the
changes over 1%:
T9961 1.5%
T8095 2.8%
T14052 3.9%
T12545 4.5%
T14052Type 5.5%
T5030 8.0%
T5321Fun 8.3%
T3064 12.7%
CoOpt_Singletons 15.6%
T9198 16.0%
LargeRecord 18.1%
I looked at the two biggest increases in compile-time bytes allocated. Interestingly,
they both show substantial *decreases* in actual compile time, due to much smaller GC times.
I'm honestly not sure either why the allocation increases, or why the GC time decreases;
but I'm going to take the win!
T9198
Baseline With patch
No Lint
Alloc 44.6M 44.6M
Mut time 0.23s 0.22s
GC time 0.21s 0.21s
With Lint
Alloc 309M 360M
Mut time 1.51s 0.85s
GC time 2.97s 0.25s
-------------------
LargeRecord
Baseline With patch
No Lint
Alloc 1.37G 1.37G
Mut time 2.33s 2.33s
GC time 2.40s 2.42s
With Lint
Alloc 3.4G 4.0G
Mut time 6.02s 5.68s
GC time 3.67s 3.03s
IMPORTANT NOTE: These changes don't show up in CI because in CI the
tests in perf/compiler are all run with -dcore-lint switched off. I
gathered this data with some manual runs.
- - - - -
8ef2dad6 by Simon Peyton Jones at 2024-12-17T02:48:09-05:00
Add Note [Typechecking overloaded literals]
See #25494.
- - - - -
e86b1b20 by Ben Gamari at 2024-12-17T13:51:39-05:00
testsuite: Use math.inf instead of division-by-zero
This both more directly captures the intent and also fixes #25580.
- - - - -
430d965a by Ben Gamari at 2024-12-17T13:52:15-05:00
rts: Fix incorrect format specifiers in era profiling
Fixes #25581.
- - - - -
267098ad by Andreas Klebinger at 2024-12-18T23:43:13-05:00
Document `-prof` and non `-prof` code being incompatible.
Fixes #25518.
- - - - -
04433916 by Zubin Duggal at 2024-12-18T23:43:50-05:00
ghcup metadata: output metadata fragment in CI
(cherry picked from commit 52b58a660e735b20961d792d8fa9267f01247a50)
- - - - -
7c78804e by Zubin Duggal at 2024-12-18T23:43:50-05:00
ghcup metatdata: use fedora33 for redhat
Redhat 9 doesn't have libtinfo.so.5 anymore
(cherry picked from commit dc86785eb43afd1bd292287c064fb5ad94fe8c7f)
- - - - -
1d72cfb2 by Zubin Duggal at 2024-12-18T23:43:50-05:00
ghcup metadata: still use centos for redhat <9
- - - - -
3f7ebc58 by Sylvain Henry at 2024-12-19T20:40:14-05:00
Merge ghc-bignum into ghc-internal (#24453)
First step towards merging ghc-bignum and ghc-prim into ghc-internal.
After this patch, ghc-bignum is deprecated and is just a shallow package
reexporting modules from ghc-internal and base. Use those directly
instead.
Move `gmp` submodule into ghc-internal directory.
- - - - -
ee0150c2 by Rodrigo Mesquita at 2024-12-19T20:40:51-05:00
Improve performance of deriving Show
Significantly improves performance of deriving Show instances by
avoiding using the very polymorphic `.` operator in favour of inlining
its definition. We were generating tons of applications of it, each
which had 3 type arguments!
Improves on #9557
-------------------------
Metric Decrease:
InstanceMatching
T12707
T3294
------------------------
- - - - -
8b266671 by Rodrigo Mesquita at 2024-12-19T20:40:51-05:00
Don't eta expand cons when deriving Data
This eta expansion was introduced with the initial commit for Linear
types.
I believe this isn't needed any longer. My guess is it is an artifact
from the initial linear types implementation: data constructors are
linear, but they shouldn't need to be eta expanded to be used as higher
order functions. I suppose in the early days this wasn't true.
For instance, this works now:
data T x = T x
f = \(x :: forall y. y -> T y) -> x True
f T -- ok!
T is linear, but can be passed where an unrestricted higher order
function is expected. I recall there being some magic around to make
this work for data constructors...
Since this works, there's no need to eta_expand the data constructors in
the derived Data instances.
- - - - -
0ef8aeb6 by Brandon Chinn at 2024-12-24T00:49:32-08:00
Fix rendering multiline string without SourceText
- - - - -
9aa099ae by Brandon Chinn at 2024-12-24T00:53:31-08:00
Unify ITstring + ITstringMulti
- - - - -
ce2a3a20 by Brandon Chinn at 2024-12-24T00:53:31-08:00
Unify HsString + HsMultilineString
- - - - -
09a83c79 by Brandon Chinn at 2024-12-24T00:53:31-08:00
Move multiline string processing functions to top-level
- - - - -
7bd65b26 by Brandon Chinn at 2024-12-24T00:53:31-08:00
Always use processCharsSingle to get StringLexError
- - - - -
66381e54 by Brandon Chinn at 2024-12-24T00:53:31-08:00
Implement interpolated strings
- - - - -
30 changed files:
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/generate-ci/gen_ci.hs
- .gitlab/jobs.yaml
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- .gitmodules
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/Cmm/ThreadSanitizer.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/SimpleOpt.hs
- compiler/GHC/Core/Subst.hs
- compiler/GHC/Core/TyCo/Rep.hs
- compiler/GHC/Core/TyCo/Subst.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/CoreToStg/Prep.hs
- compiler/GHC/Data/Unboxed.hs
- compiler/GHC/Driver/Config/Core/Rules.hs
- compiler/GHC/Driver/Config/Linker.hs
- compiler/GHC/Driver/Flags.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0af9f7757c7c20638c61e626807aee5dc72dce94...66381e546614b3569e3869616702e8956eb21315
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0af9f7757c7c20638c61e626807aee5dc72dce94...66381e546614b3569e3869616702e8956eb21315
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/20241224/ef66e91c/attachment-0001.html>
More information about the ghc-commits
mailing list