[Git][ghc/ghc][wip/T24938] 36 commits: compiler: Make ghc-experimental not wired in

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Wed Jun 19 16:25:38 UTC 2024



Simon Peyton Jones pushed to branch wip/T24938 at Glasgow Haskell Compiler / GHC


Commits:
b3cc5366 by Matthew Pickering at 2024-06-12T23:06:57-04:00
compiler: Make ghc-experimental not wired in

If you need to wire in definitions, then place them in ghc-internal and
reexport them from ghc-experimental.

Ticket #24903

- - - - -
700eeab9 by Hécate Kleidukos at 2024-06-12T23:07:37-04:00
base: Use a more appropriate unicode arrow for the ByteArray diagram

This commit rectifies the usage of a unicode arrow in favour of one that
doesn't provoke mis-alignment.

- - - - -
cca7de25 by Matthew Pickering at 2024-06-12T23:08:14-04:00
ghcup-metadata: Fix debian version ranges

This was caught by `ghcup-ci` failing and attempting to install a deb12
bindist on deb11.

```
configure: WARNING: m4/prep_target_file.m4: Expecting YES/NO but got  in ArSupportsDashL_STAGE0. Defaulting to False.
bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by bin/ghc-toolchain-bin)
bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so)
bin/ghc-toolchain-bin: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /tmp/tmp.LBhwvFbVoy/foobarbaz/.ghcup/tmp/ghcup-708d9668d5d82287/ghc-9.11.20240609-x86_64-unknown-linux/bin/../lib/x86_64-linux-ghc-9.11.20240609/libHSunix-2.8.5.1-inplace-ghc9.11.20240609.so)
```

Fixes #24974

- - - - -
7b23ce8b by Pierre Le Marre at 2024-06-13T15:35:04-04:00
ucd2haskell: remove Streamly dependency + misc

- Remove dead code.
- Remove `streamly` dependency.
- Process files with `bytestring`.
- Replace Unicode files parsers with the corresponding ones from the
  package `unicode-data-parser`.
- Simplify cabal file and rename module
- Regenerate `ghc-internal` Unicode files with new header

