[Git][ghc/ghc][wip/T23210] 155 commits: Replace the implementation of CodeBuffers with unboxed types

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Sun Jun 11 11:03:39 UTC 2023



Ben Gamari pushed to branch wip/T23210 at Glasgow Haskell Compiler / GHC


Commits:
fbe3fe00 by Josh Meredith at 2023-05-15T18:01:43-04:00
Replace the implementation of CodeBuffers with unboxed types

- - - - -
21f3aae7 by Josh Meredith at 2023-05-15T18:01:43-04:00
Use unboxed codebuffers in base

Metric Decrease:
    encodingAllocations

- - - - -
18ea2295 by Ben Gamari at 2023-05-15T18:02:20-04:00
rts: Weak pointer cleanups

Various stylistic cleanups. No functional changes.

- - - - -
c343112f by Ben Gamari at 2023-05-15T18:02:20-04:00
rts: Don't force debug output to stderr

Previously `+RTS -Dw -l` would emit debug output to the eventlog while
`+RTS -l -Dw` would emit it to stderr. This was because the parser for
`-D` would unconditionally override the debug output target. Now we
instead only do so if no it is currently `TRACE_NONE`.

- - - - -
a5f5f067 by Ben Gamari at 2023-05-15T18:02:20-04:00
rts: Forcibly flush eventlog on barf

Previously we would attempt to flush via `endEventLogging` which can
easily deadlock, e.g., if `barf` fails during GC.

