[Git][ghc/ghc][wip/T23109] 95 commits: testsuite: Handle exceptions in framework_fail when testdir is not initialised

Simon Peyton Jones (@simonpj) gitlab at gitlab.haskell.org
Thu May 16 16:48:43 UTC 2024



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


Commits:
c56d728e by Zubin Duggal at 2024-04-30T22:45:09-04:00
testsuite: Handle exceptions in framework_fail when testdir is not initialised

When `framework_fail` is called before initialising testdir, it would fail with
an exception reporting the testdir not being initialised instead of the actual failure.

Ensure we report the actual reason for the failure instead of failing in this way.

One way this can manifest is when trying to run a test that doesn't exist using `--only`

- - - - -
d5bea4d6 by Alan Zimmerman at 2024-04-30T22:45:45-04:00
EPA: Fix range for GADT decl with sig only

Closes #24714

- - - - -
4d78c53c by Sylvain Henry at 2024-05-01T17:23:06-04:00
Fix TH dependencies (#22229)

Add a dependency between Syntax and Internal (via module reexport).

- - - - -
37e38db4 by Sylvain Henry at 2024-05-01T17:23:06-04:00
Bump haddock submodule

- - - - -
ca13075c by Sylvain Henry at 2024-05-01T17:23:47-04:00
JS: cleanup to prepare for #24743

- - - - -
40026ac3 by Alan Zimmerman at 2024-05-01T22:45:07-04:00
EPA: Preserve comments for PrefixCon

Preserve comments in

    fun (Con {- c1 -} a b)
        = undefined

Closes #24736

- - - - -
92134789 by Hécate Moonlight at 2024-05-01T22:45:42-04:00
Correct `@since` metadata in HpcFlags

It was introduced in base-4.20, not 4.22.
Fix #24721

- - - - -
a580722e by Cheng Shao at 2024-05-02T08:18:45-04:00
testsuite: fix req_target_smp predicate

- - - - -
ac9c5f84 by Andreas Klebinger at 2024-05-02T08:18:45-04:00
STM: Remove (unused)coarse grained locking.

The STM code had a coarse grained locking mode guarded by #defines that was unused.
This commit removes the code.

- - - - -
917ef81b by Andreas Klebinger at 2024-05-02T08:18:45-04:00
STM: Be more optimistic when validating in-flight transactions.

* Don't lock tvars when performing non-committal validation.
* If we encounter a locked tvar don't consider it a failure.

This means in-flight validation will only fail if committing at the
moment of validation is *guaranteed* to fail.

This prevents in-flight validation from failing spuriously if it happens in
parallel on multiple threads or parallel to thread comitting.

- - - - -
167a56a0 by Alan Zimmerman at 2024-05-02T08:19:22-04:00
EPA: fix span for empty \case(s)

In
    instance SDecide Nat where
      SZero %~ (SSucc _) = Disproved (\case)

Ensure the span for the HsLam covers the full construct.

Closes #24748

- - - - -
9bae34d8 by doyougnu at 2024-05-02T15:41:08-04:00
testsuite: expand size testing infrastructure

- closes #24191
- adds windows_skip, wasm_skip, wasm_arch, find_so, _find_so
- path_from_ghcPkg, collect_size_ghc_pkg, collect_object_size, find_non_inplace functions to testsuite
- adds on_windows and req_dynamic_ghc predicate to testsuite

The design is to not make the testsuite too smart and simply offload to
ghc-pkg for locations of object files and directories.

- - - - -
b85b1199 by Sylvain Henry at 2024-05-02T15:41:49-04:00
GHCi: support inlining breakpoints (#24712)

When a breakpoint is inlined, its context may change (e.g. tyvars in
scope). We must take this into account and not used the breakpoint tick
index as its sole identifier. Each instance of a breakpoint (even with
the same tick index) now gets a different "info" index.

We also need to distinguish modules:
- tick module: module with the break array (tick counters, status, etc.)
- info module: module having the CgBreakInfo (info at occurrence site)

- - - - -
649c24b9 by Oleg Grenrus at 2024-05-03T20:45:42-04:00
Expose constructors of SNat, SChar and SSymbol in ghc-internal

- - - - -
d603f199 by Mikolaj Konarski at 2024-05-03T20:46:19-04:00
Add DCoVarSet to PluginProv (!12037)

- - - - -
ba480026 by Serge S. Gulin at 2024-05-03T20:47:01-04:00
JS: Enable more efficient packing of string data (fixes #24706)

- - - - -
be1e60ee by Simon Peyton Jones at 2024-05-03T20:47:37-04:00
Track in-scope variables in ruleCheckProgram

This small patch fixes #24726, by tracking in-scope variables
properly in -drule-check.  Not hard to do!

- - - - -
58408c77 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00
Add a couple more HasCallStack constraints in SimpleOpt

Just for debugging, no effect on normal code

- - - - -
70e245e8 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00
Add comments to Prep.hs

This documentation patch fixes a TODO left over from !12364

- - - - -
e5687186 by Simon Peyton Jones at 2024-05-03T20:47:37-04:00
Use HasDebugCallStack, rather than HasCallStack

- - - - -
631cefec by Cheng Shao at 2024-05-03T20:48:17-04:00
driver: always merge objects when possible

This patch makes the driver always merge objects with `ld -r` when
possible, and only fall back to calling `ar -L` when merge objects
command is unavailable. This completely reverts !8887 and !12313,
given more fixes in Cabal seems to be needed to avoid breaking certain
configurations and the maintainence cost is exceeding the behefits in
this case :/

- - - - -
1dacb506 by Ben Gamari at 2024-05-03T20:48:53-04:00
Bump time submodule to 1.14

As requested in #24528.

-------------------------
Metric Decrease:
    ghc_bignum_so
    rts_so
Metric Increase:
    cabal_syntax_dir
    rts_so
    time_dir
    time_so
-------------------------

- - - - -
4941b90e by Ben Gamari at 2024-05-03T20:48:53-04:00
Bump terminfo submodule to current master

- - - - -
43d48b44 by Cheng Shao at 2024-05-03T20:49:30-04:00
wasm: use scheduler.postTask() for context switch when available

This patch makes use of scheduler.postTask() for JSFFI context switch
when it's available. It's a more principled approach than our
MessageChannel based setImmediate() implementation, and it's available
in latest version of Chromium based browsers.

- - - - -
08207501 by Cheng Shao at 2024-05-03T20:50:08-04:00
testsuite: give pre_cmd for mhu-perf 5x time

- - - - -
bf3d4db0 by Alan Zimmerman at 2024-05-03T20:50:43-04:00
EPA: Preserve comments for pattern synonym sig

Closes #24749

- - - - -
c49493f2 by Matthew Pickering at 2024-05-04T06:02:57-04:00
tests: Widen acceptance window for dir and so size tests

These are testing things which are sometimes out the control of a GHC
developer. Therefore we shouldn't fail CI if something about these
dependencies change because we can't do anything about it.

It is still useful to have these statistics for visualisation in grafana
though.

Ticket #24759

- - - - -
9562808d by Matthew Pickering at 2024-05-04T06:02:57-04:00
Disable rts_so test

It has already manifested large fluctuations and destabilising CI

Fixes #24762

- - - - -
fc24c5cf by Ryan Scott at 2024-05-04T06:03:33-04:00
unboxedSum{Type,Data}Name: Use GHC.Types as the module

Unboxed sum constructors are now defined in the `GHC.Types` module, so if you
manually quote an unboxed sum (e.g., `''Sum2#`), you will get a `Name` like:

```hs
GHC.Types.Sum2#
```

The `unboxedSumTypeName` function in `template-haskell`, however, mistakenly
believes that unboxed sum constructors are defined in `GHC.Prim`, so
`unboxedSumTypeName 2` would return an entirely different `Name`:

```hs
GHC.Prim.(#|#)
```

This is a problem for Template Haskell users, as it means that they can't be
sure which `Name` is the correct one. (Similarly for `unboxedSumDataName`.)

This patch fixes the implementations of `unboxedSum{Type,Data}Name` to use
`GHC.Types` as the module. For consistency with `unboxedTupleTypeName`, the
`unboxedSumTypeName` function now uses the non-punned syntax for unboxed sums
(`Sum<N>#`) as the `OccName`.

Fixes #24750.

- - - - -
7eab4e01 by Alan Zimmerman at 2024-05-04T16:14:55+01:00
EPA: Widen stmtslist to include last semicolon

Closes #24754

- - - - -
06f7db40 by Teo Camarasu at 2024-05-05T00:19:38-04:00
doc: Fix type error in hs_try_putmvar example
- - - - -
af000532 by Moritz Schuler at 2024-05-05T06:30:58-04:00
Fix parsing of module names in CLI arguments
  closes issue #24732

- - - - -
da74e9c9 by Ben Gamari at 2024-05-05T06:31:34-04:00
ghc-platform: Add Setup.hs

The Hadrian bootstrapping script relies upon `Setup.hs` to drive its
build.

Addresses #24761.

- - - - -
35d34fde by Alan Zimmerman at 2024-05-05T12:52:40-04:00
EPA: preserve comments in class and data decls

Fix checkTyClHdr which was discarding comments.

Closes #24755

- - - - -
03c5dfbf by Simon Peyton Jones at 2024-05-05T12:53:15-04:00
Fix a float-out error

Ticket #24768 showed that the Simplifier was accidentally destroying
a join point.  It turned out to be that we were sending a bottoming
join point to the top, accidentally abstracting over /other/ join
points.

Easily fixed.

- - - - -
adba68e7 by John Ericson at 2024-05-05T19:35:56-04:00
Substitute bindist files with Hadrian not configure

The `ghc-toolchain` overhaul will eventually replace all this stuff with
something much more cleaned up, but I think it is still worth making
this sort of cleanup in the meantime so other untanglings and dead code
cleaning can procede.

I was able to delete a fair amount of dead code doing this too.

`LLVMTarget_CPP` is renamed to / merged with `LLVMTarget` because it
wasn't actually turned into a valid CPP identifier. (Original to
1345c7cc42c45e63ab1726a8fd24a7e4d4222467, actually.)

Progress on #23966

Co-Authored-By: Sylvain Henry <hsyl20 at gmail.com>

- - - - -
18f4ff84 by Alan Zimmerman at 2024-05-05T19:36:32-04:00
EPA: fix mkHsOpTyPV duplicating comments

Closes #24753

- - - - -
a19201d4 by Matthew Craven at 2024-05-06T19:54:29-04:00
Add test cases for #24664

...since none are present in the original MR !12463 fixing this issue.

- - - - -
46328a49 by Alan Zimmerman at 2024-05-06T19:55:05-04:00
EPA: preserve comments in data decls

Closes #24771

- - - - -
3b51995c by Andrei Borzenkov at 2024-05-07T14:39:40-04:00
Rename Solo# data constructor to MkSolo# (#24673)

- data Solo# a = (# a #)
+ data Solo# a = MkSolo# a

And `(# foo #)` syntax now becomes just a syntactic
sugar for `MkSolo# a`.

- - - - -
4d59abf2 by Arsen Arsenović at 2024-05-07T14:40:24-04:00
Add the cmm_cpp_is_gcc predicate to the testsuite

A future C-- test called T24474-cmm-override-g0 relies on the
GCC-specific behaviour of -g3 implying -dD, which, in turn, leads to it
emitting #defines past the preprocessing stage.  Clang, at least, does
not do this, so the test would fail if ran on Clang.

As the behaviour here being tested is ``-optCmmP-g3'' undoing effects of
the workaround we apply as a fix for bug #24474, and the workaround was
for GCC-specific behaviour, the test needs to be marked as fragile on
other compilers.

- - - - -
25b0b404 by Arsen Arsenović at 2024-05-07T14:40:24-04:00
Split out the C-- preprocessor, and make it pass -g0

Previously, C-- was processed with the C preprocessor program.  This
means that it inherited flags passed via -optc.  A flag that is somewhat
often passed through -optc is -g.  At certain -g levels (>=2), GCC
starts emitting defines *after* preprocessing, for the purposes of
debug info generation.  This is not useful for the C-- compiler, and, in
fact, causes lexer errors.  We can suppress this effect (safely, if
supported) via -g0.

As a workaround, in older versions of GCC (<=10), GCC only emitted
defines if a certain set of -g*3 flags was passed.  Newer versions check
the debug level.  For the former, we filter out those -g*3 flags and,
for the latter, we specify -g0 on top of that.

As a compatible and effective solution, this change adds a C--
preprocessor distinct from the C compiler and preprocessor, but that
keeps its flags.  The command line produced for C-- preprocessing now
looks like:

  $pgmCmmP $optCs_without_g3 $g0_if_supported $optCmmP

Closes: https://gitlab.haskell.org/ghc/ghc/-/issues/24474

- - - - -
9b4129a5 by Andreas Klebinger at 2024-05-08T13:24:20-04:00
-fprof-late: Only insert cost centres on functions/non-workfree cafs.

They are usually useless and doing so for data values comes with
a large compile time/code size overhead.

Fixes #24103

- - - - -
259b63d3 by Sebastian Graf at 2024-05-08T13:24:57-04:00
Simplifier: Preserve OccInfo on DataAlt fields when case binder is dead (#24770)

See the adjusted `Note [DataAlt occ info]`.
This change also has a positive repercussion on
`Note [Combine case alts: awkward corner]`.

Fixes #24770.

We now try not to call `dataConRepStrictness` in `adjustFieldsIdInfo` when all
fields are lazy anyway, leading to a 2% ghc/alloc decrease in T9675.

Metric Decrease:
    T9675

- - - - -
31b28cdb by Sebastian Graf at 2024-05-08T13:24:57-04:00
Kill seqRule, discard dead seq# in Prep (#24334)

Discarding seq#s in Core land via `seqRule` was problematic; see #24334.
So instead we discard certain dead, discardable seq#s in Prep now.
See the updated `Note [seq# magic]`.

This fixes the symptoms of #24334.

- - - - -
b2682534 by Rodrigo Mesquita at 2024-05-10T01:47:51-04:00
Document NcgImpl methods

Fixes #19914

- - - - -
4d3acbcf by Zejun Wu at 2024-05-10T01:48:28-04:00
Make renamer to be more flexible with parens in the LHS of the rules

We used to reject LHS like `(f a) b` in RULES and requires it to be written as
`f a b`. It will be handy to allow both as the expression may be more
readable with extra parens in some cases when infix operator is involved.
Espceially when TemplateHaskell is used, extra parens may be added out of
user's control and result in "valid" rules being rejected and there
are not always ways to workaround it.

Fixes #24621

- - - - -
ab840ce6 by Ben Gamari at 2024-05-10T01:49:04-04:00
IPE: Eliminate dependency on Read

Instead of encoding the closure type as decimal string we now simply
represent it as an integer, eliminating the need for `Read` in
`GHC.Internal.InfoProv.Types.peekInfoProv`.

Closes #24504.

-------------------------
Metric Decrease:
    T24602_perf_size
    size_hello_artifact
-------------------------

- - - - -
a9979f55 by Cheng Shao at 2024-05-10T01:49:43-04:00
testsuite: fix testwsdeque with recent clang

This patch fixes compilation of testwsdeque.c with recent versions of
clang, which will fail with the error below:

```
testwsdeque.c:95:33: error:
     warning: format specifies type 'long' but the argument has type 'void *' [-Wformat]
       95 |         barf("FAIL: %ld %d %d", p, n, val);
          |                     ~~~         ^

testwsdeque.c:95:39: error:
     warning: format specifies type 'int' but the argument has type 'StgWord' (aka 'unsigned long') [-Wformat]
       95 |         barf("FAIL: %ld %d %d", p, n, val);
          |                            ~~         ^~~
          |                            %lu

testwsdeque.c:133:42: error:
     error: incompatible function pointer types passing 'void (void *)' to parameter of type 'OSThreadProc *' (aka 'void *(*)(void *)') [-Wincompatible-function-pointer-types]
      133 |         createOSThread(&ids[n], "thief", thief, (void*)(StgWord)n);
          |                                          ^~~~~

/workspace/ghc/_build/stage1/lib/../lib/x86_64-linux-ghc-9.11.20240502/rts-1.0.2/include/rts/OSThreads.h:193:51: error:
     note: passing argument to parameter 'startProc' here
      193 |                                     OSThreadProc *startProc, void *param);
          |                                                   ^

2 warnings and 1 error generated.
```

- - - - -
c2b33fc9 by Rodrigo Mesquita at 2024-05-10T01:50:20-04:00
Rename pre-processor invocation args

Small clean up. Uses proper names for the various groups of arguments
that make up the pre-processor invocation.

- - - - -
2b1af08b by Cheng Shao at 2024-05-10T01:50:55-04:00
ghc-heap: fix typo in ghc-heap cbits

- - - - -
fc2d6de1 by Jade at 2024-05-10T21:07:16-04:00
Improve performance of Data.List.sort(By)

This patch improves the algorithm to sort lists in base.
It does so using two strategies:

1) Use a four-way-merge instead of the 'default' two-way-merge.
This is able to save comparisons and allocations.

2) Use `(>) a b` over `compare a b == GT` and allow inlining and specialization.
This mainly benefits types with a fast (>).

Note that this *may* break instances with a *malformed* Ord instance
where `a > b` is *not* equal to `compare a b == GT`.

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

Fixes #24280

-------------------------
Metric Decrease:
    MultiLayerModulesTH_Make
    T10421
    T13719
    T15164
    T18698a
    T18698b
    T1969
    T9872a
    T9961
    T18730
    WWRec
    T12425
    T15703
-------------------------

- - - - -
1012e8aa by Matthew Pickering at 2024-05-10T21:07:52-04:00
Revert "ghcup-metadata: Drop output_name field"

This reverts commit ecbf22a6ac397a791204590f94c0afa82e29e79f.

This breaks the ghcup metadata generation on the nightly jobs.

- - - - -
daff1e30 by Jannis at 2024-05-12T13:38:35-04:00
Division by constants optimization

- - - - -
413217ba by Andreas Klebinger at 2024-05-12T13:39:11-04:00
Tidy: Add flag to expose unfoldings if they take dictionary arguments.

Add the flag `-fexpose-overloaded-unfoldings` to be able to control this
behaviour.

For ghc's boot libraries file size grew by less than 1% when it was
enabled. However I refrained from enabling it by default for now.

I've also added a section on specialization more broadly to the users
guide.

-------------------------
Metric Decrease:
    MultiLayerModulesTH_OneShot
Metric Increase:
    T12425
    T13386
    hard_hole_fits
-------------------------

- - - - -
c5d89412 by Zubin Duggal at 2024-05-13T22:19:53-04:00
Don't store a GlobalRdrEnv in `mi_globals` for GHCi.

GHCi only needs the `mi_globals` field for modules imported with
:module +*SomeModule.

It uses this field to make the top level environment in `SomeModule` available
to the repl.

By default, only the first target in the command line parameters is
"star" loaded into GHCi. Other modules have to be manually "star" loaded
into the repl.

Storing the top level GlobalRdrEnv for each module is very wasteful, especially
given that we will most likely never need most of these environments.

Instead we store only the information needed to reconstruct the top level environment
in a module, which is the `IfaceTopEnv` data structure, consisting of all import statements
as well as all top level symbols defined in the module (not taking export lists into account)

When a particular module is "star-loaded" into GHCi (as the first commandline target, or via
an explicit `:module +*SomeModule`, we reconstruct the top level environment on demand using
the `IfaceTopEnv`.

- - - - -
d65bf4a2 by Fendor at 2024-05-13T22:20:30-04:00
Add perf regression test for `-fwrite-if-simplified-core`

- - - - -
2c0f8ddb by Andrei Borzenkov at 2024-05-13T22:21:07-04:00
Improve pattern to type pattern transformation (23739)

`pat_to_type_pat` function now can handle more patterns:
  - TuplePat
  - ListPat
  - LitPat
  - NPat
  - ConPat

Allowing these new constructors in type patterns significantly
increases possible shapes of type patterns without `type` keyword.

This patch also changes how lookups in `lookupOccRnConstr` are
performed, because we need to fall back into
types when we didn't find a constructor on data level to perform
`ConPat` to type transformation properly.

- - - - -
be514bb4 by Cheng Shao at 2024-05-13T22:21:43-04:00
hadrian: fix hadrian building with ghc-9.10.1

- - - - -
ad38e954 by Cheng Shao at 2024-05-13T22:21:43-04:00
linters: fix lint-whitespace compilation with ghc-9.10.1

- - - - -
a593f284 by Andreas Klebinger at 2024-05-15T07:32:10-04:00
Expand the `inline` rule to look through casts/ticks.

Fixes #24808

- - - - -
b1e0c313 by Cheng Shao at 2024-05-15T07:32:46-04:00
testsuite: bump PartialDownSweep timeout to 5x on wasm32

- - - - -
b2227487 by Fendor at 2024-05-15T17:14:06-04:00
Add Eq and Ord instance to `IfaceType`

We add an `Ord` instance so that we can store `IfaceType` in a
`Data.Map` container.
This is required to deduplicate `IfaceType` while writing `.hi` files to
disk. Deduplication has many beneficial consequences to both file size
and memory usage, as the deduplication enables implicit sharing of
values.
See issue #24540 for more motivation.

The `Ord` instance would be unnecessary if we used a `TrieMap` instead
of `Data.Map` for the deduplication process. While in theory this is
clerarly the better option, experiments on the agda code base showed
that a `TrieMap` implementation has worse run-time performance
characteristics.

To the change itself, we mostly derive `Eq` and `Ord`. This requires us
to change occurrences of `FastString` with `LexicalFastString`, since
`FastString` has no `Ord` instance.
We change the definition of `IfLclName` to a newtype of
`LexicalFastString`, to make such changes in the future easier.

Bump haddock submodule for IfLclName changes

- - - - -
d368f9a6 by Fendor at 2024-05-15T17:14:06-04:00
Move out LiteralMap to avoid cyclic module dependencies

- - - - -
2fcc09fd by Fendor at 2024-05-15T17:14:06-04:00
Add deduplication table for `IfaceType`

The type `IfaceType` is a highly redundant, tree-like data structure.
While benchmarking, we realised that the high redundancy of `IfaceType`
causes high memory consumption in GHCi sessions when byte code is
embedded into the `.hi` file via `-fwrite-if-simplified-core` or
`-fbyte-code-and-object-code`.
Loading such `.hi` files from disk introduces many duplicates of
memory expensive values in `IfaceType`, such as `IfaceTyCon`,
`IfaceTyConApp`, `IA_Arg` and many more.

We improve the memory behaviour of GHCi by adding an additional
deduplication table for `IfaceType` to the serialisation of `ModIface`,
similar to how we deduplicate `Name`s and `FastString`s.
When reading the interface file back, the table allows us to automatically
share identical values of `IfaceType`.

To provide some numbers, we evaluated this patch on the agda code base.
We loaded the full library from the `.hi` files, which contained the
embedded core expressions (`-fwrite-if-simplified-core`).

Before this patch:

* Load time: 11.7 s, 2.5 GB maximum residency.

After this patch:

* Load time:  7.3 s, 1.7 GB maximum residency.

This deduplication has the beneficial side effect to additionally reduce
the size of the on-disk interface files tremendously.

For example, on agda, we reduce the size of `.hi` files (with
`-fwrite-if-simplified-core`):

* Before: 101 MB on disk
* Now:     24 MB on disk

This has even a beneficial side effect on the cabal store. We reduce the
size of the store on disk:

* Before: 341 MB on disk
* Now:    310 MB on disk

Note, none of the dependencies have been compiled with
`-fwrite-if-simplified-core`, but `IfaceType` occurs in multiple
locations in a `ModIface`.

We also add IfaceType deduplication table to .hie serialisation and
refactor .hie file serialisation to use the same infrastrucutre as
`putWithTables`.

Bump haddock submodule to accomodate for changes to the deduplication
table layout and binary interface.

- - - - -
36aa7cf1 by Fendor at 2024-05-15T17:14:06-04:00
Add run-time configurability of `.hi` file compression

Introduce the flag `-fwrite-if-compression=<n>` which allows to
configure the compression level of writing .hi files.

The motivation is that some deduplication operations are too expensive
for the average use case. Hence, we introduce multiple compression
levels with variable impact on performance, but still reduce the
memory residency and `.hi` file size on disk considerably.

We introduce three compression levels:

* `1`: `Normal` mode. This is the least amount of compression.
    It deduplicates only `Name` and `FastString`s, and is naturally the
    fastest compression mode.
* `2`: `Safe` mode. It has a noticeable impact on .hi file size and is
  marginally slower than `Normal` mode. In general, it should be safe to
  always use `Safe` mode.
* `3`: `Full` deduplication mode. Deduplicate as much as we can,
  resulting in minimal .hi files, but at the cost of additional
  compilation time.

Reading .hi files doesn't need to know the initial compression level,
and can always deserialise a `ModIface`, as we write out a byte that
indicates the next value has been deduplicated.
This allows users to experiment with different compression levels for
packages, without recompilation of dependencies.

Note, the deduplication also has an additional side effect of reduced
memory consumption to implicit sharing of deduplicated elements.
See https://gitlab.haskell.org/ghc/ghc/-/issues/24540 for example where
that matters.

-------------------------
Metric Decrease:
    MultiLayerModulesDefsGhciWithCore
    T16875
    T21839c
    T24471
    hard_hole_fits
    libdir
-------------------------

- - - - -
1e63a6fb by Matthew Pickering at 2024-05-15T17:14:07-04:00
Introduce regression tests for `.hi` file sizes

Add regression tests to track how `-fwrite-if-compression` levels affect
the size of `.hi` files.

- - - - -
639d742b by M Farkas-Dyck at 2024-05-15T17:14:49-04:00
TTG: ApplicativeStatement exist only in Rn and Tc

Co-Authored-By: romes <rodrigo.m.mesquita at gmail.com>

- - - - -
aa7b336b by Jade at 2024-05-15T23:06:17-04:00
Documentation: Improve documentation for symbols exported from System.IO

- - - - -
c561de8f by Jade at 2024-05-15T23:06:54-04:00
Improve suggestions for language extensions

- When suggesting Language extensions, also suggest Extensions which imply them
- Suggest ExplicitForAll and GADTSyntax instead of more specific
  extensions
- Rephrase suggestion to include the term 'Extension'
- Also moves some flag specific definitions out of Session.hs into
Flags.hs (#24478)

Fixes: #24477
Fixes: #24448
Fixes: #10893

- - - - -
4c7ae2a1 by Andreas Klebinger at 2024-05-15T23:07:30-04:00
Testsuite: Check if llvm assembler is available for have_llvm

- - - - -
bc672166 by Torsten Schmits at 2024-05-15T23:08:06-04:00
refactor quadratic search in warnMissingHomeModules

- - - - -
7875e8cb by Torsten Schmits at 2024-05-15T23:08:06-04:00
add test that runs MakeDepend on thousands of modules

- - - - -
a9680e3b by Simon Peyton Jones at 2024-05-16T12:05:01+01:00
Make newtype instances opaque

I think this will help with #23109

Wibbles

Allow SelCo for newtype classes

Experimental change

Wibble

Furher wibbles

Further improvments

Further wibbles

esp exprIsConLike

Run classop rule first

Newtype classops are small

needs comments

- - - - -
b4ad94b8 by Simon Peyton Jones at 2024-05-16T12:05:01+01:00
Wibble imports

- - - - -
a2a13470 by Simon Peyton Jones at 2024-05-16T12:05:02+01:00
Wibbles

Notably: define and use mkNewTypeDictApp

- - - - -
5b029936 by Simon Peyton Jones at 2024-05-16T12:05:02+01:00
Make newtype-class data constructors not inline

This variant tries
* Making the data constructor for a newtype class not inline
* exprIsConApp_maybe treats it like a normal data constructor
* CoreToStg discards it (perhaps CorePrep should do that instead)
* Some as-it-turns-out unforced changes to corePrepPgm that makes
  it pass all TyCons, not just the data tycons
* Significantly simpler story in mkNewTypeDictApp

- - - - -
e6065030 by Simon Peyton Jones at 2024-05-16T12:05:02+01:00
Wibble

- - - - -
e327f07a by Simon Peyton Jones at 2024-05-16T12:05:02+01:00
Get rid of newtype classes in CorePrep not CoreToStg

- - - - -
d871b99a by Simon Peyton Jones at 2024-05-16T12:05:02+01:00
Comment out bits that I think are no longer necessary

* Extra field in ClassOpId,
  and classOpDictApp_maybe in Simplify.Iteration

* Newtype classes being injective

* Don't preInlineUnconditionally Dfuns

* mkNewTypeDictApp

* Zonking of unfoldings (only necessary for those local dfuns)

- - - - -
2f0c043b by Simon Peyton Jones at 2024-05-16T12:05:02+01:00
Wibble

- - - - -
0896b970 by Simon Peyton Jones at 2024-05-16T12:05:02+01:00
Allow pushDataCon on ClassTyCon newtypes

The fact that there is no *actual* data constructor in the end i
kind-of-irrelevant, and we turn out to get quite a lot of
     class-op (d |> co)
where co : C t1 ~R C t2

- - - - -
3aa5b5ca by Simon Peyton Jones at 2024-05-16T12:05:02+01:00
Wibbles to merge

- - - - -
99e55f3b by Simon Peyton Jones at 2024-05-16T12:05:02+01:00
Make newtype classes pretend to be injective

- - - - -
cf0011d3 by Simon Peyton Jones at 2024-05-16T12:05:02+01:00
Make class datacons be have-no-unfolding

Fixes the problem reported in #20689 @Mikolaj

- - - - -
8702830c by Simon Peyton Jones at 2024-05-16T12:05:02+01:00
wibble

- - - - -
532f9465 by Simon Peyton Jones at 2024-05-16T12:05:02+01:00
Don't make a closure table for type data decls

- - - - -
7d571a4b by Simon Peyton Jones at 2024-05-16T12:18:21+01:00
Make UanaryClass a new AlgTyConRhs

work in progress, won't compile

- - - - -
010ba547 by Simon Peyton Jones at 2024-05-16T12:18:21+01:00
More wibbles

- - - - -
0dc197f3 by Simon Peyton Jones at 2024-05-16T12:19:02+01:00
More wibbbles

- - - - -
de28b763 by Simon Peyton Jones at 2024-05-16T12:19:30+01:00
More wibbles

- - - - -
83c05ac1 by Simon Peyton Jones at 2024-05-16T12:19:30+01:00
Unused bindings

- - - - -
943f35f4 by Simon Peyton Jones at 2024-05-16T12:19:30+01:00
Unused import

- - - - -
1436c6fa by Simon Peyton Jones at 2024-05-16T12:19:30+01:00
Wibbles

- - - - -
3c04ca58 by Simon Peyton Jones at 2024-05-16T17:48:19+01:00
Wibbles

- - - - -


30 changed files:

- .gitlab/ci.sh
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- compiler/GHC.hs
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/Cmm.hs
- compiler/GHC/Cmm/Config.hs
- compiler/GHC/Cmm/MachOp.hs
- compiler/GHC/Cmm/Opt.hs
- compiler/GHC/Cmm/Pipeline.hs
- compiler/GHC/Cmm/Sink.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/RegInfo.hs
- compiler/GHC/CmmToAsm/Monad.hs
- compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/FVs.hs
- compiler/GHC/Core/LateCC.hs
- compiler/GHC/Core/LateCC/TopLevelBinds.hs
- compiler/GHC/Core/LateCC/Types.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Map/Expr.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/CSE.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/DmdAnal.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f0cac5db3261e4ebaa71f507e07ac0647dc306d0...3c04ca58c518bf7973652ec15f1d127b067126d6

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/f0cac5db3261e4ebaa71f507e07ac0647dc306d0...3c04ca58c518bf7973652ec15f1d127b067126d6
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/20240516/1ef5abdb/attachment-0001.html>


More information about the ghc-commits mailing list