[Git][ghc/ghc][wip/exception-context] 144 commits: Don't generate datacon wrappers for `type data` declarations

Ben Gamari (@bgamari) gitlab at gitlab.haskell.org
Thu Mar 16 12:39:52 UTC 2023



Ben Gamari pushed to branch wip/exception-context at Glasgow Haskell Compiler / GHC


Commits:
4327d635 by Ryan Scott at 2023-02-20T20:44:34-05:00
Don't generate datacon wrappers for `type data` declarations

Data constructor wrappers only make sense for _value_-level data constructors,
but data constructors for `type data` declarations only exist at the _type_
level. This patch does the following:

* The criteria in `GHC.Types.Id.Make.mkDataConRep` for whether a data
  constructor receives a wrapper now consider whether or not its parent data
  type was declared with `type data`, omitting a wrapper if this is the case.

* Now that `type data` data constructors no longer receive wrappers, there is a
  spot of code in `refineDefaultAlt` that panics when it encounters a value
  headed by a `type data` type constructor. I've fixed this with a special case
  in `refineDefaultAlt` and expanded `Note [Refine DEFAULT case alternatives]`
  to explain why we do this.

Fixes #22948.

- - - - -
96dc58b9 by Ryan Scott at 2023-02-20T20:44:35-05:00
Treat type data declarations as empty when checking pattern-matching coverage

The data constructors for a `type data` declaration don't exist at the value
level, so we don't want GHC to warn users to match on them.

Fixes #22964.

- - - - -
ff8e99f6 by Ryan Scott at 2023-02-20T20:44:35-05:00
Disallow `tagToEnum#` on `type data` types

We don't want to allow users to conjure up values of a `type data` type using
`tagToEnum#`, as these simply don't exist at the value level.

- - - - -
8e765aff by Bodigrim at 2023-02-21T12:03:24-05:00
Bump submodule text to 2.0.2

- - - - -
172ff88f by Georgi Lyubenov at 2023-02-21T18:35:56-05:00
GHC proposal 496 - Nullary record wildcards

This patch implements GHC proposal 496, which allows record wildcards
to be used for nullary constructors, e.g.

  data A = MkA1 | MkA2 { fld1 :: Int }
  f :: A -> Int
  f (MkA1 {..}) = 0
  f (MkA2 {..}) = fld1

To achieve this, we add arity information to the record field
environment, so that we can accept a constructor which has no fields
while continuing to reject non-record constructors with more than 1
field. See Note [Nullary constructors and empty record wildcards],
as well as the more general overview in Note [Local constructor info in the renamer],
both in the newly introduced GHC.Types.ConInfo module.

Fixes #22161

- - - - -
f70a0239 by sheaf at 2023-02-21T18:36:35-05:00
ghc-prim: levity-polymorphic array equality ops

This patch changes the pointer-equality comparison operations in
GHC.Prim.PtrEq to work with arrays of unlifted values, e.g.

  sameArray# :: forall {l} (a :: TYPE (BoxedRep l)). Array# a -> Array# a -> Int#

Fixes #22976

- - - - -
9296660b by Andreas Klebinger at 2023-02-21T23:58:05-05:00
base: Correct @since annotation for FP<->Integral bit cast operations.

Fixes #22708

- - - - -
f11d9c27 by romes at 2023-02-21T23:58:42-05:00
fix: Update documentation links

Closes #23008

Additionally batches some fixes to pointers to the Note [Wired-in units],
and a typo in said note.

- - - - -
fb60339f by Bryan Richter at 2023-02-23T14:45:17+02:00
Propagate failure if unable to push notes

- - - - -
8e170f86 by Alexis King at 2023-02-23T16:59:22-05:00
rts: Fix `prompt#` when profiling is enabled

This commit also adds a new -Dk RTS option to the debug RTS to assist
debugging continuation captures. Currently, the printed information is
quite minimal, but more can be added in the future if it proves to be
useful when debugging future issues.

fixes #23001

- - - - -
e9e7a00d by sheaf at 2023-02-23T17:00:01-05:00
Explicit migration timeline for loopy SC solving

This patch updates the warning message introduced in commit
9fb4ca89bff9873e5f6a6849fa22a349c94deaae to specify an explicit
migration timeline: GHC will no longer support this constraint solving
mechanism starting from GHC 9.10.

Fixes #22912