- - - - -
4570319f by Jacco Krijnen at 2024-06-13T15:35:41-04:00
Document how to run haddocks tests (#24976)

Also remove ghc 9.7 requirement

- - - - -
fb629e24 by amesgen at 2024-06-14T00:28:20-04:00
compiler: refactor lower_CmmExpr_Ptr

- - - - -
def46c8c by amesgen at 2024-06-14T00:28:20-04:00
compiler: handle CmmRegOff in lower_CmmExpr_Ptr

- - - - -
ce76bf78 by Simon Peyton Jones at 2024-06-14T00:28:56-04:00
Small documentation update in Quick Look

- - - - -
19bcfc9b by Simon Peyton Jones at 2024-06-14T14:44:19-04:00
Add hack for #24623

..Th bug in #24623 is randomly triggered by this MR!..

- - - - -
7a08a025 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00
Various fixes to type-tidying

This MR was triggered by #24868, but I found a number of bugs
and infelicities in type-tidying as I went along.  Highlights:

* Fix to #24868 is in GHC.Tc.Errors.report_unsolved: avoid
  using the OccNames of /bound/ variables when tidying /free/
  variables; see the call to `tidyAvoiding`.  That avoid the
  gratuitous renaming which was the cause of #24868. See
     Note [tidyAvoiding] in GHC.Core.TyCo.Tidy

* Refactor and document the tidying of open types.
  See GHC.Core.TyCo.Tidy
     Note [Tidying open types]
     Note [Tidying is idempotent]

* Tidy the coercion variable in HoleCo. That's important so
  that tidied types have tidied kinds.

* Some small renaming to make things consistent.  In particular
  the "X" forms return a new TidyEnv.  E.g.
     tidyOpenType  :: TidyEnv -> Type -> Type
     tidyOpenTypeX :: TidyEnv -> Type -> (TidyEnv, Type)

- - - - -
2eac0288 by Simon Peyton Jones at 2024-06-14T14:44:19-04:00
Wibble

- - - - -
e5d24cc2 by Simon Peyton Jones at 2024-06-14T14:44:20-04:00
Wibbles

- - - - -
246bc3a4 by Simon Peyton Jones at 2024-06-14T14:44:56-04:00
Localise a case-binder in SpecConstr.mkSeqs

This small change fixes #24944

See (SCF1) in Note [SpecConstr and strict fields]

- - - - -
a5994380 by Sylvain Henry at 2024-06-15T03:20:29-04:00
PPC: display foreign label in panic message (cf #23969)

- - - - -
bd95553a by Rodrigo Mesquita at 2024-06-15T03:21:06-04:00
cmm: Parse MO_BSwap primitive operation

Parsing this operation allows it to be tested using `test-primops` in a
subsequent MR.

- - - - -
e0099721 by Andrew Lelechenko at 2024-06-16T17:57:38-04:00
Make flip representation polymorphic, similar to ($) and (&)

CLC proposal: https://github.com/haskell/core-libraries-committee/issues/245

- - - - -
118a1292 by Alan Zimmerman at 2024-06-16T17:58:15-04:00
EPA: Add location to Match Pats list

So we can freely modify the pats and the following item spacing will
still be valid when exact printing.

Closes #24862

- - - - -
db343324 by Fabricio de Sousa Nascimento at 2024-06-17T10:01:51-04:00
compiler: Rejects RULES whose LHS immediately fails to type-check

Fixes GHC crashing on `decomposeRuleLhs` due to ignoring coercion values. This
happens when we have a RULE that does not type check, and enable
`-fdefer-type-errors`. We prevent this to happen by rejecting RULES with an
immediately LHS type error.

Fixes #24026

- - - - -
e7a95662 by Dylan Thinnes at 2024-06-17T10:02:35-04:00
Add hscTypecheckRenameWithDiagnostics, for HLS (#24996)

Use runHsc' in runHsc so that both functions can't fall out of sync

We're currently copying parts of GHC code to get structured warnings
in HLS, so that we can recreate `hscTypecheckRenameWithDiagnostics`
locally. Once we get this function into GHC we can drop the copied code
in future versions of HLS.

- - - - -
d70abb49 by sheaf at 2024-06-18T18:47:20-04:00
Clarify -XGADTs enables existential quantification

Even though -XGADTs does not turn on -XExistentialQuantification,
it does allow the user of existential quantification syntax, without
needing to use GADT-style syntax.

Fixes #20865

- - - - -
13fdf788 by David Binder at 2024-06-18T18:48:02-04:00
Add RTS flag --read-tix-file (GHC Proposal 612)

This commit introduces the RTS flag `--read-tix-file=<yes|no>` which
controls whether a preexisting .tix file is read in at the beginning
of a program run. The default is currently `--read-tix-file=yes` but
will change to `--read-tix-file=no` in a future release of GHC. For
this reason, whenever a .tix file is read in a warning is emitted to
stderr. This warning can be silenced by explicitly passing the
`--read-tix-file=yes` option. Details can be found in the GHC proposal
cited below.

Users can query whether this flag has been used with the help of the
module `GHC.RTS.Flags`. A new field `readTixFile` was added to the
record `HpcFlags`.

These changes have been discussed and approved in
- GHC proposal 612: https://github.com/ghc-proposals/ghc-proposals/pull/612
- CLC proposal 276: https://github.com/haskell/core-libraries-committee/issues/276

- - - - -
f0e3cb6a by Fendor at 2024-06-18T18:48:38-04:00
Improve sharing of duplicated values in `ModIface`, fixes #24723

As a `ModIface` often contains duplicated values that are not
necessarily shared, we improve sharing by serialising the `ModIface`
to an in-memory byte array. Serialisation uses deduplication tables, and
deserialisation implicitly shares duplicated values.

This helps reducing the peak memory usage while compiling in
`--make` mode. The peak memory usage is especially smaller when
generating interface files with core expressions
(`-fwrite-if-simplified-core`).

On agda, this reduces the peak memory usage:

* `2.2 GB` to `1.9 GB` for a ghci session.

On `lib:Cabal`, we report:

* `570 MB` to `500 MB` for a ghci session
* `790 MB` to `667 MB` for compiling `lib:Cabal` with ghc

There is a small impact on execution time, around 2% on the agda code
base.

- - - - -
1bab7dde by Fendor at 2024-06-18T18:48:38-04:00
Avoid unneccessarily re-serialising the `ModIface`

To reduce memory usage of `ModIface`, we serialise `ModIface` to an
in-memory byte array, which implicitly shares duplicated values.

This serialised byte array can be reused to avoid work when we actually
write the `ModIface` to disk.
We introduce a new field to `ModIface` which allows us to save the byte
array, and write it direclty to disk if the `ModIface` wasn't changed
after the initial serialisation.

This requires us to change absolute offsets, for example to jump to the
deduplication table for `Name` or `FastString` with relative offsets, as
the deduplication byte array doesn't contain header information, such as
fingerprints.
To allow us to dump the binary blob to disk, we need to replace all
absolute offsets with relative ones.

We introduce additional helpers for `ModIface` binary serialisation, which
construct relocatable binary blobs. We say the binary blob is relocatable,
if the binary representation can be moved and does not contain any
absolute offsets.

Further, we introduce new primitives for `Binary` that allow to create
relocatable binaries, such as `forwardGetRel` and `forwardPutRel`.

-------------------------
Metric Decrease:
    MultiLayerModulesDefsGhcWithCore
Metric Increase:
    MultiComponentModules
    MultiLayerModules
    T10421
    T12150
    T12234
    T12425
    T13035
    T13253-spj
    T13701
    T13719
    T14697
    T15703
    T16875
    T18698b
    T18140
    T18304
    T18698a
    T18730
    T18923
    T20049
    T24582
    T5837
    T6048
    T9198
    T9961
    mhu-perf
-------------------------

These metric increases may look bad, but they are all completely benign,
we simply allocate 1 MB per module for `shareIface`. As this allocation
is quite quick, it has a negligible impact on run-time performance.
In fact, the performance difference wasn't measurable on my local
machine. Reducing the size of the pre-allocated 1 MB buffer avoids these
test failures, but also requires us to reallocate the buffer if the
interface file is too big. These reallocations *did* have an impact on
performance, which is why I have opted to accept all these metric
increases, as the number of allocated bytes is merely a guidance.

This 1MB allocation increase causes a lot of tests to fail that
generally have a low allocation number. E.g., increasing from 40MB to
41MB is a 2.5% increase.
In particular, the tests T12150, T13253-spj, T18140, T18304, T18698a,
T18923, T20049, T24582, T5837, T6048, and T9961 only fail on i386-darwin
job, where the number of allocated bytes seems to be lower than in other
jobs.
The tests T16875 and T18698b fail on i386-linux for the same reason.

- - - - -
099992df by Andreas Klebinger at 2024-06-18T18:49:14-04:00
Improve documentation of @Any@ type.

In particular mention possible uses for non-lifted types.

Fixes #23100.

- - - - -
5e75412b by Jakob Bruenker at 2024-06-18T18:49:51-04:00
Update user guide to indicate support for 64-tuples

- - - - -
4f5da595 by Andreas Klebinger at 2024-06-18T18:50:28-04:00
lint notes: Add more info to notes.stdout

When fixing a note reference CI fails with a somewhat confusing diff.
See #21123. This commit adds a line to the output file being compared
which hopefully makes it clear this is the list of broken refs, not all
refs.

Fixes #21123

- - - - -
1eb15c61 by Jakob Bruenker at 2024-06-18T18:51:04-04:00
docs: Update mention of ($) type in user guide

Fixes #24909

- - - - -
1d66c9e3 by Jan Hrček at 2024-06-18T18:51:47-04:00
Remove duplicate Anno instances

- - - - -
8ea0ba95 by Sven Tennie at 2024-06-18T18:52:23-04:00
AArch64: Delete unused RegNos

This has the additional benefit of getting rid of the -1 encoding (real
registers start at 0.)

- - - - -
325422e0 by Sjoerd Visscher at 2024-06-18T18:53:04-04:00
Bump stm submodule to current master

- - - - -
64fba310 by Cheng Shao at 2024-06-18T18:53:40-04:00
testsuite: bump T17572 timeout on wasm32

- - - - -
eb612fbc by Sven Tennie at 2024-06-19T06:46:00-04:00
AArch64: Simplify BL instruction

The BL constructor carried unused data in its third argument.

- - - - -
b0300503 by Alan Zimmerman at 2024-06-19T06:46:36-04:00
TTG: Move SourceText from `Fixity` to `FixitySig`

It is only used there, simplifies the use of `Fixity` in the rest of
the code, and is moved into a TTG extension point.

Precedes !12842, to simplify it

- - - - -
842e119b by Rodrigo Mesquita at 2024-06-19T06:47:13-04:00
base: Deprecate some .Internal modules

Deprecates the following modules according to clc-proposal #217:
https://github.com/haskell/core-libraries-committee/issues/217

* GHC.TypeNats.Internal
* GHC.TypeLits.Internal
* GHC.ExecutionStack.Internal

Closes #24998

- - - - -
9cecd5ad by Simon Peyton Jones at 2024-06-19T17:22:36+01:00
Fix untouchability test

Addresses #24938

more documentation to come

- - - - -
5bac4438 by Simon Peyton Jones at 2024-06-19T17:24:12+01:00
Wibbles

- - - - -


30 changed files:

- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/PPC/Ppr.hs
- compiler/GHC/CmmToAsm/Wasm/FromCmm.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/SpecConstr.hs
- compiler/GHC/Core/TyCo/FVs.hs
- compiler/GHC/Core/TyCo/Ppr.hs
- compiler/GHC/Core/TyCo/Tidy.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Hs.hs
- compiler/GHC/Hs/Binds.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/Dump.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/046e255d023c2954d475d14d19c784a9a76341a7...5bac4438d07035d1266023502566648ba21bfddf

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/046e255d023c2954d475d14d19c784a9a76341a7...5bac4438d07035d1266023502566648ba21bfddf
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/20240619/eaf51f90/attachment-0001.html>


More information about the ghc-commits mailing list