| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
No changes to code; no changes to theory. Just better
explanation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Close #17672.
By scratching our heads quite hard, we realized that
we should never kick out Given/Nominal equalities. This
commit tweaks the kick-out conditions accordingly.
See also Note [K4] which describes what is going on.
This does not fix a known misbehavior, but it should be
a small improvement in both practice (kicking out is bad,
and we now do less of it) and theory (a Given/Nominal should
behave just like a filled-in metavariable, which has no notion
of kicking out).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Kick out condition K2b really only makes sense for
inerts with a type variable on the left. This updates
the commentary and the code to skip this check for
inerts with type families on the left.
Also cleans up some commentary around solver invariants
and adds Note [K2b].
Close #19042.
test case: typecheck/should_compile/T19042
|
|
|
|
|
|
|
|
|
| |
When the CharToNat and NatToChar type families were added,
the corresponding axioms were not exported.
This led to a failure much like #14934
(cherry picked from commit d44e42a26e54857cc6174f2bb7dc86cc41fcd249)
|
|
|
|
|
|
|
| |
Metric Increase:
T11276
(cherry picked from commit 2eba59e5fb54a88145692ede00d1aadc784a2f96)
|
|
|
|
|
|
|
|
|
|
|
| |
This drops allocateExec for darwin, and replaces it with
a alloc, write, mark executable strategy instead. This prevents
us from trying to allocate an executable range and then write to
it, which X^W will prohibit on darwin.
This will *only* work if we can use mmap.
(cherry picked from commit 5d9afbb7503178cb6ca202eb0091a609d0791ab3)
|
|
|
|
|
|
| |
Fixes #19564
(cherry picked from commit 0d5d344d45c200a5e731e7d067598acd2a4f7050)
|
|
|
|
|
|
| |
Follow-up from !2418, see #19579
(cherry picked from commit fcb3b0f6ad2f7d2d9ec27f7845a341544210357f)
|
|
|
|
|
|
| |
Follow-up from !2418, see #19579
(cherry picked from commit 01f8412581b601841b9399cb4af696901eb37fc6)
|
|
|
|
|
|
|
|
| |
In comments, and notes.
Follow-up from !2418, see #19579
(cherry picked from commit 4241899c2013bdf3187cbfa9d646346c120e0d57)
|
|
|
|
|
|
| |
Follow-up from !2418, see #19579
(cherry picked from commit 9f39cd4c85d6324e6093c109166ae743407266d1)
|
|
|
|
|
|
|
|
|
| |
As port of the process of migrating naming from API Annotations to
exact print annotations (EPA)
Follow-up from !2418, see #19579
(cherry picked from commit 55d935ecd911b66d32431c328386b48f52e2d1d7)
|
|
|
|
|
|
|
|
| |
This is a follow up from !2418 / #19579
[skip ci]
(cherry picked from commit c74bd3daa3468e495714647506cf30cf650d390d)
|
|
|
|
|
|
|
| |
All the comments are now captured in the AST, there is no need for a
side-channel structure for them.
(cherry picked from commit c64c119d08531049acb33dba4afb7d0dfef57981)
|
|
|
|
|
|
|
|
|
|
|
|
| |
The binder-swap transformation needs to be iterated, as shown
by #19581. The fix is pretty simple, and is explained in
point (BS2) of Note [The binder-swap substitution].
Net effect:
- sometimes, fewer simplifier iterations
- sometimes, more case merging
(cherry picked from commit b7f5f8b54ab8fe3665ec2282b6b1403d5483cf0b)
|
|
|
|
|
|
| |
Bumps Win32 submodule.
(cherry picked from commit e3ea5f5a3356a06471c20712854fd7a1a6965129)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The loader state was stored into HscEnv. As we need to have two
interpreters and one loader state per interpreter in #14335, it's
natural to make the loader state a field of the Interp type.
As a side effect, many functions now only require a Interp parameter
instead of HscEnv. Sadly we can't fully free GHC.Linker.Loader of HscEnv
yet because the loader is initialised lazily from the HscEnv the first
time it is used. This is left as future work.
HscEnv may not contain an Interp value (i.e. hsc_interp :: Maybe Interp).
So a side effect of the previous side effect is that callers of the
modified functions now have to provide an Interp. It is satisfying as it
pushes upstream the handling of the case where HscEnv doesn't contain an
Interpreter. It is better than raising a panic (less partial functions,
"parse, don't validate", etc.).
|
|
|
|
|
|
|
|
| |
In commit 540fa6b2 integer to float conversions were changed to round to
the nearest even. Implement a special case for 64 bit integer to single
precision floating point numbers.
Fixes #19563.
|
|
|
|
|
|
|
|
|
|
| |
Part of #18202
-------------------------
Metric Decrease:
T12707
T3294
-------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This Note says it all:
Note [Skip type holes rapidly]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Suppose we have module with a /lot/ of partial type signatures, and we
compile it while suppressing partial-type-signature warnings. Then
we don't want to spend ages constructing error messages and lists of
relevant bindings that we never display! This happened in #14766, in
which partial type signatures in a Happy-generated parser cause a huge
increase in compile time.
The function ignoreThisHole short-circuits the error/warning generation
machinery, in cases where it is definitely going to be a no-op.
It makes a pretty big difference on the Sigs.hs example in #14766:
Compile-time allocation
GHC 8.10 5.6G
Before this patch 937G
With this patch 4.7G
Yes, that's more than two orders of magnitude!
|
|
|
|
|
| |
As noted in #19540, a number of users within and outside of GHC rely on
unsafeCoerceUnlifted to work around the fact that this was missing
|
|
|
|
|
|
|
|
|
|
|
| |
The `extendTyVarEnvFVRn` function does the exact same thing as
`bindLocalNamesFV`. I see no meaningful distinction between the two functions,
so let's just remove the former (which is only used in a handful of places) in
favor of the latter.
Historical note: `extendTyVarEnvFVRn` and `bindLocalNamesFV` used to be
distinct functions, but their implementations were synchronized in 2004 as a
part of commit 20e39e0e07e4a8e9395894b2785d6675e4e3e3b3.
|
|
|
|
|
|
|
| |
This requires bumping the `exceptions` and `text` submodules to bring in
commits that bump their respective upper version bounds on `template-haskell`.
Fixes #19083.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All credit to @hsyl20, who in
https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4717#note_338560
figured out this was a problem.
To fix this, we use casts in addition to the shrinking and suffixing
that is already done. It might make for more verbose code, I don't think
that matters too much.
In the future, perhaps some of the shrinking and suffixing can be
removed for being redundant. That proved less trivial than it sounds, so
this wasn't done at this time.
Progress towards #19026
Metric Increase:
T12707
T13379
Co-authored-by: Sylvain Henry <hsyl20@gmail.com>
|
|
|
|
|
|
|
|
| |
As #19522 points out, we did not account for visible type
application when trying to reject naked levity-polymorphic
functions that have no binding.
This patch tidies up the code, and fixes the bug too.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While fixing #19232, it became increasingly clear that the vestigial
hack described in `Note [Optimistic field binder CPR]` is complicated
and causes reboxing. Rather than make the hack worse, this patch
gets rid of it completely in favor of giving deeply unboxed parameters
the Nested CPR property. Example:
```hs
f :: (Int, Int) -> Int
f p = case p of
(x, y) | x == y = x
| otherwise = y
```
Based on `p`'s `idDemandInfo` `1P(1P(L),1P(L))`, we can see that both
fields of `p` will be available unboxed. As a result, we give `p` the
nested CPR property `1(1,1)`. When analysing the `case`, the field
CPRs are transferred to the binders `x` and `y`, respectively, so that
we ultimately give `f` the CPR property.
I took the liberty to do a bit of refactoring:
- I renamed `CprResult` ("Constructed product result result") to plain
`Cpr`.
- I Introduced `FlatConCpr` in addition to (now nested) `ConCpr` and
and according pattern synonym that rewrites flat `ConCpr` to
`FlatConCpr`s, purely for compiler perf reasons.
- Similarly for performance reasons, we now store binders with a
Top signature in a separate `IntSet`,
see `Note [Efficient Top sigs in SigEnv]`.
- I moved a bit of stuff around in `GHC.Core.Opt.WorkWrap.Utils` and
introduced `UnboxingDecision` to replace the `Maybe DataConPatContext`
type we used to return from `wantToUnbox`.
- Since the `Outputable Cpr` instance changed anyway, I removed the
leading `m` which we used to emit for `ConCpr`. It's just noise,
especially now that we may output nested CPRs.
Fixes #19398.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit reduces allocations by the simplifier by 3% for the
Cabal test at -O2.
We do this by making a few select fields, bindings and arguments strict
which reduces allocations for the simplifier by around 3% in total
for the Cabal test. Which is about 2% fewer allocations in total at
-O2.
-------------------------
Metric Decrease:
T18698a
T18698b
T9233
T9675
T9872a
T9872b
T9872c
T9872d
T10421
T12425
T13253
T5321FD
T9961
-------------------------
|
|
|
|
|
|
| |
tuples and sums.
fixes #1257
|
|
|
|
|
| |
Metric Increase:
MultiLayerModules
|
| |
|
|
|
|
|
| |
The 'id' type is now determined by the pass, using the XTickishId
type family.
|
|
|
|
|
|
|
|
| |
GHCi needs to know the types of all breakpoints, but it's
not possible to get the exprType of any expression in STG.
This is preparation for the upcoming change to make GHCi
bytecode from STG instead of Core.
|
|
|
|
|
|
|
|
| |
Metric Increase:
T10370
parsing001
Updates haddock submodule
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The MR introducing the API Annotations, !2418 is huge.
Conceptually it is two parts, the one deals with introducing the new
types to be used for annotations, and outlining how they will be
used. This is a small change, localised to
compiler/GHC/Parser/Annotation.hs and is contained in this commit.
The follow-up, larger commit deals with mechanically working this
through the entire AST and updating all the parts affected by it.
It is being split so the part that needs good review feedback can be
seen in isolation, prior to the rest coming in.
|
|
|
|
|
| |
Co-authored-by: Daniel Rogozin <daniel.rogozin@serokell.io>
Co-authored-by: Rinat Stryungis <rinat.stryungis@serokell.io>
|
| |
|
|
|
|
|
|
| |
CmmToAsm.Reg.Linear: More strictness
More strictness
|
|
|
|
| |
Avoid top-level recursion.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In #19194 mpickering detailed that there are a LOT of allocations
of IfaceTyConInfo:
There are just two main cases: IfaceTyConInfo IsPromoted IfaceNormalTyCon
and IfaceTyConInfo NotPromoted IfaceNormalTyCon. These should be made into
CAFs and shared. From my analysis, the most common case is
IfaceTyConInfo NotPromoted IfaceNormalTyCon (53 000)
then IfaceTyConInfo IsPromoted IfaceNormalTyCon (28 000).
This patch makes it so these are properly shared by using a smart
constructor.
Fixes #19194.
|
|
|
|
|
|
|
|
| |
When we use `withTiming` we need to force the results of each timed pass
to better represent the time spent in each phase. This patch forces
some results that weren't before.
It also retrieve timings for the CoreToStg and WriteIface passes.
|
|
|
|
|
|
|
| |
Previously we would support only one LLVM major version. Here we
generalize this to accept a range, taking this range to be LLVM 10 to 11,
as 11 is necessary for Apple M1 support. We also accept 12, as that is
what apple ships with BigSur on the M1.
|
|
|
|
|
|
|
|
| |
integerToFloat# and integerToDouble# were moved from ghc-bignum to base.
GHC.Integer.floatFromInteger and doubleFromInteger were removed.
Fixes #15926, #17231, #17782
|
|
|
|
|
| |
By moving the handling of TIGHT_INFIX_PROJ to the correct place,
we can remove the isGetField hack and fix a bug at the same time.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes `guessConLikeUnivTyArgsFromResTy` consider required
Thetas of PatSynCons, by treating them as Wanted constraints to be
discharged with the constraints from the Nabla's TyState and saying
"does not match the match type" if the Wanted constraints are unsoluble.
It calls out into a new function `GHC.Tc.Solver.tcCheckWanteds` to do
so.
In pushing the failure logic around call sites of `initTcDsForSolver`
inside it by panicking, I realised that there was a bunch of dead code
surrounding `pmTopMoraliseType`: I was successfully able to delete the
`NoChange` data constructor of `TopNormaliseTypeResult`.
The details are in `Note [Matching against a ConLike result type]` and
`Note [Instantiating a ConLike].
The regression test is in `T19475`. It's pretty much a fork of `T14422`
at the moment.
Co-authored-by: Cale Gibbard <cgibbard@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GHC Proposal: 0265-unlifted-datatypes.rst
Discussion: https://github.com/ghc-proposals/ghc-proposals/pull/265
Issues: https://gitlab.haskell.org/ghc/ghc/-/issues/19523
Implementation Details: Note [Implementation of UnliftedDatatypes]
This patch introduces the `UnliftedDatatypes` extension. When this extension is
enabled, GHC relaxes the restrictions around what result kinds are allowed in
data declarations. This allows data types for which an unlifted or
levity-polymorphic result kind is inferred.
The most significant changes are in `GHC.Tc.TyCl`, where
`Note [Implementation of UnliftedDatatypes]` describes the details of the
implementation.
Fixes #19523.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Implement new debugger command `:ignore` to set an `ignore count`
for a specified breakpoint.
* Allow new optional parameter on `:continue` command to set an
`ignore count` for the current breakpoint.
* In the Interpreter replace the current `Word8` BreakArray with
an `Int` array.
* Change semantics of values in `BreakArray` to:
n < 0 : Breakpoint is disabled.
n == 0 : Breakpoint is enabled.
n > 0 : Breakpoint is enabled, but ignore next `n` iterations.
* Rewrite `:enable`/`:disable` processing as a special case of `:ignore`.
* Remove references to `BreakArray` from `ghc/UI.hs`.
|