- - - - -
4eb9c234 by Sylvain Henry at 2023-02-24T17:27:45-05:00
JS: make some arithmetic primops faster (#22835)

Don't use BigInt for wordAdd2, mulWord32, and timesInt32.

Co-authored-by: Matthew Craven <5086-clyring at users.noreply.gitlab.haskell.org>

- - - - -
92e76483 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump terminfo submodule to 0.4.1.6

- - - - -
f229db14 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump unix submodule to 2.8.1.0

- - - - -
47bd48c1 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump deepseq submodule to 1.4.8.1

- - - - -
d2012594 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump directory submodule to 1.3.8.1

- - - - -
df6f70d1 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump process submodule to v1.6.17.0

- - - - -
4c869e48 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump hsc2hs submodule to 0.68.8

- - - - -
81d96642 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump array submodule to 0.5.4.0

- - - - -
6361f771 by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump Cabal submodule to 3.9 pre-release

- - - - -
4085fb6c by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump filepath submodule to 1.4.100.1

- - - - -
2bfad50f by Ben Gamari at 2023-02-24T17:28:20-05:00
Bump haskeline submodule to 0.8.2.1

- - - - -
fdc89a8d by Ben Gamari at 2023-02-24T21:29:32-05:00
gitlab-ci: Run nix-build with -v0

This significantly cuts down on the amount of
noise in the job log.

Addresses #22861.
- - - - -
69fb0b13 by Aaron Allen at 2023-02-24T21:30:10-05:00
Fix ParallelListComp out of scope suggestion

This patch makes it so vars from one block of a parallel list
comprehension are not in scope in a subsequent block during type
checking. This was causing GHC to emit a faulty suggestion when an out
of scope variable shared the occ name of a var from a different block.

Fixes #22940

- - - - -
ece092d0 by Simon Peyton Jones at 2023-02-24T21:30:45-05:00
Fix shadowing bug in prepareAlts

As #23012 showed, GHC.Core.Opt.Simplify.Utils.prepareAlts was
using an OutType to construct an InAlt.  When shadowing is in play,
this is outright wrong.

See Note [Shadowing in prepareAlts].

- - - - -
7825fef9 by Sylvain Henry at 2023-02-24T21:31:25-05:00
JS: Store CI perf results (fix #22923)

- - - - -
b56025f4 by Gergő Érdi at 2023-02-27T13:34:22+00:00
Don't specialise incoherent instance applications

Using incoherent instances, there can be situations where two
occurrences of the same overloaded function at the same type use two
different instances (see #22448). For incoherently resolved instances,
we must mark them with `nospec` to avoid the specialiser rewriting one
to the other. This marking is done during the desugaring of the
`WpEvApp` wrapper.

Fixes #22448

Metric Increase:
    T15304

- - - - -
d0c7bbed by Tom Ellis at 2023-02-27T20:04:07-05:00
Fix SCC grouping example

- - - - -
f84a8cd4 by Bryan Richter at 2023-02-28T05:58:37-05:00
Mark setnumcapabilities001 fragile

- - - - -
29a04d6e by Bryan Richter at 2023-02-28T05:58:37-05:00
Allow nightly-x86_64-linux-deb10-validate+thread_sanitizer to fail

See #22520

- - - - -
9fa54572 by Cheng Shao at 2023-02-28T05:59:15-05:00
ghc-prim: fix hs_cmpxchg64 function prototype

hs_cmpxchg64 must return a StgWord64, otherwise incorrect runtime
results of 64-bit MO_Cmpxchg will appear in 32-bit unregisterised
builds, which go unnoticed at compile-time due to C implicit casting
in .hc files.

- - - - -
0c200ab7 by Simon Peyton Jones at 2023-02-28T11:10:31-05:00
Account for local rules in specImports

As #23024 showed, in GHC.Core.Opt.Specialise.specImports, we were
generating specialisations (a locally-define function) for imported
functions; and then generating specialisations for those
locally-defined functions.  The RULE for the latter should be
attached to the local Id, not put in the rules-for-imported-ids
set.

Fix is easy; similar to what happens in GHC.HsToCore.addExportFlagsAndRules

- - - - -
8b77f9bf by Sylvain Henry at 2023-02-28T11:11:21-05:00
JS: fix for overlap with copyMutableByteArray# (#23033)

The code wasn't taking into account some kind of overlap.

cgrun070 has been extended to test the missing case.

- - - - -
239202a2 by Sylvain Henry at 2023-02-28T11:12:03-05:00
Testsuite: replace some js_skip with req_cmm

req_cmm is more informative than js_skip

- - - - -
7192ef91 by Simon Peyton Jones at 2023-02-28T18:54:59-05:00
Take more care with unlifted bindings in the specialiser

As #22998 showed, we were floating an unlifted binding to top
level, which breaks a Core invariant.

The fix is easy, albeit a little bit conservative.  See
Note [Care with unlifted bindings] in GHC.Core.Opt.Specialise

- - - - -
bb500e2a by Simon Peyton Jones at 2023-02-28T18:55:35-05:00
Account for TYPE vs CONSTRAINT in mkSelCo

As #23018 showed, in mkRuntimeRepCo we need to account for coercions
between TYPE and COERCION.

See Note [mkRuntimeRepCo] in GHC.Core.Coercion.

- - - - -
79ffa170 by Ben Gamari at 2023-03-01T04:17:20-05:00
hadrian: Add dependency from lib/settings to mk/config.mk

In 81975ef375de07a0ea5a69596b2077d7f5959182 we attempted to fix #20253
by adding logic to the bindist Makefile to regenerate the `settings`
file from information gleaned by the bindist `configure` script.
However, this fix had no effect as `lib/settings` is shipped in the
binary distribution (to allow in-place use of the binary distribution).
As `lib/settings` already existed and its rule declared no dependencies,
`make` would fail to use the added rule to regenerate it.

Fix this by explicitly declaring a dependency from `lib/settings` on
`mk/config.mk`.

Fixes #22982.

- - - - -
a2a1a1c0 by Sebastian Graf at 2023-03-01T04:17:56-05:00
Revert the main payload of "Make `drop` and `dropWhile` fuse (#18964)"

This reverts the bits affecting fusion of `drop` and `dropWhile` of commit
0f7588b5df1fc7a58d8202761bf1501447e48914 and keeps just the small refactoring
unifying `flipSeqTake` and `flipSeqScanl'` into `flipSeq`.

It also adds a new test for #23021 (which was the reason for reverting) as
well as adds a clarifying comment to T18964.

Fixes #23021, unfixes #18964.

Metric Increase:
    T18964
Metric Decrease:
    T18964

- - - - -
cf118e2f by Simon Peyton Jones at 2023-03-01T04:18:33-05:00
Refine the test for naughty record selectors

The test for naughtiness in record selectors is surprisingly subtle.
See the revised Note [Naughty record selectors] in GHC.Tc.TyCl.Utils.

Fixes #23038.

- - - - -
86f240ca by romes at 2023-03-01T04:19:10-05:00
fix: Consider strictness annotation in rep_bind

Fixes #23036

- - - - -
1ed573a5 by Richard Eisenberg at 2023-03-02T22:42:06-05:00
Don't suppress *all* Wanteds

Code in GHC.Tc.Errors.reportWanteds suppresses a Wanted if its
rewriters have unfilled coercion holes; see
Note [Wanteds rewrite Wanteds] in GHC.Tc.Types.Constraint.

But if we thereby suppress *all* errors that's really confusing,
and as #22707 shows, GHC goes on without even realising that the
program is broken. Disaster.

This MR arranges to un-suppress them all if they all get suppressed.

Close #22707

- - - - -
8919f341 by Luite Stegeman at 2023-03-02T22:42:45-05:00
Check for platform support for JavaScript foreign imports

GHC was accepting `foreign import javascript` declarations
on non-JavaScript platforms. This adds a check so that these
are only supported on an platform that supports the JavaScript
calling convention.

Fixes #22774

- - - - -
db83f8bb by Ben Gamari at 2023-03-02T22:43:22-05:00
rts: Statically assert alignment of Capability

In #22965 we noticed that changes in the size of `Capability` can result
in unsound behavior due to the `align` pragma claiming an alignment
which we don't in practice observe. Avoid this by statically asserting
that the size is a multiple of the alignment.

- - - - -
5f7a4a6d by Ben Gamari at 2023-03-02T22:43:22-05:00
rts: Introduce stgMallocAlignedBytes

- - - - -
8a6f745d by Ben Gamari at 2023-03-02T22:43:22-05:00
rts: Correctly align Capability allocations

Previously we failed to tell the C allocator that `Capability`s needed
to be aligned, resulting in #22965.

Fixes #22965.
Fixes #22975.

- - - - -
5464c73f by Ben Gamari at 2023-03-02T22:43:22-05:00
rts: Drop no-alignment special case for Windows

For reasons that aren't clear, we were previously not giving Capability
the same favorable alignment on Windows that we provided on other
platforms. Fix this.

- - - - -
a86aae8b by Matthew Pickering at 2023-03-02T22:43:59-05:00
constant folding: Correct type of decodeDouble_Int64 rule

The first argument is Int64# unconditionally, so we better produce
something of that type. This fixes a core lint error found in the ad
package.

Fixes #23019

- - - - -
68dd64ff by Zubin Duggal at 2023-03-02T22:44:35-05:00
ncg/aarch64: Handle MULTILINE_COMMENT identically as COMMENTs

Commit 7566fd9de38c67360c090f828923d41587af519c with the fix for #22798 was
incomplete as it failed to handle MULTILINE_COMMENT pseudo-instructions, and
didn't completly fix the compiler panics when compiling with `-fregs-graph`.

Fixes #23002

- - - - -
2f97c861 by Simon Peyton Jones at 2023-03-02T22:45:11-05:00
Get the right in-scope set in etaBodyForJoinPoint

Fixes #23026

- - - - -
45af8482 by David Feuer at 2023-03-03T11:40:47-05:00
Export getSolo from Data.Tuple

Proposed in
[CLC proposal #113](https://github.com/haskell/core-libraries-committee/issues/113)
and
[approved by the CLC](https://github.com/haskell/core-libraries-committee/issues/113#issuecomment-1452452191)

- - - - -
0c694895 by David Feuer at 2023-03-03T11:40:47-05:00
Document getSolo

- - - - -
bd0536af by Simon Peyton Jones at 2023-03-03T11:41:23-05:00
More fixes for `type data` declarations

This MR fixes #23022 and #23023.  Specifically

* Beef up Note [Type data declarations] in GHC.Rename.Module,
  to make invariant (I1) explicit, and to name the several
  wrinkles.

  And add references to these specific wrinkles.

* Add a Lint check for invariant (I1) above.
  See GHC.Core.Lint.checkTypeDataConOcc

* Disable the `caseRules` for dataToTag# for `type data` values.
  See Wrinkle (W2c) in the Note above.  Fixes #23023.

* Refine the assertion in dataConRepArgTys, so that it does not
  complain about the absence of a wrapper for a `type data` constructor
  Fixes #23022.

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

- - - - -
858f34d5 by Oleg Grenrus at 2023-03-04T01:13:55+02:00
Add decideSymbol, decideChar, decideNat, decTypeRep, decT and hdecT

These all type-level equality decision procedures.

Implementes a CLC proposal https://github.com/haskell/core-libraries-committee/issues/98

- - - - -
bf43ba92 by Simon Peyton Jones at 2023-03-04T01:18:23-05:00
Add test for T22793

- - - - -
c6e1f3cd by Chris Wendt at 2023-03-04T03:35:18-07:00
Fix typo in docs referring to threadLabel

- - - - -
232cfc24 by Simon Peyton Jones at 2023-03-05T19:57:30-05:00
Add regression test for #22328

- - - - -
5ed77deb by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Enable response files for linker if supported

- - - - -
1e0f6c89 by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Synchronize `configure.ac` and `distrib/configure.ac.in`

- - - - -
70560952 by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Fix `hadrian/bindist/config.mk.in`

… as suggested by @bgamari

- - - - -
b042b125 by sheaf at 2023-03-06T17:06:50-05:00
Apply 1 suggestion(s) to 1 file(s)
- - - - -
674b6b81 by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Try to create somewhat portable `ld` command

I cannot figure out a good way to generate an `ld` command
that works on both Linux and macOS.  Normally you'd use something
like `AC_LINK_IFELSE` for this purpose (I think), but that won't
let us test response file support.

- - - - -
83b0177e by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Quote variables

… as suggested by @bgamari

- - - - -
845f404d by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Fix configure failure on alpine linux

- - - - -
c56a3ae6 by Gabriella Gonzalez at 2023-03-06T17:06:50-05:00
Small fixes to configure script

- - - - -
cad5c576 by Andrei Borzenkov at 2023-03-06T17:07:33-05:00
Convert diagnostics in GHC.Rename.Module to proper TcRnMessage (#20115)

I've turned almost all occurrences of TcRnUnknownMessage in GHC.Rename.Module
module into a proper TcRnMessage.
Instead, these TcRnMessage messages were introduced:
  TcRnIllegalInstanceHeadDecl
  TcRnUnexpectedStandaloneDerivingDecl
  TcRnUnusedVariableInRuleDecl
  TcRnUnexpectedStandaloneKindSig
  TcRnIllegalRuleLhs
  TcRnBadAssocRhs
  TcRnDuplicateRoleAnnot
  TcRnDuplicateKindSig
  TcRnIllegalDerivStrategy
  TcRnIllegalMultipleDerivClauses
  TcRnNoDerivStratSpecified
  TcRnStupidThetaInGadt
  TcRnBadImplicitSplice
  TcRnShadowedTyVarNameInFamResult
  TcRnIncorrectTyVarOnLhsOfInjCond
  TcRnUnknownTyVarsOnRhsOfInjCond

Was introduced one helper type:
  RuleLhsErrReason

- - - - -
c6432eac by Apoorv Ingle at 2023-03-06T23:26:12+00:00
Constraint simplification loop now depends on `ExpansionFuel`
instead of a boolean flag for `CDictCan.cc_pend_sc`.
Pending givens get a fuel of 3 while Wanted and quantified constraints get a fuel of 1.
This helps pending given constraints to keep up with pending wanted constraints in case of
`UndecidableSuperClasses` and superclass expansions while simplifying the infered type.

Adds 3 dynamic flags for controlling the fuels for each type of constraints
`-fgivens-expansion-fuel` for givens `-fwanteds-expansion-fuel` for wanteds and `-fqcs-expansion-fuel` for quantified constraints

Fixes #21909
Added Tests T21909, T21909b
Added Note [Expanding Recursive Superclasses and ExpansionFuel]

- - - - -
a5afc8ab by Bodigrim at 2023-03-06T22:51:01-05:00
Documentation: describe laziness of several function from Data.List

- - - - -
fa559c28 by Ollie Charles at 2023-03-07T20:56:21+00:00
Add `Data.Functor.unzip`

This function is currently present in `Data.List.NonEmpty`, but `Data.Functor`
is a better home for it. This change was discussed and approved by the CLC
at https://github.com/haskell/core-libraries-committee/issues/88.

- - - - -
2aa07708 by MorrowM at 2023-03-07T21:22:22-05:00
Fix documentation for traceWith and friends

- - - - -
f3ff7cb1 by David Binder at 2023-03-08T01:24:17-05:00
Remove utils/hpc subdirectory and its contents

- - - - -
cf98e286 by David Binder at 2023-03-08T01:24:17-05:00
Add git submodule for utils/hpc

- - - - -
605fbbb2 by David Binder at 2023-03-08T01:24:18-05:00
Update commit for utils/hpc git submodule

- - - - -
606793d4 by David Binder at 2023-03-08T01:24:18-05:00
Update commit for utils/hpc git submodule

- - - - -
4158722a by Sylvain Henry at 2023-03-08T01:24:58-05:00
linker: fix linking with aligned sections (#23066)

Take section alignment into account instead of assuming 16 bytes (which
is wrong when the section requires 32 bytes, cf #23066).

- - - - -
1e0d8fdb by Greg Steuck at 2023-03-08T08:59:05-05:00
Change hostSupportsRPaths to report False on OpenBSD

OpenBSD does support -rpath but ghc build process relies on some
related features that don't work there. See ghc/ghc#23011

- - - - -
bed3a292 by Alexis King at 2023-03-08T08:59:53-05:00
bytecode: Fix bitmaps for BCOs used to tag tuples and prim call args

fixes #23068

- - - - -
321d46d9 by Ben Gamari at 2023-03-08T15:02:30-05:00
rts: Drop redundant prototype

- - - - -
abb6070f by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Fix style

- - - - -
be278901 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Deduplicate assertion

- - - - -
b9034639 by Ben Gamari at 2023-03-08T15:02:30-05:00
rts: Fix type issues in Sparks.h

Adds explicit casts to satisfy a C++ compiler.

- - - - -
da7b2b94 by Ben Gamari at 2023-03-08T15:02:30-05:00
rts: Use release ordering when storing thread labels

Since this makes the ByteArray# visible from other cores.

- - - - -
5b7f6576 by Ben Gamari at 2023-03-08T15:02:30-05:00
rts/BlockAlloc: Allow disabling of internal assertions

These can be quite expensive and it is sometimes useful to compile a
DEBUG RTS without them.

- - - - -
6283144f by Ben Gamari at 2023-03-08T15:02:30-05:00
rts/Sanity: Mark pinned_object_blocks

- - - - -
9b528404 by Ben Gamari at 2023-03-08T15:02:30-05:00
rts/Sanity: Look at nonmoving saved_filled lists

- - - - -
0edc5438 by Ben Gamari at 2023-03-08T15:02:30-05:00
Evac: Squash data race in eval_selector_chain

- - - - -
7eab831a by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Clarify implementation

This makes the intent of this implementation a bit clearer.

- - - - -
532262b9 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Clarify comment

- - - - -
bd9cd84b by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Add missing no-op in busy-wait loop

- - - - -
c4e6bfc8 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Don't push empty arrays to update remembered set

Previously the write barrier of resizeSmallArray# incorrectly handled
resizing of zero-sized arrays, pushing an invalid pointer to the update
remembered set.

Fixes #22931.

- - - - -
92227b60 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Fix handling of weak pointers

This fixes an interaction between aging and weak pointer handling which
prevented the finalization of some weak pointers. In particular, weak
pointers could have their keys incorrectly marked by the preparatory
collector, preventing their finalization by the subsequent concurrent
collection.

While in the area, we also significantly improve the assertions
regarding weak pointers.

Fixes #22327.

- - - - -
ba7e7972 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Sanity check nonmoving large objects and compacts

- - - - -
71b038a1 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Sanity check mutable list

Assert that entries in the nonmoving generation's generational
remembered set (a.k.a. mutable list) live in nonmoving generation.

- - - - -
99d144d5 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Don't show occupancy if we didn't collect live words

- - - - -
81d6cc55 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Fix tracking of FILLED_SWEEPING segments

Previously we only updated the state of the segment at the head of each
allocator's filled list.

- - - - -
58e53bc4 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Assert state of swept segments

- - - - -
2db92e01 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Handle new closures in nonmovingIsNowAlive

We must conservatively assume that new closures are reachable since we
are not guaranteed to mark such blocks.

- - - - -
e4c3249f by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Don't clobber update rem sets of old capabilities

Previously `storageAddCapabilities` (called by `setNumCapabilities`) would
clobber the update remembered sets of existing capabilities when
increasing the capability count. Fix this by only initializing the
update remembered sets of the newly-created capabilities.

Fixes #22927.

- - - - -
1b069671 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Add missing write barriers in selector optimisation

This fixes the selector optimisation, adding a few write barriers which
are necessary for soundness. See the inline comments for details.

Fixes #22930.

- - - - -
d4032690 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Post-sweep sanity checking

- - - - -
0baa8752 by Ben Gamari at 2023-03-08T15:02:30-05:00
nonmoving: Avoid n_caps race

- - - - -
5d3232ba by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Don't push if nonmoving collector isn't enabled

- - - - -
0a7eb0aa by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Be more paranoid in segment tracking

Previously we left various segment link pointers dangling. None of this
wrong per se, but it did make it harder than necessary to debug.

- - - - -
7c817c0a by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Sync-phase mark budgeting

Here we significantly improve the bound on sync phase pause times by
imposing a limit on the amount of work that we can perform during the
sync. If we find that we have exceeded our marking budget then we allow
the mutators to resume, return to concurrent marking, and try
synchronizing again later.

Fixes #22929.

- - - - -
ce22a3e2 by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Allow pinned gen0 objects to be WEAK keys

- - - - -
78746906 by Ben Gamari at 2023-03-08T15:02:31-05:00
rts: Reenable assertion

- - - - -
b500867a by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Move current segment array into Capability

The current segments are conceptually owned by the mutator, not the
collector. Consequently, it was quite tricky to prove that the mutator
would not race with the collect due to this shared state. It turns out
that such races are possible: when resizing the current segment array
we may concurrently try to take a heap census. This will attempt to walk
the current segment array, causing a data race.

Fix this by moving the current segment array into `Capability`, where it
belongs.

Fixes #22926.

- - - - -
56e669c1 by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Fix Note references

Some references to Note [Deadlock detection under the non-moving
collector] were missing an article.

- - - - -
4a7650d7 by Ben Gamari at 2023-03-08T15:02:31-05:00
rts/Sanity: Fix block count assertion with non-moving collector

The nonmoving collector does not use `oldest_gen->blocks` to track its
block list. However, it nevertheless updates `oldest_gen->n_blocks` to
ensure that its size is accounted for by the storage manager.
Consequently, we must not attempt to assert consistency between the two.

- - - - -
96a5aaed by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Don't call prepareUnloadCheck

When the nonmoving GC is in use we do not call `checkUnload` (since we
don't unload code) and therefore should not call `prepareUnloadCheck`,
lest we run into assertions.

- - - - -
6c6674ca by Ben Gamari at 2023-03-08T15:02:31-05:00
rts: Encapsulate block allocator spinlock

This makes it a bit easier to add instrumentation on this spinlock
while debugging.

- - - - -
e84f7167 by Ben Gamari at 2023-03-08T15:02:31-05:00
testsuite: Skip some tests when sanity checking is enabled

- - - - -
3ae0f368 by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Fix unregisterised build

- - - - -
4eb9d06b by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Ensure that sanity checker accounts for saved_filled segments

- - - - -
f0cf384d by Ben Gamari at 2023-03-08T15:02:31-05:00
hadrian: Add +boot_nonmoving_gc flavour transformer

For using GHC bootstrapping to validate the non-moving GC.

- - - - -
581e58ac by Ben Gamari at 2023-03-08T15:02:31-05:00
gitlab-ci: Add job bootstrapping with nonmoving GC

- - - - -
487a8b58 by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Move allocator into new source file

- - - - -
8f374139 by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Split out nonmovingAllocateGC

- - - - -
662b6166 by Ben Gamari at 2023-03-08T15:02:31-05:00
testsuite: Only run T22795* in the normal way

It doesn't make sense to run these in multiple ways as they merely test
whether `-threaded`/`-single-threaded` flags.

- - - - -
0af21dfa by Ben Gamari at 2023-03-08T15:02:31-05:00
rts: Rename clear_segment(_free_blocks)?

To reflect the fact that these are to do with the nonmoving collector,
now since they are exposed no longer static.

- - - - -
7bcb192b by Ben Gamari at 2023-03-08T15:02:31-05:00
rts: Fix incorrect STATIC_INLINE

This should be INLINE_HEADER lest we get unused declaration warnings.

- - - - -
f1fd3ffb by Ben Gamari at 2023-03-08T15:02:31-05:00
testsuite: Mark ffi023 as broken due to #23089

- - - - -
a57f12b3 by Ben Gamari at 2023-03-08T15:02:31-05:00
testsuite: Skip T7160 in the nonmoving way

Finalization order is different under the nonmoving collector.

- - - - -
f6f12a36 by Ben Gamari at 2023-03-08T15:02:31-05:00
rts: Capture GC configuration in a struct

The number of distinct arguments passed to GarbageCollect was getting a
bit out of hand.

- - - - -
ba73a807 by Ben Gamari at 2023-03-08T15:02:31-05:00
nonmoving: Non-concurrent collection

- - - - -
7c813d06 by Alexis King at 2023-03-08T15:03:10-05:00
hadrian: Fix flavour compiler stage options off-by-one error

!9193 pointed out that ghcDebugAssertions was supposed to be a predicate
on the stage of the built compiler, but in practice it was a predicate
on the stage of the compiler used to build. Unfortunately, while it
fixed that issue for ghcDebugAssertions, it documented every other
similar option as behaving the same way when in fact they all used the
old behavior.

The new behavior of ghcDebugAssertions seems more intuitive, so this
commit changes the interpretation of every other option to match. It
also improves the enableProfiledGhc and debugGhc flavour transformers by
making them more selective about which stages in which they build
additional library/RTS ways.

- - - - -
f97c7f6d by Luite Stegeman at 2023-03-09T09:52:09-05:00
Delete created temporary subdirectories at end of session.

This patch adds temporary subdirectories to the list of
paths do clean up at the end of the GHC session. This
fixes warnings about non-empty temporary directories.

Fixes #22952

- - - - -
9ea719f2 by Apoorv Ingle at 2023-03-09T09:52:45-05:00
Fixes #19627.

Previously the solver failed with an unhelpful "solver reached too may iterations" error.
With the fix for #21909 in place we no longer have the possibility of generating such an error if we have `-fconstraint-solver-iteration` > `-fgivens-fuel > `-fwanteds-fuel`. This is true by default, and the said fix also gives programmers a knob to control how hard the solver should try before giving up.

This commit adds:
* Reference to ticket #19627 in the Note [Expanding Recursive Superclasses and ExpansionFuel]
* Test `typecheck/should_fail/T19627.hs` for regression purposes

- - - - -
ec2d93eb by Sebastian Graf at 2023-03-10T10:18:54-05:00
DmdAnal: Fix a panic on OPAQUE and trivial/PAP RHS (#22997)

We should not panic in `add_demands` (now `set_lam_dmds`), because that code
path is legimitely taken for OPAQUE PAP bindings, as in T22997.

Fixes #22997.

- - - - -
5b4628ae by Sylvain Henry at 2023-03-10T10:19:34-05:00
JS: remove dead code for old integer-gmp

- - - - -
bab23279 by Josh Meredith at 2023-03-10T23:24:49-05:00
JS: Fix implementation of MK_JSVAL

- - - - -
ec263a59 by Sebastian Graf at 2023-03-10T23:25:25-05:00
Simplify: Move `wantEtaExpansion` before expensive `do_eta_expand` check

There is no need to run arity analysis and what not if we are not in a
Simplifier phase that eta-expands or if we don't want to eta-expand the
expression in the first place.

Purely a refactoring with the goal of improving compiler perf.

- - - - -
047e9d4f by Josh Meredith at 2023-03-13T03:56:03+00:00
JS: fix implementation of forceBool to use JS backend syntax

- - - - -
559a4804 by Sebastian Graf at 2023-03-13T07:31:23-04:00
Simplifier: `countValArgs` should not count Type args (#23102)

I observed miscompilations while working on !10088 caused by this.

Fixes #23102.

Metric Decrease:
    T10421

- - - - -
31a48a6b by Ben Gamari at 2023-03-15T22:58:49-04:00
compiler/tc: Small optimisation of evCallStack

Don't lookupIds unless we actually need them.

- - - - -
47fc6ca6 by Ben Gamari at 2023-03-15T22:58:56-04:00
compiler/tc: Use toException instead of SomeException

- - - - -
1974d343 by Ben Gamari at 2023-03-15T22:59:00-04:00
base: Factor out errorBelch

This was useful when debugging

- - - - -
b9c9c031 by Ben Gamari at 2023-03-15T22:59:00-04:00
base: Clean up imports of GHC.ExecutionStack

- - - - -
f3d2cb5e by Ben Gamari at 2023-03-15T22:59:00-04:00
base: Clean up imports of GHC.Stack.CloneStack

- - - - -
1507bcf6 by Ben Gamari at 2023-03-15T22:59:00-04:00
base: Move prettyCallStack to GHC.Stack

- - - - -
9ad34238 by Ben Gamari at 2023-03-15T22:59:00-04:00
base: Move PrimMVar to GHC.MVar

- - - - -
e94fbc3d by Ben Gamari at 2023-03-15T22:59:00-04:00
base: Use displayException in top-level exception handler

Happily this also allows us to eliminate a special case for Deadlock
exceptions.

- - - - -
8e8676f1 by Ben Gamari at 2023-03-16T08:39:40-04:00
base: Introduce exception context

- - - - -
47c5db57 by Ben Gamari at 2023-03-16T08:39:40-04:00
Drop redundant import

- - - - -
c39cf782 by Ben Gamari at 2023-03-16T08:39:46-04:00
compiler: Default and warn ExceptionContext constraints

- - - - -


30 changed files:

- .gitlab/ci.sh
- .gitlab/gen_ci.hs
- .gitlab/jobs.yaml
- .gitlab/test-metrics.sh
- .gitmodules
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/ByteCode/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Class.hs
- compiler/GHC/Core/Coercion.hs
- compiler/GHC/Core/Coercion/Opt.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/InstEnv.hs
- compiler/GHC/Core/Lint.hs
- compiler/GHC/Core/Opt/Arity.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/Core/Opt/DmdAnal.hs
- compiler/GHC/Core/Opt/Simplify/Iteration.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/Specialise.hs
- compiler/GHC/Core/Predicate.hs
- compiler/GHC/Core/Rules.hs
- compiler/GHC/Core/Type.hs
- compiler/GHC/Core/Utils.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/HsToCore.hs
- compiler/GHC/HsToCore/Arrows.hs
- compiler/GHC/HsToCore/Binds.hs
- compiler/GHC/HsToCore/Binds.hs-boot


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c563563f247196096414023d36f9fdf9a5d60ea1...c39cf7827eb4f96ce27efa784440f19514abc919

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/c563563f247196096414023d36f9fdf9a5d60ea1...c39cf7827eb4f96ce27efa784440f19514abc919
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/20230316/183e4a48/attachment-0001.html>


More information about the ghc-commits mailing list