Using `flushEventLog` directly may result in slightly less consistent
eventlog output (since we don't take all capabilities before flushing)
but avoids deadlocking.

- - - - -
73b1e87c by Ben Gamari at 2023-05-15T18:02:20-04:00
rts: Assert that pointers aren't cleared by -DZ

This turns many segmentation faults into much easier-to-debug assertion
failures by ensuring that LOOKS_LIKE_*_PTR checks recognize bit-patterns
produced by `+RTS -DZ` clearing as invalid pointers.

This is a bit ad-hoc but this is the debug runtime.

- - - - -
37fb61d8 by Ben Gamari at 2023-05-15T18:02:20-04:00
rts: Introduce printGlobalThreads

- - - - -
451d65a6 by Ben Gamari at 2023-05-15T18:02:20-04:00
rts: Don't sanity-check StgTSO.global_link

See Note [Avoid dangling global_link pointers].

Fixes #19146.

- - - - -
d69cbd78 by sheaf at 2023-05-15T18:03:00-04:00
Split up tyThingToIfaceDecl from GHC.Iface.Make

This commit moves tyThingToIfaceDecl and coAxiomToIfaceDecl
from GHC.Iface.Make into GHC.Iface.Decl.
This avoids GHC.Types.TyThing.Ppr, which needs tyThingToIfaceDecl,
transitively depending on e.g. GHC.Iface.Load and GHC.Tc.Utils.Monad.

- - - - -
4d29ecdf by sheaf at 2023-05-15T18:03:00-04:00
Migrate errors to diagnostics in GHC.Tc.Module

This commit migrates the errors in GHC.Tc.Module to use the new
diagnostic infrastructure.

It required a significant overhaul of the compatibility checks between
an hs-boot or signature module and its implementation; we now use
a Writer monad to accumulate errors; see the BootMismatch datatype
in GHC.Tc.Errors.Types, with its panoply of subtypes.
For the sake of readability, several local functions inside the
'checkBootTyCon' function were split off into top-level functions.

We split off GHC.Types.HscSource into a "boot or sig" vs "normal hs file"
datatype, as this mirrors the logic in several other places where we
want to treat hs-boot and hsig files in a similar fashion.

This commit also refactors the Backpack checks for type synonyms
implementing abstract data, to correctly reject implementations that
contain qualified or quantified types (this fixes #23342 and #23344).

- - - - -
d986c98e by Rodrigo Mesquita at 2023-05-16T00:14:04-04:00
configure: Drop unused AC_PROG_CPP

In configure, we were calling `AC_PROG_CPP` but never making use of the
$CPP variable it sets or reads.

The issue is $CPP will show up in the --help output of configure,
falsely advertising a configuration option that does nothing.

The reason we don't use the $CPP variable is because HS_CPP_CMD is
expected to be a single command (without flags), but AC_PROG_CPP, when
CPP is unset, will set said variable to something like `/usr/bin/gcc -E`.
Instead, we configure HS_CPP_CMD through $CC.

- - - - -
a8f0435f by Cheng Shao at 2023-05-16T00:14:42-04:00
rts: fix --disable-large-address-space

This patch moves
ACQUIRE_ALLOC_BLOCK_SPIN_LOCK/RELEASE_ALLOC_BLOCK_SPIN_LOCK from
Storage.h to HeapAlloc.h. When --disable-large-address-space is passed
to configure, the code in HeapAlloc.h makes use of these two macros.
Fixes #23385.

- - - - -
bdb93cd2 by Oleg Grenrus at 2023-05-16T07:59:21+03:00
Add -Wmissing-role-annotations

Implements #22702

- - - - -
41ecfc34 by Ben Gamari at 2023-05-16T07:28:15-04:00
base: Export {get,set}ExceptionFinalizer from System.Mem.Weak

As proposed in CLC Proposal #126 [1].

[1]: https://github.com/haskell/core-libraries-committee/issues/126

- - - - -
67330303 by Ben Gamari at 2023-05-16T07:28:16-04:00
base: Introduce printToHandleFinalizerExceptionHandler

- - - - -
5e3f9bb5 by Josh Meredith at 2023-05-16T13:59:22-04:00
JS: Implement h$clock_gettime in the JavaScript RTS (#23360)

- - - - -
90e69d5d by Zubin Duggal at 2023-05-16T14:00:00-04:00
compiler: Use compact representation for SourceText

SourceText is serialized along with INLINE pragmas into interface files. Many of
these SourceTexts are identical, for example "{-# INLINE#". When deserialized,
each such SourceText was previously expanded out into a [Char], which is highly
wasteful of memory, and each such instance of the text would allocate an
independent list with its contents as deserializing breaks any sharing that might
have existed.

Instead, we use a `FastString` to represent these, so that each instance unique
text will be interned and stored in a memory efficient manner.

- - - - -
b70bc690 by Zubin Duggal at 2023-05-16T14:00:00-04:00
compiler: Use compact representation/FastStrings for `SourceNote`s

`SourceNote`s should not be stored as [Char] as this is highly wasteful
and in certain scenarios can be highly duplicated.

Metric Decrease:
  hard_hole_fits

- - - - -
6231a126 by Zubin Duggal at 2023-05-16T14:00:00-04:00
compiler: Use compact representation for UsageFile (#22744)

Use FastString to store filepaths in interface files, as this data is
highly redundant so we want to share all instances of filepaths in the
compiler session.

- - - - -
47a58150 by Zubin Duggal at 2023-05-16T14:00:00-04:00
testsuite: add test for T22744

This test checks for #22744 by compiling 100 modules which each have
a dependency on 1000 distinct external files.

Previously, when loading these interfaces from disk, each individual instance
of a filepath in the interface will would be allocated as an individual object
on the heap, meaning we have heap objects for 100*1000 files, when there are
only 1000 distinct files we care about.

This test checks this by first compiling the module normally, then measuring
the peak memory usage in a no-op recompile, as the recompilation checking will
force the allocation of all these filepaths.

- - - - -
0451bdc9 by Ben Gamari at 2023-05-16T21:31:40-04:00
users guide: Add glossary

Currently this merely explains the meaning of "technology preview" in
the context of released features.

- - - - -
0ba52e4e by Ben Gamari at 2023-05-16T21:31:40-04:00
Update glossary.rst
- - - - -
3d23060c by Ben Gamari at 2023-05-16T21:31:40-04:00
Use glossary directive
- - - - -
2972fd66 by Sylvain Henry at 2023-05-16T21:32:20-04:00
JS: fix getpid (fix #23399)

- - - - -
5fe1d3e6 by Matthew Pickering at 2023-05-17T21:42:00-04:00
Use setSrcSpan rather than setLclEnv in solveForAll

In subsequent MRs (#23409) we want to remove the TcLclEnv argument from
a CtLoc. This MR prepares us for that by removing the one place where
the entire TcLclEnv is used, by using it more precisely to just set the
contexts source location.

Fixes #23390

- - - - -
385edb65 by Torsten Schmits at 2023-05-17T21:42:40-04:00
Update the users guide paragraph on -O in GHCi

In relation to #23056

- - - - -
87626ef0 by Ben Gamari at 2023-05-18T15:18:53-04:00
base: Add test for #13660

- - - - -
9eef53b1 by Ben Gamari at 2023-05-18T15:18:53-04:00
base: Move implementation of GHC.Foreign to GHC.Internal

- - - - -
174ea2fa by Ben Gamari at 2023-05-18T15:18:53-04:00
base: Introduce {new,with}CStringLen0

These are useful helpers for implementing the internal-NUL code unit
check needed to fix #13660.

- - - - -
a46ced16 by Ben Gamari at 2023-05-18T15:18:53-04:00
base: Clean up documentation

- - - - -
b98d99cc by Ben Gamari at 2023-05-18T15:18:53-04:00
base: Ensure that FilePaths don't contain NULs

POSIX filepaths may not contain the NUL octet but previously we did not
reject such paths. This could be exploited by untrusted input to cause
discrepancies between various `FilePath` queries and the opened
filename. For instance, `readFile "hello.so\x00.txt"` would open the
file `"hello.so"` yet `takeFileExtension` would return `".txt"`.

The same argument applies to Windows FilePaths

Fixes #13660.

- - - - -
7ae45459 by Simon Peyton Jones at 2023-05-18T15:19:29-04:00
Allow the demand analyser to unpack tuple and equality dictionaries

Addresses #23398. The demand analyser usually does not unpack class
dictionaries: see Note [Do not unbox class dictionaries] in
GHC.Core.Opt.DmdAnal.

This patch makes an exception for tuple dictionaries and equality
dictionaries, for reasons explained in wrinkles (DNB1) and (DNB2) of
the above Note.

Compile times fall by 0.1% for some reason (max 0.7% on T18698b).

- - - - -
b53a9086 by Greg Steuck at 2023-05-18T15:20:08-04:00
Use a simpler and more portable construct in ld.ldd check

printf '%q\n' is a bash extension which led to incorrectly
failing an ld.lld test on OpenBSD which uses pdksh as /bin/sh

- - - - -
dd5710af by Torsten Schmits at 2023-05-18T15:20:50-04:00
Update the warning about interpreter optimizations

to reflect that they're not incompatible anymore, but guarded by a flag

- - - - -
4f6dd999 by Matthew Pickering at 2023-05-18T15:21:26-04:00
Remove stray dump flags in GHC.Rename.Names

- - - - -
4bca0486 by Oleg Grenrus at 2023-05-19T11:51:33+03:00
Make Warn = Located DriverMessage

This change makes command line argument parsing use diagnostic
framework for producing warnings.

- - - - -
525ed554 by Simon Peyton Jones at 2023-05-19T10:09:15-04:00
Type inference for data family newtype instances

This patch addresses #23408, a tricky case with data family
newtype instances.  Consider

  type family TF a where TF Char = Bool
  data family DF a
  newtype instance DF Bool = MkDF Int

and [W] Int ~R# DF (TF a), with a Given (a ~# Char).   We must fully
rewrite the Wanted so the tpye family can fire; that wasn't happening.

- - - - -
c6fb6690 by Peter Trommler at 2023-05-20T03:16:08-04:00
testsuite: fix predicate on rdynamic test

Test rdynamic requires dynamic linking support, which is
orthogonal to RTS linker support. Change the predicate accordingly.

Fixes #23316

- - - - -
735d504e by Matthew Pickering at 2023-05-20T03:16:44-04:00
docs: Use ghc-ticket directive where appropiate in users guide

Using the directive automatically formats and links the ticket
appropiately.

- - - - -
b56d7379 by Sylvain Henry at 2023-05-22T14:21:22-04:00
NCG: remove useless .align directive (#20758)

- - - - -
15b93d2f by Simon Peyton Jones at 2023-05-22T14:21:58-04:00
Add test for #23156

This program had exponential typechecking time in GHC 9.4 and 9.6

- - - - -
2b53f206 by Greg Steuck at 2023-05-22T20:23:11-04:00
Revert "Change hostSupportsRPaths to report False on OpenBSD"

This reverts commit 1e0d8fdb55a38ece34fa6cf214e1d2d46f5f5bf2.

- - - - -
882e43b7 by Greg Steuck at 2023-05-22T20:23:11-04:00
Disable T17414 on OpenBSD

Like on other systems it's not guaranteed that there's sufficient
space in /tmp to write 2G out.

- - - - -
9d531f9a by Greg Steuck at 2023-05-22T20:23:11-04:00
Bring back getExecutablePath to getBaseDir on OpenBSD

Fix #18173

- - - - -
9db0eadd by Krzysztof Gogolewski at 2023-05-22T20:23:47-04:00
Add an error origin for impedance matching (#23427)

- - - - -
33cf4659 by Ben Gamari at 2023-05-23T03:46:20-04:00
testsuite: Add tests for #23146

Both lifted and unlifted variants.

- - - - -
76727617 by Ben Gamari at 2023-05-23T03:46:21-04:00
codeGen: Fix some Haddocks

- - - - -
33a8c348 by Ben Gamari at 2023-05-23T03:46:21-04:00
codeGen: Give proper LFInfo to datacon wrappers

As noted in `Note [Conveying CAF-info and LFInfo between modules]`,
when importing a binding from another module we must ensure that it gets
the appropriate `LambdaFormInfo` if it is in WHNF to ensure that
references to it are tagged correctly.

However, the implementation responsible for doing this,
`GHC.StgToCmm.Closure.mkLFImported`, only dealt with datacon workers and
not wrappers. This lead to the crash of this program in #23146:

    module B where

    type NP :: [UnliftedType] -> UnliftedType
    data NP xs where
      UNil :: NP '[]

    module A where
    import B

    fieldsSam :: NP xs -> NP xs -> Bool
    fieldsSam UNil UNil = True

    x = fieldsSam UNil UNil

Due to its GADT nature, `UNil` produces a trivial wrapper

    $WUNil :: NP '[]
    $WUNil = UNil @'[] @~(<co:1>)

which is referenced in the RHS of `A.x`. Due to the above-mentioned bug
in `mkLFImported`, the references to `$WUNil` passed to `fieldsSam` were
not tagged. This is problematic as `fieldsSam` expected its arguments to
be tagged as they are unlifted.

The fix is straightforward: extend the logic in `mkLFImported` to cover
(nullary) datacon wrappers as well as workers. This is safe because we
know that the wrapper of a nullary datacon will be in WHNF, even if it
includes equalities evidence (since such equalities are not runtime
relevant).

Thanks to @MangoIV for the great ticket and @alt-romes for his
minimization and help debugging.

Fixes #23146.

- - - - -
2fc18e9e by Rodrigo Mesquita at 2023-05-23T03:46:21-04:00
codeGen: Fix LFInfo of imported datacon wrappers

As noted in #23231 and in the previous commit, we were failing to give a
an LFInfo of LFCon to a nullary datacon wrapper from another module,
failing to properly tag pointers which ultimately led to the
segmentation fault in #23146.

On top of the previous commit which now considers wrappers where we
previously only considered workers, we change the order of the guards so
that we check for the arity of the binding before we check whether it is
a constructor. This allows us to
(1) Correctly assign `LFReEntrant` to imported wrappers whose worker was
nullary, which we previously would fail to do
(2) Remove the `isNullaryRepDataCon` predicate:
    (a) which was previously wrong, since it considered wrappers whose
    workers had zero-width arguments to be non-nullary and would fail to
    give `LFCon` to them
    (b) is now unnecessary, since arity == 0 guarantees
        - that the worker takes no arguments at all
        - and the wrapper takes no arguments and its RHS must be an
          application of the worker to zero-width-args only.
        - we lint these two items with an assertion that the datacon
          `hasNoNonZeroWidthArgs`

We also update `isTagged` to use the new logic in determining the
LFInfos of imported Ids.

The creation of LFInfos for imported Ids and this detail are explained
in Note [The LFInfo of Imported Ids].

Note that before the patch to those issues we would already consider these
nullary wrappers to have `LFCon` lambda form info; but failed to re-construct
that information in `mkLFImported`

Closes #23231, #23146

(I've additionally batched some fixes to documentation I found while
investigating this issue)

- - - - -
0598f7f0 by Rodrigo Mesquita at 2023-05-23T03:46:21-04:00
Make LFInfos for DataCons on construction

As a result of the discussion in !10165, we decided to amend the
previous commit which fixed the logic of `mkLFImported` with regard to
datacon workers and wrappers.

Instead of having the logic for the LFInfo of datacons be in
`mkLFImported`, we now construct an LFInfo for all data constructors on
GHC.Types.Id.Make and store it in the `lfInfo` field.

See the new Note [LFInfo of DataCon workers and wrappers] and
ammendments to Note [The LFInfo of Imported Ids]

- - - - -
12294b22 by Rodrigo Mesquita at 2023-05-23T03:46:21-04:00
Update Note [Core letrec invariant]

Authored by @simonpj

- - - - -
e93ab972 by Rodrigo Mesquita at 2023-05-23T03:46:21-04:00
Rename mkLFImported to importedIdLFInfo

The `mkLFImported` sounded too much like a constructor of sorts, when
really it got the `LFInfo` of an imported Id from its `lf_info` field
when this existed, and otherwise returned a conservative estimate of
that imported Id's LFInfo. This in contrast to functions such as
`mkLFReEntrant` which really are about constructing an `LFInfo`.

- - - - -
e54d9259 by Rodrigo Mesquita at 2023-05-23T03:46:21-04:00
Enforce invariant on typePrimRepArgs in the types

As part of the documentation effort in !10165 I came across this
invariant on 'typePrimRepArgs' which is easily expressed at the
type-level through a NonEmpty list.

It allowed us to remove one panic.

- - - - -
b8fe6a0c by Rodrigo Mesquita at 2023-05-23T03:46:21-04:00
Merge outdated Note [Data con representation] into Note [Data constructor representation]

Introduce new Note [Constructor applications in STG] to better support
the merge, and reference it from the relevant bits in the STG syntax.

- - - - -
e1590ddc by Simon Peyton Jones at 2023-05-23T03:46:57-04:00
Add the SolverStage monad

This refactoring makes a substantial improvement in the
structure of the type-checker's constraint solver: #23070.

Specifically:

* Introduced the SolverStage monad.   See GHC.Tc.Solver.Monad
  Note [The SolverStage monad]

* Make each solver pipeline (equalities, dictionaries, irreds etc)
  deal with updating the inert set, as a separate SolverStage.  There
  is sometimes special stuff to do, and it means that each full
  pipeline can have type SolverStage Void, indicating that they never
  return anything.

* Made GHC.Tc.Solver.Equality.zonkEqTypes into a SolverStage.  Much nicer.

* Combined the remnants of GHC.Tc.Solver.Canonical and
  GHC.Tc.Solver.Interact into a new module GHC.Tc.Solver.Solve.
  (Interact and Canonical are removed.)

* Gave the same treatment to dictionary and irred constraints
  as I have already done for equality constraints:
    * New types (akin to EqCt): IrredCt and DictCt
    * Ct is now just a simple sum type
          data Ct
            = CDictCan      DictCt
            | CIrredCan     IrredCt
            | CEqCan        EqCt
            | CQuantCan     QCInst
            | CNonCanonical CtEvidence
    * inert_dicts can now have the better type DictMap DictCt, instead of
      DictMap Ct; and similarly inert_irreds.

* Significantly simplified the treatment of implicit parameters.
  Previously we had a number of special cases
    * interactGivenIP, an entire function
    * special case in maybeKickOut
    * special case in findDict, when looking up dictionaries
  But actually it's simpler than that. When adding a new Given, implicit
  parameter constraint to the InertSet, we just need to kick out any
  existing inert constraints that mention that implicit parameter.

  The main work is done in GHC.Tc.Solver.InertSet.delIPDict, along with
  its auxiliary GHC.Core.Predicate.mentionsIP.

  See Note [Shadowing of implicit parameters] in GHC.Tc.Solver.Dict.

* Add a new fast-path in GHC.Tc.Errors.Hole.tcCheckHoleFit.
  See Note [Fast path for tcCheckHoleFit].  This is a big win in some cases:
  test hard_hole_fits gets nearly 40% faster (at compile time).

* Add a new fast-path for solving /boxed/ equality constraints
  (t1 ~ t2).  See Note [Solving equality classes] in GHC.Tc.Solver.Dict.
  This makes a big difference too: test T17836 compiles 40% faster.

* Implement the PermissivePlan of #23413, which concerns what happens with
  insoluble Givens.   Our previous treatment was wildly inconsistent as that
  ticket pointed out.

  A part of this, I simplified GHC.Tc.Validity.checkAmbiguity: now we simply
  don't run the ambiguity check at all if -XAllowAmbiguousTypes is on.

Smaller points:

* In `GHC.Tc.Errors.misMatchOrCND` instead of having a special case for
  insoluble /occurs/ checks, broaden in to all insouluble constraints.
  Just generally better. See Note [Insoluble mis-match] in that module.

As noted above, compile time perf gets better.  Here are the changes
over 0.5% on Fedora.  (The figures are slightly larger on Windows for
some reason.)

Metrics: compile_time/bytes allocated
-------------------------------------
                LargeRecord(normal)   -0.9%
MultiLayerModulesTH_OneShot(normal)   +0.5%
                     T11822(normal)   -0.6%
                     T12227(normal)   -1.8% GOOD
                     T12545(normal)   -0.5%
                     T13035(normal)   -0.6%
                     T15703(normal)   -1.4% GOOD
                     T16875(normal)   -0.5%
                     T17836(normal)  -40.7% GOOD
                    T17836b(normal)  -12.3% GOOD
                    T17977b(normal)   -0.5%
                      T5837(normal)   -1.1%
                      T8095(normal)   -2.7% GOOD
                      T9020(optasm)   -1.1%
             hard_hole_fits(normal)  -37.0% GOOD

                          geo. mean   -1.3%
                          minimum    -40.7%
                          maximum     +0.5%

Metric Decrease:
    T12227
    T15703
    T17836
    T17836b
    T8095
    hard_hole_fits
    LargeRecord
    T9198
    T13035

- - - - -
6abf3648 by Simon Peyton Jones at 2023-05-23T03:46:57-04:00
Avoid an assertion failure in abstractFloats

The function GHC.Core.Opt.Simplify.Utils.abstractFloats
was carelessly calling lookupIdSubst_maybe on a CoVar;
but a precondition of the latter is being given an Id.

In fact it's harmless to call it on a CoVar, but still, the
precondition on lookupIdSubst_maybe makes sense, so I added
a test for CoVars.

This avoids a crash in a DEBUG compiler, but otherwise has
no effect. Fixes #23426.

- - - - -
838aaf4b by hainq at 2023-05-24T12:41:19-04:00
Migrate errors in GHC.Tc.Validity

This patch migrates the error messages in GHC.Tc.Validity to use
the new diagnostic infrastructure.

It adds the constructors:

  - TcRnSimplifiableConstraint
  - TcRnArityMismatch
  - TcRnIllegalInstanceDecl, with sub-datatypes for HasField errors
    and fundep coverage condition errors.

- - - - -
8539764b by Krzysztof Gogolewski at 2023-05-24T12:41:56-04:00
linear lint: Add missing processing of DEFAULT

In this correct program

f :: a %1 -> a
f x = case x of x { _DEFAULT -> x }

after checking the alternative we weren't popping the case binder 'x'
from the usage environment, which meant that the lambda-bound 'x'
was counted twice: in the scrutinee and (incorrectly) in the alternative.
In fact, we weren't checking the usage of 'x' at all.
Now the code for handling _DEFAULT is similar to the one handling
data constructors.

Fixes #23025.

- - - - -
ae683454 by Matthew Pickering at 2023-05-24T12:42:32-04:00
Remove outdated "Don't check hs-boot type family instances too early" note

This note was introduced in 25b70a29f623 which delayed performing some
consistency checks for type families. However, the change was reverted
later in 6998772043a7f0b0360116eb5ffcbaa5630b21fb but the note was not
removed.

I found it confusing when reading to code to try and work out what
special behaviour there was for hs-boot files (when in-fact there isn't
any).

- - - - -
44af57de by Matthew Pickering at 2023-05-24T12:43:08-04:00
rts: Define ticky macro stubs

These macros have long been undefined which has meant we were missing
reporting these allocations in ticky profiles.

The most critical missing definition was TICK_ALLOC_HEAP_NOCTR which was
missing all the RTS calls to allocate, this leads to a the overall
ALLOC_RTS_tot number to be severaly underreported.

Of particular interest though is the ALLOC_STACK_ctr and ALLOC_STACK_tot
counters which are useful to tracking stack allocations.

Fixes #23421

- - - - -
b2dabe3a by Matthew Pickering at 2023-05-24T12:43:08-04:00
rts: ticky: Rename TICK_ALLOC_HEAP_NOCTR to TICK_ALLOC_RTS

This macro increments the ALLOC_HEAP_tot and ALLOC_HEAP_ctr so it makes
more sense to name it after that rather than the suffix NOCTR, whose
meaning has been lost to the mists of time.

- - - - -
eac4420a by Ben Gamari at 2023-05-24T12:43:45-04:00
users guide: A few small mark-up fixes

- - - - -
a320ca76 by Rodrigo Mesquita at 2023-05-24T12:44:20-04:00
configure: Fix support check for response files.

In failing to escape the '-o' in '-o\nconftest\nconftest.o\n' argument
to printf, the writing of the arguments response file always failed.

The fix is to pass the arguments after `--` so that they are treated
positional arguments rather than flags to printf.

Closes #23435

- - - - -
f21ce0e4 by mangoiv at 2023-05-24T12:45:00-04:00
[feat] add .direnv to the .gitignore file

- - - - -
36d5944d by Bodigrim at 2023-05-24T20:58:34-04:00
Add Data.List.unsnoc

See https://github.com/haskell/core-libraries-committee/issues/165 for discussion

- - - - -
c0f2f9e3 by Bartłomiej Cieślar at 2023-05-24T20:59:14-04:00
Fix crash in backpack signature merging with -ddump-rn-trace

In some cases, backpack signature merging could crash in addUsedGRE
when -ddump-rn-trace was enabled, as pretty-printing the GREInfo would cause
unavailable interfaces to be loaded.
This commit fixes that issue by not pretty-printing the GREInfo in addUsedGRE
when -ddump-rn-trace is enabled.

Fixes #23424

Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com>

- - - - -
5a07d94a by Krzysztof Gogolewski at 2023-05-25T03:30:20-04:00
Add a regression test for #13981

The panic was fixed by 6998772043a7f0b. Fixes #13981.

- - - - -
182df90e by Krzysztof Gogolewski at 2023-05-25T03:30:57-04:00
Add a test for #23355

It was fixed by !10061, so I'm adding it in the same group.

- - - - -
1b31b039 by uhbif19 at 2023-05-25T12:08:28+02:00
Migrate errors in GHC.Rename.Splice GHC.Rename.Pat

This commit migrates the errors in GHC.Rename.Splice and GHC.Rename.Pat
to use the new diagnostic infrastructure.

- - - - -
56abe494 by sheaf at 2023-05-25T12:09:55+02:00
Common up Template Haskell errors in TcRnMessage

This commit commons up the various Template Haskell errors into a
single constructor, TcRnTHError, of TcRnMessage.

- - - - -
a487ba9e by Krzysztof Gogolewski at 2023-05-25T14:35:56-04:00
Enable ghci tests for unboxed tuples

The tests were originally skipped because ghci used not to support
unboxed tuples/sums.

- - - - -
dc3422d4 by Matthew Pickering at 2023-05-25T18:57:19-04:00
rts: Build ticky GHC with single-threaded RTS

The threaded RTS allows you to use ticky profiling but only for the
counters in the generated code. The counters used in the C portion of
the RTS are disabled. Updating the counters is also racy using the
threaded RTS which can lead to misleading or incorrect ticky results.

Therefore we change the hadrian flavour to build using the
single-threaded RTS (mainly in order to get accurate C code counter
increments)

Fixes #23430

- - - - -
fbc8e04e by sheaf at 2023-05-25T18:58:00-04:00
Propagate long-distance info in generated code

When desugaring generated pattern matches, we skip pattern match checks.
However, this ended up also discarding long-distance information, which
might be needed for user-written sub-expressions.

Example:

```haskell
okay (GADT di) cd =
  let sr_field :: ()
      sr_field = case getFooBar di of { Foo -> () }
  in case cd of { SomeRec _ -> SomeRec sr_field }
```

With sr_field a generated FunBind, we still want to propagate the outer
long-distance information from the GADT pattern match into the checks
for the user-written RHS of sr_field.

Fixes #23445

- - - - -
f8ced241 by Matthew Pickering at 2023-05-26T15:26:21-04:00
Introduce GHCiMessage to wrap GhcMessage

By introducing a wrapped message type we can control how certain
messages are printed in GHCi (to add extra information for example)

- - - - -
58e554c1 by Matthew Pickering at 2023-05-26T15:26:22-04:00
Generalise UnknownDiagnostic to allow embedded diagnostics to access
parent diagnostic options.

* Split default diagnostic options from Diagnostic class into
  HasDefaultDiagnosticOpts class.
* Generalise UnknownDiagnostic to allow embedded diagnostics to access
  options.

The principle idea here is that when wrapping an error message (such as
GHCMessage to make GHCiMessage) then we need to also be able to lift the
configuration when overriding how messages are printed (see load' for an
example).

- - - - -
b112546a by Matthew Pickering at 2023-05-26T15:26:22-04:00
Allow API users to wrap error messages created during 'load'

This allows API users to configure how messages are rendered when they
are emitted from the load function. For an example see how
'loadWithCache' is used in GHCi.

- - - - -
2e4cf0ee by Matthew Pickering at 2023-05-26T15:26:22-04:00
Abstract cantFindError and turn Opt_BuildingCabal into a print-time option

* cantFindError is abstracted so that the parts which mention specific
  things about ghc/ghci are parameters. The intention being that
  GHC/GHCi can specify the right values to put here but otherwise
  display the same error message.
* The BuildingCabalPackage argument from GenericMissing is removed and
  turned into a print-time option. The reason for the error is not
  dependent on whether `-fbuilding-cabal-package` is passed, so we don't
  want to store that in the error message.

- - - - -
34b44f7d by Matthew Pickering at 2023-05-26T15:26:22-04:00
error messages: Don't display ghci specific hints for missing packages

Tickets like #22884 suggest that it is confusing that GHC used on the
command line can suggest options which only work in GHCi.

This ticket uses the error message infrastructure to override certain
error messages which displayed GHCi specific information so that this
information is only showed when using GHCi.

The main annoyance is that we mostly want to display errors in the same
way as before, but with some additional information. This means that the
error rendering code has to be exported from the Iface/Errors/Ppr.hs
module.

I am unsure about whether the approach taken here is the best or most
maintainable solution.

Fixes #22884

- - - - -
05a1b626 by Matthew Pickering at 2023-05-26T15:26:58-04:00
ghcup-metadata: Don't override existing metadata if version already exists.

If a nightly pipeline runs twice for some reason for the same version
then we really don't want to override an existing entry with new
bindists. This could cause ABI compatability issues for users or break
ghcup's caching logic.

- - - - -
fcbcb3cc by Matthew Pickering at 2023-05-26T15:26:58-04:00
ghcup-metadata: Use proper API url for bindist download

Previously we were using links from the web interface, but it's more
robust and future-proof to use the documented links to the artifacts.

https://docs.gitlab.com/ee/api/job_artifacts.html

- - - - -
5b59c8fe by Matthew Pickering at 2023-05-26T15:26:58-04:00
ghcup-metadata: Set Nightly and LatestNightly tags

The latest nightly release needs the LatestNightly tag, and all other
nightly releases need the Nightly tag. Therefore when the metadata is
updated we need to replace all LatestNightly with Nightly.`

- - - - -
914e1468 by Matthew Pickering at 2023-05-26T15:26:58-04:00
ghcup-metadata: Download nightly metadata for correct date

The metadata now lives in https://gitlab.haskell.org/ghc/ghcup-metadata
with one metadata file per year. When we update the metadata we download
and update the right file for the current year.

- - - - -
16cf7d2e by Matthew Pickering at 2023-05-26T15:26:58-04:00
ghcup-metadata: Download metadata and update for correct year

something about pipeline date

- - - - -
14792c4b by Matthew Pickering at 2023-05-26T15:26:58-04:00
ghcup-metadata: Don't skip CI

On a push we now have a CI job which updates gitlab pages with the
metadata files.

- - - - -
1121bdd8 by Matthew Pickering at 2023-05-26T15:26:59-04:00
ghcup-metadata: Add --date flag to specify the release date

The ghcup-metadata now has a viReleaseDay field which needs to be
populated with the day of the release.

- - - - -
bc478bee by Matthew Pickering at 2023-05-26T15:26:59-04:00
ghcup-metadata: Add dlOutput field

ghcup now requires us to add this field which specifies where it should
download the bindist to. See
https://gitlab.haskell.org/ghc/ghcup-metadata/-/issues/1 for some more
discussion.

- - - - -
2bdbd9da by Josh Meredith at 2023-05-26T15:27:35-04:00
JS: Convert rendering to use HLine instead of SDoc (#22455)

- - - - -
abd9e37c by Norman Ramsey at 2023-05-26T15:28:12-04:00
testsuite: add WasmControlFlow test

This patch adds the WasmControlFlow test to test the wasm backend's
relooper component.

- - - - -
07f858eb by Sylvain Henry at 2023-05-26T15:28:53-04:00
Factorize getLinkDeps

Prepare reuse of getLinkDeps for TH implementation in the JS backend
(cf #22261 and review of !9779).

- - - - -
fad9d092 by Oleg Grenrus at 2023-05-27T13:38:08-04:00
Change GHC.Driver.Session import to .DynFlags

Also move targetPlatform selector

Plenty of GHC needs just DynFlags.
Even more can be made to use .DynFlags if more selectors is migrated.
This is a low hanging fruit.

- - - - -
69fdbece by Alan Zimmerman at 2023-05-27T13:38:45-04:00
EPA: Better fix for #22919

The original fix for #22919 simply removed the ability to match up
prior comments with the first declaration in the file.

Restore it, but add a check that the comment is on a single line, by
ensuring that it comes immediately prior to the next thing (comment or
start of declaration), and that the token preceding it is not on the
same line.

closes #22919

- - - - -
0350b186 by Josh Meredith at 2023-05-29T12:46:27+00:00
Remove JavaScriptFFI from --supported-extensions for non-JS targets (#11214)

- - - - -
b4816919 by Matthew Pickering at 2023-05-30T17:07:43-04:00
testsuite: Pass -kb16k -kc128k for performance tests

Setting a larger stack chunk size gives a greater protection
from stack thrashing (where the repeated overflow/underflow allocates a lot of
stack chunks which sigificantly impact allocations). This
stabilises some tests against differences cause by more things being
pushed onto the stack.

The performance tests are generally testing work done by the compiler,
using allocation as a proxy, so removing/stabilising the allocations due
to the stack gives us more stable tests which are also more sensitive
to actual changes in compiler performance.

The tests which increase are ones where we compile a lot of modules, and
for each module we spawn a thread to compile the module in. Therefore
increasing these numbers has a multiplying effect on these tests because
there are many more stacks which we can increase in size.

The most significant improvements though are cases such as T8095 which
reduce significantly in allocations (30%). This isn't a performance
improvement really but just helps stabilise the test against this
threshold set by the defaults.

Fixes #23439

-------------------------
Metric Decrease:
    InstanceMatching
    T14683
    T8095
    T9872b_defer
    T9872d
    T9961
    hie002
    T19695
    T3064
Metric Increase:
    MultiLayerModules
    T13701
    T14697
-------------------------

- - - - -
6629f1c5 by Ben Gamari at 2023-05-30T17:08:20-04:00
Move via-C flags into GHC

These were previously hardcoded in configure (with no option for
overriding them) and simply passed onto ghc through the settings file.

Since configure already guarantees gcc supports those flags, we simply
move them into GHC.

- - - - -
981e5e11 by Arnaud Spiwack at 2023-05-31T08:34:33-04:00
Allow CPR on unrestricted constructors

Per the new `Note [Linting linearity]`, we want optimisations over
trying to preserve linearity. This will allow CPR to handle `Ur`, in
particular.

- - - - -
bf9344d2 by Arnaud Spiwack at 2023-05-31T08:34:33-04:00
Push coercions across multiplicity boundaries

Per the new `Note [Linting linearity]`, we want optimisations over
trying to preserve linearity. This will avoid preventing inlinings and
reductions and make linear programs more efficient.

- - - - -
d56dd695 by sheaf at 2023-05-31T11:37:12-04:00
Data.Bag: add INLINEABLE to polymorphic functions

This commit allows polymorphic methods in GHC.Data.Bag to be
specialised, avoiding having to pass explicit dictionaries when they
are instantiated with e.g. a known monad.

- - - - -
5366cd35 by sheaf at 2023-05-31T11:37:12-04:00
Split off TcBinderStack into its own module

This commit splits off TcBinderStack into its own module,
to avoid module cycles: we might want to refer to it without also
pulling in the TcM monad.

- - - - -
09d4d307 by sheaf at 2023-05-31T11:37:12-04:00
Split off TcRef into its own module

This helps avoid pull in the full TcM monad when we just want access
to mutable references in the typechecker. This facilitates later patches
which introduce a slimmed down TcM monad for zonking.

- - - - -
88cc19b3 by sheaf at 2023-05-31T11:37:12-04:00
Introduce Codensity monad

The Codensity monad is useful to write state-passing computations in
continuation-passing style, e.g. to implement a State monad as
continuation-passing style over a Reader monad.

- - - - -
f62d8195 by sheaf at 2023-05-31T11:37:12-04:00
Restructure the zonker

This commit splits up the zonker into a few separate components, described
in Note [The structure of the zonker] in `GHC.Tc.Zonk.Type`.

1. `GHC.Tc.Zonk.Monad` introduces a pared-down `TcM` monad, `ZonkM`,
     which has enough information for zonking types.
     This allows us to refactor `ErrCtxt` to use `ZonkM` instead of `TcM`,
     which guarantees we don't throw an error while reporting an error.

2. `GHC.Tc.Zonk.Env` is the new home of `ZonkEnv`, and also defines
    two zonking monad transformers, `ZonkT` and `ZonkBndrT`.
    `ZonkT` is a reader monad transformer over `ZonkEnv`.
    `ZonkBndrT m` is the codensity monad over `ZonkT m`.

     `ZonkBndrT` is used for computations that accumulate binders
     in the `ZonkEnv`.

3. `GHC.Tc.Zonk.TcType` contains the code for zonking types, for use
    in the typechecker. It uses the `ZonkM` monad.

4. `GHC.Tc.Zonk.Type` contains the code for final zonking to `Type`,
    which has been refactored to use `ZonkTcM = ZonkT TcM` and
    `ZonkBndrTcM = ZonkBndrT TcM`.

Allocations slightly decrease on the whole due to using
continuation-passing style instead of manual state passing of ZonkEnv
in the final zonking to Type.

-------------------------
Metric Decrease:
    T4029
    T8095
    T14766
    T15304
    hard_hole_fits
    RecordUpdPerf
Metric Increase:
    T10421
-------------------------

- - - - -
70526f5b by mimi.vx at 2023-05-31T11:37:53-04:00
Update rdt-theme to latest upstream version

Fixes https://gitlab.haskell.org/ghc/ghc/-/issues/23444

- - - - -
f3556d6c by Finley McIlwaine at 2023-06-01T04:53:12-04:00
Restructure IPE buffer layout

Reference ticket #21766

This commit restructures IPE buffer list entries to not contain
references to their corresponding info tables. IPE buffer list nodes now
point to two lists of equal length, one holding the list of info table
pointers and one holding the corresponding entries for each info table.
This will allow the entry data to be compressed without losing the
references to the info tables.

- - - - -
5d1f2411 by Finley McIlwaine at 2023-06-01T04:53:12-04:00
Add IPE compression to configure

Reference ticket #21766

Adds an `--enable-ipe-data-compreesion` flag to the configure script
which will check for libzstd and set the appropriate flags to allow for
IPE data compression in the compiler

- - - - -
b7a640ac by Finley McIlwaine at 2023-06-01T04:53:12-04:00
IPE data compression

Reference ticket #21766

When IPE data compression is enabled, compress the emitted IPE buffer
entries and decompress them in the RTS.

- - - - -
5aef5658 by Finley McIlwaine at 2023-06-01T04:53:12-04:00
Fix libzstd detection in configure and RTS

Ensure that `HAVE_LIBZSTD` gets defined to either 0 or 1 in all cases
and properly check that before IPE data decompression in the RTS. See
ticket #21766.

- - - - -
69563c97 by Finley McIlwaine at 2023-06-01T04:53:12-04:00
Add note describing IPE data compression

See ticket #21766

- - - - -
7872e2b6 by Finley McIlwaine at 2023-06-01T04:53:12-04:00
Fix byte order of IPE data, fix IPE tests

Make sure byte order of written IPE buffer entries matches target.

Make sure the IPE-related tests properly access the fields of IPE buffer
entry nodes with the new IPE layout.

This commit also introduces checks to avoid importing modules if IPE
compression is not enabled.

See ticket #21766.

- - - - -
0e85099b by Finley McIlwaine at 2023-06-01T04:53:12-04:00
Fix IPE data decompression buffer allocation

Capacity of buffers allocated for decompressed IPE data was
incorrect due to a misuse of the `ZSTD_findFrameCompressedSize`
function. Fix by always storing decompressed size of IPE data in IPE
buffer list nodes and using `ZSTD_findFrameCompressedSize` to determine
the size of the compressed data.

See ticket #21766

- - - - -
a0048866 by Finley McIlwaine at 2023-06-01T04:53:12-04:00
Add optional dependencies to ./configure output

Changes the configure script to indicate whether libnuma, libzstd, or
libdw are being used as dependencies due to their optional features
being enabled.

- - - - -
09d93bd0 by Finley McIlwaine at 2023-06-01T04:53:12-04:00
Add IPE-enabled builds to CI

- Adds an IPE job to the CI pipeline which is triggered by the ~IPE label
- Introduces CI logic to enable IPE data compression
- Enables uncompressed IPE data on debug CI job
- Regenerates jobs.yaml

MR https://gitlab.haskell.org/ghc/ci-images/-/merge_requests/112 on the
images repository is meant to ensure that the proper images have
libzstd-dev installed.

- - - - -
3ded9a1c by Finley McIlwaine at 2023-06-01T04:53:12-04:00
Update user's guide and release notes, small fixes

Add mention of IPE data compression to user's guide and the release
notes for 9.8.1. Also note the impact compression has on binary size in
both places.

Change IpeBufferListNode compression check so only the value `1`
indicates compression.

See ticket #21766

- - - - -
41b41577 by Finley McIlwaine at 2023-06-01T04:53:12-04:00
Remove IPE enabled builds from CI

We don't need to explicitly specify the +ipe transformer to test IPE data
since there are tests which manually enable IPE information. This commit does
leave zstd IPE data compression enabled on the debian CI jobs.

- - - - -
982bef3a by Krzysztof Gogolewski at 2023-06-01T04:53:49-04:00
Fix build with 9.2

GHC.Tc.Zonk.Type uses an equality constraint.
ghc.nix currently provides 9.2.

- - - - -
1c96bc3d by Krzysztof Gogolewski at 2023-06-01T10:56:11-04:00
Output Lint errors to stderr instead of stdout

This is a continuation of 7b095b99, which fixed warnings but not errors.

Refs #13342

- - - - -
8e81f140 by sheaf at 2023-06-01T10:56:51-04:00
Refactor lookupExactOrOrig & friends

This refactors the panoply of renamer lookup functions relating to
lookupExactOrOrig to more graciously handle Exact and Orig names.

In particular, we avoid the situation in which we would add Exact/Orig
GREs to the tcg_used_gres field, which could cause a panic in bestImport
like in #23240.

Fixes #23428

- - - - -
5d415bfd by Krzysztof Gogolewski at 2023-06-01T10:57:31-04:00
Use the one-shot trick for UM and RewriteM functors

As described in Note [The one-shot state monad trick],
we shouldn't use derived Functor instances for monads using
one-shot. This was done for most of them, but UM and RewriteM
were missed.

- - - - -
2c38551e by Krzysztof Gogolewski at 2023-06-01T10:58:08-04:00
Fix testsuite skipping Lint

setTestOpts() is used to modify the test options for an entire .T file,
rather than a single test.
If there was a test using collect_compiler_stats, all of the tests
in the same file had lint disabled.

Fixes #21247

- - - - -
00a1e50b by Krzysztof Gogolewski at 2023-06-01T10:58:44-04:00
Add testcases for already fixed #16432

They were fixed by 40c7daed0.

Fixes #16432

- - - - -
f6e060cc by Krzysztof Gogolewski at 2023-06-02T09:07:25-04:00
cleanup: Remove unused field from SelfBoot

It is no longer needed since Note [Extra dependencies from .hs-boot files]
was deleted in 6998772043.

I've also added tildes to Note headers, otherwise they're not detected
by the linter.

- - - - -
82eacab6 by sheaf at 2023-06-02T09:08:01-04:00
Delete GHC.Tc.Utils.Zonk

This module was split up into GHC.Tc.Zonk.Type and GHC.Tc.Zonk.TcType
in commit f62d8195, but I forgot to delete the original module
- - - - -
4a4eb761 by Ben Gamari at 2023-06-02T23:53:21-04:00
base: Add build-order import of GHC.Types in GHC.IO.Handle.Types

For reasons similar to those described in Note [Depend on
GHC.Num.Integer].

Fixes #23411.

- - - - -
f53ac0ae by Sylvain Henry at 2023-06-02T23:54:01-04:00
JS: fix and enhance non-minimized code generation (#22455)

Flag -ddisable-js-minimizer was producing invalid code. Fix that and
also a few other things to generate nicer JS code for debugging.

The added test checks that we don't regress when using the flag.

- - - - -
f7744e8e by Andrey Mokhov at 2023-06-03T16:49:44-04:00
[hadrian] Fix multiline synopsis rendering

- - - - -
b2c745db by Bodigrim at 2023-06-03T16:50:23-04:00
Elaborate on performance properties of Data.List.++

- - - - -
7cd8a61e by Matthew Pickering at 2023-06-05T11:46:23+01:00
Big TcLclEnv and CtLoc refactoring

The overall goal of this refactoring is to reduce the dependency
footprint of the parser and syntax tree. Good reasons include:

- Better module graph parallelisability
- Make it easier to migrate error messages without introducing module loops
- Philosophically, there's not reason for the AST to depend on half the
  compiler.

One of the key edges which added this dependency was

> GHC.Hs.Expr -> GHC.Tc.Types (TcLclEnv)

As this in turn depending on TcM which depends on HscEnv and so on.

Therefore the goal of this patch is to move `TcLclEnv` out of
`GHC.Tc.Types` so that `GHC.Hs.Expr` can import TcLclEnv without
incurring a huge dependency chain.

The changes in this patch are:

* Move TcLclEnv from GHC.Tc.Types to GHC.Tc.Types.LclEnv
* Create new smaller modules for the types used in TcLclEnv
  New Modules:
  - GHC.Tc.Types.ErrCtxt
  - GHC.Tc.Types.BasicTypes
  - GHC.Tc.Types.TH
  - GHC.Tc.Types.LclEnv
  - GHC.Tc.Types.CtLocEnv
  - GHC.Tc.Errors.Types.PromotionErr

  Removed Boot File:
  - {-# SOURCE #-} GHC.Tc.Types

* Introduce TcLclCtxt, the part of the TcLclEnv which doesn't
  participate in restoreLclEnv.

* Replace TcLclEnv in CtLoc with specific CtLocEnv which is defined in
  GHC.Tc.Types.CtLocEnv. Use CtLocEnv in Implic and CtLoc to record the
  location of the implication and constraint.

By splitting up TcLclEnv from GHC.Tc.Types we allow GHC.Hs.Expr to no
longer depend on the TcM monad and all that entails.

Fixes #23389 #23409

- - - - -
3d8d39d1 by Matthew Pickering at 2023-06-05T11:46:23+01:00
Remove dependency of GHC.Tc.Utils.TcType on GHC.Driver.Session

This removes the usage of DynFlags from Tc.Utils.TcType  so that it no
longer depends on GHC.Driver.Session. In general we don't want anything
which is a dependency of Language.Haskell.Syntax to depend on
GHC.Driver.Session and removing this edge gets us closer to that goal.

- - - - -
18db5ada by Matthew Pickering at 2023-06-05T11:46:23+01:00
Move isIrrefutableHsPat to GHC.Rename.Utils and rename to isIrrefutableHsPatRn

This removes edge from GHC.Hs.Pat to GHC.Driver.Session, which makes
Language.Haskell.Syntax end up depending on GHC.Driver.Session.

- - - - -
12919dd5 by Matthew Pickering at 2023-06-05T11:46:23+01:00
Remove dependency of GHC.Tc.Types.Constraint on GHC.Driver.Session

- - - - -
eb852371 by Matthew Pickering at 2023-06-05T11:46:24+01:00
hole fit plugins: Split definition into own module

The hole fit plugins are defined in terms of TcM, a type we want to
avoid depending on from `GHC.Tc.Errors.Types`. By moving it into its own
module we can remove this dependency. It also simplifies the necessary
boot file.

- - - - -
9e5246d7 by Matthew Pickering at 2023-06-05T11:46:24+01:00
Move GHC.Core.Opt.CallerCC Types into separate module

This allows `GHC.Driver.DynFlags` to depend on these types without
depending on CoreM and hence the entire simplifier pipeline.

We can also remove a hs-boot file with this change.

- - - - -
52d6a7d7 by Matthew Pickering at 2023-06-05T11:46:24+01:00
Remove unecessary SOURCE import

- - - - -
698d160c by Matthew Pickering at 2023-06-05T11:46:24+01:00
testsuite: Accept new output for CountDepsAst and CountDepsParser tests

These are in a separate commit as the improvement to these tests is the
cumulative effect of the previous set of patches rather than just the
responsibility of the last one in the patchset.

- - - - -
58ccf02e by sheaf at 2023-06-05T16:00:47-04:00
TTG: only allow VarBind at GhcTc

The VarBind constructor of HsBind is only used at the GhcTc stage.
This commit makes that explicit by setting the extension field of
VarBind to be DataConCantHappen at all other stages.

This allows us to delete a dead code path in GHC.HsToCore.Quote.rep_bind,
and remove some panics.

- - - - -
54b83253 by Matthew Craven at 2023-06-06T12:59:25-04:00
Generate Addr# access ops programmatically

The existing utils/genprimopcode/gen_bytearray_ops.py was
relocated and extended for this purpose.  Additionally, hadrian
now knows about this script and uses it when generating primops.txt

- - - - -
ecadbc7e by Matthew Pickering at 2023-06-06T13:00:01-04:00
ghcup-metadata: Only add Nightly tag when replacing LatestNightly

Previously we were always adding the Nightly tag, but this led to all
the previous builds getting an increasing number of nightly tags over
time. Now we just add it once, when we remove the LatestNightly tag.

- - - - -
4aea0a72 by Vladislav Zavialov at 2023-06-07T12:06:46+02:00
Invisible binders in type declarations (#22560)

This patch implements @k-binders introduced in GHC Proposal #425
and guarded behind the TypeAbstractions extension:

	type D :: forall k j. k -> j -> Type
	data D @k @j a b = ...
	       ^^ ^^

To represent the new syntax, we modify LHsQTyVars as follows:

	-  hsq_explicit :: [LHsTyVarBndr () pass]
	+  hsq_explicit :: [LHsTyVarBndr (HsBndrVis pass) pass]

HsBndrVis is a new data type that records the distinction between
type variable binders written with and without the @ sign:

	data HsBndrVis pass
	  = HsBndrRequired
	  | HsBndrInvisible (LHsToken "@" pass)

The rest of the patch updates GHC, template-haskell, and haddock
to handle the new syntax.

Parser:
  The PsErrUnexpectedTypeAppInDecl error message is removed.
  The syntax it used to reject is now permitted.

Renamer:
  The @ sign does not affect the scope of a binder, so the changes to
  the renamer are minimal.  See rnLHsTyVarBndrVisFlag.

Type checker:
  There are three code paths that were updated to deal with the newly
  introduced invisible type variable binders:

    1. checking SAKS: see kcCheckDeclHeader_sig, matchUpSigWithDecl
    2. checking CUSK: see kcCheckDeclHeader_cusk
    3. inference: see kcInferDeclHeader, rejectInvisibleBinders

  Helper functions bindExplicitTKBndrs_Q_Skol and bindExplicitTKBndrs_Q_Tv
  are generalized to work with HsBndrVis.

Updates the haddock submodule.

Metric Increase:
    MultiLayerModulesTH_OneShot

Co-authored-by: Simon Peyton Jones <simon.peytonjones at gmail.com>

- - - - -
b7600997 by Josh Meredith at 2023-06-07T13:10:21-04:00
JS: clean up FFI 'fat arrow' calls in base:System.Posix.Internals (#23481)

- - - - -
e5d3940d by Sebastian Graf at 2023-06-07T18:01:28-04:00
Update CODEOWNERS
- - - - -
960ef111 by Matthew Pickering at 2023-06-07T18:02:04-04:00
Revert "Remove IPE enabled builds from CI"

This reverts commit 41b41577c8a28c236fa37e8f73aa1c6dc368d951.

- - - - -
bad1c8cc by Matthew Pickering at 2023-06-07T18:02:04-04:00
Revert "Update user's guide and release notes, small fixes"

This reverts commit 3ded9a1cd22f9083f31bc2f37ee1b37f9d25dab7.

- - - - -
12726d90 by Matthew Pickering at 2023-06-07T18:02:04-04:00
Revert "Add IPE-enabled builds to CI"

This reverts commit 09d93bd0305b0f73422ce7edb67168c71d32c15f.

- - - - -
dbdd989d by Matthew Pickering at 2023-06-07T18:02:04-04:00
Revert "Add optional dependencies to ./configure output"

This reverts commit a00488665cd890a26a5564a64ba23ff12c9bec58.

- - - - -
240483af by Matthew Pickering at 2023-06-07T18:02:04-04:00
Revert "Fix IPE data decompression buffer allocation"

This reverts commit 0e85099b9316ee24565084d5586bb7290669b43a.

- - - - -
9b8c7dd8 by Matthew Pickering at 2023-06-07T18:02:04-04:00
Revert "Fix byte order of IPE data, fix IPE tests"

This reverts commit 7872e2b6f08ea40d19a251c4822a384d0b397327.

- - - - -
3364379b by Matthew Pickering at 2023-06-07T18:02:04-04:00
Revert "Add note describing IPE data compression"

This reverts commit 69563c97396b8fde91678fae7d2feafb7ab9a8b0.

- - - - -
fda30670 by Matthew Pickering at 2023-06-07T18:02:04-04:00
Revert "Fix libzstd detection in configure and RTS"

This reverts commit 5aef5658ad5fb96bac7719710e0ea008bf7b62e0.

- - - - -
1cbcda9a by Matthew Pickering at 2023-06-07T18:02:04-04:00
Revert "IPE data compression"

This reverts commit b7a640acf7adc2880e5600d69bcf2918fee85553.

- - - - -
fb5e99aa by Matthew Pickering at 2023-06-07T18:02:04-04:00
Revert "Add IPE compression to configure"

This reverts commit 5d1f2411f4becea8650d12d168e989241edee186.

- - - - -
2cdcb3a5 by Matthew Pickering at 2023-06-07T18:02:04-04:00
Revert "Restructure IPE buffer layout"

This reverts commit f3556d6cefd3d923b36bfcda0c8185abb1d11a91.

- - - - -
2b0c9f5e by Simon Peyton Jones at 2023-06-08T07:52:34+00:00
Don't report redundant Givens from quantified constraints

This fixes #23323

See (RC4) in Note [Tracking redundant constraints]

- - - - -
567b32e1 by David Binder at 2023-06-08T18:41:29-04:00
Update the outdated instructions in HACKING.md on how to compile GHC

- - - - -
e459f77e by Ben Gamari at 2023-06-11T07:00:01-04:00
rts: Tighten up invariants of PACK

- - - - -
54ea1e2d by Ben Gamari at 2023-06-11T07:03:30-04:00
StgToByteCode: Don't assume that data con workers are nullary

Previously StgToByteCode assumed that all data-con workers were of a
nullary representation. This is not a valid assumption, as seen
in #23210, where an unsaturated application of a unary data
constructor's worker resulted in invalid bytecode. Sadly, I have not yet
been able to reduce a minimal testcase for this.

Fixes #23210.

- - - - -
7c44b201 by Ben Gamari at 2023-06-11T07:03:30-04:00
StgToByteCode: Fix handling of Addr# literals

Previously we assumed that all unlifted types were Addr#.

- - - - -


30 changed files:

- .gitignore
- .gitlab-ci.yml
- .gitlab/rel_eng/mk-ghcup-metadata/README.mkd
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- CODEOWNERS
- HACKING.md
- compiler/GHC.hs
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/Types/Prim.hs
- − compiler/GHC/Builtin/bytearray-ops.txt.pp
- utils/genprimopcode/gen_bytearray_ops.py → compiler/GHC/Builtin/gen_bytearray_addr_access_ops.py
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/CmmToAsm/AArch64/Ppr.hs
- compiler/GHC/CmmToAsm/Dwarf.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/CmmToLlvm.hs
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/LateCC.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/CallerCC.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/204c825fdc937c99371c330c6d56d2cf69fa7e42...7c44b201ff859a17058d6e4efacfd0f760a993af

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/204c825fdc937c99371c330c6d56d2cf69fa7e42...7c44b201ff859a17058d6e4efacfd0f760a993af
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/20230611/d6ce2b52/attachment-0001.html>


More information about the ghc-commits mailing list