| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
As noted in #18391, foreignInterruptible fails pretty regularly under
GHCi.
|
| |
|
|
|
|
|
|
|
| |
foreign code" section
"+RTS" in argv[0] is interpreted as a program name and does not work
as an indicator of RTS options.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When combining
Inert: [W] C ty1 ty2
Work item: [D] C ty1 ty2
we were simply discarding the Derived one. Not good! We should turn
the inert back into [WD] or keep both. E.g. fundeps work only on
Derived (see isImprovable).
This little patch fixes it. The bug is hard to tickle, but #19315 did so.
The fix is a little messy (see Note [KeepBoth] plus the change in
addDictCt), but I am disinclined to refine it further because it'll
all be swept away when we Kill Deriveds.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a new heuristic, controllable via two new flags to
better tune inlining behaviour.
The new flags are -funfolding-case-threshold and
-funfolding-case-scaling which are document both
in the user guide and in
Note [Avoid inlining into deeply nested cases].
Co-authored-by: Andreas Klebinger <klebinger.andreas@gmx.at>
|
|
|
|
| |
Merged ghc-8.10 into ghc-head.
|
| |
|
| |
|
|
|
|
|
|
|
| |
Commit 65721691ce9c (Improve inference with linear types, !4632)
fixed the bug.
Closes #18736.
|
|
|
|
|
|
|
|
| |
This small patch makes pattern synonyms play nicely with CallStack
constraints, using logic explained in GHC.Tc.Gen.Pat
Note [Call-stack tracing of pattern synonyms]
Fixes #19289
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a user writes code like:
unsafePerformIO $ do
let x = f x
writeIORef ref x
return x
We might expect that the write happens before we evaluate `f x`.
Sadly this wasn't to case for reasons detailed in #19181.
We fix this by avoiding the strict demand by turning:
unsafeDupablePerformIO (IO m) = case runRW# m of (# _, a #) -> a
into
unsafeDupablePerformIO (IO m) = case runRW# m of (# _, a #) -> lazy a
This makes the above code lazy in x. And ensures the side effect of the
write happens before the evaluation of `f x`. If a user *wants* the code
to be strict on the returned value he can simply use `return $! x`.
This fixes #19181
|
|
|
|
|
|
|
|
|
|
| |
The fix for #17958, implemented in MR !2952, introduced a small bug
in GHC.Core.TyCon.expandSynTyCon_maybe, in the case of under-saturated
type synonyms.
This MR fixes the bug, very easy.
Fixes #19279
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Co-authored-by: Rinat Stryungis <rinat.stryungis@serokell.io>
Implement GHC Proposal #387
* Parse char literals 'x' at the type level
* New built-in type families CmpChar, ConsSymbol, UnconsSymbol
* New KnownChar class (cf. KnownSymbol and KnownNat)
* New SomeChar type (cf. SomeSymbol and SomeNat)
* CharTyLit support in template-haskell
Updated submodules: binary, haddock.
Metric Decrease:
T5205
haddock.base
Metric Increase:
Naperian
T13035
|
| |
|
|
|
|
| |
Fixes #19307
|
|
|
|
|
|
|
|
|
|
|
| |
Function arguments passed to the interpreter are extended to whole
words. However, foreign function interface expects correctly typed
argument pointers. Accordingly, we have to adjust argument pointers in
case of a big-endian architecture.
In contrast to function arguments where subwords are passed in the low
bytes of a word, the return value is expected to reside in the high
bytes of a word.
|
|
|
|
|
|
|
| |
Just marking the `SimplTopEnv` parameter as one-shot was not enough to
eta-expand `simplExpr`.
Fixes #19302.
|
|
|
|
|
|
|
| |
Since commit be5d74ca small ints/words are passed according to their
natural size which obsoletes fix from commit 01f7052cc1.
Reverted 01f7052cc1 but kept the introduced test case.
|
|
|
|
|
|
| |
As found by @phadej in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4740/diffs#note_327510
Also fix FastMutInt which allocating the size in bits instead of bytes.
|
|
|
|
|
|
|
| |
Since commit be5d74caab the payload of a closure of Int<N> or Word<N>
is not extended anymore to the machines word size. Instead, only the
first N bits of a payload are written. This patch ensures that only
those bits are read/written independent of the machines endianness.
|
|
|
|
|
|
|
|
|
| |
Also updates the note with the case of multi-argument lambdas.
Seems slightly beneficial based on the Cabal test:
-O0: -1MB allocations (out of 50GB)
-O : -1MB allocations (out of ~200GB)
|
| |
|
|
|
|
|
| |
This is avoids pushing the entire list to the stack before we can begin
computing the result.
|
| |
|
|
|
|
| |
Data.List.NonEmpty
|
|
|
|
|
|
| |
These instances are useful so that a `GenClosure` form `ghc-heap` can be
used as a key in a `Map`. Therefore the order itself is not important
but just the fact that there is one.
|
|
|
|
|
|
|
|
|
|
| |
Previously tc_eq_type would allocate a number of closures due to the two
boolean "mode" flags, despite the fact that these were always statically
known.
To avoid this we force tc_eq_type to inline into its call sites,
allowing the simplifier to eliminate both some runtime branches and the
closure allocations.
|
|
|
|
|
| |
This commit introduces a DecoratedSDoc type which replaces the old
ErrDoc, and hopefully better reflects the intent.
|
|
|
|
| |
Updates Haddock submodule
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit boldly removes the ErrDoc and the MsgDoc from the codebase.
The former was introduced with the only purpose of classifying errors
according to their importance, but a similar result can be obtained just
by having a simple [SDoc], and placing bullets after each of them.
On top of that I have taken the perhaps controversial decision to also
banish MsgDoc, as it was merely a type alias over an SDoc and as such it wasn't
offering any extra type safety. Granted, it was perhaps making type
signatures slightly more "focused", but at the expense of cognitive
burden: if it's really just an SDoc, let's call it with its proper name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After commit 55ef3bdc28681a22ceccf207707c49229f9b7559, running `./configure`
now generates a `driver/ghci/ghci-wrapper.cabal` file from
`driver/ghci/ghci-wrapper.cabal.in`, which pollutes the `git` tree:
```
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
driver/ghci/ghci-wrapper.cabal
nothing added to commit but untracked files present (use "git add" to track)
```
Since `driver/ghci/ghci-wrapper.cabal` is autogenerated, the sensible thing to
do is to add it to `.gitignore`. While I was in town, I also added the standard
`*.in` file disclaimer to `driver/ghci/ghci-wrapper.cabal.in`.
[ci skip]
|
|
|
|
|
|
|
|
|
| |
An accidental use of `tcSymbol` instead of `tcNat` in the `TypeLitNat` case of
`mkTypeLitFromString` meant that it was possible to unsafely equate `Nat` with
`Symbol`. A consequence of this is that you could write `unsafeCoerce`, as
observed in #19288. This is fixed easily enough, thankfully.
Fixes #19288.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add missing :since: for NondecreasingIndentation and OverlappingInstances
- Remove duplicated descriptions for Safe Haskell flags and
UndecidableInstances. Instead, the sections contain a link.
- compare-flags: Also check for options supported by ghci.
This uncovered two more that are not documented.
The flag -smp was removed.
- Formatting fixes
- Remove the warning about -XNoImplicitPrelude - it was written in 1996,
the extension is no longer dangerous.
- Fix misspelled :reverse: flags
Fixes #18958.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
See T19264 for a tricky corner case when explicitly importing
GHC.Num.BigNat and another module. With -dynamic-too, the FinderCache
contains paths for non-dynamic interfaces so they must be loaded first,
which is usually the case, except for some interfaces loaded in the
backend (e.g. in CorePrep).
So we must run the backend for the non-dynamic way first for
-dynamic-too to work as it is but I broke this invariant in
c85f4928d4dbb2eb2cf906d08bfe7620d6f04ca5 by mistakenly making the
backend run for the dynamic way first.
|
|
|
|
|
|
| |
The motivation is given in Note [tcFamTyPats: zonking the result kind].
Fixes #19250 -- the fix is easy.
|
|
|
|
| |
Otherwise we end up with terminating \r characters on Windows.
|
|
|
|
|
| |
This wraps the existing GHCi wrapper script (driver/ghci/ghci.c) in a
cabal file and adds the package to Hadrian.
|
| |
|
|
|
|
|
|
| |
Following the example of `git`, as noted in #19030.
Fixes #19030.
|
|
|
|
|
|
|
|
| |
-fstg-lift-lams-rec-* and -fstg-lift-lams-non-rec-* were setting the same
field.
Fix manual: -fstg-lift-lams-non-rec-args is disabled by
-fstg-lift-lams-non-rec-args-any, there's no -fno-stg-lift-*.
|
|
|
|
|
|
|
|
|
|
| |
Provoked by #19074, this patch makes GHC.Core.PatSyn.PatSyn
immutable, by recording only the *Name* of the matcher and
builder rather than (as currently) the *Id*.
See Note [Keep Ids out of PatSyn] in GHC.Core.PatSyn.
Updates haddock submodule.
|
|
|
|
|
| |
It was checking the old path compiler/prelude/*, outdated with the new module
hierarchy. I added a sanity check to avoid this in the future.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
SDoc string literals created for example with `text "xyz"` are converted
into `PtrString` (`Addr#` + size in bytes) with a rewrite rule to avoid
allocating a String.
Before this patch, the size in bytes was still computed at runtime. For
every literal, we obtained the following pseudo STG:
x :: Addr#
x = "xzy"#
s :: PtrString
s = \u [] case ffi:strlen [x realWorld#] of
(# _, sz #) -> PtrString [x sz]
But since GHC 9.0, we can use `cstringLength#` instead to get:
x :: Addr#
x = "xzy"#
s :: PtrString
s = PtrString! [x 3#]
Literals become statically known constructor applications. Allocations
seem to decrease a little in perf tests (between -0.1% and -0.7% on CI).
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Related to a future change in Data.List,
https://downloads.haskell.org/ghc/8.10.3/docs/html/users_guide/using-warnings.html?highlight=wcompat#ghc-flag--Wcompat-unqualified-imports
Companion pull&merge requests:
- https://github.com/judah/haskeline/pull/153
- https://github.com/haskell/containers/pull/762
- https://gitlab.haskell.org/ghc/packages/hpc/-/merge_requests/9
After these the actual change in Data.List should be easy to do.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
StgLam is used exclusively in the work of CoreToStg, but there's nothing
in the type of StgExpr that indicates this, so we're forced throughout
the Stg.* codebase to handle cases like:
case expr of
...
StgLam lam -> panic "Unexpected StgLam"
...
This patch removes the StgLam constructor from the base StgExpr so these
cases no longer need to be handled. Instead, we use a new intermediate
type in CoreToStg, PreStgRhs, to represent the RHS expression of a
binding.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When -XStrict is enabled the rules for irrefutability are slightly modified.
Specifically, the pattern in a program like
do ~(Just hi) <- expr
cannot be considered irrefutable. The ~ here merely disables the bang that
-XStrict would usually apply, rendering the program equivalent to the following
without -XStrict
do Just hi <- expr
To achieve make this pattern irrefutable with -XStrict the user would rather
need to write
do ~(~(Just hi)) <- expr
Failing to account for this resulted in #19027. To fix this isIrrefutableHsPat
takes care to check for two the irrefutability of the inner pattern when it
encounters a LazyPat and -XStrict is enabled.
|