[Git][ghc/ghc][wip/T22404] 721 commits: Improve GHC.Tc.Gen.App.tcInstFun
Simon Peyton Jones (@simonpj)
gitlab at gitlab.haskell.org
Wed Jul 5 21:45:53 UTC 2023
Simon Peyton Jones pushed to branch wip/T22404 at Glasgow Haskell Compiler / GHC
Commits:
7080a93f by Simon Peyton Jones at 2023-02-20T12:06:32+01:00
Improve GHC.Tc.Gen.App.tcInstFun
It wasn't behaving right when inst_final=False, and the
function had no type variables
f :: Foo => Int
Rather a corner case, but we might as well do it right.
Fixes #22908
Unexpectedly, three test cases (all using :type in GHCi) got
slightly better output as a result:
T17403, T14796, T12447
- - - - -
2592ab69 by Cheng Shao at 2023-02-20T10:35:30-05:00
compiler: fix cost centre profiling breakage in wasm NCG due to incorrect register mapping
The wasm NCG used to map CCCS to a wasm global, based on the
observation that CCCS is a transient register that's already handled
by thread state load/store logic, so it doesn't need to be backed by
the rCCCS field in the register table.
Unfortunately, this is wrong, since even when Cmm execution hasn't
yielded back to the scheduler, the Cmm code may call enterFunCCS,
which does use rCCCS.
This breaks cost centre profiling in a subtle way, resulting in
inaccurate stack traces in some test cases. The fix is simple though:
just remove the CCCS mapping.
- - - - -
26243de1 by Alexis King at 2023-02-20T15:27:17-05:00
Handle top-level Addr# literals in the bytecode compiler
Fixes #22376.
- - - - -
0196cc2b by romes at 2023-02-20T15:27:52-05:00
fix: Explicitly flush stdout on plugin
Because of #20791, the plugins tests often fail. This is a temporary
fix to stop the tests from failing due to unflushed outputs on windows
and the explicit flush should be removed when #20791 is fixed.
- - - - -
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
- - - - -
536d1f90 by Matthew Pickering at 2023-03-13T14:04:49+00:00
Bump Win32 to 2.13.4.0
Updates Win32 submodule
- - - - -
ee17001e by Ben Gamari at 2023-03-13T21:18:24-04:00
ghc-bignum: Drop redundant include-dirs field
- - - - -
c9c26cd6 by Teo Camarasu at 2023-03-16T12:17:50-04:00
Fix BCO creation setting caps when -j > -N
* Remove calls to 'setNumCapabilities' in 'createBCOs'
These calls exist to ensure that 'createBCOs' can benefit from
parallelism. But this is not the right place to call
`setNumCapabilities`. Furthermore the logic differs from that in the
driver causing the capability count to be raised and lowered at each TH
call if -j > -N.
* Remove 'BCOOpts'
No longer needed as it was only used to thread the job count down to `createBCOs`
Resolves #23049
- - - - -
5ddbf5ed by Teo Camarasu at 2023-03-16T12:17:50-04:00
Add changelog entry for #23049
- - - - -
6e3ce9a4 by Ben Gamari at 2023-03-16T12:18:26-04:00
configure: Fix FIND_CXX_STD_LIB test on Darwin
Annoyingly, Darwin's <cstddef> includes <version> and APFS is
case-insensitive. Consequently, it will end up #including the
`VERSION` file generated by the `configure` script on the second
and subsequent runs of the `configure` script.
See #23116.
- - - - -
19d6d039 by sheaf at 2023-03-16T21:31:22+01:00
ghci: only keep the GlobalRdrEnv in ModInfo
The datatype GHC.UI.Info.ModInfo used to store a ModuleInfo,
which includes a TypeEnv. This can easily cause space leaks as we
have no way of forcing everything in a type environment.
In GHC, we only use the GlobalRdrEnv, which we can force completely.
So we only store that instead of a fully-fledged ModuleInfo.
- - - - -
73d07c6e by Torsten Schmits at 2023-03-17T14:36:49-04:00
Add structured error messages for GHC.Tc.Utils.Backpack
Tracking ticket: #20119
MR: !10127
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
One occurrence, when handing a nested error from the interface loading
machinery, was omitted. It will be handled by a subsequent changeset
that addresses interface errors.
- - - - -
a13affce by Andrei Borzenkov at 2023-03-21T11:17:17-04:00
Rename () into Unit, (,,...,,) into Tuple<n> (#21294)
This patch implements a part of GHC Proposal #475.
The key change is in GHC.Tuple.Prim:
- data () = ()
- data (a,b) = (a,b)
- data (a,b,c) = (a,b,c)
...
+ data Unit = ()
+ data Tuple2 a b = (a,b)
+ data Tuple3 a b c = (a,b,c)
...
And the rest of the patch makes sure that Unit and Tuple<n>
are pretty-printed as () and (,,...,,) in various contexts.
Updates the haddock submodule.
Co-authored-by: Vladislav Zavialov <vlad.z.4096 at gmail.com>
- - - - -
23642bf6 by Adam Sandberg Ericsson at 2023-03-21T11:17:53-04:00
docs: fix some wrongs in the eventlog format documentation
- - - - -
90159773 by Adam Sandberg Ericsson at 2023-03-21T11:17:53-04:00
docs: explain the BLOCK_MARKER event
- - - - -
ab1c25e8 by Adam Sandberg Ericsson at 2023-03-21T11:17:53-04:00
docs: add BlockedOnMVarRead thread status in eventlog encodings
- - - - -
898afaef by Adam Sandberg Ericsson at 2023-03-21T11:17:53-04:00
docs: add TASK_DELETE event in eventlog encodings
- - - - -
bb05b4cc by Adam Sandberg Ericsson at 2023-03-21T11:17:53-04:00
docs: add WALL_CLOCK_TIME event in eventlog encodings
- - - - -
eeea0343 by Torsten Schmits at 2023-03-21T11:18:34-04:00
Add structured error messages for GHC.Tc.Utils.Env
Tracking ticket: #20119
MR: !10129
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
be1d4be8 by Bodigrim at 2023-03-21T11:19:13-04:00
Document pdep / pext primops
- - - - -
e8b4aac4 by Alex Mason at 2023-03-21T18:11:04-04:00
Allow LLVM backend to use HDoc for faster file generation.
Also remove the MetaStmt constructor from LlvmStatement and places the annotations into the Store statement.
Includes “Implement a workaround for -no-asm-shortcutting bug“ (https://gitlab.haskell.org/ghc/ghc/-/commit/2fda9e0df886cc551e2cd6b9c2a384192bdc3045)
- - - - -
ea24360d by Luite Stegeman at 2023-03-21T18:11:44-04:00
Compute LambdaFormInfo when using JavaScript backend.
CmmCgInfos is needed to write interface files, but the
JavaScript backend does not generate it, causing
"Name without LFInfo" warnings.
This patch adds a conservative but always correct
CmmCgInfos when the JavaScript backend is used.
Fixes #23053
- - - - -
926ad6de by Simon Peyton Jones at 2023-03-22T01:03:08-04:00
Be more careful about quantification
This MR is driven by #23051. It does several things:
* It is guided by the generalisation plan described in #20686.
But it is still far from a complete implementation of that plan.
* Add Note [Inferred type with escaping kind] to GHC.Tc.Gen.Bind.
This explains that we don't (yet, pending #20686) directly
prevent generalising over escaping kinds.
* In `GHC.Tc.Utils.TcMType.defaultTyVar` we default RuntimeRep
and Multiplicity variables, beause we don't want to quantify over
them. We want to do the same for a Concrete tyvar, but there is
nothing sensible to default it to (unless it has kind RuntimeRep,
in which case it'll be caught by an earlier case). So we promote
instead.
* Pure refactoring in GHC.Tc.Solver:
* Rename decideMonoTyVars to decidePromotedTyVars, since that's
what it does.
* Move the actual promotion of the tyvars-to-promote from
`defaultTyVarsAndSimplify` to `decidePromotedTyVars`. This is a
no-op; just tidies up the code. E.g then we don't need to
return the promoted tyvars from `decidePromotedTyVars`.
* A little refactoring in `defaultTyVarsAndSimplify`, but no
change in behaviour.
* When making a TauTv unification variable into a ConcreteTv
(in GHC.Tc.Utils.Concrete.makeTypeConcrete), preserve the occ-name
of the type variable. This just improves error messages.
* Kill off dead code: GHC.Tc.Utils.TcMType.newConcreteHole
- - - - -
0ab0cc11 by Sylvain Henry at 2023-03-22T01:03:48-04:00
Testsuite: use appropriate predicate for ManyUbxSums test (#22576)
- - - - -
048c881e by romes at 2023-03-22T01:04:24-04:00
fix: Incorrect @since annotations in GHC.TypeError
Fixes #23128
- - - - -
a1528b68 by Sylvain Henry at 2023-03-22T01:05:04-04:00
Testsuite: use req_interp predicate for T16318 (#22370)
- - - - -
ad765b6f by Sylvain Henry at 2023-03-22T01:05:04-04:00
Testsuite: use req_interp predicate for T20214
- - - - -
e0b8eaf3 by Simon Peyton Jones at 2023-03-22T09:50:13+00:00
Refactor the constraint solver pipeline
The big change is to put the entire type-equality solver into
GHC.Tc.Solver.Equality, rather than scattering it over Canonical
and Interact. Other changes
* EqCt becomes its own data type, a bit like QCInst. This is
great because EqualCtList is then just [EqCt]
* New module GHC.Tc.Solver.Dict has come of the class-contraint
solver. In due course it will be all. One step at a time.
This MR is intended to have zero change in behaviour: it is a
pure refactor. It opens the way to subsequent tidying up, we
believe.
- - - - -
cedf9a3b by Torsten Schmits at 2023-03-22T15:31:18-04:00
Add structured error messages for GHC.Tc.Utils.TcMType
Tracking ticket: #20119
MR: !10138
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
30d45e97 by Sylvain Henry at 2023-03-22T15:32:01-04:00
Testsuite: use js_skip for T2615 (#22374)
- - - - -
8c98deba by Armando Ramirez at 2023-03-23T09:19:32-04:00
Optimized Foldable methods for Data.Functor.Compose
Explicitly define length, elem, etc. in Foldable instance for Data.Functor.Compose
Implementation of https://github.com/haskell/core-libraries-committee/issues/57
- - - - -
bc066108 by Armando Ramirez at 2023-03-23T09:19:32-04:00
Additional optimized versions
- - - - -
80fce576 by Bodigrim at 2023-03-23T09:19:32-04:00
Simplify minimum/maximum in instance Foldable (Compose f g)
- - - - -
8cb88a5a by Bodigrim at 2023-03-23T09:19:32-04:00
Update changelog to mention changes to instance Foldable (Compose f g)
- - - - -
e1c8c41d by Torsten Schmits at 2023-03-23T09:20:13-04:00
Add structured error messages for GHC.Tc.TyCl.PatSyn
Tracking ticket: #20117
MR: !10158
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
f932c589 by Adam Gundry at 2023-03-24T02:36:09-04:00
Allow WARNING pragmas to be controlled with custom categories
Closes #17209. This implements GHC Proposal 541, allowing a WARNING
pragma to be annotated with a category like so:
{-# WARNING in "x-partial" head "This function is undefined on empty lists." #-}
The user can then enable, disable and set the severity of such warnings
using command-line flags `-Wx-partial`, `-Werror=x-partial` and so on. There
is a new warning group `-Wextended-warnings` containing all these warnings.
Warnings without a category are treated as if the category was `deprecations`,
and are (still) controlled by the flags `-Wdeprecations`
and `-Wwarnings-deprecations`.
Updates Haddock submodule.
- - - - -
0426515b by Adam Gundry at 2023-03-24T02:36:09-04:00
Move mention of warning groups change to 9.8.1 release notes
- - - - -
b8d783d2 by Ben Gamari at 2023-03-24T02:36:45-04:00
nativeGen/AArch64: Fix bitmask immediate predicate
Previously the predicate for determining whether a logical instruction
operand could be encoded as a bitmask immediate was far too
conservative. This meant that, e.g., pointer untagged required five
instructions whereas it should only require one.
Fixes #23030.
- - - - -
46120bb6 by Joachim Breitner at 2023-03-24T13:09:43-04:00
User's guide: Improve docs for -Wall
previously it would list the warnings _not_ enabled by -Wall. That’s
unnecessary round-about and was out of date. So let's just name
the relevant warnings (based on `compiler/GHC/Driver/Flags.hs`).
- - - - -
509d1f11 by Ben Gamari at 2023-03-24T13:10:20-04:00
codeGen/tsan: Disable instrumentation of unaligned stores
There is some disagreement regarding the prototype of
`__tsan_unaligned_write` (specifically whether it takes just the written
address, or the address and the value as an argument). Moreover, I have
observed crashes which appear to be due to it. Disable instrumentation
of unaligned stores as a temporary mitigation.
Fixes #23096.
- - - - -
6a73655f by Li-yao Xia at 2023-03-25T00:02:44-04:00
base: Document GHC versions associated with past base versions in the changelog
- - - - -
43bd7694 by Teo Camarasu at 2023-03-25T00:03:24-04:00
Add regression test for #17574
This test currently fails in the nonmoving way
- - - - -
f2d56bf7 by Teo Camarasu at 2023-03-25T00:03:24-04:00
fix: account for large and compact object stats with nonmoving gc
Make sure that we keep track of the size of large and compact objects that have been moved onto the nonmoving heap.
We keep track of their size and add it to the amount of live bytes in nonmoving segments to get the total size of the live nonmoving heap.
Resolves #17574
- - - - -
7131b705 by David Feuer at 2023-03-25T00:04:04-04:00
Modify ThreadId documentation and comments
For a long time, `GHC.Conc.Sync` has said
```haskell
-- ToDo: data ThreadId = ThreadId (Weak ThreadId#)
-- But since ThreadId# is unlifted, the Weak type must use open
-- type variables.
```
We are now actually capable of using `Weak# ThreadId#`, but the
world has moved on. To support the `Show` and `Ord` instances, we'd
need to store the thread ID number in the `ThreadId`. And it seems
very difficult to continue to support `threadStatus` in that regime,
since it needs to be able to explain how threads died. In addition,
garbage collection of weak references can be quite expensive, and it
would be hard to evaluate the cost over he whole ecosystem. As discussed
in
[this CLC issue](https://github.com/haskell/core-libraries-committee/issues/125),
it doesn't seem very likely that we'll actually switch to weak
references here.
- - - - -
c421bbbb by Ben Gamari at 2023-03-25T00:04:41-04:00
rts: Fix barriers of IND and IND_STATIC
Previously IND and IND_STATIC lacked the acquire barriers enjoyed by
BLACKHOLE. As noted in the (now updated) Note [Heap memory barriers],
this barrier is critical to ensure that the indirectee is visible to the
entering core.
Fixes #22872.
- - - - -
62fa7faa by Bodigrim at 2023-03-25T00:05:22-04:00
Improve documentation of atomicModifyMutVar2#
- - - - -
b2d14d0b by Cheng Shao at 2023-03-25T03:46:43-04:00
rts: use performBlockingMajorGC in hs_perform_gc and fix ffi023
This patch does a few things:
- Add the missing RtsSymbols.c entry of performBlockingMajorGC
- Make hs_perform_gc call performBlockingMajorGC, which restores
previous behavior
- Use hs_perform_gc in ffi023
- Remove rts_clearMemory() call in ffi023, it now works again in some
test ways previously marked as broken. Fixes #23089
- - - - -
d9ae24ad by Cheng Shao at 2023-03-25T03:46:44-04:00
testsuite: add the rts_clearMemory test case
This patch adds a standalone test case for rts_clearMemory that mimics
how it's typically used by wasm backend users and ensures this RTS API
isn't broken by future RTS refactorings. Fixes #23901.
- - - - -
80729d96 by Bodigrim at 2023-03-25T03:47:22-04:00
Improve documentation for resizing of byte arrays
- - - - -
c6ec4cd1 by Ben Gamari at 2023-03-25T20:23:47-04:00
rts: Don't rely on EXTERN_INLINE for slop-zeroing logic
Previously we relied on calling EXTERN_INLINE functions defined in
ClosureMacros.h from Cmm to zero slop. However, as far as I can tell,
this is no longer safe to do in C99 as EXTERN_INLINE definitions may be emitted
in each compilation unit.
Fix this by explicitly declaring a new set of non-inline functions in
ZeroSlop.c which can be called from Cmm and marking the ClosureMacros.h
definitions as INLINE_HEADER.
In the future we should try to eliminate EXTERN_INLINE.
- - - - -
c32abd4b by Ben Gamari at 2023-03-25T20:23:48-04:00
rts: Fix capability-count check in zeroSlop
Previously `zeroSlop` examined `RtsFlags` to determine whether the
program was single-threaded. This is wrong; a program may be started
with `+RTS -N1` yet the process may later increase the capability count
with `setNumCapabilities`. This lead to quite subtle and rare crashes.
Fixes #23088.
- - - - -
656d4cb3 by Ryan Scott at 2023-03-25T20:24:23-04:00
Add Eq/Ord instances for SSymbol, SChar, and SNat
This implements [CLC proposal #148](https://github.com/haskell/core-libraries-committee/issues/148).
- - - - -
4f93de88 by David Feuer at 2023-03-26T15:33:02-04:00
Update and expand atomic modification Haddocks
* The documentation for `atomicModifyIORef` and `atomicModifyIORef'`
were incomplete, and the documentation for `atomicModifyIORef` was
out of date. Update and expand.
* Remove a useless lazy pattern match in the definition of
`atomicModifyIORef`. The pair it claims to match lazily
was already forced by `atomicModifyIORef2`.
- - - - -
e1fb56b2 by David Feuer at 2023-03-26T15:33:41-04:00
Document the constructor name for lists
Derived `Data` instances use raw infix constructor names when applicable.
The `Data.Data [a]` instance, if derived, would have a constructor name
of `":"`. However, it actually uses constructor name `"(:)"`. Document this
peculiarity.
See https://github.com/haskell/core-libraries-committee/issues/147
- - - - -
c1f755c4 by Simon Peyton Jones at 2023-03-27T22:09:41+01:00
Make exprIsConApp_maybe a bit cleverer
Addresses #23159.
See Note Note [Exploit occ-info in exprIsConApp_maybe]
in GHC.Core.SimpleOpt.
Compile times go down very slightly, but always go down,
never up. Good!
Metrics: compile_time/bytes allocated
------------------------------------------------
CoOpt_Singletons(normal) -1.8%
T15703(normal) -1.2% GOOD
geo. mean -0.1%
minimum -1.8%
maximum +0.0%
Metric Decrease:
CoOpt_Singletons
T15703
- - - - -
76bb4c58 by Ryan Scott at 2023-03-28T08:12:08-04:00
Add COMPLETE pragmas to TypeRep, SSymbol, SChar, and SNat
This implements
[CLC proposal #149](https://github.com/haskell/core-libraries-committee/issues/149).
- - - - -
3f374399 by sheaf at 2023-03-29T13:57:33+02:00
Handle records in the renamer
This patch moves the field-based logic for disambiguating record updates
to the renamer. The type-directed logic, scheduled for removal, remains
in the typechecker.
To do this properly (and fix the myriad of bugs surrounding the treatment
of duplicate record fields), we took the following main steps:
1. Create GREInfo, a renamer-level equivalent to TyThing which stores
information pertinent to the renamer.
This allows us to uniformly treat imported and local Names in the
renamer, as described in Note [GREInfo].
2. Remove GreName. Instead of a GlobalRdrElt storing GreNames, which
distinguished between normal names and field names, we now store
simple Names in GlobalRdrElt, along with the new GREInfo information
which allows us to recover the FieldLabel for record fields.
3. Add namespacing for record fields, within the OccNames themselves.
This allows us to remove the mangling of duplicate field selectors.
This change ensures we don't print mangled names to the user in
error messages, and allows us to handle duplicate record fields
in Template Haskell.
4. Move record disambiguation to the renamer, and operate on the
level of data constructors instead, to handle #21443.
The error message text for ambiguous record updates has also been
changed to reflect that type-directed disambiguation is on the way
out.
(3) means that OccEnv is now a bit more complex: we first key on the
textual name, which gives an inner map keyed on NameSpace:
OccEnv a ~ FastStringEnv (UniqFM NameSpace a)
Note that this change, along with (2), both increase the memory residency
of GlobalRdrEnv = OccEnv [GlobalRdrElt], which causes a few tests to
regress somewhat in compile-time allocation.
Even though (3) simplified a lot of code (in particular the treatment of
field selectors within Template Haskell and in error messages), it came
with one important wrinkle: in the situation of
-- M.hs-boot
module M where { data A; foo :: A -> Int }
-- M.hs
module M where { data A = MkA { foo :: Int } }
we have that M.hs-boot exports a variable foo, which is supposed to match
with the record field foo that M exports. To solve this issue, we add a
new impedance-matching binding to M
foo{var} = foo{fld}
This mimics the logic that existed already for impedance-binding DFunIds,
but getting it right was a bit tricky.
See Note [Record field impedance matching] in GHC.Tc.Module.
We also needed to be careful to avoid introducing space leaks in GHCi.
So we dehydrate the GlobalRdrEnv before storing it anywhere, e.g. in
ModIface. This means stubbing out all the GREInfo fields, with the
function forceGlobalRdrEnv.
When we read it back in, we rehydrate with rehydrateGlobalRdrEnv.
This robustly avoids any space leaks caused by retaining old type
environments.
Fixes #13352 #14848 #17381 #17551 #19664 #21443 #21444 #21720 #21898 #21946 #21959 #22125 #22160 #23010 #23062 #23063
Updates haddock submodule
-------------------------
Metric Increase:
MultiComponentModules
MultiLayerModules
MultiLayerModulesDefsGhci
MultiLayerModulesNoCode
T13701
T14697
hard_hole_fits
-------------------------
- - - - -
4f1940f0 by sheaf at 2023-03-29T13:57:33+02:00
Avoid repeatedly shadowing in shadowNames
This commit refactors GHC.Type.Name.Reader.shadowNames to first
accumulate all the shadowing arising from the introduction of a new
set of GREs, and then applies all the shadowing to the old GlobalRdrEnv
in one go.
- - - - -
d246049c by sheaf at 2023-03-29T13:57:34+02:00
igre_prompt_env: discard "only-qualified" names
We were unnecessarily carrying around names only available qualified
in igre_prompt_env, violating the icReaderEnv invariant.
We now get rid of these, as they aren't needed for the shadowing
computation that igre_prompt_env exists for.
Fixes #23177
-------------------------
Metric Decrease:
T14052
T14052Type
-------------------------
- - - - -
41a572f6 by Matthew Pickering at 2023-03-29T16:17:21-04:00
hadrian: Fix path to HpcParser.y
The source for this project has been moved into a src/ folder so we also
need to update this path.
Fixes #23187
- - - - -
b159e0e9 by doyougnu at 2023-03-30T01:40:08-04:00
js: split JMacro into JS eDSL and JS syntax
This commit:
Splits JExpr and JStat into two nearly identical DSLs:
- GHC.JS.Syntax is the JMacro based DSL without unsaturation, i.e., a
value cannot be unsaturated, or, a value of this DSL is a witness that a
value of GHC.JS.Unsat has been saturated
- GHC.JS.Unsat is the JMacro DSL from GHCJS with Unsaturation.
Then all binary and outputable instances are changed to use
GHC.JS.Syntax.
This moves us closer to closing out #22736 and #22352. See #22736 for
roadmap.
-------------------------
Metric Increase:
CoOpt_Read
LargeRecord
ManyAlternatives
PmSeriesS
PmSeriesT
PmSeriesV
T10421
T10858
T11195
T11374
T11822
T12227
T12707
T13035
T13253
T13253-spj
T13379
T14683
T15164
T15703
T16577
T17096
T17516
T17836
T18140
T18282
T18304
T18478
T18698a
T18698b
T18923
T1969
T19695
T20049
T21839c
T3064
T4801
T5321FD
T5321Fun
T5631
T5642
T783
T9198
T9233
T9630
TcPlugin_RewritePerf
WWRec
-------------------------
- - - - -
f4f1f14f by Sylvain Henry at 2023-03-30T01:40:49-04:00
ghc-heap: remove wrong Addr# coercion (#23181)
Conversion from Addr# to I# isn't correct with the JS backend.
Also used the opportunity to reenable 64-bit Word/Int tests
- - - - -
a5360490 by Ben Gamari at 2023-03-30T01:41:25-04:00
testsuite: Fix racing prints in T21465
As noted in #23155, we previously failed to add flushes necessary to
ensure predictable output.
Fixes #23155.
- - - - -
98b5cf67 by Matthew Pickering at 2023-03-30T09:58:40+01:00
Revert "ghc-heap: remove wrong Addr# coercion (#23181)"
This reverts commit f4f1f14f8009c3c120b8b963ec130cbbc774ec02.
This fails to build with GHC-9.2 as a boot compiler.
See #23195 for tracking this issue.
- - - - -
61a2dfaa by Bodigrim at 2023-03-30T14:35:57-04:00
Add {-# WARNING #-} to Data.List.{head,tail}
- - - - -
8f15c47c by Bodigrim at 2023-03-30T14:35:57-04:00
Fixes to accomodate Data.List.{head,tail} with {-# WARNING #-}
- - - - -
7c7dbade by Bodigrim at 2023-03-30T14:35:57-04:00
Bump submodules
- - - - -
d2d8251b by Bodigrim at 2023-03-30T14:35:57-04:00
Fix tests
- - - - -
3d38dcb6 by sheaf at 2023-03-30T14:35:57-04:00
Proxies for head and tail: review suggestions
- - - - -
930edcfd by sheaf at 2023-03-30T14:36:33-04:00
docs: move RecordUpd changelog entry to 9.8
This was accidentally included in the 9.6 changelog
instead of the 9.6 changelog.
- - - - -
6f885e65 by sheaf at 2023-03-30T14:37:09-04:00
Add LANGUAGE GADTs to GHC.Rename.Env
We need to enable this extension for the file to compile with ghc 9.2,
as we are pattern matching on a GADT and this required the GADT extension
to be enabled until 9.4.
- - - - -
6d6a37a8 by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: make lint-ci-config job fast again
We don't pin our nixpkgs revision and tracks the default
nixpkgs-unstable channel anyway. Instead of using
haskell.packages.ghc924, we should be using haskell.packages.ghc92 to
maximize the binary cache hit rate and make lint-ci-config job fast
again. Also bumps the nix docker image to the latest revision.
- - - - -
ef1548c4 by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: ensure that all non-i386 pipelines do parallel xz compression
We can safely enable parallel xz compression for non-i386 pipelines.
However, previously we didn't export XZ_OPT, so the xz process won't
see it if XZ_OPT hasn't already been set in the current job.
- - - - -
20432d16 by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: unset CROSS_EMULATOR for js job
- - - - -
4a24dbbe by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: fix lint-testsuite job
The list_broken make target will transitively depend on the
calibrate.out target, which used STAGE1_GHC instead of TEST_HC. It
really should be TEST_HC since that's what get passed in the gitlab CI
config.
- - - - -
cea56ccc by Cheng Shao at 2023-03-30T18:42:56+00:00
ci: use alpine3_17-wasm image for wasm jobs
Bump the ci-images dependency and use the new alpine3_17-wasm docker
image for wasm jobs.
- - - - -
79d0cb32 by Ben Gamari at 2023-03-30T18:43:53+00:00
testsuite/driver: Add basic support for testing cross-compilers
- - - - -
e7392b4e by Ben Gamari at 2023-03-30T18:43:53+00:00
testsuite/driver: Normalize away differences in ghc executable name
- - - - -
ee160d06 by Ben Gamari at 2023-03-30T18:43:53+00:00
hadrian: Pass CROSS_EMULATOR to runtests.py
- - - - -
30c84511 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: don't add optllvm way for wasm32
- - - - -
f1beee36 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: normalize the .wasm extension
- - - - -
a984a103 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: strip the cross ghc prefix in output and error message
- - - - -
f7478d95 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: handle target executable extension
- - - - -
8fe8b653 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: mypy typing error fixes
This patch fixes some mypy typing errors which weren't caught in
previous linting jobs.
- - - - -
0149f32f by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: use context variable instead of thread-local variable
This patch changes a thread-local variable to context variable
instead, which works as intended when the testsuite transitions to use
asyncio & coroutines instead of multi-threading to concurrently run
test cases. Note that this also raises the minimum Python version to
3.7.
- - - - -
ea853ff0 by Cheng Shao at 2023-03-30T18:43:53+00:00
testsuite: asyncify the testsuite driver
This patch refactors the testsuite driver, gets rid of multi-threading
logic for running test cases concurrently, and uses asyncio &
coroutines instead. This is not yak shaving for its own sake; the
previous multi-threading logic is prone to livelock/deadlock
conditions for some reason, even if the total number of threads is
bounded to a thread pool's capacity.
The asyncify change is an internal implementation detail of the
testsuite driver and does not impact most GHC maintainers out there.
The patch does not touch the .T files, test cases can be
added/modified the exact same way as before.
- - - - -
0077cb22 by Matthew Pickering at 2023-03-31T21:28:28-04:00
Add test for T23184
There was an outright bug, which Simon fixed in July 2021, as a little side-fix on a complicated patch:
```
commit 6656f0165a30fc2a22208532ba384fc8e2f11b46
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Fri Jul 23 23:57:01 2021 +0100
A bunch of changes related to eta reduction
This is a large collection of changes all relating to eta
reduction, originally triggered by #18993, but there followed
a long saga.
Specifics:
...lots of lines omitted...
Other incidental changes
* Fix a fairly long-standing outright bug in the ApplyToVal case of
GHC.Core.Opt.Simplify.mkDupableContWithDmds. I was failing to take the
tail of 'dmds' in the recursive call, which meant the demands were All
Wrong. I have no idea why this has not caused problems before now.
```
Note this "Fix a fairly longstanding outright bug". This is the specific fix
```
@@ -3552,8 +3556,8 @@ mkDupableContWithDmds env dmds
-- let a = ...arg...
-- in [...hole...] a
-- NB: sc_dup /= OkToDup; that is caught earlier by contIsDupable
- do { let (dmd:_) = dmds -- Never fails
- ; (floats1, cont') <- mkDupableContWithDmds env dmds cont
+ do { let (dmd:cont_dmds) = dmds -- Never fails
+ ; (floats1, cont') <- mkDupableContWithDmds env cont_dmds cont
; let env' = env `setInScopeFromF` floats1
; (_, se', arg') <- simplArg env' dup se arg
; (let_floats2, arg'') <- makeTrivial env NotTopLevel dmd (fsLit "karg") arg'
```
Ticket #23184 is a report of the bug that this diff fixes.
- - - - -
62d25071 by mangoiv at 2023-04-01T04:20:01-04:00
[feat] make ($) representation polymorphic
- this change was approved by the CLC in [1] following a CLC proposal [2]
- make ($) representation polymorphic (adjust the type signature)
- change ($) implementation to allow additional polymorphism
- adjust the haddock of ($) to reflect these changes
- add additional documentation to document these changes
- add changelog entry
- adjust tests (move now succeeding tests and adjust stdout of some
tests)
[1] https://github.com/haskell/core-libraries-committee/issues/132#issuecomment-1487456854
[2] https://github.com/haskell/core-libraries-committee/issues/132
- - - - -
77c33fb9 by Artem Pelenitsyn at 2023-04-01T04:20:41-04:00
User Guide: update copyright year: 2020->2023
- - - - -
3b5be05a by doyougnu at 2023-04-01T09:42:31-04:00
driver: Unit State Data.Map -> GHC.Unique.UniqMap
In pursuit of #22426. The driver and unit state are major contributors.
This commit also bumps the haddock submodule to reflect the API changes in
UniqMap.
-------------------------
Metric Decrease:
MultiComponentModules
MultiComponentModulesRecomp
T10421
T10547
T12150
T12234
T12425
T13035
T16875
T18140
T18304
T18698a
T18698b
T18923
T20049
T5837
T6048
T9198
-------------------------
- - - - -
a84fba6e by Torsten Schmits at 2023-04-01T09:43:12-04:00
Add structured error messages for GHC.Tc.TyCl
Tracking ticket: #20117
MR: !10183
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
6e2eb275 by doyougnu at 2023-04-01T18:27:56-04:00
JS: Linker: use saturated JExpr
Follow on to MR!10142 in pursuit of #22736
- - - - -
3da69346 by sheaf at 2023-04-01T18:28:37-04:00
Improve haddocks of template-haskell Con datatype
This adds a bit more information, in particular about the lists of
constructors in the GadtC and RecGadtC cases.
- - - - -
3b7bbb39 by sheaf at 2023-04-01T18:28:37-04:00
TH: revert changes to GadtC & RecGadtC
Commit 3f374399 included a breaking-change to the template-haskell
library when it made the GadtC and RecGadtC constructors take non-empty
lists of names. As this has the potential to break many users' packages,
we decided to revert these changes for now.
- - - - -
f60f6110 by Bodigrim at 2023-04-02T18:59:30-04:00
Rework documentation for data Char
- - - - -
43ebd5dc by Bodigrim at 2023-04-02T19:00:09-04:00
cmm: implement parsing of MO_AtomicRMW from hand-written CMM files
Fixes #23206
- - - - -
ab9cd52d by Sylvain Henry at 2023-04-03T08:15:21-04:00
ghc-heap: remove wrong Addr# coercion (#23181)
Conversion from Addr# to I# isn't correct with the JS backend.
- - - - -
2b2afff3 by Matthew Pickering at 2023-04-03T08:15:58-04:00
hadrian: Update bootstrap plans for 9.2.6, 9.2.7, 9.4.4, 9.4.5, 9.6.1
Also fixes the ./generate_bootstrap_plans script which was recently
broken
We can hopefully drop the 9.2 plans soon but they still work so kept
them around for now.
- - - - -
c2605e25 by Matthew Pickering at 2023-04-03T08:15:58-04:00
ci: Add job to test 9.6 bootstrapping
- - - - -
53e4d513 by Krzysztof Gogolewski at 2023-04-03T08:16:35-04:00
hadrian: Improve option parsing
Several options in Hadrian had their argument marked as optional
(`OptArg`), but if the argument wasn't there they were just giving an
error. It's more idiomatic to mark the argument as required instead;
the code uses less Maybes, the parser can enforce that the argument
is present, --help gives better output.
- - - - -
a8e36892 by Sylvain Henry at 2023-04-03T08:17:16-04:00
JS: fix issues with FD api support
- Add missing implementations for fcntl_read/write/lock
- Fix fdGetMode
These were found while implementing TH in !9779. These functions must be
used somehow by the external interpreter code.
- - - - -
8b092910 by Haskell-mouse at 2023-04-03T19:31:26-04:00
Convert diagnostics in GHC.Rename.HsType to proper TcRnMessage
I've turned all occurrences of TcRnUnknownMessage in GHC.Rename.HsType
module into a proper TcRnMessage.
Instead, these TcRnMessage messages were introduced:
TcRnDataKindsError
TcRnUnusedQuantifiedTypeVar
TcRnIllegalKindSignature
TcRnUnexpectedPatSigType
TcRnSectionPrecedenceError
TcRnPrecedenceParsingError
TcRnIllegalKind
TcRnNegativeNumTypeLiteral
TcRnUnexpectedKindVar
TcRnBindMultipleVariables
TcRnBindVarAlreadyInScope
- - - - -
220a7a48 by Krzysztof Gogolewski at 2023-04-03T19:32:02-04:00
Fixes around unsafeCoerce#
1. `unsafeCoerce#` was documented in `GHC.Prim`. But since the overhaul
in 74ad75e87317, `unsafeCoerce#` is no longer defined there.
I've combined the documentation in `GHC.Prim` with the `Unsafe.Coerce` module.
2. The documentation of `unsafeCoerce#` stated that you should not
cast a function to an algebraic type, even if you later cast it back
before applying it. But ghci was doing that type of cast, as can be seen
with 'ghci -ddump-ds' and typing 'x = not'. I've changed it to use Any
following the documentation.
- - - - -
9095e297 by Matthew Craven at 2023-04-04T01:04:10-04:00
Add a few more memcpy-ish primops
* copyMutableByteArrayNonOverlapping#
* copyAddrToAddr#
* copyAddrToAddrNonOverlapping#
* setAddrRange#
The implementations of copyBytes, moveBytes, and fillBytes
in base:Foreign.Marshal.Utils now use these new primops,
which can cause us to work a bit harder generating code for them,
resulting in the metric increase in T21839c observed by CI on
some architectures. But in exchange, we get better code!
Metric Increase:
T21839c
- - - - -
f7da530c by Matthew Craven at 2023-04-04T01:04:10-04:00
StgToCmm: Upgrade -fcheck-prim-bounds behavior
Fixes #21054. Additionally, we can now check for range overlap
when generating Cmm for primops that use memcpy internally.
- - - - -
cd00e321 by sheaf at 2023-04-04T01:04:50-04:00
Relax assertion in varToRecFieldOcc
When using Template Haskell, it is possible to re-parent a field OccName
belonging to one data constructor to another data constructor. The
lsp-types package did this in order to "extend" a data constructor
with additional fields.
This ran into an assertion in 'varToRecFieldOcc'. This assertion
can simply be relaxed, as the resulting splices are perfectly sound.
Fixes #23220
- - - - -
eed0d930 by Sylvain Henry at 2023-04-04T11:09:15-04:00
GHCi.RemoteTypes: fix doc and avoid unsafeCoerce (#23201)
- - - - -
071139c3 by Ryan Scott at 2023-04-04T11:09:51-04:00
Make INLINE pragmas for pattern synonyms work with TH
Previously, the code for converting `INLINE <name>` pragmas from TH splices
used `vNameN`, which assumed that `<name>` must live in the variable namespace.
Pattern synonyms, on the other hand, live in the constructor namespace. I've
fixed the issue by switching to `vcNameN` instead, which works for both the
variable and constructor namespaces.
Fixes #23203.
- - - - -
7c16f3be by Krzysztof Gogolewski at 2023-04-04T17:13:00-04:00
Fix unification with oversaturated type families
unify_ty was incorrectly saying that F x y ~ T x are surely apart,
where F x y is an oversaturated type family and T x is a tyconapp.
As a result, the simplifier dropped a live case alternative (#23134).
- - - - -
c165f079 by sheaf at 2023-04-04T17:13:40-04:00
Add testcase for #23192
This issue around solving of constraints arising from superclass
expansion using other constraints also borned from superclass expansion
was the topic of commit aed1974e. That commit made sure we don't emit
a "redundant constraint" warning in a situation in which removing the
constraint would cause errors.
Fixes #23192
- - - - -
d1bb16ed by Ben Gamari at 2023-04-06T03:40:45-04:00
nonmoving: Disable slop-zeroing
As noted in #23170, the nonmoving GC can race with a mutator zeroing the
slop of an updated thunk (in much the same way that two mutators would
race). Consequently, we must disable slop-zeroing when the nonmoving GC
is in use.
Closes #23170
- - - - -
04b80850 by Brandon Chinn at 2023-04-06T03:41:21-04:00
Fix reverse flag for -Wunsupported-llvm-version
- - - - -
0c990e13 by Pierre Le Marre at 2023-04-06T10:16:29+00:00
Add release note for GHC.Unicode refactor in base-4.18.
Also merge CLC proposal 130 in base-4.19 with CLC proposal 59 in
base-4.18 and add proper release date.
- - - - -
cbbfb283 by Alex Dixon at 2023-04-07T18:27:45-04:00
Improve documentation for ($) (#22963)
- - - - -
5193c2b0 by Alex Dixon at 2023-04-07T18:27:45-04:00
Remove trailing whitespace from ($) commentary
- - - - -
b384523b by Sebastian Graf at 2023-04-07T18:27:45-04:00
Adjust wording wrt representation polymorphism of ($)
- - - - -
6a788f0a by Torsten Schmits at 2023-04-07T22:29:28-04:00
Add structured error messages for GHC.Tc.TyCl.Utils
Tracking ticket: #20117
MR: !10251
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
3ba77b36 by sheaf at 2023-04-07T22:30:07-04:00
Renamer: don't call addUsedGRE on an exact Name
When looking up a record field in GHC.Rename.Env.lookupRecFieldOcc,
we could end up calling addUsedGRE on an exact Name, which would then
lead to a panic in the bestImport function: it would be incapable of
processing a GRE which is not local but also not brought into scope
by any imports (as it is referred to by its unique instead).
Fixes #23240
- - - - -
bc4795d2 by Krzysztof Gogolewski at 2023-04-11T19:24:54-04:00
Add support for -debug in the testsuite
Confusingly, GhcDebugged referred to GhcDebugAssertions.
- - - - -
b7474b57 by Krzysztof Gogolewski at 2023-04-11T19:24:54-04:00
Add missing cases in -Di prettyprinter
Fixes #23142
- - - - -
6c392616 by Cheng Shao at 2023-04-11T19:25:31-04:00
compiler: make WasmCodeGenM an instance of MonadUnique
- - - - -
05d26a65 by Cheng Shao at 2023-04-11T19:25:31-04:00
compiler: apply cmm node-splitting for wasm backend
This patch applies cmm node-splitting for wasm32 NCG, which is
required when handling irreducible CFGs. Fixes #23237.
- - - - -
f1892cc0 by Bodigrim at 2023-04-11T19:26:09-04:00
Set base 'maintainer' field to CLC
- - - - -
ecf22da3 by Simon Peyton Jones at 2023-04-11T19:26:45-04:00
Clarify a couple of Notes about 'nospec'
- - - - -
ebd8918b by Oleg Grenrus at 2023-04-12T12:32:57-04:00
Allow generation of TTH syntax with TH
In other words allow generation of typed splices and brackets with
Untyped Template Haskell.
That is useful in cases where a library is build with TTH in mind,
but we still want to generate some auxiliary declarations,
where TTH cannot help us, but untyped TH can.
Such example is e.g. `staged-sop` which works with TTH,
but we would like to derive `Generic` declarations with TH.
An alternative approach is to use `unsafeCodeCoerce`, but then the
derived `Generic` instances would be type-checked only at use sites,
i.e. much later. Also `-ddump-splices` output is quite ugly:
user-written instances would use TTH brackets, not `unsafeCodeCoerce`.
This commit doesn't allow generating of untyped template splices
and brackets with untyped TH, as I don't know why one would want to do
that (instead of merging the splices, e.g.)
- - - - -
690d0225 by Rodrigo Mesquita at 2023-04-12T12:33:33-04:00
Add regression test for #23229
- - - - -
59321879 by Sylvain Henry at 2023-04-13T08:50:33-04:00
Add quotRem rules (#22152)
case quotRemInt# x y of
(# q, _ #) -> body
====>
case quotInt# x y of
q -> body
case quotRemInt# x y of
(# _, r #) -> body
====>
case remInt# x y of
r -> body
- - - - -
4dd02122 by Sylvain Henry at 2023-04-13T08:50:33-04:00
Add quot folding rule (#22152)
(x / l1) / l2
l1 and l2 /= 0
l1*l2 doesn't overflow
==> x / (l1 * l2)
- - - - -
1148ac72 by Sylvain Henry at 2023-04-13T08:50:33-04:00
Make Int64/Word64 division ok for speculation too.
Only when the divisor is definitely non-zero.
- - - - -
8af401cc by Sylvain Henry at 2023-04-13T08:50:33-04:00
Make WordQuotRem2Op ok-for-speculation too
- - - - -
27d2978e by Josh Meredith at 2023-04-13T08:51:09-04:00
Base/JS: GHC.JS.Foreign.Callback module (issue 23126)
* Add the Callback module for "exporting" Haskell functions
to be available to plain JavaScript code
* Fix some primitives defined in GHC.JS.Prim
* Add a JavaScript section to the user guide with instructions
on how to use the JavaScript FFI, building up to using Callbacks
to interact with the browser
* Add tests for the JavaScript FFI and Callbacks
- - - - -
a34aa8da by Adam Sandberg Ericsson at 2023-04-14T04:17:52-04:00
rts: improve memory ordering and add some comments in the StablePtr implementation
- - - - -
d7a768a4 by Matthew Pickering at 2023-04-14T04:18:28-04:00
docs: Generate docs/index.html with version number
* Generate docs/index.html to include the version of the ghc library
* This also fixes the packageVersions interpolations which were
- Missing an interpolation for `LIBRARY_ghc_VERSION`
- Double quoting the version so that "9.7" was being inserted.
Fixes #23121
- - - - -
d48fbfea by Simon Peyton Jones at 2023-04-14T04:19:05-04:00
Stop if type constructors have kind errors
Otherwise we get knock-on errors, such as #23252.
This makes GHC fail a bit sooner, and I have not attempted to add
recovery code, to add a fake TyCon place of the erroneous one,
in an attempt to get more type errors in one pass. We could
do that (perhaps) if there was a call for it.
- - - - -
2371d6b2 by Simon Peyton Jones at 2023-04-14T20:01:02+02:00
Major refactor in the handling of equality constraints
This MR substantially refactors the way in which the constraint
solver deals with equality constraints. The big thing is:
* Intead of a pipeline in which we /first/ canonicalise and /then/
interact (the latter including performing unification) the two steps
are more closely integreated into one. That avoids the current
rather indirect communication between the two steps.
The proximate cause for this refactoring is fixing #22194, which involve
solving [W] alpha[2] ~ Maybe (F beta[4])
by doing this:
alpha[2] := Maybe delta[2]
[W] delta[2] ~ F beta[4]
That is, we don't promote beta[4]! This is very like introducing a cycle
breaker, and was very awkward to do before, but now it is all nice.
See GHC.Tc.Utils.Unify Note [Promotion and level-checking] and
Note [Family applications in canonical constraints].
The big change is this:
* Several canonicalisation checks (occurs-check, cycle-breaking,
checking for concreteness) are combined into one new function:
GHC.Tc.Utils.Unify.checkTyEqRhs
This function is controlled by `TyEqFlags`, which says what to do
for foralls, type families etc.
* `canEqCanLHSFinish` now sees if unification is possible, and if so,
actually does it: see `canEqCanLHSFinish_try_unification`.
There are loads of smaller changes:
* The on-the-fly unifier `GHC.Tc.Utils.Unify.unifyType` has a
cheap-and-cheerful version of `checkTyEqRhs`, called
`simpleUnifyCheck`. If `simpleUnifyCheck` succeeds, it can unify,
otherwise it defers by emitting a constraint. This is simpler than
before.
* I simplified the swapping code in `GHC.Tc.Solver.Equality.canEqCanLHS`.
Especially the nasty stuff involving `swap_for_occurs` and
`canEqTyVarFunEq`. Much nicer now. See
Note [Orienting TyVarLHS/TyFamLHS]
Note [Orienting TyFamLHS/TyFamLHS]
* Added `cteSkolemOccurs`, `cteConcrete`, and `cteCoercionHole` to the
problems that can be discovered by `checkTyEqRhs`.
* I fixed #23199 `pickQuantifiablePreds`, which actually allows GHC to
to accept both cases in #22194 rather than rejecting both.
Yet smaller:
* Added a `synIsConcrete` flag to `SynonymTyCon` (alongside `synIsFamFree`)
to reduce the need for synonym expansion when checking concreteness.
Use it in `isConcreteType`.
* Renamed `isConcrete` to `isConcreteType`
* Defined `GHC.Core.TyCo.FVs.isInjectiveInType` as a more efficient
way to find if a particular type variable is used injectively than
finding all the injective variables. It is called in
`GHC.Tc.Utils.Unify.definitely_poly`, which in turn is used quite a
lot.
* Moved `rewriterView` to `GHC.Core.Type`, so we can use it from the
constraint solver.
Fixes #22194, #23199
Compile times decrease by an average of 0.1%; but there is a 7.4%
drop in compiler allocation on T15703.
Metric Decrease:
T15703
- - - - -
99b2734b by Simon Peyton Jones at 2023-04-14T20:01:02+02:00
Add some documentation about redundant constraints
- - - - -
3f2d0eb8 by Simon Peyton Jones at 2023-04-14T20:01:02+02:00
Improve partial signatures
This MR fixes #23223. The changes are in two places:
* GHC.Tc.Bind.checkMonomorphismRestriction
See the new `Note [When the MR applies]`
We now no longer stupidly attempt to apply the MR when the user
specifies a context, e.g. f :: Eq a => _ -> _
* GHC.Tc.Solver.decideQuantification
See rewritten `Note [Constraints in partial type signatures]`
Fixing this bug apparently breaks three tests:
* partial-sigs/should_compile/T11192
* partial-sigs/should_fail/Defaulting1MROff
* partial-sigs/should_fail/T11122
However they are all symptoms of #23232, so I'm marking them as
expect_broken(23232).
I feel happy about this MR. Nice.
- - - - -
23e2a8a0 by Simon Peyton Jones at 2023-04-14T20:01:02+02:00
Make approximateWC a bit cleverer
This MR fixes #23224: making approximateWC more clever
See the long `Note [ApproximateWC]` in GHC.Tc.Solver
All this is delicate and ad-hoc -- but it /has/ to be: we are
talking about inferring a type for a binding in the presence of
GADTs, type families and whatnot: known difficult territory.
We just try as hard as we can.
- - - - -
2c040246 by Matthew Pickering at 2023-04-15T00:57:14-04:00
docs: Update template-haskell docs to use Code Q a rather than Q (TExp a)
Since GHC Proposal #195, the type of [|| ... ||] has been Code Q a
rather than Q (TExp a). The documentation in the `template-haskell`
library wasn't updated to reflect this change.
Fixes #23148
- - - - -
0da18eb7 by Krzysztof Gogolewski at 2023-04-15T14:35:53+02:00
Show an error when we cannot default a concrete tyvar
Fixes #23153
- - - - -
bad2f8b8 by sheaf at 2023-04-15T15:14:36+02:00
Handle ConcreteTvs in inferResultToType
inferResultToType was discarding the ir_frr information, which meant
some metavariables ended up being MetaTvs instead of ConcreteTvs.
This function now creates new ConcreteTvs as necessary, instead of
always creating MetaTvs.
Fixes #23154
- - - - -
3b0ea480 by Simon Peyton Jones at 2023-04-16T18:12:20-04:00
Transfer DFunId_ness onto specialised bindings
Whether a binding is a DFunId or not has consequences for the `-fdicts-strict`
flag, essentially if we are doing demand analysis for a DFunId then `-fdicts-strict` does
not apply because the constraint solver can create recursive groups of dictionaries.
In #22549 this was fixed for the "normal" case, see
Note [Do not strictify the argument dictionaries of a dfun].
However the loop still existed if the DFunId was being specialised.
The problem was that the specialiser would specialise a DFunId and
turn it into a VanillaId and so the demand analyser didn't know to
apply special treatment to the binding anymore and the whole recursive
group was optimised to bottom.
The solution is to transfer over the DFunId-ness of the binding in the specialiser so
that the demand analyser knows not to apply the `-fstrict-dicts`.
Fixes #22549
- - - - -
a1371ebb by Oleg Grenrus at 2023-04-16T18:12:59-04:00
Add import lists to few GHC.Driver.Session imports
Related to https://gitlab.haskell.org/ghc/ghc/-/issues/23261.
There are a lot of GHC.Driver.Session which only use DynFlags,
but not the parsing code.
- - - - -
51479ceb by Matthew Pickering at 2023-04-17T08:08:48-04:00
Account for special GHC.Prim import in warnUnusedPackages
The GHC.Prim import is treated quite specially primarily because there
isn't an interface file for GHC.Prim. Therefore we record separately in
the ModSummary if it's imported or not so we don't go looking for it.
This logic hasn't made it's way to `-Wunused-packages` so if you
imported GHC.Prim then the warning would complain you didn't use
`-package ghc-prim`.
Fixes #23212
- - - - -
1532a8b2 by Simon Peyton Jones at 2023-04-17T08:09:24-04:00
Add regression test for #23199
- - - - -
0158c5f1 by Ryan Scott at 2023-04-17T18:43:27-04:00
validDerivPred: Reject exotic constraints in IrredPreds
This brings the `IrredPred` case in sync with the treatment of `ClassPred`s as
described in `Note [Valid 'deriving' predicate]` in `GHC.Tc.Validity`. Namely,
we should reject `IrredPred`s that are inferred from `deriving` clauses whose
arguments contain other type constructors, as described in `(VD2) Reject exotic
constraints` of that Note. This has the nice property that `deriving` clauses
whose inferred instance context mention `TypeError` will now emit the type
error in the resulting error message, which better matches existing intuitions
about how `TypeError` should work.
While I was in town, I noticed that much of `Note [Valid 'deriving' predicate]`
was duplicated in a separate `Note [Exotic derived instance contexts]` in
`GHC.Tc.Deriv.Infer`. I decided to fold the latter Note into the former so that
there is a single authority on describing the conditions under which an
inferred `deriving` constraint can be considered valid.
This changes the behavior of `deriving` in a way that existing code might
break, so I have made a mention of this in the GHC User's Guide. It seems very,
very unlikely that much code is relying on this strange behavior, however, and
even if there is, there is a clear, backwards-compatible migration path using
`StandaloneDeriving`.
Fixes #22696.
- - - - -
10364818 by Krzysztof Gogolewski at 2023-04-17T18:44:03-04:00
Misc cleanup
- Use dedicated list functions
- Make cloneBndrs and cloneRecIdBndrs monadic
- Fix invalid haddock comments in libraries/base
- - - - -
5e1d33d7 by Matthew Pickering at 2023-04-18T10:31:02-04:00
Convert interface file loading errors into proper diagnostics
This patch converts all the errors to do with loading interface files
into proper structured diagnostics.
* DriverMessage: Sometimes in the driver we attempt to load an interface
file so we embed the IfaceMessage into the DriverMessage.
* TcRnMessage: Most the time we are loading interface files during
typechecking, so we embed the IfaceMessage
This patch also removes the TcRnInterfaceLookupError constructor which
is superceded by the IfaceMessage, which is now structured compared to
just storing an SDoc before.
- - - - -
df1a5811 by sheaf at 2023-04-18T10:31:43-04:00
Don't panic in ltPatersonSize
The function GHC.Tc.Utils.TcType.ltPatersonSize would panic when it
encountered a type family on the RHS, as usually these are not allowed
(type families are not allowed on the RHS of class instances or of
quantified constraints). However, it is possible to still encounter
type families on the RHS after doing a bit of constraint solving, as
seen in test case T23171. This could trigger the panic in the call to
ltPatersonSize in GHC.Tc.Solver.Canonical.mk_strict_superclasses, which
is involved in avoiding loopy superclass constraints.
This patch simply changes ltPatersonSize to return "I don't know, because
there's a type family involved" in these cases.
Fixes #23171
- - - - -
d442ac05 by Sylvain Henry at 2023-04-19T20:04:35-04:00
JS: fix thread-related primops
- - - - -
7a96f90b by Bryan Richter at 2023-04-19T20:05:11-04:00
CI: Disable abi-test-nightly
See #23269
- - - - -
ab6c1d29 by Sylvain Henry at 2023-04-19T20:05:50-04:00
Testsuite: don't use obsolescent egrep (#22351)
Recent egrep displays the following message, breaking golden tests:
egrep: warning: egrep is obsolescent; using grep -E
Switch to using "grep -E" instead
- - - - -
f15b0ce5 by Matthew Pickering at 2023-04-20T11:01:06-04:00
hadrian: Pass haddock file arguments in a response file
In !10119 CI was failing on windows because the command line was too
long. We can mitigate this by passing the file arguments to haddock in a
response file.
We can't easily pass all the arguments in a response file because the
`+RTS` arguments can't be placed in the response file.
Fixes #23273
- - - - -
7012ec2f by tocic at 2023-04-20T11:01:42-04:00
Fix doc typo in GHC.Read.readList
- - - - -
5c873124 by sheaf at 2023-04-20T18:33:34-04:00
Implement -jsem: parallelism controlled by semaphores
See https://github.com/ghc-proposals/ghc-proposals/pull/540/ for a
complete description for the motivation for this feature.
The `-jsem` option allows a build tool to pass a semaphore to GHC which
GHC can use in order to control how much parallelism it requests.
GHC itself acts as a client in the GHC jobserver protocol.
```
GHC Jobserver Protocol
~~~~~~~~~~~~~~~~~~~~~~
This proposal introduces the GHC Jobserver Protocol. This protocol allows
a server to dynamically invoke many instances of a client process,
while restricting all of those instances to use no more than <n> capabilities.
This is achieved by coordination over a system semaphore (either a POSIX
semaphore [6]_ in the case of Linux and Darwin, or a Win32 semaphore [7]_
in the case of Windows platforms).
There are two kinds of participants in the GHC Jobserver protocol:
- The *jobserver* creates a system semaphore with a certain number of
available tokens.
Each time the jobserver wants to spawn a new jobclient subprocess, it **must**
first acquire a single token from the semaphore, before spawning
the subprocess. This token **must** be released once the subprocess terminates.
Once work is finished, the jobserver **must** destroy the semaphore it created.
- A *jobclient* is a subprocess spawned by the jobserver or another jobclient.
Each jobclient starts with one available token (its *implicit token*,
which was acquired by the parent which spawned it), and can request more
tokens through the Jobserver Protocol by waiting on the semaphore.
Each time a jobclient wants to spawn a new jobclient subprocess, it **must**
pass on a single token to the child jobclient. This token can either be the
jobclient's implicit token, or another token which the jobclient acquired
from the semaphore.
Each jobclient **must** release exactly as many tokens as it has acquired from
the semaphore (this does not include the implicit tokens).
```
Build tools such as cabal act as jobservers in the protocol and are
responsibile for correctly creating, cleaning up and managing the
semaphore.
Adds a new submodule (semaphore-compat) for managing and interacting
with semaphores in a cross-platform way.
Fixes #19349
- - - - -
52d3e9b4 by Ben Gamari at 2023-04-20T18:34:11-04:00
rts: Initialize Array# header in listThreads#
Previously the implementation of listThreads# failed to initialize the
header of the created array, leading to various nastiness.
Fixes #23071
- - - - -
1db30fe1 by Ben Gamari at 2023-04-20T18:34:11-04:00
testsuite: Add test for #23071
- - - - -
dae514f9 by tocic at 2023-04-21T13:31:21-04:00
Fix doc typos in libraries/base/GHC
- - - - -
113e21d7 by Sylvain Henry at 2023-04-21T13:32:01-04:00
Testsuite: replace some js_broken/js_skip predicates with req_c
Using req_c is more precise.
- - - - -
038bb031 by Krzysztof Gogolewski at 2023-04-21T18:03:04-04:00
Minor doc fixes
- Add docs/index.html to .gitignore.
It is created by ./hadrian/build docs, and it was the only file
in Hadrian's templateRules not present in .gitignore.
- Mention that MultiWayIf supports non-boolean guards
- Remove documentation of optdll - removed in 2007, 763daed95
- Fix markdown syntax
- - - - -
e826cdb2 by amesgen at 2023-04-21T18:03:44-04:00
User's guide: DeepSubsumption is implied by Haskell{98,2010}
- - - - -
499a1c20 by PHO at 2023-04-23T13:39:32-04:00
Implement executablePath for Solaris and make getBaseDir less platform-dependent
Use base-4.17 executablePath when possible, and fall back on
getExecutablePath when it's not available. The sole reason why getBaseDir
had #ifdef's was apparently that getExecutablePath wasn't reliable, and we
could reduce the number of CPP conditionals by making use of
executablePath instead.
Also export executablePath on js_HOST_ARCH.
- - - - -
97a6f7bc by tocic at 2023-04-23T13:40:08-04:00
Fix doc typos in libraries/base
- - - - -
787c6e8c by Ben Gamari at 2023-04-24T12:19:06-04:00
testsuite/T20137: Avoid impl.-defined behavior
Previously we would cast pointers to uint64_t. However, implementations
are allowed to either zero- or sign-extend such casts. Instead cast to
uintptr_t to avoid this.
Fixes #23247.
- - - - -
87095f6a by Cheng Shao at 2023-04-24T12:19:44-04:00
rts: always build 64-bit atomic ops
This patch does a few things:
- Always build 64-bit atomic ops in rts/ghc-prim, even on 32-bit
platforms
- Remove legacy "64bit" cabal flag of rts package
- Fix hs_xchg64 function prototype for 32-bit platforms
- Fix AtomicFetch test for wasm32
- - - - -
2685a12d by Cheng Shao at 2023-04-24T12:20:21-04:00
compiler: don't install signal handlers when the host platform doesn't have signals
Previously, large parts of GHC API will transitively invoke
withSignalHandlers, which doesn't work on host platforms without
signal functionality at all (e.g. wasm32-wasi). By making
withSignalHandlers a no-op on those platforms, we can make more parts
of GHC API work out of the box when signals aren't supported.
- - - - -
1338b7a3 by Cheng Shao at 2023-04-24T16:21:30-04:00
hadrian: fix non-ghc program paths passed to testsuite driver when testing cross GHC
- - - - -
1a10f556 by Bodigrim at 2023-04-24T16:22:09-04:00
Add since pragma to Data.Functor.unzip
- - - - -
0da9e882 by Soham Chowdhury at 2023-04-25T00:15:22-04:00
More informative errors for bad imports (#21826)
- - - - -
ebd5b078 by Josh Meredith at 2023-04-25T00:15:58-04:00
JS/base: provide implementation for mkdir (issue 22374)
- - - - -
8f656188 by Josh Meredith at 2023-04-25T18:12:38-04:00
JS: Fix h$base_access implementation (issue 22576)
- - - - -
74c55712 by Andrei Borzenkov at 2023-04-25T18:13:19-04:00
Give more guarntees about ImplicitParams (#23289)
- Added new section in the GHC user's guide that legends behavior of
nested implicit parameter bindings in these two cases:
let ?f = 1 in let ?f = 2 in ?f
and
data T where MkT :: (?f :: Int) => T
f :: T -> T -> Int
f MkT MkT = ?f
- Added new test case to examine this behavior.
- - - - -
c30ac25f by Sebastian Graf at 2023-04-26T14:50:51-04:00
DmdAnal: Unleash demand signatures of free RULE and unfolding binders (#23208)
In #23208 we observed that the demand signature of a binder occuring in a RULE
wasn't unleashed, leading to a transitively used binder being discarded as
absent. The solution was to use the same code path that we already use for
handling exported bindings.
See the changes to `Note [Absence analysis for stable unfoldings and RULES]`
for more details.
I took the chance to factor out the old notion of a `PlusDmdArg` (a pair of a
`VarEnv Demand` and a `Divergence`) into `DmdEnv`, which fits nicely into our
existing framework. As a result, I had to touch quite a few places in the code.
This refactoring exposed a few small bugs around correct handling of bottoming
demand environments. As a result, some strictness signatures now mention uniques
that weren't there before which caused test output changes to T13143, T19969 and
T22112. But these tests compared whole -ddump-simpl listings which is a very
fragile thing to begin with. I changed what exactly they test for based on the
symptoms in the corresponding issues.
There is a single regression in T18894 because we are more conservative around
stable unfoldings now. Unfortunately it is not easily fixed; let's wait until
there is a concrete motivation before invest more time.
Fixes #23208.
- - - - -
77f506b8 by Josh Meredith at 2023-04-26T14:51:28-04:00
Refactor GenStgRhs to include the Type in both constructors (#23280, #22576, #22364)
Carry the actual type of an expression through the PreStgRhs and into GenStgRhs
for use in later stages. Currently this is used in the JavaScript backend to fix
some tests from the above mentioned issues: EtaExpandLevPoly, RepPolyWrappedVar2,
T13822, T14749.
- - - - -
052e2bb6 by Alan Zimmerman at 2023-04-26T14:52:05-04:00
EPA: Use ExplicitBraces only in HsModule
!9018 brought in exact print annotations in LayoutInfo for open and
close braces at the top level.
But it retained them in the HsModule annotations too.
Remove the originals, so exact printing uses LayoutInfo
- - - - -
d5c4629b by Cheng Shao at 2023-04-27T16:00:35-04:00
ci: update ci.sh to actually run the entire testsuite for wasm backend
For the time being, we still need to use in-tree mode and can't test
the bindist yet.
- - - - -
533d075e by Cheng Shao at 2023-04-27T16:00:35-04:00
ci: additional wasm32 manual jobs in validate pipelines
This patch enables bignum native & unregisterised wasm32 jobs as
manual jobs in validate pipelines, which can be useful to prevent
breakage when working on wasm32 related patches.
- - - - -
b5f00811 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: fix cross prefix stripping
This patch fixes cross prefix stripping in the testsuite driver. The
normalization logic used to only handle prefixes of the triple form
<arch>-<vendor>-<os>, now it's relaxed to allow any number of tokens
in the prefix tuple, so the cross prefix stripping logic would work
when ghc is configured with something like --target=wasm32-wasi.
- - - - -
6f511c36 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: include target exe extension in heap profile filenames
This patch fixes hp2ps related framework failures when testing the
wasm backend by including target exe extension in heap profile
filenames.
- - - - -
e6416b10 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: exclude ghci ways if no rts linker is present
This patch implements logic to automatically exclude ghci ways when
there is no rts linker. It's way better than having to annotate
individual test cases.
- - - - -
791cce64 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: fix permission bits in copy_files
When the testsuite driver copy files instead of symlinking them, it
should also copy the permission bits, otherwise there'll be permission
denied errors. Also, enforce file copying when testing wasm32, since
wasmtime doesn't handle host symlinks quite well
(https://github.com/bytecodealliance/wasmtime/issues/6227).
- - - - -
aa6afe8a by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: add the req_ghc_with_threaded_rts predicate
This patch adds the req_ghc_with_threaded_rts predicate to the
testsuite to assert the platform has threaded RTS, and mark some tests
as req_ghc_with_threaded_rts. Also makes ghc_with_threaded_rts a
config field instead of a global variable.
- - - - -
ce580426 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: add the req_process predicate
This patch adds the req_process predicate to the testsuite to assert
the platform has a process model, also marking tests that involve
spawning processes as req_process. Also bumps hpc & process submodule.
- - - - -
cb933665 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: add the req_host_target_ghc predicate
This patch adds the req_host_target_ghc predicate to the testsuite to
assert the ghc compiler being tested can compile both host/target
code. When testing cross GHCs this is not supported yet, but it may
change in the future.
- - - - -
b174a110 by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: add missing annotations for some tests
This patch adds missing annotations (req_th, req_dynamic_lib_support,
req_rts_linker) to some tests. They were discovered when testing
wasm32, though it's better to be explicit about what features they
require, rather than simply adding when(arch('wasm32'), skip).
- - - - -
bd2bfdec by Cheng Shao at 2023-04-27T16:00:35-04:00
testsuite: wasm32-specific fixes
This patch includes all wasm32-specific testsuite fixes.
- - - - -
4eaf2c2a by Josh Meredith at 2023-04-27T16:01:11-04:00
JS: change GHC.JS.Transform.identsS/E/V to take a saturated IR (#23304)
- - - - -
57277662 by sheaf at 2023-04-29T20:23:06+02:00
Add the Unsatisfiable class
This commit implements GHC proposal #433, adding the Unsatisfiable
class to the GHC.TypeError module. This provides an alternative to
TypeError for which error reporting is more predictable: we report it
when we are reporting unsolved Wanted constraints.
Fixes #14983 #16249 #16906 #18310 #20835
- - - - -
00a8a5ff by Torsten Schmits at 2023-04-30T03:45:09-04:00
Add structured error messages for GHC.Rename.Names
Tracking ticket: #20115
MR: !10336
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
931c8d82 by Ben Orchard at 2023-05-03T20:16:18-04:00
Add sized primitive literal syntax
Adds a new LANGUAGE pragma ExtendedLiterals, which enables defining
unboxed numeric literals such as `0xFF#Word8 :: Word8#`.
Implements GHC proposal 0451:
https://github.com/ghc-proposals/ghc-proposals/blob/b384a538b34f79d18a0201455b7b3c473bc8c936/proposals/0451-sized-literals.rst
Fixes #21422.
Bumps haddock submodule.
Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski at tweag.io>
- - - - -
f3460845 by Bodigrim at 2023-05-03T20:16:57-04:00
Document instances of Double
- - - - -
1e9caa1a by Sylvain Henry at 2023-05-03T20:17:37-04:00
Bump Cabal submodule (#22356)
- - - - -
4eafb52a by sheaf at 2023-05-03T20:18:16-04:00
Don't forget to check the parent in an export list
Commit 3f374399 introduced a bug which caused us to forget to include
the parent of an export item of the form T(..) (that is, IEThingAll)
when checking for duplicate exports.
Fixes #23318
- - - - -
8fde4ac8 by amesgen at 2023-05-03T20:18:57-04:00
Fix unlit path in cross bindists
- - - - -
8cc9a534 by Matthew Pickering at 2023-05-04T14:58:14-04:00
hadrian: Flavour: Change args -> extraArgs
Previously in a flavour definition you could override all the flags
which were passed to GHC. This causes issues when needed to compute a
package hash because we need to know what these extra arguments are
going to be before computing the hash. The solution is to modify flavour
so that the arguments you pass here are just extra ones rather than all
the arguments that you need to compile something.
This makes things work more like how cabal.project files work when you
give extra arguments to a package and also means that flavour
transformers correctly affect the hash.
- - - - -
3fdb18f8 by romes at 2023-05-04T14:58:14-04:00
Hardwire a better unit-id for ghc
Previously, the unit-id of ghc-the-library was fixed as `ghc`.
This was done primarily because the compiler must know the unit-id of
some packages (including ghc) a-priori to define wired-in names.
However, as seen in #20742, a reinstallable `ghc` whose unit-id is fixed
to `ghc` might result in subtle bugs when different ghc's interact.
A good example of this is having GHC_A load a plugin compiled by GHC_B,
where GHC_A and GHC_B are linked to ghc-libraries that are ABI
incompatible. Without a distinction between the unit-id of the ghc library
GHC_A is linked against and the ghc library the plugin it is loading was
compiled against, we can't check compatibility.
This patch gives a slightly better unit-id to ghc (ghc-version) by
(1) Not setting -this-unit-id to ghc, but rather to the new unit-id (modulo stage0)
(2) Adding a definition to `GHC.Settings.Config` whose value is the new unit-id.
(2.1) `GHC.Settings.Config` is generated by Hadrian
(2.2) and also by cabal through `compiler/Setup.hs`
This unit-id definition is imported by `GHC.Unit.Types` and used to
set the wired-in unit-id of "ghc", which was previously fixed to "ghc"
The commits following this one will improve the unit-id with a
cabal-style package hash and check compatibility when loading plugins.
Note that we also ensure that ghc's unit key matches unit id both when
hadrian or cabal builds ghc, and in this way we no longer need to add
`ghc` to the WiringMap.
- - - - -
6689c9c6 by romes at 2023-05-04T14:58:14-04:00
Validate compatibility of ghcs when loading plugins
Ensure, when loading plugins, that the ghc the plugin depends on is the
ghc loading the plugin -- otherwise fail to load the plugin.
Progress towards #20742.
- - - - -
db4be339 by romes at 2023-05-04T14:58:14-04:00
Add hashes to unit-ids created by hadrian
This commit adds support for computing an inputs hash for packages
compiled by hadrian. The result is that ABI incompatible packages should
be given different hashes and therefore be distinct in a cabal store.
Hashing is enabled by the `--flag`, and is off by default as the hash
contains a hash of the source files. We enable it when we produce
release builds so that the artifacts we distribute have the right unit
ids.
- - - - -
944a9b94 by Matthew Pickering at 2023-05-04T14:58:14-04:00
Use hash-unit-ids in release jobs
Includes fix upload_ghc_libs glob
- - - - -
116d7312 by Josh Meredith at 2023-05-04T14:58:51-04:00
JS: fix bounds checking (Issue 23123)
* For ByteArray-based bounds-checking, the JavaScript backend must use the
`len` field, instead of the inbuild JavaScript `length` field.
* Range-based operations must also check both the start and end of the range
for bounds
* All indicies are valid for ranges of size zero, since they are essentially no-ops
* For cases of ByteArray accesses (e.g. read as Int), the end index is
(i * sizeof(type) + sizeof(type) - 1), while the previous implementation
uses (i + sizeof(type) - 1). In the Int32 example, this is (i * 4 + 3)
* IndexByteArrayOp_Word8As* primitives use byte array indicies (unlike
the previous point), but now check both start and end indicies
* Byte array copies now check if the arrays are the same by identity and
then if the ranges overlap.
- - - - -
2d5c1dde by Sylvain Henry at 2023-05-04T14:58:51-04:00
Fix remaining issues with bound checking (#23123)
While fixing these I've also changed the way we store addresses into
ByteArray#. Addr# are composed of two parts: a JavaScript array and an
offset (32-bit number).
Suppose we want to store an Addr# in a ByteArray# foo at offset i.
Before this patch, we were storing both fields as a tuple in the "arr"
array field:
foo.arr[i] = [addr_arr, addr_offset];
Now we only store the array part in the "arr" field and the offset
directly in the array:
foo.dv.setInt32(i, addr_offset):
foo.arr[i] = addr_arr;
It avoids wasting space for the tuple.
- - - - -
98c5ee45 by Luite Stegeman at 2023-05-04T14:59:31-04:00
JavaScript: Correct arguments to h$appendToHsStringA
fixes #23278
- - - - -
ca611447 by Josh Meredith at 2023-05-04T15:00:07-04:00
base/encoding: add an allocations performance test (#22946)
- - - - -
e3ddf58d by Krzysztof Gogolewski at 2023-05-04T15:00:44-04:00
linear types: Don't add external names to the usage env
This has no observable effect, but avoids storing useless data.
- - - - -
b3226616 by Andrei Borzenkov at 2023-05-04T15:01:25-04:00
Improved documentation for the Data.OldList.nub function
There was recomentation to use map head . group . sort instead of nub
function, but containers library has more suitable and efficient
analogue
- - - - -
e8b72ff6 by Ryan Scott at 2023-05-04T15:02:02-04:00
Fix type variable substitution in gen_Newtype_fam_insts
Previously, `gen_Newtype_fam_insts` was substituting the type variable binders
of a type family instance using `substTyVars`, which failed to take type
variable dependencies into account. There is similar code in
`GHC.Tc.TyCl.Class.tcATDefault` that _does_ perform this substitution properly,
so this patch:
1. Factors out this code into a top-level `substATBndrs` function, and
2. Uses `substATBndrs` in `gen_Newtype_fam_insts`.
Fixes #23329.
- - - - -
275836d2 by Torsten Schmits at 2023-05-05T08:43:02+00:00
Add structured error messages for GHC.Rename.Utils
Tracking ticket: #20115
MR: !10350
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
983ce558 by Oleg Grenrus at 2023-05-05T13:11:29-04:00
Use TemplateHaskellQuotes in TH.Syntax to construct Names
- - - - -
a5174a59 by Matthew Pickering at 2023-05-05T18:42:31-04:00
driver: Use hooks from plugin_hsc_env
This fixes a bug in oneshot mode where hooks modified in a plugin
wouldn't be used in oneshot mode because we neglected to use the right
hsc_env. This was observed by @csabahruska.
- - - - -
18a7d03d by Aaron Allen at 2023-05-05T18:42:31-04:00
Rework plugin initialisation points
In general this patch pushes plugin initialisation points to earlier in
the pipeline. As plugins can modify the `HscEnv`, it's imperative that
the plugins are initialised as soon as possible and used thereafter.
For example, there are some new tests which modify hsc_logger and other
hooks which failed to fire before (and now do)
One consequence of this change is that the error for specifying the
usage of a HPT plugin from the command line has changed, because it's
now attempted to be loaded at initialisation rather than causing a
cyclic module import.
Closes #21279
Co-authored-by: Matthew Pickering <matthewtpickering at gmail.com>
- - - - -
6e776ed3 by Matthew Pickering at 2023-05-05T18:42:31-04:00
docs: Add Note [Timing of plugin initialization]
- - - - -
e1df8511 by Matthew Pickering at 2023-05-05T18:43:07-04:00
Incrementally update ghcup metadata in ghc/ghcup-metadata
This job paves the way for distributing nightly builds
* A new repo https://gitlab.haskell.org/ghc/ghcup-metadata stores the
metadata on the "updates" branch.
* Each night this metadata is downloaded and the nightly builds are
appended to the end of the metadata.
* The update job only runs on the scheduled nightly pipeline, not just
when NIGHTLY=1.
Things which are not done yet
* Modify the retention policy for nightly jobs
* Think about building release flavour compilers to distribute nightly.
Fixes #23334
- - - - -
8f303d27 by Rodrigo Mesquita at 2023-05-05T22:04:31-04:00
docs: Remove mentions of ArrayArray# from unlifted FFI section
Fixes #23277
- - - - -
994bda56 by Torsten Schmits at 2023-05-05T22:05:12-04:00
Add structured error messages for GHC.Rename.Module
Tracking ticket: #20115
MR: !10361
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
Only addresses the single warning missing from the previous MR.
- - - - -
3e3a6be4 by Ben Gamari at 2023-05-08T12:15:19+00:00
rts: Fix data-race in hs_init_ghc
As noticed by @Terrorjack, `hs_init_ghc` previously used non-atomic
increment/decrement on the RTS's initialization count. This may go wrong
in a multithreaded program which initializes the runtime multiple times.
Closes #22756.
- - - - -
78c8dc50 by Torsten Schmits at 2023-05-08T21:41:51-04:00
Add structured error messages for GHC.IfaceToCore
Tracking ticket: #20114
MR: !10390
This converts uses of `mkTcRnUnknownMessage` to newly added constructors
of `TcRnMessage`.
- - - - -
0e2df4c9 by Bryan Richter at 2023-05-09T12:03:35+03:00
Fix up rules for ghcup-metadata-nightly-push
- - - - -
b970e64f by Ben Gamari at 2023-05-09T08:41:33-04:00
testsuite: Add test for atomicSwapIORef
- - - - -
81cfefd2 by Ben Gamari at 2023-05-09T08:41:53-04:00
compiler: Implement atomicSwapIORef with xchg
As requested by @treeowl in CLC#139.
- - - - -
6b29154d by Ben Gamari at 2023-05-09T08:41:53-04:00
Make atomicSwapMutVar# an inline primop
- - - - -
64064cfe by doyougnu at 2023-05-09T18:40:01-04:00
JS: add GHC.JS.Optimizer, remove RTS.Printer, add Linker.Opt
This MR changes some simple optimizations and is a first step in re-architecting
the JS backend pipeline to add the optimizer. In particular it:
- removes simple peep hole optimizations from `GHC.StgToJS.Printer` and removes that module
- adds module `GHC.JS.Optimizer`
- defines the same peep hole opts that were removed only now they are `Syntax -> Syntax` transformations rather than `Syntax -> JS code` optimizations
- hooks the optimizer into code gen
- adds FuncStat and ForStat constructors to the backend.
Working Ticket:
- #22736
Related MRs:
- MR !10142
- MR !10000
-------------------------
Metric Decrease:
CoOpt_Read
ManyAlternatives
PmSeriesS
PmSeriesT
PmSeriesV
T10421
T12707
T13253
T13253-spj
T15164
T17516
T18140
T18282
T18698a
T18698b
T18923
T1969
T19695
T20049
T3064
T5321FD
T5321Fun
T783
T9198
T9233
T9630
-------------------------
- - - - -
6738c01d by Krzysztof Gogolewski at 2023-05-09T18:40:38-04:00
Add a regression test for #21050
- - - - -
b2cdb7da by Ben Gamari at 2023-05-09T18:41:14-04:00
nonmoving: Account for mutator allocations in bytes_allocated
Previously we failed to account direct mutator allocations into the
nonmoving heap against the mutator's allocation limit and
`cap->total_allocated`. This only manifests during CAF evaluation (since
we allocate the CAF's blackhole directly into the nonmoving heap).
Fixes #23312.
- - - - -
0657b482 by Sven Tennie at 2023-05-09T22:22:42-04:00
Adjust AArch64 stackFrameHeaderSize
The prologue of each stack frame are the saved LR and FP registers, 8
byte each. I.e. the size of the stack frame header is 2 * 8 byte.
- - - - -
7788c09c by konsumlamm at 2023-05-09T22:23:23-04:00
Make `(&)` representation polymorphic in the return type
- - - - -
b3195922 by Ben Gamari at 2023-05-10T05:06:45-04:00
ghc-prim: Generalize keepAlive#/touch# in state token type
Closes #23163.
- - - - -
1e6861dd by Cheng Shao at 2023-05-10T05:07:25-04:00
Bump hsc2hs submodule
Fixes #22981.
- - - - -
0a513952 by Ben Gamari at 2023-05-11T04:10:17-04:00
base: Export GHC.Conc.Sync.fromThreadId
Closes #22706.
- - - - -
29be39ba by Matthew Pickering at 2023-05-11T04:10:54-04:00
Build vanilla alpine bindists
We currently attempt to build and distribute fully static alpine
bindists (ones which could be used on any linux platform) but most
people who use the alpine bindists want to use alpine to build their own
static applications (for which a fully static bindist is not necessary).
We should build and distribute these bindists for these users whilst the
fully-static bindist is still unusable.
Fixes #23349
- - - - -
40c7daed by Simon Peyton Jones at 2023-05-11T04:11:30-04:00
Look both ways when looking for quantified equalities
When looking up (t1 ~# t2) in the quantified constraints,
check both orientations. Forgetting this led to #23333.
- - - - -
c17bb82f by Rodrigo Mesquita at 2023-05-11T04:12:07-04:00
Move "target has RTS linker" out of settings
We move the "target has RTS linker" information out of configure into a
predicate in GHC, and remove this option from the settings file where it
is unnecessary -- it's information statically known from the platform.
Note that previously we would consider `powerpc`s and `s390x`s other
than `powerpc-ibm-aix*` and `s390x-ibm-linux` to have an RTS linker,
but the RTS linker supports neither platform.
Closes #23361
- - - - -
bd0b056e by Krzysztof Gogolewski at 2023-05-11T04:12:44-04:00
Add a test for #17284
Since !10123 we now reject this program.
- - - - -
630b1fea by Bodigrim at 2023-05-11T04:13:24-04:00
Document unlawfulness of instance Num Fixed
Fixes #22712
- - - - -
87eebf98 by sheaf at 2023-05-11T11:55:22-04:00
Add fused multiply-add instructions
This patch adds eight new primops that fuse a multiplication and an
addition or subtraction:
- `{fmadd,fmsub,fnmadd,fnmsub}{Float,Double}#`
fmadd x y z is x * y + z, computed with a single rounding step.
This patch implements code generation for these primops in the following
backends:
- X86, AArch64 and PowerPC NCG,
- LLVM
- C
WASM uses the C implementation. The primops are unsupported in the
JavaScript backend.
The following constant folding rules are also provided:
- compute a * b + c when a, b, c are all literals,
- x * y + 0 ==> x * y,
- ±1 * y + z ==> z ± y and x * ±1 + z ==> z ± x.
NB: the constant folding rules incorrectly handle signed zero.
This is a known limitation with GHC's floating-point constant folding
rules (#21227), which we hope to resolve in the future.
- - - - -
ad16a066 by Krzysztof Gogolewski at 2023-05-11T11:55:59-04:00
Add a test for #21278
- - - - -
05cea68c by Matthew Pickering at 2023-05-11T11:56:36-04:00
rts: Refine memory retention behaviour to account for pinned/compacted objects
When using the copying collector there is still a lot of data which
isn't copied (such as pinned, compacted, large objects etc). The logic
to decide how much memory to retain didn't take into account that these
wouldn't be copied. Therefore we pessimistically retained 2* the amount
of memory for these blocks even though they wouldn't be copied by the
collector.
The solution is to split up the heap into two parts, the parts which
will be copied and the parts which won't be copied. Then the appropiate
factor is applied to each part individually (2 * for copying and 1.2 *
for not copying).
The T23221 test demonstrates this improvement with a program which first
allocates many unpinned ByteArray# followed by many pinned ByteArray#
and observes the difference in the ultimate memory baseline between the
two.
There are some charts on #23221.
Fixes #23221
- - - - -
1bb24432 by Cheng Shao at 2023-05-11T11:57:15-04:00
hadrian: fix no_dynamic_libs flavour transformer
This patch fixes the no_dynamic_libs flavour transformer and make
fully_static reuse it. Previously building with no_dynamic_libs fails
since ghc program is still dynamic and transitively brings in dyn ways
of rts which are produced by no rules.
- - - - -
0ed493a3 by Josh Meredith at 2023-05-11T23:08:27-04:00
JS: refactor jsSaturate to return a saturated JStat (#23328)
- - - - -
a856d98e by Pierre Le Marre at 2023-05-11T23:09:08-04:00
Doc: Fix out-of-sync using-optimisation page
- Make explicit that default flag values correspond to their -O0 value.
- Fix -fignore-interface-pragmas, -fstg-cse, -fdo-eta-reduction,
-fcross-module-specialise, -fsolve-constant-dicts, -fworker-wrapper.
- - - - -
c176ad18 by sheaf at 2023-05-12T06:10:57-04:00
Don't panic in mkNewTyConRhs
This function could come across invalid newtype constructors, as we
only perform validity checking of newtypes once we are outside the
knot-tied typechecking loop.
This patch changes this function to fake up a stub type in the case of
an invalid newtype, instead of panicking.
This patch also changes "checkNewDataCon" so that it reports as many
errors as possible at once.
Fixes #23308
- - - - -
ab63daac by Krzysztof Gogolewski at 2023-05-12T06:11:38-04:00
Allow Core optimizations when interpreting bytecode
Tracking ticket: #23056
MR: !10399
This adds the flag `-funoptimized-core-for-interpreter`, permitting use
of the `-O` flag to enable optimizations when compiling with the
interpreter backend, like in ghci.
- - - - -
c6cf9433 by Ben Gamari at 2023-05-12T06:12:14-04:00
hadrian: Fix mention of non-existent removeFiles function
Previously Hadrian's bindist Makefile referred to a `removeFiles`
function that was previously defined by the `make` build system. Since
the `make` build system is no longer around, this function is now
undefined. Naturally, make being make, this appears to be silently
ignored instead of producing an error.
Fix this by rewriting it to `rm -f`.
Closes #23373.
- - - - -
eb60ec18 by Bodigrim at 2023-05-12T06:12:54-04:00
Mention new implementation of GHC.IORef.atomicSwapIORef in the changelog
- - - - -
aa84cff4 by Teo Camarasu at 2023-05-12T19:27:23-04:00
rts: Ensure non-moving gc is not running when pausing
- - - - -
5ad776ab by Teo Camarasu at 2023-05-12T19:27:23-04:00
rts: Teach listAllBlocks about nonmoving heap
List all blocks on the non-moving heap.
Resolves #22627
- - - - -
d683b2e5 by Krzysztof Gogolewski at 2023-05-12T19:28:00-04:00
Fix coercion optimisation for SelCo (#23362)
setNominalRole_maybe is supposed to output a nominal coercion.
In the SelCo case, it was not updating the stored role to Nominal,
causing #23362.
- - - - -
59aa4676 by Alexis King at 2023-05-12T19:28:47-04:00
hadrian: Fix linker script flag for MergeObjects builder
This fixes what appears to have been a typo in !9530. The `-t` flag just
enables tracing on all versions of `ld` I’ve looked at, while `-T` is
used to specify a linker script. It seems that this worked anyway for
some reason on some `ld` implementations (perhaps because they
automatically detect linker scripts), but the missing `-T` argument
causes `gold` to complain.
- - - - -
4bf9fa0f by Adam Gundry at 2023-05-12T23:49:49-04:00
Less coercion optimization for non-newtype axioms
See Note [Push transitivity inside newtype axioms only] for an explanation
of the change here. This change substantially improves the performance of
coercion optimization for programs involving transitive type family reductions.
-------------------------
Metric Decrease:
CoOpt_Singletons
LargeRecord
T12227
T12545
T13386
T15703
T5030
T8095
-------------------------
- - - - -
dc0c9574 by Adam Gundry at 2023-05-12T23:49:49-04:00
Move checkAxInstCo to GHC.Core.Lint
A consequence of the previous change is that checkAxInstCo is no longer
called during coercion optimization, so it can be moved back where it belongs.
Also includes some edits to Note [Conflict checking with AxiomInstCo] as
suggested by @simonpj.
- - - - -
8b9b7dbc by Simon Peyton Jones at 2023-05-12T23:50:25-04:00
Use the eager unifier in the constraint solver
This patch continues the refactoring of the constraint solver
described in #23070.
The Big Deal in this patch is to call the regular, eager unifier from the
constraint solver, when we want to create new equalities. This
replaces the existing, unifyWanted which amounted to
yet-another-unifier, so it reduces duplication of a rather subtle
piece of technology. See
* Note [The eager unifier] in GHC.Tc.Utils.Unify
* GHC.Tc.Solver.Monad.wrapUnifierTcS
I did lots of other refactoring along the way
* I simplified the treatment of right hand sides that contain CoercionHoles.
Now, a constraint that contains a hetero-kind CoercionHole is non-canonical,
and cannot be used for rewriting or unification alike. This required me
to add the ch_hertero_kind flag to CoercionHole, with consequent knock-on
effects. See wrinkle (2) of `Note [Equalities with incompatible kinds]` in
GHC.Tc.Solver.Equality.
* I refactored the StopOrContinue type to add StartAgain, so that after a
fundep improvement (for example) we can simply start the pipeline again.
* I got rid of the unpleasant (and inefficient) rewriterSetFromType/Co functions.
With Richard I concluded that they are never needed.
* I discovered Wrinkle (W1) in Note [Wanteds rewrite Wanteds] in
GHC.Tc.Types.Constraint, and therefore now prioritise non-rewritten equalities.
Quite a few error messages change, I think always for the better.
Compiler runtime stays about the same, with one outlier: a 17% improvement in T17836
Metric Decrease:
T17836
T18223
- - - - -
5cad28e7 by Bartłomiej Cieślar at 2023-05-12T23:51:06-04:00
Cleanup of dynflags override in export renaming
The deprecation warnings are normally emitted whenever the name's GRE is being looked up, which calls the GHC.Rename.Env.addUsedGRE function. We do not want those warnings to be emitted when renaming export lists, so they are artificially turned off by removing all warning categories from DynFlags at the beginning of GHC.Tc.Gen.Export.rnExports. This commit removes that dependency by unifying the function used for GRE lookup in lookup_ie to lookupGreAvailRn and disabling the call to addUsedGRE in said function (the warnings are also disabled in a call to lookupSubBndrOcc_helper in lookupChildrenExport), as per #17957. This commit also changes the setting for whether to warn about deprecated names in addUsedGREs to be an explicit enum instead of a boolean.
- - - - -
d85ed900 by Alexis King at 2023-05-13T08:45:18-04:00
Use a uniform return convention in bytecode for unary results
fixes #22958
- - - - -
8a0d45f7 by Bodigrim at 2023-05-13T08:45:58-04:00
Add more instances for Compose: Enum, Bounded, Num, Real, Integral
See https://github.com/haskell/core-libraries-committee/issues/160 for discussion
- - - - -
902f0730 by Simon Peyton Jones at 2023-05-13T14:58:34-04:00
Make GHC.Types.Id.Make.shouldUnpackTy a bit more clever
As #23307, GHC.Types.Id.Make.shouldUnpackTy was leaving money on the
table, failing to unpack arguments that are perfectly unpackable.
The fix is pretty easy; see Note [Recursive unboxing]
- - - - -
a5451438 by sheaf at 2023-05-13T14:59:13-04:00
Fix bad multiplicity role in tyConAppFunCo_maybe
The function tyConAppFunCo_maybe produces a multiplicity coercion
for the multiplicity argument of the function arrow, except that
it could be at the wrong role if asked to produce a representational
coercion. We fix this by using the 'funRole' function, which computes
the right roles for arguments to the function arrow TyCon.
Fixes #23386
- - - - -
5b9e9300 by sheaf at 2023-05-15T11:26:59-04:00
Turn "ambiguous import" error into a panic
This error should never occur, as a lookup of a type or data constructor
should never be ambiguous. This is because a single module cannot export
multiple Names with the same OccName, as per item (1) of
Note [Exporting duplicate declarations] in GHC.Tc.Gen.Export.
This code path was intended to handle duplicate record fields, but the
rest of the code had since been refactored to handle those in a
different way.
We also remove the AmbiguousImport constructor of IELookupError, as
it is no longer used.
Fixes #23302
- - - - -
e305e60c by M Farkas-Dyck at 2023-05-15T11:27:41-04:00
Unbreak some tests with latest GNU grep, which now warns about stray '\'.
Confusingly, the testsuite mangled the error to say "stray /".
We also migrate some tests from grep to grep -E, as it seems the author actually wanted an "POSIX extended" (a.k.a. sane) regex.
Background: POSIX specifies 2 "regex" syntaxen: "basic" and "extended". Of these, only "extended" syntax is actually a regular expression. Furthermore, "basic" syntax is inconsistent in its use of the '\' character — sometimes it escapes a regex metacharacter, but sometimes it unescapes it, i.e. it makes an otherwise normal character become a metacharacter. This baffles me and it seems also the authors of these tests. Also, the regex(7) man page (at least on Linux) says "basic" syntax is obsolete. Nearly all modern tools and libraries are consistent in this use of the '\' character (of which many use "extended" syntax by default).
- - - - -
5ae81842 by sheaf at 2023-05-15T14:49:17-04:00
Improve "ambiguous occurrence" error messages
This error was sometimes a bit confusing, especially when data families
were involved. This commit improves the general presentation of the
"ambiguous occurrence" error, and adds a bit of extra context in the
case of data families.
Fixes #23301
- - - - -
2f571afe by Sylvain Henry at 2023-05-15T14:50:07-04:00
Fix GHCJS OS platform (fix #23346)
- - - - -
86aae570 by Oleg Grenrus at 2023-05-15T14:50:43-04:00
Split DynFlags structure into own module
This will allow to make command line parsing to depend on
diagnostic system (which depends on dynflags)
- - - - -
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
- - - - -
2b1a4abe by Ryan Scott at 2023-06-09T07:56:58-04:00
Restore mingwex dependency on Windows
This partially reverts some of the changes in !9475 to make `base` and
`ghc-prim` depend on the `mingwex` library on Windows. It also restores the
RTS's stubs for `mingwex`-specific symbols such as `_lock_file`.
This is done because the C runtime provides `libmingwex` nowadays, and
moreoever, not linking against `mingwex` requires downstream users to link
against it explicitly in difficult-to-predict circumstances. Better to always
link against `mingwex` and prevent users from having to do the guesswork
themselves.
See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/10360#note_495873 for
the discussion that led to this.
- - - - -
28954758 by Ryan Scott at 2023-06-09T07:56:58-04:00
RtsSymbols.c: Remove mingwex symbol stubs
As of !9475, the RTS now links against `ucrt` instead of `msvcrt` on Windows,
which means that the RTS no longer needs to declare stubs for the `__mingw_*`
family of symbols. Let's remove these stubs to avoid confusion.
Fixes #23309.
- - - - -
3ab0155b by Ryan Scott at 2023-06-09T07:57:35-04:00
Consistently use validity checks for TH conversion of data constructors
We were checking that TH-spliced data declarations do not look like this:
```hs
data D :: Type = MkD Int
```
But we were only doing so for `data` declarations' data constructors, not for
`newtype`s, `data instance`s, or `newtype instance`s. This patch factors out
the necessary validity checks into its own `cvtDataDefnCons` function and uses
it in all of the places where it needs to be.
Fixes #22559.
- - - - -
a24b83dd by Matthew Pickering at 2023-06-09T15:19:00-04:00
Fix behaviour of -keep-tmp-files when used in OPTIONS_GHC pragma
This fixes the behaviour of -keep-tmp-files when used in an OPTIONS_GHC
pragma for files with module level scope.
Instead of simple not deleting the files, we also need to remove them
from the TmpFs so they are not deleted later on when all the other files
are deleted.
There are additional complications because you also need to remove the
directory where these files live from the TmpFs so we don't try to
delete those later either.
I added two tests.
1. Tests simply that -keep-tmp-files works at all with a single module
and --make mode.
2. The other tests that temporary files are deleted for other modules
which don't enable -keep-tmp-files.
Fixes #23339
- - - - -
dcf32882 by Matthew Pickering at 2023-06-09T15:19:00-04:00
withDeferredDiagnostics: When debugIsOn, write landmine into IORef to catch use-after-free.
Ticket #23305 reports an error where we were attempting to use the
logger which was created by withDeferredDiagnostics after its scope had
ended.
This problem would have been caught by this patch and a validate build:
```
+*** Exception: Use after free
+CallStack (from HasCallStack):
+ error, called at compiler/GHC/Driver/Make.hs:<line>:<column> in <package-id>:GHC.Driver.Make
```
This general issue is tracked by #20981
- - - - -
432c736c by Matthew Pickering at 2023-06-09T15:19:00-04:00
Don't return complete HscEnv from upsweep
By returning a complete HscEnv from upsweep the logger (as introduced by
withDeferredDiagnostics) was escaping the scope of
withDeferredDiagnostics and hence we were losing error messages.
This is reminiscent of #20981, which also talks about writing errors
into messages after their scope has ended.
See #23305 for details.
- - - - -
26013cdc by Alexander McKenna at 2023-06-09T15:19:41-04:00
Dump `SpecConstr` specialisations separately
Introduce a `-ddump-spec-constr` flag which debugs specialisations from
`SpecConstr`. These are no longer shown when you use `-ddump-spec`.
- - - - -
4639100b by Matthew Pickering at 2023-06-09T18:50:43-04:00
Add role annotations to SNat, SSymbol and SChar
Ticket #23454 explained it was possible to implement unsafeCoerce
because SNat was lacking a role annotation.
As these are supposed to be singleton types but backed by an efficient
representation the correct annotation is nominal to ensure these kinds
of coerces are forbidden.
These annotations were missed from https://github.com/haskell/core-libraries-committee/issues/85
which was implemented in 532de36870ed9e880d5f146a478453701e9db25d.
CLC Proposal: https://github.com/haskell/core-libraries-committee/issues/170
Fixes #23454
- - - - -
9c0dcff7 by Matthew Pickering at 2023-06-09T18:51:19-04:00
Remove non-existant bytearray-ops.txt.pp file from ghc.cabal.in
This broke the sdist generation.
Fixes #23489
- - - - -
273ff0c7 by David Binder at 2023-06-09T18:52:00-04:00
Regression test T13438 is no longer marked as "expect_broken" in the testsuite driver.
- - - - -
b84a2900 by Andrei Borzenkov at 2023-06-10T08:27:28-04:00
Fix -Wterm-variable-capture scope (#23434)
-Wterm-variable-capture wasn't accordant with type variable
scoping in associated types, in type classes. For example,
this code produced the warning:
k = 12
class C k a where
type AT a :: k -> Type
I solved this issue by reusing machinery of newTyVarNameRn function
that is accordand with associated types: it does lookup for each free type
variable when we are in the type class context. And in this patch I
use result of this work to make sure that -Wterm-variable-capture warns
only on implicitly quantified type variables.
- - - - -
9d1a8d87 by Jorge Mendes at 2023-06-10T08:28:10-04:00
Remove redundant case statement in rts/js/mem.js.
- - - - -
a1f350e2 by Oleg Grenrus at 2023-06-13T09:42:16-04:00
Change WarningWithFlag to plural WarningWithFlags
Resolves #22825
Now each diagnostic can name multiple different warning flags for its reason.
There is currently one use case: missing signatures.
Currently we need to check which warning flags are enabled when
generating the diagnostic, which is against the declarative nature of
the diagnostic framework.
This patch allows a warning diagnostic to have multiple warning flags,
which makes setup more declarative.
The WarningWithFlag pattern synonym is added for backwards compatibility
The 'msgEnvReason' field is added to MsgEnvelope to store the
`ResolvedDiagnosticReason`, which accounts for the enabled flags, and
then that is used for pretty printing the diagnostic.
- - - - -
ec01f0ec by Matthew Pickering at 2023-06-13T09:42:59-04:00
Add a test Way for running ghci with Core optimizations
Tracking ticket: #23059
This runs compile_and_run tests with optimised code with bytecode
interpreter
Changed submodules: hpc, process
Co-authored-by: Torsten Schmits <git at tryp.io>
- - - - -
c6741e72 by Rodrigo Mesquita at 2023-06-13T09:43:38-04:00
Configure -Qunused-arguments instead of hardcoding it
When GHC invokes clang, it currently passes -Qunused-arguments to
discard warnings resulting from GHC using multiple options that aren't
used.
In this commit, we configure -Qunused-arguments into the Cc options
instead of checking if the compiler is clang at runtime and hardcoding
the flag into GHC.
This is part of the effort to centralise toolchain information in
toolchain target files at configure time with the end goal of a runtime
retargetable GHC.
This also means we don't need to call getCompilerInfo ever, which
improves performance considerably (see !10589).
Metric Decrease:
PmSeriesG
T10421
T11303b
T12150
T12227
T12234
T12425
T13035
T13253-spj
T13386
T15703
T16875
T17836b
T17977
T17977b
T18140
T18282
T18304
T18698a
T18698b
T18923
T20049
T21839c
T3064
T5030
T5321FD
T5321Fun
T5837
T6048
T9020
T9198
T9872d
T9961
- - - - -
0128db87 by Victor Cacciari Miraldo at 2023-06-13T09:44:18-04:00
Improve docs for Data.Fixed; adds 'realToFrac' as an option for conversion
between different precisions.
- - - - -
95b69cfb by Ryan Scott at 2023-06-13T09:44:55-04:00
Add regression test for #23143
!10541, the fix for #23323, also fixes #23143. Let's add a regression test to
ensure that it stays fixed.
Fixes #23143.
- - - - -
ed2dbdca by Emily Martins at 2023-06-13T09:45:37-04:00
delete GHCi.UI.Tags module and remove remaining references
Co-authored-by: Tilde Rose <t1lde at protonmail.com>
- - - - -
c90d96e4 by Victor Cacciari Miraldo at 2023-06-13T09:46:26-04:00
Add regression test for 17328
- - - - -
de58080c by Victor Cacciari Miraldo at 2023-06-13T09:46:26-04:00
Skip checking whether constructors are in scope when deriving
newtype instances.
Fixes #17328
- - - - -
5e3c2b05 by Philip Hazelden at 2023-06-13T09:47:07-04:00
Don't suggest `DeriveAnyClass` when instance can't be derived.
Fixes #19692.
Prototypical cases:
class C1 a where
x1 :: a -> Int
data G1 = G1 deriving C1
class C2 a where
x2 :: a -> Int
x2 _ = 0
data G2 = G2 deriving C2
Both of these used to give this suggestion, but for C1 the suggestion
would have failed (generated code with undefined methods, which compiles
but warns). Now C2 still gives the suggestion but C1 doesn't.
- - - - -
80a0b099 by David Binder at 2023-06-13T09:47:49-04:00
Add testcase for error GHC-00711 to testsuite
- - - - -
e4b33a1d by Oleg Grenrus at 2023-06-14T07:01:21-04:00
Add -Wmissing-poly-kind-signatures
Implements #22826
This is a restricted version of -Wmissing-kind-signatures shown only for polykinded types.
- - - - -
f8395b94 by doyougnu at 2023-06-14T07:02:01-04:00
ci: special case in req_host_target_ghc for JS
- - - - -
b852a5b6 by Gergo ERDI at 2023-06-14T07:02:42-04:00
When forcing a `ModIface`, force the `MINIMAL` pragmas in class definitions
Fixes #23486
- - - - -
c29b45ee by Krzysztof Gogolewski at 2023-06-14T07:03:19-04:00
Add a testcase for #20076
Remove 'recursive' in the error message, since the error
can arise without recursion.
- - - - -
b80ef202 by Krzysztof Gogolewski at 2023-06-14T07:03:56-04:00
Use tcInferFRR to prevent bad generalisation
Fixes #23176
- - - - -
bd8ef37d by Matthew Pickering at 2023-06-14T07:04:31-04:00
ci: Add dependenices on necessary aarch64 jobs for head.hackage ci
These need to be added since we started testing aarch64 on head.hackage
CI. The jobs will sometimes fail because they will start before the
relevant aarch64 job has finished.
Fixes #23511
- - - - -
a0c27cee by Vladislav Zavialov at 2023-06-14T07:05:08-04:00
Add standalone kind signatures for Code and TExp
CodeQ and TExpQ already had standalone kind signatures
even before this change:
type TExpQ :: TYPE r -> Kind.Type
type CodeQ :: TYPE r -> Kind.Type
Now Code and TExp have signatures too:
type TExp :: TYPE r -> Kind.Type
type Code :: (Kind.Type -> Kind.Type) -> TYPE r -> Kind.Type
This is a stylistic change.
- - - - -
e70c1245 by Tom Ellis at 2023-06-14T07:05:48-04:00
Warn that GHC.TypeLits.Internal should not be used
- - - - -
100650e3 by Tom Ellis at 2023-06-14T07:05:48-04:00
Warn that GHC.TypeNats.Internal should not be used
- - - - -
078250ef by Jacco Krijnen at 2023-06-14T17:17:53-04:00
Add more flags for dumping core passes (#23491)
- - - - -
1b7604af by Jacco Krijnen at 2023-06-14T17:17:53-04:00
Add tests for dumping flags (#23491)
- - - - -
42000000 by Sebastian Graf at 2023-06-14T17:18:29-04:00
Provide a demand signature for atomicModifyMutVar.# (#23047)
Fixes #23047
- - - - -
8f27023b by Ben Gamari at 2023-06-15T03:10:24-04:00
compiler: Cross-reference Note [StgToJS design]
In particular, the numeric representations are quite useful context in a
few places.
- - - - -
a71b60e9 by Andrei Borzenkov at 2023-06-15T03:11:00-04:00
Implement the -Wimplicit-rhs-quantification warning (#23510)
GHC Proposal #425 "Invisible binders in type declarations" forbids
implicit quantification of type variables that occur free on the
right-hand side of a type synonym but are not mentioned on the left-hand side.
The users are expected to rewrite this using invisible binders:
type T1 :: forall a . Maybe a
type T1 = 'Nothing :: Maybe a -- old
type T1 @a = 'Nothing :: Maybe a -- new
Since the @k-binders are a new feature, we need to wait for three releases
before we require the use of the new syntax. In the meantime, we ought to
provide users with a new warning, -Wimplicit-rhs-quantification, that would
detect when such implicit quantification takes place, and include it in -Wcompat.
- - - - -
0078dd00 by Sven Tennie at 2023-06-15T03:11:36-04:00
Minor refactorings to mkSpillInstr and mkLoadInstr
Better error messages. And, use the existing `off` constant to reduce
duplication.
- - - - -
1792b57a by doyougnu at 2023-06-15T03:12:17-04:00
JS: merge util modules
Merge Core and StgUtil modules for StgToJS pass.
Closes: #23473
- - - - -
469ff08b by Vladislav Zavialov at 2023-06-15T03:12:57-04:00
Check visibility of nested foralls in can_eq_nc (#18863)
Prior to this change, `can_eq_nc` checked the visibility of the
outermost layer of foralls:
forall a. forall b. forall c. phi1
forall x. forall y. forall z. phi2
^^
up to here
Then it delegated the rest of the work to `can_eq_nc_forall`, which
split off all foralls:
forall a. forall b. forall c. phi1
forall x. forall y. forall z. phi2
^^
up to here
This meant that some visibility flags were completely ignored.
We fix this oversight by moving the check to `can_eq_nc_forall`.
- - - - -
59c9065b by Luite Stegeman at 2023-06-15T03:13:37-04:00
JS: use regular mask for blocking IO
Blocking IO used uninterruptibleMask which should make any thread
blocked on IO unreachable by async exceptions (such as those from
timeout). This changes it to a regular mask.
It's important to note that the nodejs runtime does not actually
interrupt the blocking IO when the Haskell thread receives an
async exception, and that file positions may be updated and buffers
may be written after the Haskell thread has already resumed.
Any file descriptor affected by an async exception interruption
should therefore be used with caution.
- - - - -
907c06c3 by Luite Stegeman at 2023-06-15T03:13:37-04:00
JS: nodejs: do not set 'readable' handler on stdin at startup
The Haskell runtime used to install a 'readable' handler on stdin
at startup in nodejs. This would cause the nodejs system to start
buffering the stream, causing data loss if the stdin file
descriptor is passed to another process.
This change delays installation of the 'readable' handler until
the first read of stdin by Haskell code.
- - - - -
a54b40a9 by Luite Stegeman at 2023-06-15T03:13:37-04:00
JS: reserve one more virtual (negative) file descriptor
This is needed for upcoming support of the process package
- - - - -
78cd1132 by Andrei Borzenkov at 2023-06-15T11:16:11+04:00
Report scoped kind variables at the type-checking phase (#16635)
This patch modifies the renamer to respect ScopedTypeVariables in kind
signatures. This means that kind variables bound by the outermost
`forall` now scope over the type:
type F = '[Right @a @() () :: forall a. Either a ()]
-- ^^^^^^^^^^^^^^^ ^^^
-- in scope here bound here
However, any use of such variables is a type error, because we don't
have type-level lambdas to bind them in Core. This is described in the
new Note [Type variable scoping errors during type check] in GHC.Tc.Types.
- - - - -
4a41ba75 by Sylvain Henry at 2023-06-15T18:09:15-04:00
JS: testsuite: use correct ticket number
Replace #22356 with #22349 for these tests because #22356 has been fixed
but now these tests fail because of #22349.
- - - - -
15f150c8 by Sylvain Henry at 2023-06-15T18:09:16-04:00
JS: testsuite: update ticket numbers
- - - - -
08d8e9ef by Sylvain Henry at 2023-06-15T18:09:16-04:00
JS: more triage
- - - - -
e8752e12 by Krzysztof Gogolewski at 2023-06-15T18:09:52-04:00
Fix test T18522-deb-ppr
Fixes #23509
- - - - -
62c56416 by Ben Price at 2023-06-16T05:52:39-04:00
Lint: more details on "Occurrence is GlobalId, but binding is LocalId"
This is helpful when debugging a pass which accidentally shadowed a
binder.
- - - - -
d4c10238 by Ryan Hendrickson at 2023-06-16T05:53:22-04:00
Clean a stray bit of text in user guide
- - - - -
93647b5c by Vladislav Zavialov at 2023-06-16T05:54:02-04:00
testsuite: Add forall visibility test cases
The added tests ensure that the type checker does not confuse
visible and invisible foralls.
VisFlag1: kind-checking type applications and inferred type variable instantiations
VisFlag1_ql: kind-checking Quick Look instantiations
VisFlag2: kind-checking type family instances
VisFlag3: checking kind annotations on type parameters of associated type families
VisFlag4: checking kind annotations on type parameters in type declarations with SAKS
VisFlag5: checking the result kind annotation of data family instances
- - - - -
a5f0c00e by Sylvain Henry at 2023-06-16T12:25:40-04:00
JS: factorize SaneDouble into its own module
Follow-up of b159e0e9 whose ticket is #22736
- - - - -
0baf9e7c by Krzysztof Gogolewski at 2023-06-16T12:26:17-04:00
Add tests for #21973
- - - - -
640ea90e by Diego Diverio at 2023-06-16T23:07:55-04:00
Update documentation for `<**>`
- - - - -
2469a813 by Diego Diverio at 2023-06-16T23:07:55-04:00
Update text
- - - - -
1f515bbb by Diego Diverio at 2023-06-16T23:07:55-04:00
Update examples
- - - - -
7af99a0d by Diego Diverio at 2023-06-16T23:07:55-04:00
Update documentation to actually display code correctly
- - - - -
800aad7e by Andrei Borzenkov at 2023-06-16T23:08:32-04:00
Type/data instances: require that variables on the RHS are mentioned on the LHS (#23512)
GHC Proposal #425 "Invisible binders in type declarations" restricts the
scope of type and data family instances as follows:
In type family and data family instances, require that every variable
mentioned on the RHS must also occur on the LHS.
For example, here are three equivalent type instance definitions accepted before this patch:
type family F1 a :: k
type instance F1 Int = Any :: j -> j
type family F2 a :: k
type instance F2 @(j -> j) Int = Any :: j -> j
type family F3 a :: k
type instance forall j. F3 Int = Any :: j -> j
- In F1, j is implicitly quantified and it occurs only on the RHS;
- In F2, j is implicitly quantified and it occurs both on the LHS and the RHS;
- In F3, j is explicitly quantified.
Now F1 is rejected with an out-of-scope error, while F2 and F3 continue to be accepted.
- - - - -
9132d529 by Sylvain Henry at 2023-06-18T02:50:34-04:00
JS: testsuite: use correct ticket numbers
- - - - -
c3a1274c by Sylvain Henry at 2023-06-18T02:50:34-04:00
JS: don't dump eventlog to stderr by default
Fix T16707
Bump stm submodule
- - - - -
89bb8ad8 by Ryan Hendrickson at 2023-06-18T02:51:14-04:00
Fix TH name lookup for symbolic tycons (#23525)
- - - - -
cb9e1ce4 by Finley McIlwaine at 2023-06-18T21:16:45-06:00
IPE data compression
IPE data resulting from the `-finfo-table-map` flag may now be
compressed by configuring the GHC build with the
`--enable-ipe-data-compression` flag. This results in about a 20%
reduction in the size of IPE-enabled build results.
The compression library, zstd, may optionally be statically linked by
configuring with the `--enabled-static-libzstd` flag (on non-darwin
platforms)
libzstd version 1.4.0 or greater is required.
- - - - -
0cbc3ae0 by Gergő Érdi at 2023-06-19T09:11:38-04:00
Add `IfaceWarnings` to represent the `ModIface`-storable parts
of a `Warnings GhcRn`.
Fixes #23516
- - - - -
3e80c2b4 by Arnaud Spiwack at 2023-06-20T03:19:41-04:00
Avoid desugaring non-recursive lets into recursive lets
This prepares for having linear let expressions in the frontend.
When desugaring lets, SPECIALISE statements create more copies of a
let binding. Because of the rewrite rules attached to the bindings,
there are dependencies between the generated binds.
Before this commit, we simply wrapped all these in a mutually
recursive let block, and left it to the simplified to sort it out.
With this commit: we are careful to generate the bindings in
dependency order, so that we can wrap them in consecutive lets (if the
source is non-recursive).
- - - - -
9fad49e0 by Ben Gamari at 2023-06-20T03:20:19-04:00
rts: Do not call exit() from SIGINT handler
Previously `shutdown_handler` would call `stg_exit` if the scheduler was
Oalready found to be in `SCHED_INTERRUPTING` state (or higher). However,
`stg_exit` is not signal-safe as it calls `exit` (which calls `atexit`
handlers). The only safe thing to do in this situation is to call
`_exit`, which terminates with minimal cleanup.
Fixes #23417.
- - - - -
7485f848 by Bodigrim at 2023-06-20T03:20:57-04:00
Bump Cabal submodule
This requires changing the recomp007 test because now cabal passes
`this-unit-id` to executable components, and that unit-id contains a
hash which includes the ABI of the dependencies. Therefore changing the
dependencies means that -this-unit-id changes and recompilation is
triggered.
The spririt of the test is to test GHC's recompilation logic assuming
that `-this-unit-id` is constant, so we explicitly pass `-ipid` to
`./configure` rather than letting `Cabal` work it out.
- - - - -
1464a2a8 by mangoiv at 2023-06-20T03:21:34-04:00
[feat] add a hint to `HasField` error message
- add a hint that indicates that the record that the record dot is used
on might just be missing a field
- as the intention of the programmer is not entirely clear, it is only
shown if the type is known
- This addresses in part issue #22382
- - - - -
b65e78dd by Ben Gamari at 2023-06-20T16:56:43-04:00
rts/ipe: Fix unused lock warning
- - - - -
6086effd by Ben Gamari at 2023-06-20T16:56:44-04:00
rts/ProfilerReportJson: Fix memory leak
- - - - -
1e48c434 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Various warnings fixes
- - - - -
471486b9 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Fix printf format mismatch
- - - - -
80603fb3 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Fix incorrect #include <sys/poll.h>
According to Alpine's warnings and poll(2), <poll.h> should be
preferred.
- - - - -
ff18e6fd by Ben Gamari at 2023-06-20T16:56:44-04:00
nonmoving: Fix unused definition warrnings
- - - - -
6e7fe8ee by Ben Gamari at 2023-06-20T16:56:44-04:00
Disable futimens on Darwin.
See #22938
- - - - -
b7706508 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Fix incorrect CPP guard
- - - - -
94f00e9b by Ben Gamari at 2023-06-20T16:56:44-04:00
hadrian: Ensure that -Werror is passed when compiling the RTS.
Previously the `+werror` transformer would only pass `-Werror` to GHC,
which does not ensure that the same is passed to the C compiler when
building the RTS. Arguably this is itself a bug but for now we will just
work around this by passing `-optc-Werror` to GHC.
I tried to enable `-Werror` in all C compilations but the boot libraries
are something of a portability nightmare.
- - - - -
5fb54bf8 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Disable `#pragma GCC`s on clang compilers
Otherwise the build fails due to warnings. See #23530.
- - - - -
cf87f380 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Fix capitalization of prototype
- - - - -
17f250d7 by Ben Gamari at 2023-06-20T16:56:44-04:00
rts: Fix incorrect format specifier
- - - - -
0ff1c501 by Josh Meredith at 2023-06-20T16:57:20-04:00
JS: remove js_broken(22576) in favour of the pre-existing wordsize(32) condition (#22576)
- - - - -
3d1d42b7 by Finley McIlwaine at 2023-06-21T12:04:58-04:00
Memory usage fixes for Haddock
- Do not include `mi_globals` in the `NoBackend` backend. It was only included
for Haddock, but Haddock does not actually need it. This causes a 200MB
reduction in max residency when generating haddocks on the Agda codebase
(roughly 1GB to 800MB).
- Make haddock_{parser,renamer}_perf tests more accurate by forcing docs to
be written to interface files using `-fwrite-interface`
Bumps haddock submodule.
Metric Decrease:
haddock.base
- - - - -
8185b1c2 by Finley McIlwaine at 2023-06-21T12:04:58-04:00
Fix associated data family doc structure items
Associated data families were being given their own export DocStructureItems,
which resulted in them being documented separately from their classes in
haddocks. This commit fixes it.
- - - - -
4d356ea3 by Sylvain Henry at 2023-06-21T12:04:59-04:00
JS: implement TH support
- Add ghc-interp.js bootstrap script for the JS interpreter
- Interactively link and execute iserv code from the ghci package
- Incrementally load and run JS code for splices into the running iserv
Co-authored-by: Luite Stegeman <stegeman at gmail.com>
- - - - -
3249cf12 by Sylvain Henry at 2023-06-21T12:04:59-04:00
Don't use getKey
- - - - -
f84ff161 by Sylvain Henry at 2023-06-21T12:04:59-04:00
Stg: return imported FVs
This is used to determine what to link when using the interpreter.
For now it's only used by the JS interpreter but it could easily be used
by the native interpreter too (instead of extracting names from compiled BCOs).
- - - - -
fab2ad23 by Sylvain Henry at 2023-06-21T12:04:59-04:00
Fix some recompilation avoidance tests
- - - - -
a897dc13 by Sylvain Henry at 2023-06-21T12:04:59-04:00
TH_import_loop is now broken as expected
- - - - -
dbb4ad51 by Sylvain Henry at 2023-06-21T12:04:59-04:00
JS: always recompile when TH is enabled (cf #23013)
- - - - -
711b1d24 by Bartłomiej Cieślar at 2023-06-21T12:59:27-04:00
Add support for deprecating exported items (proposal #134)
This is an implementation of the deprecated exports proposal #134.
The proposal introduces an ability to introduce warnings to exports.
This allows for deprecating a name only when it is exported from a specific
module, rather than always depreacting its usage. In this example:
module A ({-# DEPRECATED "do not use" #-} x) where
x = undefined
---
module B where
import A(x)
`x` will emit a warning when it is explicitly imported.
Like the declaration warnings, export warnings are first accumulated within
the `Warnings` struct, then passed into the ModIface, from which they are
then looked up and warned about in the importing module in the `lookup_ie`
helpers of the `filterImports` function (for the explicitly imported names)
and in the `addUsedGRE(s)` functions where they warn about regular usages
of the imported name.
In terms of the AST information, the custom warning is stored in the
extension field of the variants of the `IE` type (see Trees that Grow for
more information).
The commit includes a bump to the haddock submodule added in MR #28
Signed-off-by: Bartłomiej Cieślar <bcieslar2001 at gmail.com>
- - - - -
c1865854 by Ben Gamari at 2023-06-21T12:59:30-04:00
configure: Bump version to 9.8
Bumps Haddock submodule
- - - - -
4e1de71c by Ben Gamari at 2023-06-21T21:07:48-04:00
configure: Bump version to 9.9
Bumps haddock submodule.
- - - - -
5b6612bc by Ben Gamari at 2023-06-23T03:56:49-04:00
rts: Work around missing prototypes errors
Darwin's toolchain inexpliciably claims that `write_barrier` and friends
have declarations without prototypes, despite the fact that (a) they are
definitions, and (b) the prototypes appear only a few lines above. Work
around this by making the definitions proper prototypes.
- - - - -
43b66a13 by Matthew Pickering at 2023-06-23T03:57:26-04:00
ghcup-metadata: Fix date modifier (M = minutes, m = month)
Fixes #23552
- - - - -
564164ef by Luite Stegeman at 2023-06-24T10:27:29+09:00
Support large stack frames/offsets in GHCi bytecode interpreter
Bytecode instructions like PUSH_L (push a local variable) contain
an operand that refers to the stack slot. Before this patch, the
operand type was SmallOp (Word16), limiting the maximum stack
offset to 65535 words. This could cause compiler panics in some
cases (See #22888).
This patch changes the operand type for stack offsets from
SmallOp to Op, removing the stack offset limit.
Fixes #22888
- - - - -
8d6574bc by Sylvain Henry at 2023-06-26T13:15:06-04:00
JS: support levity-polymorphic datatypes (#22360,#22291)
- thread knowledge about levity into PrimRep instead of panicking
- JS: remove assumption that unlifted heap objects are rts objects (TVar#, etc.)
Doing this also fixes #22291 (test added).
There is a small performance hit (~1% more allocations).
Metric Increase:
T18698a
T18698b
- - - - -
5578bbad by Matthew Pickering at 2023-06-26T13:15:43-04:00
MR Review Template: Mention "Blocked on Review" label
In order to improve our MR review processes we now have the label
"Blocked on Review" which allows people to signal that a MR is waiting
on a review to happen.
See: https://mail.haskell.org/pipermail/ghc-devs/2023-June/021255.html
- - - - -
4427e9cf by Matthew Pickering at 2023-06-26T13:15:43-04:00
Move MR template to Default.md
This makes it more obvious what you have to modify to affect the default
template rather than looking in the project settings.
- - - - -
522bd584 by Arnaud Spiwack at 2023-06-26T13:16:33-04:00
Revert "Avoid desugaring non-recursive lets into recursive lets"
This (temporary) reverts commit 3e80c2b40213bebe302b1bd239af48b33f1b30ef.
Fixes #23550
- - - - -
c59fbb0b by Torsten Schmits at 2023-06-26T19:34:20+02:00
Propagate breakpoint information when inlining across modules
Tracking ticket: #23394
MR: !10448
* Add constructor `IfaceBreakpoint` to `IfaceTickish`
* Store breakpoint data in interface files
* Store `BreakArray` for the breakpoint's module, not the current module, in BCOs
* Store module name in BCOs instead of `Unique`, since the `Unique` from an `Iface` doesn't match the modules in GHCi's
state
* Allocate module name in `ModBreaks`, like `BreakArray`
* Lookup breakpoint by module name in GHCi
* Skip creating breakpoint instructions when no `ModBreaks` are available, rather than injecting `ModBreaks` in the
linker when breakpoints are enabled, and panicking when `ModBreaks` is missing
- - - - -
6f904808 by Greg Steuck at 2023-06-27T16:53:07-04:00
Remove undefined FP_PROG_LD_BUILD_ID from configure.ac's
- - - - -
e89aa072 by Andrei Borzenkov at 2023-06-27T16:53:44-04:00
Remove arity inference in type declarations (#23514)
Arity inference in type declarations was introduced
as a workaround for the lack of @k-binders.
They were added in 4aea0a72040, so I simplified all
of this by simply removing arity inference altogether.
This is part of GHC Proposal #425 "Invisible binders in type
declarations".
- - - - -
459dee1b by Torsten Schmits at 2023-06-27T16:54:20-04:00
Relax defaulting of RuntimeRep/Levity when printing
Fixes #16468
MR: !10702
Only default RuntimeRep to LiftedRep when variables are bound by the toplevel forall
- - - - -
151f8f18 by Torsten Schmits at 2023-06-27T16:54:57-04:00
Remove duplicate link label in linear types docs
- - - - -
ecdc4353 by Rodrigo Mesquita at 2023-06-28T12:24:57-04:00
Stop configuring unused Ld command in `settings`
GHC has no direct dependence on the linker. Rather, we depend upon the C
compiler for linking and an object-merging program (which is typically
`ld`) for production of GHCi objects and merging of C stubs into final
object files.
Despite this, for historical reasons we still recorded information about
the linker into `settings`. Remove these entries from `settings`,
`hadrian/cfg/system.config`, as well as the `configure` logic
responsible for this information.
Closes #23566.
- - - - -
bf9ec3e4 by Bryan Richter at 2023-06-28T12:25:33-04:00
Remove extraneous debug output
- - - - -
7eb68dd6 by Bryan Richter at 2023-06-28T12:25:33-04:00
Work with unset vars in -e mode
- - - - -
49c27936 by Bryan Richter at 2023-06-28T12:25:33-04:00
Pass positional arguments in their positions
By quoting $cmd, the default "bash -i" is a single argument to run, and
no file named "bash -i" actually exists to be run.
- - - - -
887dc4fc by Bryan Richter at 2023-06-28T12:25:33-04:00
Handle unset value in -e context
- - - - -
5ffc7d7b by Rodrigo Mesquita at 2023-06-28T21:07:36-04:00
Configure CPP into settings
There is a distinction to be made between the Haskell Preprocessor and
the C preprocessor. The former is used to preprocess Haskell files,
while the latter is used in C preprocessing such as Cmm files.
In practice, they are both the same program (usually the C compiler) but
invoked with different flags.
Previously we would, at configure time, configure the haskell
preprocessor and save the configuration in the settings file, but,
instead of doing the same for CPP, we had hardcoded in GHC that the CPP
program was either `cc -E` or `cpp`.
This commit fixes that asymmetry by also configuring CPP at configure
time, and tries to make more explicit the difference between HsCpp and
Cpp (see Note [Preprocessing invocations]).
Note that we don't use the standard CPP and CPPFLAGS to configure Cpp,
but instead use the non-standard --with-cpp and --with-cpp-flags.
The reason is that autoconf sets CPP to "$CC -E", whereas we expect the
CPP command to be configured as a standalone executable rather than a
command. These are symmetrical with --with-hs-cpp and
--with-hs-cpp-flags.
Cleanup: Hadrian no longer needs to pass the CPP configuration for CPP
to be C99 compatible through -optP, since we now configure that
into settings.
Closes #23422
- - - - -
5efa9ca5 by Ben Gamari at 2023-06-28T21:08:13-04:00
hadrian: Always canonicalize topDirectory
Hadrian's `topDirectory` is intended to provide an absolute path to the
root of the GHC tree. However, if the tree is reached via a symlink this
One question here is whether the `canonicalizePath` call is expensive
enough to warrant caching. In a quick microbenchmark I observed that
`canonicalizePath "."` takes around 10us per call; this seems
sufficiently low not to worry.
Alternatively, another approach here would have been to rather move the
canonicalization into `m4/fp_find_root.m4`. This would have avoided
repeated canonicalization but sadly path canonicalization is a hard
problem in POSIX shell.
Addresses #22451.
- - - - -
b3e1436f by aadaa_fgtaa at 2023-06-28T21:08:53-04:00
Optimise ELF linker (#23464)
- cache last elements of `relTable`, `relaTable` and `symbolTables` in `ocInit_ELF`
- cache shndx table in ObjectCode
- run `checkProddableBlock` only with debug rts
- - - - -
30525b00 by Ben Gamari at 2023-06-28T21:09:30-04:00
compiler: Introduce MO_{ACQUIRE,RELEASE}_FENCE
- - - - -
b787e259 by Ben Gamari at 2023-06-28T21:09:30-04:00
compiler: Drop MO_WriteBarrier
rts: Drop write_barrier
- - - - -
7550b4a5 by Ben Gamari at 2023-06-28T21:09:30-04:00
rts: Drop load_store_barrier()
This is no longer used.
- - - - -
d5f2875e by Ben Gamari at 2023-06-28T21:09:31-04:00
rts: Drop last instances of prim_{write,read}_barrier
- - - - -
965ac2ba by Ben Gamari at 2023-06-28T21:09:31-04:00
rts: Eliminate remaining uses of load_load_barrier
- - - - -
0fc5cb97 by Sven Tennie at 2023-06-28T21:09:31-04:00
compiler: Drop MO_ReadBarrier
- - - - -
7a7d326c by Ben Gamari at 2023-06-28T21:09:31-04:00
rts: Drop load_load_barrier
This is no longer used.
- - - - -
9f63da66 by Sven Tennie at 2023-06-28T21:09:31-04:00
Delete write_barrier function
- - - - -
bb0ed354 by Ben Gamari at 2023-06-28T21:09:31-04:00
rts: Make collectFreshWeakPtrs definition a prototype
x86-64/Darwin's toolchain inexplicably warns that collectFreshWeakPtrs
needs to be a prototype.
- - - - -
ef81a1eb by Sven Tennie at 2023-06-28T21:10:08-04:00
Fix number of free double regs
D1..D4 are defined for aarch64 and thus not free.
- - - - -
c335fb7c by Ryan Scott at 2023-06-28T21:10:44-04:00
Fix typechecking of promoted empty lists
The `'[]` case in `tc_infer_hs_type` is smart enough to handle arity-0 uses of
`'[]` (see the newly added `T23543` test case for an example), but the `'[]`
case in `tc_hs_type` was not. We fix this by changing the `tc_hs_type` case to
invoke `tc_infer_hs_type`, as prescribed in `Note [Future-proofing the type
checker]`.
There are some benign changes to test cases' expected output due to the new
code path using `forall a. [a]` as the kind of `'[]` rather than `[k]`.
Fixes #23543.
- - - - -
fcf310e7 by Rodrigo Mesquita at 2023-06-28T21:11:21-04:00
Configure MergeObjs supports response files rather than Ld
The previous configuration script to test whether Ld supported response
files was
* Incorrect (see #23542)
* Used, in practice, to check if the *merge objects tool* supported
response files.
This commit modifies the macro to run the merge objects tool (rather
than Ld), using a response file, and checking the result with $NM
Fixes #23542
- - - - -
78b2f3cc by Sylvain Henry at 2023-06-28T21:12:02-04:00
JS: fix JS stack printing (#23565)
- - - - -
9f01d14b by Matthew Pickering at 2023-06-29T04:13:41-04:00
Add -fpolymorphic-specialisation flag (off by default at all optimisation levels)
Polymorphic specialisation has led to a number of hard to diagnose
incorrect runtime result bugs (see #23469, #23109, #21229, #23445) so
this commit introduces a flag `-fpolymorhphic-specialisation` which
allows users to turn on this experimental optimisation if they are
willing to buy into things going very wrong.
Ticket #23469
- - - - -
b1e611d5 by Ben Gamari at 2023-06-29T04:14:17-04:00
Rip out runtime linker/compiler checks
We used to choose flags to pass to the toolchain at runtime based on the
platform running GHC, and in this commit we drop all of those runtime
linker checks
Ultimately, this represents a change in policy: We no longer adapt at
runtime to the toolchain being used, but rather make final decisions
about the toolchain used at /configure time/
(we have deleted Note [Run-time linker info] altogether!).
This works towards the goal of having all toolchain configuration logic
living in the same place, which facilities the work towards a
runtime-retargetable GHC (see #19877).
As of this commit, the runtime linker/compiler logic was moved to
autoconf, but soon it, and the rest of the existing toolchain
configuration logic, will live in the standalone ghc-toolchain program
(see !9263)
In particular, what used to be done at runtime is now as follows:
* The flags -Wl,--no-as-needed for needed shared libs are configured
into settings
* The flag -fstack-check is configured into settings
* The check for broken tables-next-to-code was outdated
* We use the configured c compiler by default as the assembler program
* We drop `asmOpts` because we already configure -Qunused-arguments flag
into settings (see !10589)
Fixes #23562
Co-author: Rodrigo Mesquita (@alt-romes)
- - - - -
8b35e8ca by Ben Gamari at 2023-06-29T18:46:12-04:00
Define FFI_GO_CLOSURES
The libffi shipped with Apple's XCode toolchain does not contain a
definition of the FFI_GO_CLOSURES macro, despite containing references
to said macro. Work around this by defining the macro, following the
model of a similar workaround in OpenJDK [1].
[1] https://github.com/openjdk/jdk17u-dev/pull/741/files
- - - - -
d7ef1704 by Ben Gamari at 2023-06-29T18:46:12-04:00
base: Fix incorrect CPP guard
This was guarded on `darwin_HOST_OS` instead of `defined(darwin_HOST_OS)`.
- - - - -
7c7d1f66 by Ben Gamari at 2023-06-29T18:46:48-04:00
rts/Trace: Ensure that debugTrace arguments are used
As debugTrace is a macro we must take care to ensure that
the fact is clear to the compiler lest we see warnings.
- - - - -
cb92051e by Ben Gamari at 2023-06-29T18:46:48-04:00
rts: Various warnings fixes
- - - - -
dec81dd1 by Ben Gamari at 2023-06-29T18:46:48-04:00
hadrian: Ignore warnings in unix and semaphore-compat
- - - - -
d7f6448a by Matthew Pickering at 2023-06-30T12:38:43-04:00
hadrian: Fix dependencies of docs:* rule
For the docs:* rule we need to actually build the package rather than
just the haddocks for the dependent packages. Therefore we depend on the
.conf files of the packages we are trying to build documentation for as
well as the .haddock files.
Fixes #23472
- - - - -
cec90389 by sheaf at 2023-06-30T12:39:27-04:00
Add tests for #22106
Fixes #22106
- - - - -
083794b1 by Torsten Schmits at 2023-07-03T03:27:27-04:00
Add -fbreak-points to control breakpoint insertion
Rather than statically enabling breakpoints only for the interpreter,
this adds a new flag.
Tracking ticket: #23057
MR: !10466
- - - - -
fd8c5769 by Ben Gamari at 2023-07-03T03:28:04-04:00
rts: Ensure that pinned allocations respect block size
Previously, it was possible for pinned, aligned allocation requests to
allocate beyond the end of the pinned accumulator block. Specifically,
we failed to account for the padding needed to achieve the requested
alignment in the "large object" check. With large alignment requests,
this can result in the allocator using the capability's pinned object
accumulator block to service a request which is larger than
`PINNED_EMPTY_SIZE`.
To fix this we reorganize `allocatePinned` to consistently account for
the alignment padding in all large object checks. This is a bit subtle
as we must handle the case of a small allocation request filling the
accumulator block, as well as large requests.
Fixes #23400.
- - - - -
98185d52 by Ben Gamari at 2023-07-03T03:28:05-04:00
testsuite: Add test for #23400
- - - - -
4aac0540 by Ben Gamari at 2023-07-03T03:28:42-04:00
ghc-heap: Support for BLOCKING_QUEUE closures
- - - - -
03f941f4 by Ben Bellick at 2023-07-03T03:29:29-04:00
Add some structured diagnostics in Tc/Validity.hs
This addresses the work of ticket #20118
Created the following constructors for TcRnMessage
- TcRnInaccessibleCoAxBranch
- TcRnPatersonCondFailure
- - - - -
6074cc3c by Moisés Ackerman at 2023-07-03T03:30:13-04:00
Add failing test case for #23492
- - - - -
356a2692 by Moisés Ackerman at 2023-07-03T03:30:13-04:00
Use generated src span for catch-all case of record selector functions
This fixes #23492. The problem was that we used the real source span
of the field declaration for the generated catch-all case in the
selector function, in particular in the generated call to
`recSelError`, which meant it was included in the HIE output. Using
`generatedSrcSpan` instead means that it is not included.
- - - - -
3efe7f39 by Moisés Ackerman at 2023-07-03T03:30:13-04:00
Introduce genLHsApp and genLHsLit helpers in GHC.Rename.Utils
- - - - -
dd782343 by Moisés Ackerman at 2023-07-03T03:30:13-04:00
Construct catch-all default case using helpers
GHC.Rename.Utils concrete helpers instead of wrapGenSpan + HS AST constructors
- - - - -
0e09c38e by Ryan Hendrickson at 2023-07-03T03:30:56-04:00
Add regression test for #23549
- - - - -
32741743 by Alexis King at 2023-07-03T03:31:36-04:00
perf tests: Increase default stack size for MultiLayerModules
An unhelpfully small stack size appears to have been the real culprit
behind the metric fluctuations in #19293. Debugging metric decreases
triggered by !10729 helped to finally identify the problem.
Metric Decrease:
MultiLayerModules
MultiLayerModulesTH_Make
T13701
T14697
- - - - -
82ac6bf1 by Bryan Richter at 2023-07-03T03:32:15-04:00
Add missing void prototypes to rts functions
See #23561.
- - - - -
6078b429 by Ben Gamari at 2023-07-03T03:32:51-04:00
gitlab-ci: Refactor compilation of gen_ci
Flakify and document it, making it far less sensitive to the build
environment.
- - - - -
aa2db0ae by Ben Gamari at 2023-07-03T03:33:29-04:00
testsuite: Update documentation
- - - - -
924a2362 by Gregory Gerasev at 2023-07-03T03:34:10-04:00
Better error for data deriving of type synonym/family. Closes #23522
- - - - -
4457da2a by Dave Barton at 2023-07-03T03:34:51-04:00
Fix some broken links and typos
- - - - -
de5830d0 by Ben Gamari at 2023-07-04T22:03:59-04:00
configure: Rip out Solaris dyld check
Solaris 11 was released over a decade ago and, moreover, I doubt we have
any Solaris users
- - - - -
59c5fe1d by doyougnu at 2023-07-04T22:04:56-04:00
CI: add JS release and debug builds, regen CI jobs
- - - - -
679bbc97 by Vladislav Zavialov at 2023-07-04T22:05:32-04:00
testsuite: Do not require CUSKs
Numerous tests make use of CUSKs (complete user-supplied kinds),
a legacy feature scheduled for deprecation. In order to proceed
with the said deprecation, the tests have been updated to use SAKS
instead (standalone kind signatures).
This also allows us to remove the Haskell2010 language pragmas that
were added in 115cd3c85a8 to work around the lack of CUSKs in GHC2021.
- - - - -
945d3599 by Ben Gamari at 2023-07-04T22:06:08-04:00
gitlab: Drop backport-for-8.8 MR template
Its usefulness has long passed.
- - - - -
66c721d3 by Alan Zimmerman at 2023-07-04T22:06:44-04:00
EPA: Simplify GHC/Parser.y comb2
Use the HasLoc instance from Ast.hs to allow comb2 to work with
anything with a SrcSpan
This gets rid of the custom comb2A, comb2Al, comb2N functions, and
removes various reLoc calls.
- - - - -
2be99b7e by Matthew Pickering at 2023-07-04T22:07:21-04:00
Fix deprecation warning when deprecated identifier is from another module
A stray 'Just' was being printed in the deprecation message.
Fixes #23573
- - - - -
46c9bcd6 by Ben Gamari at 2023-07-04T22:07:58-04:00
rts: Don't rely on initializers for sigaction_t
As noted in #23577, CentOS's ancient toolchain throws spurious
missing-field-initializer warnings.
- - - - -
ec55035f by Ben Gamari at 2023-07-04T22:07:58-04:00
hadrian: Don't treat -Winline warnings as fatal
Such warnings are highly dependent upon the toolchain, platform, and
build configuration. It's simply too fragile to rely on these.
- - - - -
3a09b789 by Ben Gamari at 2023-07-04T22:07:58-04:00
hadrian: Only pass -Wno-nonportable-include-path on Darwin
This flag, which was introduced due to #17798, is only understood by
Clang and consequently throws warnings on platforms using gcc. Sadly,
there is no good way to treat such warnings as non-fatal with `-Werror`
so for now we simply make this flag specific to platforms known to use
Clang and case-insensitive filesystems (Darwin and Windows).
See #23577.
- - - - -
4af7eac2 by Mario Blažević at 2023-07-04T22:08:38-04:00
Fixed ticket #23571, TH.Ppr.pprLit hanging on large numeric literals
- - - - -
2304c697 by Ben Gamari at 2023-07-04T22:09:15-04:00
compiler: Make OccSet opaque
- - - - -
cf735db8 by Andrei Borzenkov at 2023-07-04T22:09:51-04:00
Add Note about why we need forall in Code to be on the right
- - - - -
fb140f82 by Hécate Moonlight at 2023-07-04T22:10:34-04:00
Relax the constraint about the foreign function's calling convention of FinalizerPtr to capi as well as ccall.
- - - - -
9ce44336 by meooow25 at 2023-07-05T11:42:37-04:00
Improve the situation with the stimes cycle
Currently the Semigroup stimes cycle is resolved in GHC.Base by
importing stimes implementations from a hs-boot file. Resolve the cycle
using hs-boot files for required classes (Num, Integral) instead. Now
stimes can be defined directly in GHC.Base, making inlining and
specialization possible.
This leads to some new boot files for `GHC.Num` and `GHC.Real`, the
methods for those are only used to implement `stimes` so it doesn't
appear that these boot files will introduce any new performance traps.
Metric Decrease:
T13386
T8095
Metric Increase:
T13253
T13386
T18698a
T18698b
T19695
T8095
- - - - -
9edcb1fb by Jaro Reinders at 2023-07-05T11:43:24-04:00
Refactor Unique to be represented by Word64
In #22010 we established that Int was not always sufficient to store all
the uniques we generate during compilation on 32-bit platforms. This
commit addresses that problem by using Word64 instead of Int for
uniques.
The core of the change is in GHC.Core.Types.Unique and
GHC.Core.Types.Unique.Supply. However, the representation of uniques is
used in many other places, so those needed changes too. Additionally, the RTS
has been extended with an atomic_inc64 operation.
One major change from this commit is the introduction of the Word64Set and
Word64Map data types. These are adapted versions of IntSet and IntMap
from the containers package. These are planned to be upstreamed in the
future.
As a natural consequence of these changes, the compiler will be a bit
slower and take more space on 32-bit platforms. Our CI tests indicate
around a 5% residency increase.
Metric Increase:
CoOpt_Read
CoOpt_Singletons
LargeRecord
ManyAlternatives
ManyConstructors
MultiComponentModules
MultiComponentModulesRecomp
MultiLayerModulesTH_OneShot
RecordUpdPerf
T10421
T10547
T12150
T12227
T12234
T12425
T12707
T13035
T13056
T13253
T13253-spj
T13379
T13386
T13719
T14683
T14697
T14766
T15164
T15703
T16577
T16875
T17516
T18140
T18223
T18282
T18304
T18698a
T18698b
T18923
T1969
T19695
T20049
T21839c
T3064
T3294
T4801
T5030
T5321FD
T5321Fun
T5631
T5642
T5837
T6048
T783
T8095
T9020
T9198
T9233
T9630
T9675
T9872a
T9872b
T9872b_defer
T9872c
T9872d
T9961
TcPlugin_RewritePerf
UniqLoop
WWRec
hard_hole_fits
- - - - -
6b9db7d4 by Brandon Chinn at 2023-07-05T11:44:03-04:00
Fix docs for __GLASGOW_HASKELL_FULL_VERSION__ macro
- - - - -
03b1230c by Simon Peyton Jones at 2023-07-05T20:47:26+01:00
Work in progress on #22404
Very much not ready!
- - - - -
1a1ce851 by Sebastian Graf at 2023-07-05T20:47:26+01:00
Partition into OneOccs and ManyOccs
- - - - -
801b220b by Simon Peyton Jones at 2023-07-05T20:47:27+01:00
Wibbles
- - - - -
1c4fd207 by Simon Peyton Jones at 2023-07-05T20:47:27+01:00
Refactor WithTailJoinDetails
- - - - -
d73d19e3 by Simon Peyton Jones at 2023-07-05T20:48:28+01:00
Wibbles
- - - - -
fe452deb by Simon Peyton Jones at 2023-07-05T20:48:28+01:00
Wibbles
- - - - -
1a541ffa by Simon Peyton Jones at 2023-07-05T20:53:38+01:00
Major wibbles
- - - - -
f3fbc7c9 by Simon Peyton Jones at 2023-07-05T20:53:38+01:00
Wibble
- - - - -
554ae3c7 by Simon Peyton Jones at 2023-07-05T20:53:38+01:00
Vital fix to alt_env
- - - - -
a2bea302 by Simon Peyton Jones at 2023-07-05T20:56:21+01:00
Comments
- - - - -
11f64213 by Simon Peyton Jones at 2023-07-05T20:56:21+01:00
Another crucial change
Fixing a wrongly-zapped occ_join_points
..and a DEBUG check to catch it if it happens again
- - - - -
c2035d91 by Simon Peyton Jones at 2023-07-05T20:56:21+01:00
Fast path for addInScope
- - - - -
18358594 by Simon Peyton Jones at 2023-07-05T22:45:17+01:00
Tiny fix
- - - - -
30 changed files:
- .gitignore
- .gitlab-ci.yml
- .gitlab/ci.sh
- .gitlab/darwin/toolchain.nix
- + .gitlab/generate-ci/LICENSE
- + .gitlab/generate-ci/README.mkd
- + .gitlab/generate-ci/flake.lock
- + .gitlab/generate-ci/flake.nix
- .gitlab/gen_ci.hs → .gitlab/generate-ci/gen_ci.hs
- + .gitlab/generate-ci/generate-ci.cabal
- + .gitlab/generate-ci/generate-job-metadata
- + .gitlab/generate-ci/generate-jobs
- − .gitlab/generate_job_metadata
- − .gitlab/generate_jobs
- .gitlab/jobs.yaml
- .gitlab/merge_request_templates/merge-request.md → .gitlab/merge_request_templates/Default.md
- − .gitlab/merge_request_templates/backport-for-8.8.md
- .gitlab/rel_eng/fetch-gitlab-artifacts/fetch_gitlab.py
- .gitlab/rel_eng/mk-ghcup-metadata/README.mkd
- .gitlab/rel_eng/mk-ghcup-metadata/mk_ghcup_metadata.py
- .gitlab/rel_eng/upload_ghc_libs.py
- .gitlab/test-metrics.sh
- .gitmodules
- CODEOWNERS
- HACKING.md
- cabal.project-reinstall
- compiler/GHC.hs
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Builtin/PrimOps.hs
The diff was not included because it is too large.
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0b3f6a25fda786d936331e547b4667168add4037...18358594ece6149675a8e917072d9a8b6f1ead84
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/0b3f6a25fda786d936331e547b4667168add4037...18358594ece6149675a8e917072d9a8b6f1ead84
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/20230705/f6a887b8/attachment-0001.html>
More information about the ghc-commits
mailing list